aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-02-09 15:13:28 +0000
committerlloyd <[email protected]>2011-02-09 15:13:28 +0000
commit75eff6cba7ac959f0d3b5292aa5ca7e321bf2e0d (patch)
treead44e3ce741c7d2c83c46a21f0242be4eec33402 /src/pubkey
parent5fa1a353fcdfc5fc83618f07a89b3d320596ae07 (diff)
Convert the BER/DER coders to use size_t instead of u32bit for small
integer values. Update callers.
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/ec_dompar/ec_dompar.cpp4
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp4
-rw-r--r--src/pubkey/if_algo/if_algo.cpp4
-rw-r--r--src/pubkey/pkcs8.cpp4
-rw-r--r--src/pubkey/pubkey_enums.h6
5 files changed, 8 insertions, 14 deletions
diff --git a/src/pubkey/ec_dompar/ec_dompar.cpp b/src/pubkey/ec_dompar/ec_dompar.cpp
index f27185e84..deb512518 100644
--- a/src/pubkey/ec_dompar/ec_dompar.cpp
+++ b/src/pubkey/ec_dompar/ec_dompar.cpp
@@ -68,7 +68,7 @@ EC_Domain_Params::EC_Domain_Params(const MemoryRegion<byte>& ber_data)
BER_Decoder(ber_data)
.start_cons(SEQUENCE)
- .decode_and_check<u32bit>(1, "Unknown ECC param version code")
+ .decode_and_check<size_t>(1, "Unknown ECC param version code")
.start_cons(SEQUENCE)
.decode_and_check(OID("1.2.840.10045.1.1"),
"Only prime ECC fields supported")
@@ -96,7 +96,7 @@ EC_Domain_Params::DER_encode(EC_Domain_Params_Encoding form) const
{
if(form == EC_DOMPAR_ENC_EXPLICIT)
{
- const u32bit ecpVers1 = 1;
+ const size_t ecpVers1 = 1;
OID curve_type("1.2.840.10045.1.1");
const size_t p_bytes = curve.get_p().bytes();
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index bf221aad0..bd04e3197 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -108,7 +108,7 @@ MemoryVector<byte> EC_PrivateKey::pkcs8_private_key() const
{
return DER_Encoder()
.start_cons(SEQUENCE)
- .encode(static_cast<u32bit>(1))
+ .encode(static_cast<size_t>(1))
.encode(BigInt::encode_1363(private_key, private_key.bytes()),
OCTET_STRING)
.end_cons()
@@ -123,7 +123,7 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id,
BER_Decoder(key_bits)
.start_cons(SEQUENCE)
- .decode_and_check<u32bit>(1, "Unknown version code for ECC key")
+ .decode_and_check<size_t>(1, "Unknown version code for ECC key")
.decode_octet_string_bigint(private_key)
.verify_end()
.end_cons();
diff --git a/src/pubkey/if_algo/if_algo.cpp b/src/pubkey/if_algo/if_algo.cpp
index eb58874ee..6e75bc276 100644
--- a/src/pubkey/if_algo/if_algo.cpp
+++ b/src/pubkey/if_algo/if_algo.cpp
@@ -53,7 +53,7 @@ MemoryVector<byte> IF_Scheme_PrivateKey::pkcs8_private_key() const
{
return DER_Encoder()
.start_cons(SEQUENCE)
- .encode(static_cast<u32bit>(0))
+ .encode(static_cast<size_t>(0))
.encode(n)
.encode(e)
.encode(d)
@@ -72,7 +72,7 @@ IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(RandomNumberGenerator& rng,
{
BER_Decoder(key_bits)
.start_cons(SEQUENCE)
- .decode_and_check<u32bit>(0, "Unknown PKCS #1 key format version")
+ .decode_and_check<size_t>(0, "Unknown PKCS #1 key format version")
.decode(n)
.decode(e)
.decode(d)
diff --git a/src/pubkey/pkcs8.cpp b/src/pubkey/pkcs8.cpp
index 4a43f4402..16440b648 100644
--- a/src/pubkey/pkcs8.cpp
+++ b/src/pubkey/pkcs8.cpp
@@ -107,7 +107,7 @@ SecureVector<byte> PKCS8_decode(DataSource& source, const User_Interface& ui,
BER_Decoder(key)
.start_cons(SEQUENCE)
- .decode_and_check<u32bit>(0, "Unknown PKCS #8 version number")
+ .decode_and_check<size_t>(0, "Unknown PKCS #8 version number")
.decode(pk_alg_id)
.decode(key, OCTET_STRING)
.discard_remaining()
@@ -133,7 +133,7 @@ SecureVector<byte> PKCS8_decode(DataSource& source, const User_Interface& ui,
*/
SecureVector<byte> BER_encode(const Private_Key& key)
{
- const u32bit PKCS8_VERSION = 0;
+ const size_t PKCS8_VERSION = 0;
return DER_Encoder()
.start_cons(SEQUENCE)
diff --git a/src/pubkey/pubkey_enums.h b/src/pubkey/pubkey_enums.h
index 53e319f38..99f804e0a 100644
--- a/src/pubkey/pubkey_enums.h
+++ b/src/pubkey/pubkey_enums.h
@@ -66,12 +66,6 @@ enum CRL_Code {
*/
enum X509_Encoding { RAW_BER, PEM };
-/**
-* Value to encode in case of no path limit in the X509
-* BasicConstraints extension.
-*/
-static const u32bit NO_CERT_PATH_LIMIT = 0xFFFFFFF0;
-
}
#endif