Skip to content

Commit

Permalink
fix OQS_OPENSSL_GUARD failure
Browse files Browse the repository at this point in the history
Signed-off-by: Songling Han <[email protected]>
  • Loading branch information
songlingatpan committed Sep 22, 2024
1 parent 5e0d03b commit 0c2345b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/aes/aes_ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,19 @@ static void AES256_CTR_inc_stream_iv(const uint8_t *iv, size_t iv_len, const voi
return; /* TODO: better error handling */
}
const struct key_schedule *ks = (const struct key_schedule *) schedule;
if (OQS_OPENSSL_GUARD(OSSL_FUNC(EVP_EncryptInit_ex)(ctr_ctx, oqs_aes_256_ctr(), NULL, ks->key, iv_ctr)) != 1) {
if (OSSL_FUNC(EVP_EncryptInit_ex)(ctr_ctx, oqs_aes_256_ctr(), NULL, ks->key, iv_ctr) != 1) {
OSSL_FUNC(EVP_CIPHER_CTX_free)(ctr_ctx);
return;
}

SIZE_T_TO_INT_OR_EXIT(out_len, out_len_input_int)
memset(out, 0, (size_t)out_len_input_int);
int out_len_output;
if (OQS_OPENSSL_GUARD(OSSL_FUNC(EVP_EncryptUpdate)(ctr_ctx, out, &out_len_output, out, out_len_input_int)) != 1) {
if (OSSL_FUNC(EVP_EncryptUpdate)(ctr_ctx, out, &out_len_output, out, out_len_input_int) != 1) {
OSSL_FUNC(EVP_CIPHER_CTX_free)(ctr_ctx);
return;
}
if (OQS_OPENSSL_GUARD(OSSL_FUNC(EVP_EncryptFinal_ex)(ctr_ctx, out + out_len_output, &out_len_output)) != 1) {
if (OSSL_FUNC(EVP_EncryptFinal_ex)(ctr_ctx, out + out_len_output, &out_len_output) != 1) {
OSSL_FUNC(EVP_CIPHER_CTX_free)(ctr_ctx);
return;
}
Expand Down

0 comments on commit 0c2345b

Please sign in to comment.