explicit_bzero()/free(). Less code and potentially less overhead.
-/* $OpenBSD: d1_lib.c,v 1.41 2017/02/07 02:08:38 beck Exp $ */
+/* $OpenBSD: d1_lib.c,v 1.42 2017/04/10 17:27:33 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
pqueue_free(s->d1->sent_messages);
pqueue_free(D1I(s)->buffered_app_data.q);
- explicit_bzero(s->d1->internal, sizeof(*s->d1->internal));
- free(s->d1->internal);
-
- explicit_bzero(s->d1, sizeof(*s->d1));
- free(s->d1);
+ freezero(s->d1->internal, sizeof(*s->d1->internal));
+ freezero(s->d1, sizeof(*s->d1));
s->d1 = NULL;
}
-/* $OpenBSD: s3_lib.c,v 1.139 2017/04/10 17:25:22 jsing Exp $ */
+/* $OpenBSD: s3_lib.c,v 1.140 2017/04/10 17:27:33 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
free(S3I(s)->alpn_selected);
- explicit_bzero(S3I(s), sizeof(*S3I(s)));
- free(S3I(s));
-
- explicit_bzero(s->s3, sizeof(*s->s3));
- free(s->s3);
+ freezero(S3I(s), sizeof(*S3I(s)));
+ freezero(s->s3, sizeof(*s->s3));
s->s3 = NULL;
}
-/* $OpenBSD: ssl_sess.c,v 1.70 2017/02/07 02:08:38 beck Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.71 2017/04/10 17:27:33 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
free(ss->internal->tlsext_ecpointformatlist);
free(ss->internal->tlsext_supportedgroups);
- explicit_bzero(ss->internal, sizeof(*ss->internal));
- free(ss->internal);
-
- explicit_bzero(ss, sizeof(*ss));
- free(ss);
+ freezero(ss->internal, sizeof(*ss->internal));
+ freezero(ss, sizeof(*ss));
}
int