diff options
author | Ben Laurie <ben@openssl.org> | 2012-06-03 22:03:37 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2012-06-03 22:03:37 +0000 |
commit | 68d2cf51bcfc1c2c1d0deec9be21c3d743737656 (patch) | |
tree | 7b8ed6018e595520ff18873c4fc267228b552f85 /ssl/s2_srvr.c | |
parent | 19eedffcafe5e703f28e015bad417bc50266c19b (diff) |
Reduce version skew: trivia (I hope).
Diffstat (limited to 'ssl/s2_srvr.c')
-rw-r--r-- | ssl/s2_srvr.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c index bc885e8e7f..2cba426bb7 100644 --- a/ssl/s2_srvr.c +++ b/ssl/s2_srvr.c @@ -1059,10 +1059,12 @@ static int request_certificate(SSL *s) EVP_PKEY *pkey=NULL; EVP_MD_CTX_init(&ctx); - EVP_VerifyInit_ex(&ctx,s->ctx->rsa_md5, NULL); - EVP_VerifyUpdate(&ctx,s->s2->key_material, - s->s2->key_material_length); - EVP_VerifyUpdate(&ctx,ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH); + if (!EVP_VerifyInit_ex(&ctx,s->ctx->rsa_md5, NULL) + || !EVP_VerifyUpdate(&ctx,s->s2->key_material, + s->s2->key_material_length) + || !EVP_VerifyUpdate(&ctx,ccd, + SSL2_MIN_CERT_CHALLENGE_LENGTH)) + goto msg_end; i=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,NULL); buf2=OPENSSL_malloc((unsigned int)i); @@ -1073,7 +1075,11 @@ static int request_certificate(SSL *s) } p2=buf2; i=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,&p2); - EVP_VerifyUpdate(&ctx,buf2,(unsigned int)i); + if (!EVP_VerifyUpdate(&ctx,buf2,(unsigned int)i)) + { + OPENSSL_free(buf2); + goto msg_end; + } OPENSSL_free(buf2); pkey=X509_get_pubkey(x509); |