Revert ssl_asn1.c r1.50 - CBB and freezero(3) do not play nicely together.
authorjsing <jsing@openbsd.org>
Tue, 11 Apr 2017 13:14:08 +0000 (13:14 +0000)
committerjsing <jsing@openbsd.org>
Tue, 11 Apr 2017 13:14:08 +0000 (13:14 +0000)
Back this out while we investigate and implement a solution.

Found the hard way by sthen@

lib/libssl/ssl_asn1.c

index 5110ca3..aca34f8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_asn1.c,v 1.50 2017/04/10 16:47:08 jsing Exp $ */
+/* $OpenBSD: ssl_asn1.c,v 1.51 2017/04/11 13:14:08 jsing Exp $ */
 
 /*
  * Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
@@ -205,9 +205,12 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp)
        rv = (int)data_len;
 
  err:
+       if (data != NULL)
+               explicit_bzero(data, data_len);
+
        CBB_cleanup(&session);
-       freezero(data, data_len);
        free(peer_cert_bytes);
+       free(data);
 
        return rv;
 }