Correctly handle the return value from EVP_Cipher() in the CMAC code
authorMatt Caswell <matt@openssl.org>
Wed, 27 May 2020 10:38:39 +0000 (11:38 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 10 Jun 2020 11:58:26 +0000 (12:58 +0100)
commit154ea425e647de4a497aa28c91d279aa93b3bf60
tree3b796139930bc22d0d76f8419f925ab8d66d9fa4
parentb896d9436d69c67f9d10ffcc8aed15db42c08766
Correctly handle the return value from EVP_Cipher() in the CMAC code

EVP_Cipher() is a very low level routine that directly calls the
underlying cipher function. It's return value semantics are very odd.
Depending on the type of cipher 0 or -1 is returned on error. We should
just check for <=0 for a failure.

Fixes #11957

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11972)
crypto/cmac/cmac.c