From 277912a7d6a37c28a305eb2f3731ccdf4b18fa64 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 22 Jun 2015 14:19:49 +0200 Subject: [3908] Added a clear() function to SecBuf class --- src/lib/cryptolink/openssl_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/cryptolink/openssl_common.h') diff --git a/src/lib/cryptolink/openssl_common.h b/src/lib/cryptolink/openssl_common.h index 0652037247..fb19c9f2d6 100644 --- a/src/lib/cryptolink/openssl_common.h +++ b/src/lib/cryptolink/openssl_common.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -78,6 +78,11 @@ public: vec_.resize(sz); }; + void clear() { + std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T)); + vec_.clear(); + } + SecBuf& operator=(const SecBuf& x) { if (&x != *this) { vec_ = x.vec_; -- cgit v1.2.3