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>
Fri, 19 Jun 2020 10:41:23 +0000 (11:41 +0100)
commitce7bd71a428b0907958beb6dfa71681e751b33d1
tree210242e99afb3dcabc2ffa793d567d18155b27d9
parent86863f2ddc4200e5048e28c40ed6521495010699
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: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12107)
crypto/cmac/cmac.c