aboutsummaryrefslogtreecommitdiffstats
path: root/src/kdf/prf_x942
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-25 22:52:00 +0000
committerlloyd <[email protected]>2012-05-25 22:52:00 +0000
commit12090a7148d9ee73572cc1a7268fc489504a8173 (patch)
tree51e50ce0852c56231e9e6dc13f168b10edd45d01 /src/kdf/prf_x942
parent9594979caf775dc4062850044715b804d1fda60c (diff)
parent65cc04445f8d40497f02a14bd8cb97081790e54b (diff)
propagate from branch 'net.randombit.botan.x509-path-validation' (head 63b5a20eab129ca13287fda33d2d02eec329708f)
to branch 'net.randombit.botan' (head 8b8150f09c55184f028f2929c4e7f7cd0d46d96e)
Diffstat (limited to 'src/kdf/prf_x942')
-rw-r--r--src/kdf/prf_x942/prf_x942.cpp10
-rw-r--r--src/kdf/prf_x942/prf_x942.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/kdf/prf_x942/prf_x942.cpp b/src/kdf/prf_x942/prf_x942.cpp
index fc31effe4..149be163f 100644
--- a/src/kdf/prf_x942/prf_x942.cpp
+++ b/src/kdf/prf_x942/prf_x942.cpp
@@ -20,11 +20,11 @@ namespace {
/*
* Encode an integer as an OCTET STRING
*/
-MemoryVector<byte> encode_x942_int(u32bit n)
+std::vector<byte> encode_x942_int(u32bit n)
{
byte n_buf[4] = { 0 };
store_be(n, n_buf);
- return DER_Encoder().encode(n_buf, 4, OCTET_STRING).get_contents();
+ return DER_Encoder().encode(n_buf, 4, OCTET_STRING).get_contents_unlocked();
}
}
@@ -32,14 +32,14 @@ MemoryVector<byte> encode_x942_int(u32bit n)
/*
* X9.42 PRF
*/
-SecureVector<byte> X942_PRF::derive(size_t key_len,
+secure_vector<byte> X942_PRF::derive(size_t key_len,
const byte secret[], size_t secret_len,
const byte salt[], size_t salt_len) const
{
SHA_160 hash;
const OID kek_algo(key_wrap_oid);
- SecureVector<byte> key;
+ secure_vector<byte> key;
u32bit counter = 1;
while(key.size() != key_len && counter)
@@ -68,7 +68,7 @@ SecureVector<byte> X942_PRF::derive(size_t key_len,
.end_cons().get_contents()
);
- SecureVector<byte> digest = hash.final();
+ secure_vector<byte> digest = hash.final();
const size_t needed = std::min(digest.size(), key_len - key.size());
key += std::make_pair(&digest[0], needed);
diff --git a/src/kdf/prf_x942/prf_x942.h b/src/kdf/prf_x942/prf_x942.h
index e6093eda6..f86b1bdd5 100644
--- a/src/kdf/prf_x942/prf_x942.h
+++ b/src/kdf/prf_x942/prf_x942.h
@@ -18,7 +18,7 @@ namespace Botan {
class BOTAN_DLL X942_PRF : public KDF
{
public:
- SecureVector<byte> derive(size_t, const byte[], size_t,
+ secure_vector<byte> derive(size_t, const byte[], size_t,
const byte[], size_t) const;
std::string name() const { return "X942_PRF(" + key_wrap_oid + ")"; }