aboutsummaryrefslogtreecommitdiffstats
path: root/src/asn1/der_enc.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-13 12:28:27 +0000
committerlloyd <[email protected]>2010-09-13 12:28:27 +0000
commit27d79c87365105d6128afe9eaf8a82383976ed44 (patch)
tree9a4f0e1d5ae7ecd5c058c0293d9b546191990cdb /src/asn1/der_enc.cpp
parent9acfc3a50b31044e48d8dee5fc8030ad7f4518d4 (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/der_enc.cpp')
-rw-r--r--src/asn1/der_enc.cpp10
1 files changed, 5 insertions, 5 deletions
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);
}