aboutsummaryrefslogtreecommitdiffstats
path: root/src/cms/cms_ealg.cpp
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/cms/cms_ealg.cpp
parent5fa1a353fcdfc5fc83618f07a89b3d320596ae07 (diff)
Convert the BER/DER coders to use size_t instead of u32bit for small
integer values. Update callers.
Diffstat (limited to 'src/cms/cms_ealg.cpp')
-rw-r--r--src/cms/cms_ealg.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cms/cms_ealg.cpp b/src/cms/cms_ealg.cpp
index 262c74b86..4aee8afd8 100644
--- a/src/cms/cms_ealg.cpp
+++ b/src/cms/cms_ealg.cpp
@@ -140,10 +140,10 @@ void CMS_Encoder::encrypt_ktri(RandomNumberGenerator& rng,
DER_Encoder encoder;
encoder.start_cons(SEQUENCE)
- .encode((u32bit)0)
+ .encode(static_cast<size_t>(0))
.start_cons(SET)
.start_cons(SEQUENCE)
- .encode((u32bit)0);
+ .encode(static_cast<size_t>(0));
encode_si(encoder, to)
.encode(alg_id)
.encode(encryptor.encrypt(cek.bits_of(), rng), OCTET_STRING)
@@ -203,9 +203,9 @@ void CMS_Encoder::encrypt(RandomNumberGenerator& rng,
DER_Encoder encoder;
encoder.start_cons(SEQUENCE)
- .encode((u32bit)2)
+ .encode(static_cast<size_t>(2))
.start_explicit(ASN1_Tag(2))
- .encode((u32bit)4)
+ .encode(static_cast<size_t>(4))
.start_cons(SEQUENCE)
.encode(kek_id, OCTET_STRING)
.end_cons()
@@ -302,8 +302,8 @@ void CMS_Encoder::sign(const X509_Certificate& cert,
SecureVector<byte> signature = signer.signature(rng);
signed_attr[0] = 0xA0;
- const u32bit SI_VERSION = cert.subject_key_id().size() ? 3 : 1;
- const u32bit CMS_VERSION = (type != "CMS.DataContent") ? 3 : SI_VERSION;
+ const size_t SI_VERSION = cert.subject_key_id().size() ? 3 : 1;
+ const size_t CMS_VERSION = (type != "CMS.DataContent") ? 3 : SI_VERSION;
DER_Encoder encoder;
@@ -347,7 +347,7 @@ void CMS_Encoder::digest(const std::string& user_hash)
if(!OIDS::have_oid(hash))
throw Encoding_Error("CMS: No OID assigned for " + hash);
- const u32bit VERSION = (type != "CMS.DataContent") ? 2 : 0;
+ const size_t VERSION = (type != "CMS.DataContent") ? 2 : 0;
DER_Encoder encoder;
encoder.start_cons(SEQUENCE)