aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cert/cvc/asn1_eac_str.cpp10
-rw-r--r--src/cert/cvc/ecdsa_sig.cpp2
-rw-r--r--src/entropy/cryptoapi_rng/es_capi.cpp2
-rw-r--r--src/filters/modes/mode_pad/mode_pad.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/cert/cvc/asn1_eac_str.cpp b/src/cert/cvc/asn1_eac_str.cpp
index a306ffb01..e617ba81f 100644
--- a/src/cert/cvc/asn1_eac_str.cpp
+++ b/src/cert/cvc/asn1_eac_str.cpp
@@ -103,14 +103,14 @@ void ASN1_EAC_String::decode_from(BER_Decoder& source)
bool ASN1_EAC_String::sanity_check() const
{
const byte* rep = reinterpret_cast<const byte*>(iso_8859_str.data());
- const u32bit rep_len = iso_8859_str.size();
- for (u32bit i=0; i<rep_len; i++)
+ const size_t rep_len = iso_8859_str.size();
+
+ for(size_t i = 0; i != rep_len; ++i)
{
- if ((rep[i] < 0x20) || ((rep[i] >= 0x7F) && (rep[i] < 0xA0)))
- {
+ if((rep[i] < 0x20) || ((rep[i] >= 0x7F) && (rep[i] < 0xA0)))
return false;
- }
}
+
return true;
}
diff --git a/src/cert/cvc/ecdsa_sig.cpp b/src/cert/cvc/ecdsa_sig.cpp
index 1b3940250..e8fd7f051 100644
--- a/src/cert/cvc/ecdsa_sig.cpp
+++ b/src/cert/cvc/ecdsa_sig.cpp
@@ -48,7 +48,7 @@ ECDSA_Signature decode_concatenation(const MemoryRegion<byte>& concat)
if(concat.size() % 2 != 0)
throw Invalid_Argument("Erroneous length of signature");
- const u32bit rs_len = concat.size() / 2;
+ const size_t rs_len = concat.size() / 2;
BigInt r = BigInt::decode(&concat[0], rs_len);
BigInt s = BigInt::decode(&concat[rs_len], rs_len);
diff --git a/src/entropy/cryptoapi_rng/es_capi.cpp b/src/entropy/cryptoapi_rng/es_capi.cpp
index 420977a9b..496dfa1f3 100644
--- a/src/entropy/cryptoapi_rng/es_capi.cpp
+++ b/src/entropy/cryptoapi_rng/es_capi.cpp
@@ -35,7 +35,7 @@ class CSP_Handle
size_t gen_random(byte out[], size_t n) const
{
- if(is_valid() && CryptGenRandom(handle, n, out))
+ if(is_valid() && CryptGenRandom(handle, n, static_cast<DWORD>(out)))
return n;
return 0;
}
diff --git a/src/filters/modes/mode_pad/mode_pad.cpp b/src/filters/modes/mode_pad/mode_pad.cpp
index 7809a122f..495a0abe9 100644
--- a/src/filters/modes/mode_pad/mode_pad.cpp
+++ b/src/filters/modes/mode_pad/mode_pad.cpp
@@ -66,7 +66,7 @@ void ANSI_X923_Padding::pad(byte block[], size_t size, size_t position) const
{
for(size_t j = 0; j != size-position; ++j)
block[j] = 0;
- block[size-position-1] = (size-position);
+ block[size-position-1] = static_cast<byte>(size-position);
}
/*