diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_ssl.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_ssl.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c index 9bcd4b2c03..1050844f8d 100644 --- a/src/lib/libcrypto/rsa/rsa_ssl.c +++ b/src/lib/libcrypto/rsa/rsa_ssl.c | |||
@@ -58,15 +58,12 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "bn.h" | 61 | #include <openssl/bn.h> |
62 | #include "rsa.h" | 62 | #include <openssl/rsa.h> |
63 | #include "rand.h" | 63 | #include <openssl/rand.h> |
64 | 64 | ||
65 | int RSA_padding_add_SSLv23(to,tlen,from,flen) | 65 | int RSA_padding_add_SSLv23(unsigned char *to, int tlen, unsigned char *from, |
66 | unsigned char *to; | 66 | int flen) |
67 | int tlen; | ||
68 | unsigned char *from; | ||
69 | int flen; | ||
70 | { | 67 | { |
71 | int i,j; | 68 | int i,j; |
72 | unsigned char *p; | 69 | unsigned char *p; |
@@ -103,11 +100,8 @@ int flen; | |||
103 | return(1); | 100 | return(1); |
104 | } | 101 | } |
105 | 102 | ||
106 | int RSA_padding_check_SSLv23(to,tlen,from,flen) | 103 | int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *from, |
107 | unsigned char *to; | 104 | int flen, int num) |
108 | int tlen; | ||
109 | unsigned char *from; | ||
110 | int flen; | ||
111 | { | 105 | { |
112 | int i,j,k; | 106 | int i,j,k; |
113 | unsigned char *p; | 107 | unsigned char *p; |
@@ -118,7 +112,7 @@ int flen; | |||
118 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_DATA_TOO_SMALL); | 112 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_DATA_TOO_SMALL); |
119 | return(-1); | 113 | return(-1); |
120 | } | 114 | } |
121 | if (*(p++) != 02) | 115 | if ((num != (flen+1)) || (*(p++) != 02)) |
122 | { | 116 | { |
123 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_BLOCK_TYPE_IS_NOT_02); | 117 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_BLOCK_TYPE_IS_NOT_02); |
124 | return(-1); | 118 | return(-1); |