diff options
Diffstat (limited to 'crypto/cmac')
-rw-r--r-- | crypto/cmac/cmac.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/cmac/cmac.c b/crypto/cmac/cmac.c index 218eb94259..15968f74c4 100644 --- a/crypto/cmac/cmac.c +++ b/crypto/cmac/cmac.c @@ -137,9 +137,9 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, /* If anything fails then ensure we can't use this ctx */ ctx->nlast_block = -1; - if (!EVP_CIPHER_CTX_get0_cipher(ctx->cctx)) + if (EVP_CIPHER_CTX_get0_cipher(ctx->cctx) == NULL) return 0; - if (!EVP_CIPHER_CTX_set_key_length(ctx->cctx, keylen)) + if (EVP_CIPHER_CTX_set_key_length(ctx->cctx, keylen) <= 0) return 0; if (!EVP_EncryptInit_ex(ctx->cctx, NULL, NULL, key, zero_iv)) return 0; |