diff options
author | jsing <> | 2014-06-07 14:37:35 +0000 |
---|---|---|
committer | jsing <> | 2014-06-07 14:37:35 +0000 |
commit | cc3db42372df8be9ddfe6036931b6254f311e2b4 (patch) | |
tree | eabd81247bf2217b6023388d752c4430b93b65fc /src | |
parent | c2b57cdd8d2c468fd3c1895b1d3aea730c70edcd (diff) | |
download | openbsd-cc3db42372df8be9ddfe6036931b6254f311e2b4.tar.gz openbsd-cc3db42372df8be9ddfe6036931b6254f311e2b4.tar.bz2 openbsd-cc3db42372df8be9ddfe6036931b6254f311e2b4.zip |
ssl3_free_digest_list() has its own NULL check.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/s3_lib.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/s3_enc.c | 6 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/s3_lib.c | 8 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 6165b2a120..3058b66a0d 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c | |||
@@ -2338,8 +2338,7 @@ ssl3_free(SSL *s) | |||
2338 | if (s->s3->tmp.ca_names != NULL) | 2338 | if (s->s3->tmp.ca_names != NULL) |
2339 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); | 2339 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); |
2340 | BIO_free(s->s3->handshake_buffer); | 2340 | BIO_free(s->s3->handshake_buffer); |
2341 | if (s->s3->handshake_dgst) | 2341 | ssl3_free_digest_list(s); |
2342 | ssl3_free_digest_list(s); | ||
2343 | OPENSSL_cleanse(s->s3, sizeof *s->s3); | 2342 | OPENSSL_cleanse(s->s3, sizeof *s->s3); |
2344 | free(s->s3); | 2343 | free(s->s3); |
2345 | s->s3 = NULL; | 2344 | s->s3 = NULL; |
@@ -2382,9 +2381,8 @@ ssl3_clear(SSL *s) | |||
2382 | BIO_free(s->s3->handshake_buffer); | 2381 | BIO_free(s->s3->handshake_buffer); |
2383 | s->s3->handshake_buffer = NULL; | 2382 | s->s3->handshake_buffer = NULL; |
2384 | } | 2383 | } |
2385 | if (s->s3->handshake_dgst) { | 2384 | ssl3_free_digest_list(s); |
2386 | ssl3_free_digest_list(s); | 2385 | |
2387 | } | ||
2388 | memset(s->s3, 0, sizeof *s->s3); | 2386 | memset(s->s3, 0, sizeof *s->s3); |
2389 | s->s3->rbuf.buf = rp; | 2387 | s->s3->rbuf.buf = rp; |
2390 | s->s3->wbuf.buf = wp; | 2388 | s->s3->wbuf.buf = wp; |
diff --git a/src/lib/libssl/src/ssl/s3_enc.c b/src/lib/libssl/src/ssl/s3_enc.c index 7f1ad5a5b6..e8d96d5356 100644 --- a/src/lib/libssl/src/ssl/s3_enc.c +++ b/src/lib/libssl/src/ssl/s3_enc.c | |||
@@ -536,8 +536,7 @@ void | |||
536 | ssl3_init_finished_mac(SSL *s) | 536 | ssl3_init_finished_mac(SSL *s) |
537 | { | 537 | { |
538 | BIO_free(s->s3->handshake_buffer); | 538 | BIO_free(s->s3->handshake_buffer); |
539 | if (s->s3->handshake_dgst) | 539 | ssl3_free_digest_list(s); |
540 | ssl3_free_digest_list(s); | ||
541 | s->s3->handshake_buffer = BIO_new(BIO_s_mem()); | 540 | s->s3->handshake_buffer = BIO_new(BIO_s_mem()); |
542 | 541 | ||
543 | (void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE); | 542 | (void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE); |
@@ -547,7 +546,8 @@ void | |||
547 | ssl3_free_digest_list(SSL *s) | 546 | ssl3_free_digest_list(SSL *s) |
548 | { | 547 | { |
549 | int i; | 548 | int i; |
550 | if (!s->s3->handshake_dgst) | 549 | |
550 | if (s->s3->handshake_dgst == NULL) | ||
551 | return; | 551 | return; |
552 | for (i = 0; i < SSL_MAX_DIGEST; i++) { | 552 | for (i = 0; i < SSL_MAX_DIGEST; i++) { |
553 | if (s->s3->handshake_dgst[i]) | 553 | if (s->s3->handshake_dgst[i]) |
diff --git a/src/lib/libssl/src/ssl/s3_lib.c b/src/lib/libssl/src/ssl/s3_lib.c index 6165b2a120..3058b66a0d 100644 --- a/src/lib/libssl/src/ssl/s3_lib.c +++ b/src/lib/libssl/src/ssl/s3_lib.c | |||
@@ -2338,8 +2338,7 @@ ssl3_free(SSL *s) | |||
2338 | if (s->s3->tmp.ca_names != NULL) | 2338 | if (s->s3->tmp.ca_names != NULL) |
2339 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); | 2339 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); |
2340 | BIO_free(s->s3->handshake_buffer); | 2340 | BIO_free(s->s3->handshake_buffer); |
2341 | if (s->s3->handshake_dgst) | 2341 | ssl3_free_digest_list(s); |
2342 | ssl3_free_digest_list(s); | ||
2343 | OPENSSL_cleanse(s->s3, sizeof *s->s3); | 2342 | OPENSSL_cleanse(s->s3, sizeof *s->s3); |
2344 | free(s->s3); | 2343 | free(s->s3); |
2345 | s->s3 = NULL; | 2344 | s->s3 = NULL; |
@@ -2382,9 +2381,8 @@ ssl3_clear(SSL *s) | |||
2382 | BIO_free(s->s3->handshake_buffer); | 2381 | BIO_free(s->s3->handshake_buffer); |
2383 | s->s3->handshake_buffer = NULL; | 2382 | s->s3->handshake_buffer = NULL; |
2384 | } | 2383 | } |
2385 | if (s->s3->handshake_dgst) { | 2384 | ssl3_free_digest_list(s); |
2386 | ssl3_free_digest_list(s); | 2385 | |
2387 | } | ||
2388 | memset(s->s3, 0, sizeof *s->s3); | 2386 | memset(s->s3, 0, sizeof *s->s3); |
2389 | s->s3->rbuf.buf = rp; | 2387 | s->s3->rbuf.buf = rp; |
2390 | s->s3->wbuf.buf = wp; | 2388 | s->s3->wbuf.buf = wp; |