coverity 1462564 Improper use of negative value
authorPauli <paul.dale@oracle.com>
Sun, 26 Apr 2020 23:04:05 +0000 (09:04 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 30 Apr 2020 10:21:32 +0000 (20:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)

providers/implementations/macs/kmac_prov.c

index 6feaba7695307e50ac383da7bc956c2007281298..451b52460c848e2d3f9c535a99a60e6ee1637965 100644 (file)
@@ -250,6 +250,8 @@ static int kmac_init(void *vmacctx)
         return 0;
 
     block_len = EVP_MD_block_size(ossl_prov_digest_md(&kctx->digest));
+    if (block_len < 0)
+        return 0;
 
     /* Set default custom string if it is not already set */
     if (kctx->custom_len == 0) {