diff options
author | Jack Lloyd <[email protected]> | 2019-10-28 06:48:38 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-10-28 06:51:35 -0400 |
commit | f84a03eaace029270d2d026fc3ecf5ba004f0c89 (patch) | |
tree | b8d96422275d9686bb56c532c9bdcd2770f3552b /src/tests/unit_x509.cpp | |
parent | dcb621e23a8ff8f1cb24adc681807a52dc6a49b3 (diff) |
Deprecate DER_Encoder::get_contents_unlocked
It's better to use the version taking the vector in the constructor
as otherwise we store to locked memory then copy out at the end.
Convert all library uses.
Diffstat (limited to 'src/tests/unit_x509.cpp')
-rw-r--r-- | src/tests/unit_x509.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp index d180e8ffc..eaae35842 100644 --- a/src/tests/unit_x509.cpp +++ b/src/tests/unit_x509.cpp @@ -1356,7 +1356,9 @@ class String_Extension final : public Botan::Certificate_Extension std::vector<uint8_t> encode_inner() const override { - return Botan::DER_Encoder().encode(Botan::ASN1_String(m_contents, Botan::UTF8_STRING)).get_contents_unlocked(); + std::vector<uint8_t> bits; + Botan::DER_Encoder(bits).encode(Botan::ASN1_String(m_contents, Botan::UTF8_STRING)); + return bits; } void decode_inner(const std::vector<uint8_t>& in) override |