diff options
Diffstat (limited to 'src/kdf/tls_prf')
-rw-r--r-- | src/kdf/tls_prf/prf_tls.cpp | 3 | ||||
-rw-r--r-- | src/kdf/tls_prf/prf_tls.h | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/kdf/tls_prf/prf_tls.cpp b/src/kdf/tls_prf/prf_tls.cpp index 872997c28..2b57cdd25 100644 --- a/src/kdf/tls_prf/prf_tls.cpp +++ b/src/kdf/tls_prf/prf_tls.cpp @@ -85,9 +85,8 @@ SecureVector<byte> TLS_PRF::derive(size_t key_len, /* * TLS v1.2 PRF Constructor and Destructor */ -TLS_12_PRF::TLS_12_PRF(HashFunction* hash) +TLS_12_PRF::TLS_12_PRF(MessageAuthenticationCode* mac) : hmac(mac) { - hmac = new HMAC(hash); } TLS_12_PRF::~TLS_12_PRF() diff --git a/src/kdf/tls_prf/prf_tls.h b/src/kdf/tls_prf/prf_tls.h index ee1b29df6..5237f17c0 100644 --- a/src/kdf/tls_prf/prf_tls.h +++ b/src/kdf/tls_prf/prf_tls.h @@ -24,6 +24,9 @@ class BOTAN_DLL TLS_PRF : public KDF const byte secret[], size_t secret_len, const byte seed[], size_t seed_len) const; + std::string name() const { return "TLS-PRF"; } + KDF* clone() const { return new TLS_PRF; } + TLS_PRF(); ~TLS_PRF(); private: @@ -41,7 +44,10 @@ class BOTAN_DLL TLS_12_PRF : public KDF const byte secret[], size_t secret_len, const byte seed[], size_t seed_len) const; - TLS_12_PRF(HashFunction* hash); + std::string name() const { return "TLSv12-PRF(" + hmac->name() + ")"; } + KDF* clone() const { return new TLS_12_PRF(hmac->clone()); } + + TLS_12_PRF(MessageAuthenticationCode* hmac); ~TLS_12_PRF(); private: MessageAuthenticationCode* hmac; |