summaryrefslogtreecommitdiffstats
path: root/ssl/s3_clnt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-09-18 22:37:44 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-09-18 22:37:44 +0000
commit1c80019a2c8f59410552197723829fd72ab45a5e (patch)
treee78f00fb8637de56d6dc390c9d5a239b494ab830 /ssl/s3_clnt.c
parent090d848ea89b112587cf2e5b26acfaaae6bf79c2 (diff)
Add new sign and verify members to RSA_METHOD and change SSL code to use sign
and verify rather than direct encrypt/decrypt.
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r--ssl/s3_clnt.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index d3e6b4d1e5..31a8535bb0 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -1053,15 +1053,15 @@ static int ssl3_get_key_exchange(SSL *s)
q+=i;
j+=i;
}
- i=RSA_public_decrypt((int)n,p,p,pkey->pkey.rsa,
- RSA_PKCS1_PADDING);
- if (i <= 0)
+ i=RSA_verify(NID_md5_sha1, md_buf, j, p, n,
+ pkey->pkey.rsa);
+ if (i < 0)
{
al=SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT);
goto f_err;
}
- if ((j != i) || (memcmp(p,md_buf,i) != 0))
+ if (i == 0)
{
/* bad signature */
al=SSL_AD_DECRYPT_ERROR;
@@ -1481,11 +1481,9 @@ static int ssl3_send_client_verify(SSL *s)
{
s->method->ssl3_enc->cert_verify_mac(s,
&(s->s3->finish_dgst1),&(data[0]));
- i=RSA_private_encrypt(
- MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH,
- data,&(p[2]),pkey->pkey.rsa,
- RSA_PKCS1_PADDING);
- if (i <= 0)
+ if (RSA_sign(NID_md5_sha1, data,
+ MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH,
+ &(p[2]), &i, pkey->pkey.rsa) <= 0 )
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY,ERR_R_RSA_LIB);
goto err;