diff options
author | Jack Lloyd <[email protected]> | 2018-06-08 06:30:01 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-06-08 06:30:01 -0400 |
commit | 1d474f74977ed7ba0609307316f11a708fd13159 (patch) | |
tree | 573605ebf513220d402cb6dce8b746eac0e7fa2b | |
parent | 2559c80b098cec1bfcb30be1ca976f595aaf1fd6 (diff) |
Expose BER_Decoder constructor taking BER_Object&&
-rw-r--r-- | src/lib/asn1/ber_dec.h | 10 | ||||
-rw-r--r-- | src/lib/x509/x509_crl.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/asn1/ber_dec.h b/src/lib/asn1/ber_dec.h index 2086eacd3..0f2fb4607 100644 --- a/src/lib/asn1/ber_dec.h +++ b/src/lib/asn1/ber_dec.h @@ -47,6 +47,12 @@ class BOTAN_PUBLIC_API(2,0) BER_Decoder final BER_Decoder(const BER_Object& obj) : BER_Decoder(obj.bits(), obj.length()) {} + /** + * Set up to BER decode the data in obj + */ + BER_Decoder(BER_Object&& obj) : + BER_Decoder(std::move(obj), nullptr) {} + BER_Decoder(const BER_Decoder& other); BER_Decoder& operator=(const BER_Decoder&) = delete; @@ -297,7 +303,7 @@ class BOTAN_PUBLIC_API(2,0) BER_Decoder final { if((class_tag & CONSTRUCTED) && (class_tag & CONTEXT_SPECIFIC)) { - BER_Decoder(obj).decode(out, real_type).verify_end(); + BER_Decoder(std::move(obj)).decode(out, real_type).verify_end(); } else { @@ -339,7 +345,7 @@ BER_Decoder& BER_Decoder::decode_optional(T& out, { if((class_tag & CONSTRUCTED) && (class_tag & CONTEXT_SPECIFIC)) { - BER_Decoder(obj).decode(out).verify_end(); + BER_Decoder(std::move(obj)).decode(out).verify_end(); } else { diff --git a/src/lib/x509/x509_crl.cpp b/src/lib/x509/x509_crl.cpp index da075e009..47742c1da 100644 --- a/src/lib/x509/x509_crl.cpp +++ b/src/lib/x509/x509_crl.cpp @@ -143,7 +143,7 @@ std::unique_ptr<CRL_Data> decode_crl_body(const std::vector<uint8_t>& body, if(next.is_a(SEQUENCE, CONSTRUCTED)) { - BER_Decoder cert_list(next); + BER_Decoder cert_list(std::move(next)); while(cert_list.more_items()) { @@ -156,7 +156,7 @@ std::unique_ptr<CRL_Data> decode_crl_body(const std::vector<uint8_t>& body, if(next.is_a(0, ASN1_Tag(CONSTRUCTED | CONTEXT_SPECIFIC))) { - BER_Decoder crl_options(next); + BER_Decoder crl_options(std::move(next)); crl_options.decode(data->m_extensions).verify_end(); next = tbs_crl.get_next_object(); } |