diff options
author | Ben Laurie <ben@openssl.org> | 2008-12-27 02:00:38 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2008-12-27 02:00:38 +0000 |
commit | 6ba71a71732b1e0ae9289ad7cceafcde91ec76ea (patch) | |
tree | fd3dcc67e771ede00812f993419367bc794d59d1 /ssl/t1_enc.c | |
parent | 4ded7b44a8709f46896953e6289565ac26f1de5d (diff) |
Handle the unlikely event that BIO_get_mem_data() returns -ve.
Diffstat (limited to 'ssl/t1_enc.c')
-rw-r--r-- | ssl/t1_enc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 3a349920d9..4d9a18e3a6 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -749,7 +749,9 @@ int tls1_cert_verify_mac(SSL *s, int md_nid, unsigned char *out) int i; if (s->s3->handshake_buffer) - ssl3_digest_cached_records(s); + if (!ssl3_digest_cached_records(s)) + return 0; + for (i=0;i<SSL_MAX_DIGEST;i++) { if (s->s3->handshake_dgst[i]&&EVP_MD_CTX_type(s->s3->handshake_dgst[i])==md_nid) @@ -784,10 +786,11 @@ int tls1_final_finish_mac(SSL *s, q=buf; - EVP_MD_CTX_init(&ctx); - if (s->s3->handshake_buffer) - ssl3_digest_cached_records(s); + if (!ssl3_digest_cached_records(s)) + return 0; + + EVP_MD_CTX_init(&ctx); for (idx=0;ssl_get_handshake_digest(idx,&mask,&md);idx++) { |