diff options
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_x931.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rsa/rsa_x931.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_x931.c b/src/lib/libcrypto/rsa/rsa_x931.c index f22c50ba13..c3305139f8 100644 --- a/src/lib/libcrypto/rsa/rsa_x931.c +++ b/src/lib/libcrypto/rsa/rsa_x931.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_x931.c,v 1.3 2014/07/09 08:20:08 miod Exp $ */ | 1 | /* $OpenBSD: rsa_x931.c,v 1.4 2014/07/09 09:07:00 miod Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -135,7 +135,7 @@ RSA_padding_check_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
135 | } else | 135 | } else |
136 | j = flen - 2; | 136 | j = flen - 2; |
137 | 137 | ||
138 | if (p[j] != 0xCC) { | 138 | if (j < 0 || p[j] != 0xCC) { |
139 | RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_TRAILER); | 139 | RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_TRAILER); |
140 | return -1; | 140 | return -1; |
141 | } | 141 | } |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_x931.c b/src/lib/libssl/src/crypto/rsa/rsa_x931.c index f22c50ba13..c3305139f8 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_x931.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_x931.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_x931.c,v 1.3 2014/07/09 08:20:08 miod Exp $ */ | 1 | /* $OpenBSD: rsa_x931.c,v 1.4 2014/07/09 09:07:00 miod Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -135,7 +135,7 @@ RSA_padding_check_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
135 | } else | 135 | } else |
136 | j = flen - 2; | 136 | j = flen - 2; |
137 | 137 | ||
138 | if (p[j] != 0xCC) { | 138 | if (j < 0 || p[j] != 0xCC) { |
139 | RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_TRAILER); | 139 | RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_TRAILER); |
140 | return -1; | 140 | return -1; |
141 | } | 141 | } |