diff options
author | zhailiangliang <zhailiangliang@loongson.cn> | 2022-12-15 15:11:14 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-12-22 12:19:03 +0100 |
commit | 624efd2ba6f1dabdcdecf17c77bd206c421efdaf (patch) | |
tree | d8d2d3d5589d5a1a9774bd7988dfe5af22a211fa /ssl/record/methods/ssl3_meth.c | |
parent | 467b0492c1e597857b30b91ed72605387aa9825b (diff) |
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)
Diffstat (limited to 'ssl/record/methods/ssl3_meth.c')
-rw-r--r-- | ssl/record/methods/ssl3_meth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/record/methods/ssl3_meth.c b/ssl/record/methods/ssl3_meth.c index de4ce8b67e..279a3d11e8 100644 --- a/ssl/record/methods/ssl3_meth.c +++ b/ssl/record/methods/ssl3_meth.c @@ -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; |