aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/prf_x942/prf_x942.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-04 08:26:06 -0400
committerJack Lloyd <[email protected]>2019-08-04 16:26:50 -0400
commit0006bd1db9a96c294f2da852218d3f8579f422a9 (patch)
tree15600a4e8369eb167be052e8343c58dcb6693a3a /src/lib/kdf/prf_x942/prf_x942.cpp
parent247df8cae3fbec8d9b608c5dc8b42a4f6bdeef8b (diff)
Reduce usage of oids.h with the addition of some helpers on OID
Diffstat (limited to 'src/lib/kdf/prf_x942/prf_x942.cpp')
-rw-r--r--src/lib/kdf/prf_x942/prf_x942.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/kdf/prf_x942/prf_x942.cpp b/src/lib/kdf/prf_x942/prf_x942.cpp
index 3fe0a682f..f4437b10b 100644
--- a/src/lib/kdf/prf_x942/prf_x942.cpp
+++ b/src/lib/kdf/prf_x942/prf_x942.cpp
@@ -7,7 +7,6 @@
#include <botan/prf_x942.h>
#include <botan/der_enc.h>
-#include <botan/oids.h>
#include <botan/hash.h>
#include <botan/loadstor.h>
#include <algorithm>
@@ -37,7 +36,6 @@ size_t X942_PRF::kdf(uint8_t key[], size_t key_len,
const uint8_t label[], size_t label_len) const
{
std::unique_ptr<HashFunction> hash(HashFunction::create("SHA-160"));
- const OID kek_algo(m_key_wrap_oid);
secure_vector<uint8_t> h;
secure_vector<uint8_t> in;
@@ -56,7 +54,7 @@ size_t X942_PRF::kdf(uint8_t key[], size_t key_len,
DER_Encoder().start_cons(SEQUENCE)
.start_cons(SEQUENCE)
- .encode(kek_algo)
+ .encode(m_key_wrap_oid)
.raw_bytes(encode_x942_int(counter))
.end_cons()
@@ -85,15 +83,9 @@ size_t X942_PRF::kdf(uint8_t key[], size_t key_len,
return offset;
}
-/*
-* X9.42 Constructor
-*/
-X942_PRF::X942_PRF(const std::string& oid)
+std::string X942_PRF::name() const
{
- if(OIDS::have_oid(oid))
- m_key_wrap_oid = OIDS::str2oid_or_empty(oid).to_string();
- else
- m_key_wrap_oid = oid;
+ return "X9.42-PRF(" + m_key_wrap_oid.to_formatted_string() + ")";
}
}