aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/hkdf
diff options
context:
space:
mode:
authorKai Michaelis <[email protected]>2016-06-01 11:57:42 +0200
committerKai Michaelis <[email protected]>2016-06-01 11:57:42 +0200
commitcf74d1c376df1d9e6400e264a1d059720eeaa059 (patch)
treeac16b3e568c59a710af79020c0fee96887a9c4df /src/lib/kdf/hkdf
parent57a3f3272c96a83c5c87c36761caee83982be498 (diff)
make sure kdf labels are always used
Diffstat (limited to 'src/lib/kdf/hkdf')
-rw-r--r--src/lib/kdf/hkdf/hkdf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/kdf/hkdf/hkdf.cpp b/src/lib/kdf/hkdf/hkdf.cpp
index b7e6db020..56dc72f09 100644
--- a/src/lib/kdf/hkdf/hkdf.cpp
+++ b/src/lib/kdf/hkdf/hkdf.cpp
@@ -23,7 +23,7 @@ HKDF* HKDF::make(const Spec& spec)
size_t HKDF::kdf(byte out[], size_t out_len,
const byte secret[], size_t secret_len,
const byte salt[], size_t salt_len,
- const byte[], size_t) const
+ const byte label[], size_t label_len) const
{
m_prf->set_key(secret, secret_len);
@@ -34,6 +34,7 @@ size_t HKDF::kdf(byte out[], size_t out_len,
while(offset != out_len && counter != 0)
{
m_prf->update(h);
+ m_prf->update(label, label_len);
m_prf->update(salt, salt_len);
m_prf->update(counter++);
m_prf->final(h);