Skip to content

Commit

Permalink
Remove BN_CTX_init as its no longer in OpenSSL for a long time
Browse files Browse the repository at this point in the history
  • Loading branch information
julek-wolfssl committed Feb 4, 2025
1 parent 91bffee commit 8b7b963
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
15 changes: 1 addition & 14 deletions src/ssl_bn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2380,25 +2380,12 @@ WOLFSSL_BN_CTX* wolfSSL_BN_CTX_new(void)
ctx = (WOLFSSL_BN_CTX*)XMALLOC(sizeof(WOLFSSL_BN_CTX), NULL,
DYNAMIC_TYPE_OPENSSL);
if (ctx != NULL) {
wolfSSL_BN_CTX_init(ctx);
XMEMSET(ctx, 0, sizeof(WOLFSSL_BN_CTX));
}

return ctx;
}

/* Initialize a BN context object.
*
* @param [in] ctx BN context object.
*/
void wolfSSL_BN_CTX_init(WOLFSSL_BN_CTX* ctx)
{
WOLFSSL_ENTER("wolfSSL_BN_CTX_init");
if (ctx != NULL) {
XMEMSET(ctx, 0, sizeof(WOLFSSL_BN_CTX));
}
}


/* Free a BN context object.
*
* @param [in] ctx BN context object.
Expand Down
3 changes: 0 additions & 3 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -62646,9 +62646,6 @@ static int test_wolfSSL_BN_CTX(void)

ExpectNotNull(bn_ctx = BN_CTX_new());

/* No implementation. */
BN_CTX_init(NULL);

ExpectNull(BN_CTX_get(NULL));
ExpectNotNull(BN_CTX_get(bn_ctx));
ExpectNotNull(BN_CTX_get(bn_ctx));
Expand Down
2 changes: 0 additions & 2 deletions wolfssl/openssl/bn.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ typedef struct WOLFSSL_BN_MONT_CTX WOLFSSL_BN_MONT_CTX;
typedef struct WOLFSSL_BN_GENCB WOLFSSL_BN_GENCB;

WOLFSSL_API WOLFSSL_BN_CTX* wolfSSL_BN_CTX_new(void);
WOLFSSL_API void wolfSSL_BN_CTX_init(WOLFSSL_BN_CTX* ctx);
WOLFSSL_API void wolfSSL_BN_CTX_free(WOLFSSL_BN_CTX* ctx);

WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_new(void);
Expand Down Expand Up @@ -215,7 +214,6 @@ typedef WOLFSSL_BN_MONT_CTX BN_MONT_CTX;
typedef WOLFSSL_BN_GENCB BN_GENCB;

#define BN_CTX_new wolfSSL_BN_CTX_new
#define BN_CTX_init wolfSSL_BN_CTX_init
#define BN_CTX_free wolfSSL_BN_CTX_free

#define BN_new wolfSSL_BN_new
Expand Down

0 comments on commit 8b7b963

Please sign in to comment.