diff options
author | lloyd <[email protected]> | 2010-09-13 12:28:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 12:28:27 +0000 |
commit | 27d79c87365105d6128afe9eaf8a82383976ed44 (patch) | |
tree | 9a4f0e1d5ae7ecd5c058c0293d9b546191990cdb /src/asn1 | |
parent | 9acfc3a50b31044e48d8dee5fc8030ad7f4518d4 (diff) |
Anywhere where we use MemoryRegion::begin to get access to the raw pointer
representation (rather than in an interator context), instead use &buf[0],
which works for both MemoryRegion and std::vector
Diffstat (limited to 'src/asn1')
-rw-r--r-- | src/asn1/asn1_alt.cpp | 2 | ||||
-rw-r--r-- | src/asn1/asn1_int.cpp | 2 | ||||
-rw-r--r-- | src/asn1/der_enc.cpp | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/asn1/asn1_alt.cpp b/src/asn1/asn1_alt.cpp index 9fe159356..1fccf6ac0 100644 --- a/src/asn1/asn1_alt.cpp +++ b/src/asn1/asn1_alt.cpp @@ -217,7 +217,7 @@ void AlternativeName::decode_from(BER_Decoder& source) { if(obj.value.size() == 4) { - u32bit ip = load_be<u32bit>(obj.value.begin(), 0); + u32bit ip = load_be<u32bit>(&obj.value[0], 0); add_attribute("IP", ipv4_to_string(ip)); } } diff --git a/src/asn1/asn1_int.cpp b/src/asn1/asn1_int.cpp index 5e18f3961..75cb1f90c 100644 --- a/src/asn1/asn1_int.cpp +++ b/src/asn1/asn1_int.cpp @@ -45,7 +45,7 @@ SecureVector<byte> put_in_sequence(const MemoryRegion<byte>& contents) */ std::string to_string(const BER_Object& obj) { - return std::string(reinterpret_cast<const char*>(obj.value.begin()), + return std::string(reinterpret_cast<const char*>(&obj.value[0]), obj.value.size()); } diff --git a/src/asn1/der_enc.cpp b/src/asn1/der_enc.cpp index dd173590f..0ce633c7a 100644 --- a/src/asn1/der_enc.cpp +++ b/src/asn1/der_enc.cpp @@ -180,7 +180,7 @@ DER_Encoder& DER_Encoder::end_explicit() */ DER_Encoder& DER_Encoder::raw_bytes(const MemoryRegion<byte>& val) { - return raw_bytes(val.begin(), val.size()); + return raw_bytes(&val[0], val.size()); } /* @@ -234,7 +234,7 @@ DER_Encoder& DER_Encoder::encode(const BigInt& n) DER_Encoder& DER_Encoder::encode(const MemoryRegion<byte>& bytes, ASN1_Tag real_type) { - return encode(bytes.begin(), bytes.size(), + return encode(&bytes[0], bytes.size(), real_type, real_type, UNIVERSAL); } @@ -277,7 +277,7 @@ DER_Encoder& DER_Encoder::encode(const BigInt& n, bool extra_zero = (n.bits() % 8 == 0); SecureVector<byte> contents(extra_zero + n.bytes()); - BigInt::encode(contents.begin() + extra_zero, n); + BigInt::encode(&contents[extra_zero], n); if(n < 0) { for(u32bit j = 0; j != contents.size(); ++j) @@ -297,7 +297,7 @@ DER_Encoder& DER_Encoder::encode(const MemoryRegion<byte>& bytes, ASN1_Tag real_type, ASN1_Tag type_tag, ASN1_Tag class_tag) { - return encode(bytes.begin(), bytes.size(), + return encode(&bytes[0], bytes.size(), real_type, type_tag, class_tag); } @@ -364,7 +364,7 @@ DER_Encoder& DER_Encoder::add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, DER_Encoder& DER_Encoder::add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, const MemoryRegion<byte>& rep_buf) { - const byte* rep = rep_buf.begin(); + const byte* rep = &rep_buf[0]; const u32bit rep_len = rep_buf.size(); return add_object(type_tag, class_tag, rep, rep_len); } |