diff options
author | jsing <> | 2017-04-10 17:27:33 +0000 |
---|---|---|
committer | jsing <> | 2017-04-10 17:27:33 +0000 |
commit | 8bea6e7211234af80b7a52972d3c14596a38c767 (patch) | |
tree | 8385526871849725f6ed77516a693d277bbdfa91 /src/lib/libssl/d1_lib.c | |
parent | c8368f35409fe0a4a05ea25108a4055d6082d923 (diff) | |
download | openbsd-8bea6e7211234af80b7a52972d3c14596a38c767.tar.gz openbsd-8bea6e7211234af80b7a52972d3c14596a38c767.tar.bz2 openbsd-8bea6e7211234af80b7a52972d3c14596a38c767.zip |
Use freezero() for the internal opaque structures, instead of the current
explicit_bzero()/free(). Less code and potentially less overhead.
Diffstat (limited to 'src/lib/libssl/d1_lib.c')
-rw-r--r-- | src/lib/libssl/d1_lib.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c index 8092d56a4c..7e919a6c9b 100644 --- a/src/lib/libssl/d1_lib.c +++ b/src/lib/libssl/d1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_lib.c,v 1.41 2017/02/07 02:08:38 beck Exp $ */ | 1 | /* $OpenBSD: d1_lib.c,v 1.42 2017/04/10 17:27:33 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -191,11 +191,8 @@ dtls1_free(SSL *s) | |||
191 | pqueue_free(s->d1->sent_messages); | 191 | pqueue_free(s->d1->sent_messages); |
192 | pqueue_free(D1I(s)->buffered_app_data.q); | 192 | pqueue_free(D1I(s)->buffered_app_data.q); |
193 | 193 | ||
194 | explicit_bzero(s->d1->internal, sizeof(*s->d1->internal)); | 194 | freezero(s->d1->internal, sizeof(*s->d1->internal)); |
195 | free(s->d1->internal); | 195 | freezero(s->d1, sizeof(*s->d1)); |
196 | |||
197 | explicit_bzero(s->d1, sizeof(*s->d1)); | ||
198 | free(s->d1); | ||
199 | 196 | ||
200 | s->d1 = NULL; | 197 | s->d1 = NULL; |
201 | } | 198 | } |