Skip to content

Commit fac0842

Browse files
julek-wolfssldgarske
authored andcommitted
Fix missing op validation in EVP_PKEY_decrypt
F-747
1 parent 5f7bc0f commit fac0842

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,12 @@ int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
30963096
return 0;
30973097
}
30983098

3099+
if (ctx->op != WC_EVP_PKEY_OP_DECRYPT) {
3100+
WOLFSSL_MSG("ctx->op must be set to WC_EVP_PKEY_OP_DECRYPT. Use "
3101+
"wolfSSL_EVP_PKEY_decrypt_init.");
3102+
return WOLFSSL_FAILURE;
3103+
}
3104+
30993105
(void)out;
31003106
(void)outLen;
31013107
(void)in;

0 commit comments

Comments
 (0)