From 37d0300a22dd887d88e7502e1c4279c639607907 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 4 Apr 2021 20:40:48 +0000 Subject: [PATCH] Add missing error check for AES_unwrap_key(). --- regress/lib/libcrypto/aeswrap/aes_wrap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regress/lib/libcrypto/aeswrap/aes_wrap.c b/regress/lib/libcrypto/aeswrap/aes_wrap.c index b48c7ae6e08..2b61ae3739e 100644 --- a/regress/lib/libcrypto/aeswrap/aes_wrap.c +++ b/regress/lib/libcrypto/aeswrap/aes_wrap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_wrap.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ +/* $OpenBSD: aes_wrap.c,v 1.5 2021/04/04 20:40:48 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -85,6 +85,8 @@ AES_wrap_unwrap_test(const unsigned char *kek, int keybits, if (AES_set_decrypt_key(kek, keybits, &wctx)) goto err; r = AES_unwrap_key(&wctx, iv, ptmp, otmp, r); + if (r <= 0) + goto err; if (memcmp(key, ptmp, keylen)) goto err; -- 2.20.1