diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-07 14:37:36 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-07 14:37:36 +0000 |
commit | b0686dd1003d9d0fc8f116146955c368a9158b34 (patch) | |
tree | 6c90eab01b926a1d9466348effd545f127b3965d /lib | |
parent | e7472a9d59dc07ac8b0816650fefc2ce8be27117 (diff) |
ssl3_free_digest_list() has its own NULL check.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/ssl/s3_enc.c | 6 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_lib.c | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c index 7f1ad5a5b68..e8d96d53561 100644 --- a/lib/libssl/src/ssl/s3_enc.c +++ b/lib/libssl/src/ssl/s3_enc.c @@ -536,8 +536,7 @@ void ssl3_init_finished_mac(SSL *s) { BIO_free(s->s3->handshake_buffer); - if (s->s3->handshake_dgst) - ssl3_free_digest_list(s); + ssl3_free_digest_list(s); s->s3->handshake_buffer = BIO_new(BIO_s_mem()); (void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE); @@ -547,7 +546,8 @@ void ssl3_free_digest_list(SSL *s) { int i; - if (!s->s3->handshake_dgst) + + if (s->s3->handshake_dgst == NULL) return; for (i = 0; i < SSL_MAX_DIGEST; i++) { if (s->s3->handshake_dgst[i]) diff --git a/lib/libssl/src/ssl/s3_lib.c b/lib/libssl/src/ssl/s3_lib.c index 6165b2a1207..3058b66a0d9 100644 --- a/lib/libssl/src/ssl/s3_lib.c +++ b/lib/libssl/src/ssl/s3_lib.c @@ -2338,8 +2338,7 @@ ssl3_free(SSL *s) if (s->s3->tmp.ca_names != NULL) sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); BIO_free(s->s3->handshake_buffer); - if (s->s3->handshake_dgst) - ssl3_free_digest_list(s); + ssl3_free_digest_list(s); OPENSSL_cleanse(s->s3, sizeof *s->s3); free(s->s3); s->s3 = NULL; @@ -2382,9 +2381,8 @@ ssl3_clear(SSL *s) BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; } - if (s->s3->handshake_dgst) { - ssl3_free_digest_list(s); - } + ssl3_free_digest_list(s); + memset(s->s3, 0, sizeof *s->s3); s->s3->rbuf.buf = rp; s->s3->wbuf.buf = wp; |