summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_pk1.c
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>1998-12-21 11:00:56 +0000
committerRalf S. Engelschall <rse@openssl.org>1998-12-21 11:00:56 +0000
commitdfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c (patch)
tree2f74e0cfd76a9e092548a9bf52e579aef984299b /crypto/rsa/rsa_pk1.c
parent58964a492275ca9a59a0cd9c8155cb2491b4b909 (diff)
Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeay
Diffstat (limited to 'crypto/rsa/rsa_pk1.c')
-rw-r--r--crypto/rsa/rsa_pk1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c
index 2791291b94..4638187970 100644
--- a/crypto/rsa/rsa_pk1.c
+++ b/crypto/rsa/rsa_pk1.c
@@ -103,17 +103,18 @@ int flen;
return(1);
}
-int RSA_padding_check_PKCS1_type_1(to,tlen,from,flen)
+int RSA_padding_check_PKCS1_type_1(to,tlen,from,flen,num)
unsigned char *to;
int tlen;
unsigned char *from;
int flen;
+int num;
{
int i,j;
unsigned char *p;
p=from;
- if (*(p++) != 01)
+ if ((num != (flen+1)) || (*(p++) != 01))
{
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1,RSA_R_BLOCK_TYPE_IS_NOT_01);
return(-1);
@@ -192,21 +193,25 @@ int flen;
return(1);
}
-int RSA_padding_check_PKCS1_type_2(to,tlen,from,flen)
+int RSA_padding_check_PKCS1_type_2(to,tlen,from,flen,num)
unsigned char *to;
int tlen;
unsigned char *from;
int flen;
+int num;
{
int i,j;
unsigned char *p;
p=from;
- if (*(p++) != 02)
+ if ((num != (flen+1)) || (*(p++) != 02))
{
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2,RSA_R_BLOCK_TYPE_IS_NOT_02);
return(-1);
}
+#ifdef PKCS1_CHECK
+ return(num-11);
+#endif
/* scan over padding data */
j=flen-1; /* one for type. */