]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: switch to ceph::crypto::zeroize_for_security().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 15 Nov 2019 22:25:32 +0000 (23:25 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 11 Dec 2019 00:11:11 +0000 (01:11 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit a5e19234eda35688782318da16e74de05c8ba9d3)

src/common/ceph_crypto.h

index dda3306b2a60e12497b66213da180698beb456c2..03351eb4053b1e600bcd362a7b226f2f38241036 100644 (file)
@@ -244,7 +244,9 @@ namespace ceph::crypto::ssl {
   public:
     HMAC (const EVP_MD *type, const unsigned char *key, size_t length)
       : mpType(type) {
-      ::memset(&mContext, 0, sizeof(mContext));
+      // the strict FIPS zeroization doesn't seem to be necessary here.
+      // just in the case.
+      ::ceph::crypto::zeroize_for_security(&mContext, sizeof(mContext));
       const auto r = HMAC_Init_ex(&mContext, key, length, mpType, nullptr);
       if (r != 1) {
          throw DigestException("HMAC_Init_ex() failed");