aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-11-15 03:26:58 +0000
committerlloyd <[email protected]>2007-11-15 03:26:58 +0000
commiteea881973fc97d1e3ccd4ce358229bd2459acb25 (patch)
tree677121e3a220b37257287b7a0796a14c5145c1af /src
parenta731f8135bfd322d187dff46b0b1c3cdc0e76cba (diff)
Revert the change that renamed append() to push_back(). As pointed out
by Joel Low on the mailing list, the STL container types have only a single version of push_back(), along with variations of insert() for handling range-based appending.
Diffstat (limited to 'src')
-rw-r--r--src/alg_id.cpp4
-rw-r--r--src/asn1_oid.cpp8
-rw-r--r--src/ber_dec.cpp4
-rw-r--r--src/big_code.cpp2
-rw-r--r--src/der_enc.cpp36
-rw-r--r--src/emsa_raw.cpp2
-rw-r--r--src/filter.cpp2
-rw-r--r--src/kdf.cpp2
-rw-r--r--src/pk_filts.cpp4
-rw-r--r--src/prf_x942.cpp2
-rw-r--r--src/pubkey.cpp2
-rw-r--r--src/symkey.cpp2
-rw-r--r--src/x509_ext.cpp10
13 files changed, 40 insertions, 40 deletions
diff --git a/src/alg_id.cpp b/src/alg_id.cpp
index 317329102..d85396295 100644
--- a/src/alg_id.cpp
+++ b/src/alg_id.cpp
@@ -40,7 +40,7 @@ AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
oid = alg_id;
if(option == USE_NULL_PARAM)
- parameters.push_back(DER_NULL, sizeof(DER_NULL));
+ parameters.append(DER_NULL, sizeof(DER_NULL));
}
/*************************************************
@@ -53,7 +53,7 @@ AlgorithmIdentifier::AlgorithmIdentifier(const std::string& alg_id,
oid = OIDS::lookup(alg_id);
if(option == USE_NULL_PARAM)
- parameters.push_back(DER_NULL, sizeof(DER_NULL));
+ parameters.append(DER_NULL, sizeof(DER_NULL));
}
/*************************************************
diff --git a/src/asn1_oid.cpp b/src/asn1_oid.cpp
index 875fd7e67..ad64f4602 100644
--- a/src/asn1_oid.cpp
+++ b/src/asn1_oid.cpp
@@ -120,20 +120,20 @@ void OID::encode_into(DER_Encoder& der) const
throw Invalid_Argument("OID::encode_into: OID is invalid");
MemoryVector<byte> encoding;
- encoding.push_back(40 * id[0] + id[1]);
+ encoding.append(40 * id[0] + id[1]);
for(u32bit j = 2; j != id.size(); ++j)
{
if(id[j] == 0)
- encoding.push_back(0);
+ encoding.append(0);
else
{
u32bit blocks = high_bit(id[j]) + 6;
blocks = (blocks - (blocks % 7)) / 7;
for(u32bit k = 0; k != blocks - 1; ++k)
- encoding.push_back(0x80 | ((id[j] >> 7*(blocks-k-1)) & 0x7F));
- encoding.push_back(id[j] & 0x7F);
+ encoding.append(0x80 | ((id[j] >> 7*(blocks-k-1)) & 0x7F));
+ encoding.append(id[j] & 0x7F);
}
}
der.add_object(OBJECT_ID, UNIVERSAL, encoding);
diff --git a/src/ber_dec.cpp b/src/ber_dec.cpp
index afe678f84..2537a917b 100644
--- a/src/ber_dec.cpp
+++ b/src/ber_dec.cpp
@@ -104,7 +104,7 @@ u32bit find_eoc(DataSource* ber)
const u32bit got = ber->peek(buffer, buffer.size(), data.size());
if(got == 0)
break;
- data.push_back(buffer, got);
+ data.append(buffer, got);
}
DataSource_Memory source(data);
@@ -169,7 +169,7 @@ BER_Decoder& BER_Decoder::raw_bytes(MemoryRegion<byte>& out)
out.destroy();
byte buf;
while(source->read_byte(buf))
- out.push_back(buf);
+ out.append(buf);
return (*this);
}
diff --git a/src/big_code.cpp b/src/big_code.cpp
index 03fa72dbd..f56fc53c4 100644
--- a/src/big_code.cpp
+++ b/src/big_code.cpp
@@ -104,7 +104,7 @@ BigInt BigInt::decode(const byte buf[], u32bit length, Base base)
SecureVector<byte> hex;
for(u32bit j = 0; j != length; ++j)
if(Hex_Decoder::is_valid(buf[j]))
- hex.push_back(buf[j]);
+ hex.append(buf[j]);
u32bit offset = (hex.size() % 2);
SecureVector<byte> binary(hex.size() / 2 + offset);
diff --git a/src/der_enc.cpp b/src/der_enc.cpp
index 5467e78c0..e418568bc 100644
--- a/src/der_enc.cpp
+++ b/src/der_enc.cpp
@@ -26,16 +26,16 @@ SecureVector<byte> encode_tag(ASN1_Tag type_tag, ASN1_Tag class_tag)
SecureVector<byte> encoded_tag;
if(type_tag <= 30)
- encoded_tag.push_back(static_cast<byte>(type_tag | class_tag));
+ encoded_tag.append(static_cast<byte>(type_tag | class_tag));
else
{
u32bit blocks = high_bit(type_tag) + 6;
blocks = (blocks - (blocks % 7)) / 7;
- encoded_tag.push_back(class_tag | 0x1F);
+ encoded_tag.append(class_tag | 0x1F);
for(u32bit k = 0; k != blocks - 1; ++k)
- encoded_tag.push_back(0x80 | ((type_tag >> 7*(blocks-k-1)) & 0x7F));
- encoded_tag.push_back(type_tag & 0x7F);
+ encoded_tag.append(0x80 | ((type_tag >> 7*(blocks-k-1)) & 0x7F));
+ encoded_tag.append(type_tag & 0x7F);
}
return encoded_tag;
@@ -48,13 +48,13 @@ SecureVector<byte> encode_length(u32bit length)
{
SecureVector<byte> encoded_length;
if(length <= 127)
- encoded_length.push_back(static_cast<byte>(length));
+ encoded_length.append(static_cast<byte>(length));
else
{
const u32bit top_byte = significant_bytes(length);
- encoded_length.push_back(static_cast<byte>(0x80 | top_byte));
+ encoded_length.append(static_cast<byte>(0x80 | top_byte));
for(u32bit j = 4-top_byte; j != 4; ++j)
- encoded_length.push_back(get_byte(j, length));
+ encoded_length.append(get_byte(j, length));
}
return encoded_length;
}
@@ -74,16 +74,16 @@ SecureVector<byte> DER_Encoder::DER_Sequence::get_contents()
{
std::sort(set_contents.begin(), set_contents.end());
for(u32bit j = 0; j != set_contents.size(); ++j)
- contents.push_back(set_contents[j]);
+ contents.append(set_contents[j]);
set_contents.clear();
}
SecureVector<byte> encoded_length = encode_length(contents.size());
SecureVector<byte> retval;
- retval.push_back(encoded_tag);
- retval.push_back(encoded_length);
- retval.push_back(contents);
+ retval.append(encoded_tag);
+ retval.append(encoded_length);
+ retval.append(contents);
contents.destroy();
return retval;
}
@@ -96,7 +96,7 @@ void DER_Encoder::DER_Sequence::add_bytes(const byte data[], u32bit length)
if(type_tag == SET)
set_contents.push_back(SecureVector<byte>(data, length));
else
- contents.push_back(data, length);
+ contents.append(data, length);
}
/*************************************************
@@ -190,7 +190,7 @@ DER_Encoder& DER_Encoder::raw_bytes(const byte bytes[], u32bit length)
if(subsequences.size())
subsequences[subsequences.size()-1].add_bytes(bytes, length);
else
- contents.push_back(bytes, length);
+ contents.append(bytes, length);
return (*this);
}
@@ -313,8 +313,8 @@ DER_Encoder& DER_Encoder::encode(const byte bytes[], u32bit length,
if(real_type == BIT_STRING)
{
SecureVector<byte> encoded;
- encoded.push_back(0);
- encoded.push_back(bytes, length);
+ encoded.append(0);
+ encoded.append(bytes, length);
return add_object(type_tag, class_tag, encoded);
}
else
@@ -350,9 +350,9 @@ DER_Encoder& DER_Encoder::add_object(ASN1_Tag type_tag, ASN1_Tag class_tag,
SecureVector<byte> encoded_length = encode_length(length);
SecureVector<byte> buffer;
- buffer.push_back(encoded_tag);
- buffer.push_back(encoded_length);
- buffer.push_back(rep, length);
+ buffer.append(encoded_tag);
+ buffer.append(encoded_length);
+ buffer.append(rep, length);
return raw_bytes(buffer);
}
diff --git a/src/emsa_raw.cpp b/src/emsa_raw.cpp
index a3a57dbcd..4639d624d 100644
--- a/src/emsa_raw.cpp
+++ b/src/emsa_raw.cpp
@@ -12,7 +12,7 @@ namespace Botan {
*************************************************/
void EMSA_Raw::update(const byte input[], u32bit length)
{
- message.push_back(input, length);
+ message.append(input, length);
}
/*************************************************
diff --git a/src/filter.cpp b/src/filter.cpp
index e27501e80..385ab28a8 100644
--- a/src/filter.cpp
+++ b/src/filter.cpp
@@ -37,7 +37,7 @@ void Filter::send(const byte input[], u32bit length)
nothing_attached = false;
}
if(nothing_attached)
- write_queue.push_back(input, length);
+ write_queue.append(input, length);
else if(write_queue.has_items())
write_queue.destroy();
}
diff --git a/src/kdf.cpp b/src/kdf.cpp
index b1b92dfe6..22d8ac7cc 100644
--- a/src/kdf.cpp
+++ b/src/kdf.cpp
@@ -110,7 +110,7 @@ SecureVector<byte> KDF2::derive(u32bit out_len,
SecureVector<byte> hash_result = hash->final();
u32bit added = std::min(hash_result.size(), out_len);
- output.push_back(hash_result, added);
+ output.append(hash_result, added);
out_len -= added;
++counter;
diff --git a/src/pk_filts.cpp b/src/pk_filts.cpp
index d7d09d9a0..93ccea337 100644
--- a/src/pk_filts.cpp
+++ b/src/pk_filts.cpp
@@ -12,7 +12,7 @@ namespace Botan {
*************************************************/
void PK_Encryptor_Filter::write(const byte input[], u32bit length)
{
- buffer.push_back(input, length);
+ buffer.append(input, length);
}
/*************************************************
@@ -29,7 +29,7 @@ void PK_Encryptor_Filter::end_msg()
*************************************************/
void PK_Decryptor_Filter::write(const byte input[], u32bit length)
{
- buffer.push_back(input, length);
+ buffer.append(input, length);
}
/*************************************************
diff --git a/src/prf_x942.cpp b/src/prf_x942.cpp
index 18deca46d..8ede79efa 100644
--- a/src/prf_x942.cpp
+++ b/src/prf_x942.cpp
@@ -67,7 +67,7 @@ SecureVector<byte> X942_PRF::derive(u32bit key_len,
);
SecureVector<byte> digest = hash->final();
- key.push_back(digest, std::min(digest.size(), key_len - key.size()));
+ key.append(digest, std::min(digest.size(), key_len - key.size()));
++counter;
}
diff --git a/src/pubkey.cpp b/src/pubkey.cpp
index fd0d099c9..dae6ee936 100644
--- a/src/pubkey.cpp
+++ b/src/pubkey.cpp
@@ -305,7 +305,7 @@ bool PK_Verifier::check_signature(const byte sig[], u32bit length)
{
BigInt sig_part;
ber_sig.decode(sig_part);
- real_sig.push_back(BigInt::encode_1363(sig_part,
+ real_sig.append(BigInt::encode_1363(sig_part,
key_message_part_size()));
++count;
}
diff --git a/src/symkey.cpp b/src/symkey.cpp
index 9ab8c3ed3..b1f0786b0 100644
--- a/src/symkey.cpp
+++ b/src/symkey.cpp
@@ -29,7 +29,7 @@ void OctetString::change(const std::string& hex_string)
SecureVector<byte> hex;
for(u32bit j = 0; j != hex_string.length(); ++j)
if(Hex_Decoder::is_valid(hex_string[j]))
- hex.push_back(hex_string[j]);
+ hex.append(hex_string[j]);
if(hex.size() % 2 != 0)
throw Invalid_Argument("OctetString: hex string must encode full bytes");
diff --git a/src/x509_ext.cpp b/src/x509_ext.cpp
index 47e44cc1d..65ea2872c 100644
--- a/src/x509_ext.cpp
+++ b/src/x509_ext.cpp
@@ -201,12 +201,12 @@ MemoryVector<byte> Key_Usage::encode_inner() const
const u32bit unused_bits = low_bit(constraints) - 1;
SecureVector<byte> der;
- der.push_back(BIT_STRING);
- der.push_back(2 + ((unused_bits < 8) ? 1 : 0));
- der.push_back(unused_bits % 8);
- der.push_back((constraints >> 8) & 0xFF);
+ der.append(BIT_STRING);
+ der.append(2 + ((unused_bits < 8) ? 1 : 0));
+ der.append(unused_bits % 8);
+ der.append((constraints >> 8) & 0xFF);
if(constraints & 0xFF)
- der.push_back(constraints & 0xFF);
+ der.append(constraints & 0xFF);
return der;
}