Skip to content

Commit

Permalink
correct formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
baentsch committed Feb 2, 2024
1 parent ee9eee1 commit 84b42f5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions oqsprov/oqsprov_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
int primitive, const char *propq, int bit_security,
int alg_idx)
{
OQSX_KEY *ret = OPENSSL_zalloc(sizeof(*ret)); // ensure all component pointers are NULL
OQSX_KEY *ret = OPENSSL_zalloc(
sizeof(*ret)); // ensure all component pointers are NULL
OQSX_EVP_CTX *evp_ctx = NULL;
int ret2 = 0;

Expand All @@ -781,7 +782,7 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
ret->numkeys = 1;
ret->comp_privkey = OPENSSL_malloc(sizeof(void *));
ret->comp_pubkey = OPENSSL_malloc(sizeof(void *));
ON_ERR_GOTO(!ret->comp_privkey||!ret->comp_pubkey, err);
ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err);
ret->oqsx_provider_ctx.oqsx_qs_ctx.sig = OQS_SIG_new(oqs_name);
if (!ret->oqsx_provider_ctx.oqsx_qs_ctx.sig) {
fprintf(
Expand Down Expand Up @@ -820,7 +821,7 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
ret->numkeys = 1;
ret->comp_privkey = OPENSSL_malloc(sizeof(void *));
ret->comp_pubkey = OPENSSL_malloc(sizeof(void *));
ON_ERR_GOTO(!ret->comp_privkey||!ret->comp_pubkey, err);
ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err);
ret->oqsx_provider_ctx.oqsx_qs_ctx.kem = OQS_KEM_new(oqs_name);
if (!ret->oqsx_provider_ctx.oqsx_qs_ctx.kem) {
fprintf(
Expand Down Expand Up @@ -855,7 +856,7 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
ret->numkeys = 2;
ret->comp_privkey = OPENSSL_malloc(ret->numkeys * sizeof(void *));
ret->comp_pubkey = OPENSSL_malloc(ret->numkeys * sizeof(void *));
ON_ERR_GOTO(!ret->comp_privkey||!ret->comp_pubkey, err);
ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err);
ret->privkeylen
= (ret->numkeys - 1) * SIZE_OF_UINT32
+ ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key
Expand Down Expand Up @@ -886,7 +887,7 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
ret->numkeys = 2;
ret->comp_privkey = OPENSSL_malloc(ret->numkeys * sizeof(void *));
ret->comp_pubkey = OPENSSL_malloc(ret->numkeys * sizeof(void *));
ON_ERR_GOTO(!ret->comp_privkey||!ret->comp_pubkey, err);
ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err);
ret->privkeylen
= (ret->numkeys - 1) * SIZE_OF_UINT32
+ ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key
Expand Down Expand Up @@ -923,7 +924,8 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name,
err:
ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE);
#ifdef OQS_PROVIDER_NOATOMIC
if (ret->lock) CRYPTO_THREAD_lock_free(ret->lock);
if (ret->lock)
CRYPTO_THREAD_lock_free(ret->lock);
#endif
OPENSSL_free(ret->tls_name);
OPENSSL_free(ret->propq);
Expand Down

0 comments on commit 84b42f5

Please sign in to comment.