Use freezero(3) in the CBB clean up path, since this could hold sensitive
authorjsing <jsing@openbsd.org>
Fri, 14 Apr 2017 15:20:55 +0000 (15:20 +0000)
committerjsing <jsing@openbsd.org>
Fri, 14 Apr 2017 15:20:55 +0000 (15:20 +0000)
information (such as master keys).

lib/libssl/bs_cbb.c

index a84299f..154a796 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: bs_cbb.c,v 1.14 2017/03/10 15:16:20 jsing Exp $       */
+/*     $OpenBSD: bs_cbb.c,v 1.15 2017/04/14 15:20:55 jsing Exp $       */
 /*
  * Copyright (c) 2014, Google Inc.
  *
@@ -80,8 +80,7 @@ CBB_cleanup(CBB *cbb)
 {
        if (cbb->base) {
                if (cbb->base->can_resize)
-                       free(cbb->base->buf);
-
+                       freezero(cbb->base->buf, cbb->base->cap);
                free(cbb->base);
        }
        cbb->base = NULL;