summaryrefslogtreecommitdiffstats
path: root/rsaref
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-04-09 16:26:37 +0000
committerUlf Möller <ulf@openssl.org>1999-04-09 16:26:37 +0000
commit28847dd15398a5914e45275c887192a5e04f39fa (patch)
treea1e757ff5d12e32547fac89ac01d38d211731af9 /rsaref
parenta5a47e4afbdc1cc1ec8c98f63cbc49705b8a6f4f (diff)
Test PKCS#1 v1.5 padding as well.
Diffstat (limited to 'rsaref')
-rw-r--r--rsaref/rsaref.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/rsaref/rsaref.c b/rsaref/rsaref.c
index 90cda4687b..84486dd1b5 100644
--- a/rsaref/rsaref.c
+++ b/rsaref/rsaref.c
@@ -283,6 +283,11 @@ int padding;
int i,outlen= -1;
RSArefPrivateKey RSAkey;
+ if (padding != RSA_PKCS1_PADDING)
+ {
+ RSAREFerr(RSAREF_F_RSA_REF_PRIVATE_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
+ goto err;
+ }
if (!RSAref_Private_eay2ref(rsa,&RSAkey))
goto err;
if ((i=RSAPrivateEncrypt(to,&outlen,from,len,&RSAkey)) != 0)
@@ -328,9 +333,12 @@ int padding;
RSARandomState rnd;
unsigned char buf[16];
- if (padding == RSA_PKCS1_OAEP_PADDING)
+ if (padding != RSA_PKCS1_PADDING && padding != RSA_SSLV23_PADDING)
+ {
+ RSAREFerr(RSAREF_F_RSA_REF_PUBLIC_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
goto err;
-
+ }
+
R_RandomInit(&rnd);
R_GetRandomBytesNeeded((unsigned int *)&i,&rnd);
while (i > 0)