diff options
author | Adam Langley <agl@chromium.org> | 2014-07-18 20:28:40 +0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-07-18 21:22:05 +0400 |
commit | 37a623cf2932b8e7de6c6d58d1a6ce81c4b9f56e (patch) | |
tree | ac2d47055eda660506fea42862aa4b7ae1715db5 /ssl/s3_enc.c | |
parent | b5d725df63695aa7298126ea9eb12320d7e25dfd (diff) |
Have BIO_get_mem_data return a size_t and uint8_t*
Change-Id: I883f9c3527b572a2140ae4899cf4409cdc25c6dc
Reviewed-on: https://boringssl-review.googlesource.com/1261
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r-- | ssl/s3_enc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 8f6d75bf..24298fd5 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -552,15 +552,14 @@ int ssl3_digest_cached_records(SSL *s) int i; long mask; const EVP_MD *md; - long hdatalen; - char *hdata; + const uint8_t *hdata; + size_t hdatalen; /* Allocate handshake_dgst array */ ssl3_free_digest_list(s); s->s3->handshake_dgst = OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *)); memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST *sizeof(EVP_MD_CTX *)); - hdatalen = BIO_get_mem_data(s->s3->handshake_buffer,&hdata); - if (hdatalen <= 0) + if (!BIO_mem_contents(s->s3->handshake_buffer, &hdata, &hdatalen)) { OPENSSL_PUT_ERROR(SSL, ssl3_digest_cached_records, SSL_R_BAD_HANDSHAKE_LENGTH); return 0; |