From 64272438aad858bdf4fc93cd94e0a20093c0191f Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 13 Dec 2010 21:56:41 +0000 Subject: Fix some VC warnings under 64 bit compiles --- src/cert/cvc/asn1_eac_str.cpp | 10 +++++----- src/cert/cvc/ecdsa_sig.cpp | 2 +- src/entropy/cryptoapi_rng/es_capi.cpp | 2 +- src/filters/modes/mode_pad/mode_pad.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') 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(iso_8859_str.data()); - const u32bit rep_len = iso_8859_str.size(); - for (u32bit i=0; 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& 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(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(size-position); } /* -- cgit v1.2.3