From: Dr. Stephen Henson Date: Mon, 6 Jun 2005 22:41:50 +0000 (+0000) Subject: Update from head. X-Git-Tag: OpenSSL_0_9_8-beta5~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=39d29195a7c6fe7394137ea543d19edd28465de9;p=oweals%2Fopenssl.git Update from head. --- diff --git a/crypto/rsa/rsa_x931.c b/crypto/rsa/rsa_x931.c index 7d77213d13..e918654176 100644 --- a/crypto/rsa/rsa_x931.c +++ b/crypto/rsa/rsa_x931.c @@ -115,9 +115,9 @@ int RSA_padding_check_X931(unsigned char *to, int tlen, return -1; } - j=flen-3; if (*p++ == 0x6B) { + j=flen-3; for (i = 0; i < j; i++) { unsigned char c = *p++; @@ -130,15 +130,17 @@ int RSA_padding_check_X931(unsigned char *to, int tlen, return -1; } } - } - j -= i; + j -= i; + + if (i == 0) + { + RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_PADDING); + return -1; + } - if (i == 0) - { - RSAerr(RSA_F_RSA_PADDING_CHECK_X931, RSA_R_INVALID_PADDING); - return -1; } + else j = flen - 2; if (p[j] != 0xCC) {