aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/dl_algo
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-18 20:32:36 +0000
committerlloyd <[email protected]>2012-05-18 20:32:36 +0000
commitc691561f3198f481c13457433efbccc1c9fcd898 (patch)
treea45ea2c5a30e0cb009fbcb68a61ef39332ff790c /src/pubkey/dl_algo
parentd76700f01c7ecac5633edf75f8d7408b46c5dbac (diff)
Fairly huge update that replaces the old secmem types with std::vector
using a custom allocator. Currently our allocator just does new/delete with a memset before deletion, and the mmap and mlock allocators have been removed.
Diffstat (limited to 'src/pubkey/dl_algo')
-rw-r--r--src/pubkey/dl_algo/dl_algo.cpp10
-rw-r--r--src/pubkey/dl_algo/dl_algo.h8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/pubkey/dl_algo/dl_algo.cpp b/src/pubkey/dl_algo/dl_algo.cpp
index 8e326ef6a..1034a3252 100644
--- a/src/pubkey/dl_algo/dl_algo.cpp
+++ b/src/pubkey/dl_algo/dl_algo.cpp
@@ -18,13 +18,13 @@ AlgorithmIdentifier DL_Scheme_PublicKey::algorithm_identifier() const
group.DER_encode(group_format()));
}
-MemoryVector<byte> DL_Scheme_PublicKey::x509_subject_public_key() const
+std::vector<byte> DL_Scheme_PublicKey::x509_subject_public_key() const
{
- return DER_Encoder().encode(y).get_contents();
+ return DER_Encoder().encode(y).get_contents_unlocked();
}
DL_Scheme_PublicKey::DL_Scheme_PublicKey(const AlgorithmIdentifier& alg_id,
- const MemoryRegion<byte>& key_bits,
+ const secure_vector<byte>& key_bits,
DL_Group::Format format)
{
DataSource_Memory source(alg_id.parameters);
@@ -33,13 +33,13 @@ DL_Scheme_PublicKey::DL_Scheme_PublicKey(const AlgorithmIdentifier& alg_id,
BER_Decoder(key_bits).decode(y);
}
-MemoryVector<byte> DL_Scheme_PrivateKey::pkcs8_private_key() const
+secure_vector<byte> DL_Scheme_PrivateKey::pkcs8_private_key() const
{
return DER_Encoder().encode(x).get_contents();
}
DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(const AlgorithmIdentifier& alg_id,
- const MemoryRegion<byte>& key_bits,
+ const secure_vector<byte>& key_bits,
DL_Group::Format format)
{
DataSource_Memory source(alg_id.parameters);
diff --git a/src/pubkey/dl_algo/dl_algo.h b/src/pubkey/dl_algo/dl_algo.h
index 2cc632caa..af2806b02 100644
--- a/src/pubkey/dl_algo/dl_algo.h
+++ b/src/pubkey/dl_algo/dl_algo.h
@@ -24,7 +24,7 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key
AlgorithmIdentifier algorithm_identifier() const;
- MemoryVector<byte> x509_subject_public_key() const;
+ std::vector<byte> x509_subject_public_key() const;
/**
* Get the DL domain parameters of this key.
@@ -62,7 +62,7 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key
virtual DL_Group::Format group_format() const = 0;
DL_Scheme_PublicKey(const AlgorithmIdentifier& alg_id,
- const MemoryRegion<byte>& key_bits,
+ const secure_vector<byte>& key_bits,
DL_Group::Format group_format);
protected:
@@ -94,10 +94,10 @@ class BOTAN_DLL DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey,
*/
const BigInt& get_x() const { return x; }
- MemoryVector<byte> pkcs8_private_key() const;
+ secure_vector<byte> pkcs8_private_key() const;
DL_Scheme_PrivateKey(const AlgorithmIdentifier& alg_id,
- const MemoryRegion<byte>& key_bits,
+ const secure_vector<byte>& key_bits,
DL_Group::Format group_format);
protected: