diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/evp/e_rc2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c index 456a22eeeb..9052195ac2 100644 --- a/src/lib/libcrypto/evp/e_rc2.c +++ b/src/lib/libcrypto/evp/e_rc2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_rc2.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: e_rc2.c,v 1.11 2015/02/10 09:52:35 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -187,7 +187,11 @@ rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
187 | 187 | ||
188 | if (type != NULL) { | 188 | if (type != NULL) { |
189 | l = EVP_CIPHER_CTX_iv_length(c); | 189 | l = EVP_CIPHER_CTX_iv_length(c); |
190 | OPENSSL_assert(l <= sizeof(iv)); | 190 | if (l > sizeof(iv)) { |
191 | EVPerr(EVP_F_RC2_GET_ASN1_TYPE_AND_IV, | ||
192 | EVP_R_IV_TOO_LARGE); | ||
193 | return -1; | ||
194 | } | ||
191 | i = ASN1_TYPE_get_int_octetstring(type, &num, iv, l); | 195 | i = ASN1_TYPE_get_int_octetstring(type, &num, iv, l); |
192 | if (i != (int)l) | 196 | if (i != (int)l) |
193 | return (-1); | 197 | return (-1); |