From: Francis Dupont Date: Mon, 22 Jun 2015 12:19:49 +0000 (+0200) Subject: [3908] Added a clear() function to SecBuf class X-Git-Tag: trac3634b_base~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=277912a7d6a37c28a305eb2f3731ccdf4b18fa64;p=thirdparty%2Fkea.git [3908] Added a clear() function to SecBuf class --- 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_;