mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibCrypto: Move OpenSSL RAII helper methods out of line
This commit is contained in:
parent
977af95b5b
commit
559c5a7311
Notes:
github-actions[bot]
2025-01-13 16:02:04 +00:00
Author: https://github.com/devgianlu
Commit: 559c5a7311
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3234
2 changed files with 20 additions and 12 deletions
|
@ -6,10 +6,27 @@
|
|||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <LibCrypto/OpenSSL.h>
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
namespace Crypto {
|
||||
|
||||
ErrorOr<OpenSSL_BN> OpenSSL_BN::create()
|
||||
{
|
||||
return OpenSSL_BN(OPENSSL_TRY_PTR(BN_new()));
|
||||
}
|
||||
|
||||
ErrorOr<OpenSSL_PKEY> OpenSSL_PKEY::create()
|
||||
{
|
||||
return OpenSSL_PKEY(OPENSSL_TRY_PTR(EVP_PKEY_new()));
|
||||
}
|
||||
|
||||
ErrorOr<OpenSSL_MD_CTX> OpenSSL_MD_CTX::create()
|
||||
{
|
||||
return OpenSSL_MD_CTX(OPENSSL_TRY_PTR(EVP_MD_CTX_new()));
|
||||
}
|
||||
|
||||
ErrorOr<OpenSSL_BN> unsigned_big_integer_to_openssl_bignum(UnsignedBigInteger const& integer)
|
||||
{
|
||||
auto bn = TRY(OpenSSL_BN::create());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue