ssl3_mac(): Fix possible divide by zero bug

CLA: trivial

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19912)
This commit is contained in:
zhailiangliang 2022-12-15 15:11:14 +08:00 committed by Tomas Mraz
parent 467b0492c1
commit 624efd2ba6
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ static int ssl3_mac(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec, unsigned char *md
hash = rl->md_ctx;
t = EVP_MD_CTX_get_size(hash);
if (t < 0)
if (t <= 0)
return 0;
md_size = t;
npad = (48 / md_size) * md_size;