summaryrefslogtreecommitdiff
path: root/regress/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-04-04 20:40:49 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-04-04 20:40:49 +0000
commit2f42b27f666fa473fd1031608ddfd21c4ff44e00 (patch)
tree779d0ed8425125ba95deddeebd843b2be9311c04 /regress/lib/libcrypto
parent17f7b24dff932062d432dd89c508f680aa2ae727 (diff)
Add missing error check for AES_unwrap_key().
Diffstat (limited to 'regress/lib/libcrypto')
-rw-r--r--regress/lib/libcrypto/aeswrap/aes_wrap.c4
1 files changed, 3 insertions, 1 deletions
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;