From c14e40f952b413aec2aede064bcd815a4e30e6fb Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 4 Nov 2016 18:33:10 +0100 Subject: [PATCH] [3908] Addressed last comments --- src/lib/cryptolink/botan_hmac.cc | 2 -- src/lib/cryptolink/openssl_common.h | 12 +++--------- src/lib/cryptolink/openssl_hmac.cc | 2 -- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/lib/cryptolink/botan_hmac.cc b/src/lib/cryptolink/botan_hmac.cc index 27281f0cbc..55360e94b2 100644 --- a/src/lib/cryptolink/botan_hmac.cc +++ b/src/lib/cryptolink/botan_hmac.cc @@ -194,8 +194,6 @@ public: if (digest_.empty()) { digest_ = hmac_->final(); } - // digest_.size() == size by construction - // if you are not convinced, add an assert() return (Botan::same_mem(&digest_[0], static_cast(sig), len)); diff --git a/src/lib/cryptolink/openssl_common.h b/src/lib/cryptolink/openssl_common.h index fb19c9f2d6..a3e455699b 100644 --- a/src/lib/cryptolink/openssl_common.h +++ b/src/lib/cryptolink/openssl_common.h @@ -36,17 +36,11 @@ public: explicit SecBuf() : vec_(std::vector()) {} - explicit SecBuf(size_t n, const T& value = T()) : - vec_(std::vector(n, value)) - {} + explicit SecBuf(size_t n, const T& value = T()) : vec_(n, value) {} - SecBuf(iterator first, iterator last) : - vec_(std::vector(first, last)) - {} + SecBuf(iterator first, iterator last) : vec_(first, last) {} - SecBuf(const_iterator first, const_iterator last) : - vec_(std::vector(first, last)) - {} + SecBuf(const_iterator first, const_iterator last) : vec_(first, last) {} SecBuf(const std::vector& x) : vec_(x) {} diff --git a/src/lib/cryptolink/openssl_hmac.cc b/src/lib/cryptolink/openssl_hmac.cc index 57ed066a75..6d6a129672 100644 --- a/src/lib/cryptolink/openssl_hmac.cc +++ b/src/lib/cryptolink/openssl_hmac.cc @@ -163,8 +163,6 @@ public: if (len > size) { len = size; } - // digest.size() == size by construction - // if you are not convinced, add an assert() return (digest.same(sig, len)); }