From 83b142529f5bc31d350229d423175b859e5c7a54 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 11 Feb 2011 16:12:07 +0000 Subject: Some dependency fixes --- src/cert/certstore/info.txt | 3 ++- src/cert/x509cert/info.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cert') diff --git a/src/cert/certstore/info.txt b/src/cert/certstore/info.txt index ee730490f..a5de1baff 100644 --- a/src/cert/certstore/info.txt +++ b/src/cert/certstore/info.txt @@ -1,5 +1,6 @@ define CERTIFICATE_STORE -asn1 +x509cert +x509crl diff --git a/src/cert/x509cert/info.txt b/src/cert/x509cert/info.txt index 3be50f077..5e3715e7a 100644 --- a/src/cert/x509cert/info.txt +++ b/src/cert/x509cert/info.txt @@ -2,4 +2,5 @@ define X509_CERTIFICATES certstore +datastor -- cgit v1.2.3 From d996f15128ff12fb268f342cbbc0a855666caae4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Feb 2011 14:44:29 +0000 Subject: Use size_t rather than u32bit for loop variables --- src/block/aes/aes.cpp | 4 ++-- src/cert/x509cert/x509cert.cpp | 24 ++++++++++++------------ src/constructs/aont/package.cpp | 8 ++++---- src/stream/ctr/ctr.cpp | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/cert') diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index 7f32d243c..9fb12cd11 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -457,7 +457,7 @@ void aes_encrypt_n(const byte in[], byte out[], rotate_right(TE[get_byte(2, T1)], 16) ^ rotate_right(TE[get_byte(3, T2)], 24) ^ EK[7]; - for(u32bit r = 2*4; r < EK.size(); r += 2*4) + for(size_t r = 2*4; r < EK.size(); r += 2*4) { T0 = TE0[get_byte(0, B0)] ^ TE1[get_byte(1, B1)] ^ TE2[get_byte(2, B2)] ^ TE3[get_byte(3, B3)] ^ EK[r]; @@ -560,7 +560,7 @@ void aes_decrypt_n(const byte in[], byte out[], size_t blocks, rotate_right(TD[get_byte(2, T1)], 16) ^ rotate_right(TD[get_byte(3, T0)], 24) ^ DK[7]; - for(u32bit r = 2*4; r < DK.size(); r += 2*4) + for(size_t r = 2*4; r < DK.size(); r += 2*4) { T0 = TD0[get_byte(0, B0)] ^ TD1[get_byte(1, B3)] ^ TD2[get_byte(2, B2)] ^ TD3[get_byte(3, B1)] ^ DK[r]; diff --git a/src/cert/x509cert/x509cert.cpp b/src/cert/x509cert/x509cert.cpp index b7c399078..38775271e 100644 --- a/src/cert/x509cert/x509cert.cpp +++ b/src/cert/x509cert/x509cert.cpp @@ -378,16 +378,16 @@ std::string X509_Certificate::to_string() const if(policies.size()) { out << "Policies: " << "\n"; - for(u32bit j = 0; j != policies.size(); j++) - out << " " << policies[j] << "\n"; + for(size_t i = 0; i != policies.size(); i++) + out << " " << policies[i] << "\n"; } std::vector ex_constraints = this->ex_constraints(); if(ex_constraints.size()) { out << "Extended Constraints:\n"; - for(u32bit j = 0; j != ex_constraints.size(); j++) - out << " " << ex_constraints[j] << "\n"; + for(size_t i = 0; i != ex_constraints.size(); i++) + out << " " << ex_constraints[i] << "\n"; } out << "Signature algorithm: " << @@ -425,9 +425,9 @@ X509_DN create_dn(const Data_Store& info) X509_DN dn; - std::multimap::iterator j; - for(j = names.begin(); j != names.end(); ++j) - dn.add_attribute(j->first, j->second); + std::multimap::iterator i; + for(i = names.begin(); i != names.end(); ++i) + dn.add_attribute(i->first, i->second); return dn; } @@ -442,8 +442,8 @@ AlternativeName create_alt_name(const Data_Store& info) public: bool operator()(const std::string& key, const std::string&) const { - for(u32bit j = 0; j != matches.size(); ++j) - if(key.compare(matches[j]) == 0) + for(size_t i = 0; i != matches.size(); ++i) + if(key.compare(matches[i]) == 0) return true; return false; } @@ -461,9 +461,9 @@ AlternativeName create_alt_name(const Data_Store& info) AlternativeName alt_name; - std::multimap::iterator j; - for(j = names.begin(); j != names.end(); ++j) - alt_name.add_attribute(j->first, j->second); + std::multimap::iterator i; + for(i = names.begin(); i != names.end(); ++i) + alt_name.add_attribute(i->first, i->second); return alt_name; } diff --git a/src/constructs/aont/package.cpp b/src/constructs/aont/package.cpp index 4d92a789c..4d46f6b61 100644 --- a/src/constructs/aont/package.cpp +++ b/src/constructs/aont/package.cpp @@ -46,13 +46,13 @@ void aont_package(RandomNumberGenerator& rng, clear_mem(final_block, BLOCK_SIZE); // XOR the hash blocks into the final block - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { const size_t left = std::min(BLOCK_SIZE, input_len - BLOCK_SIZE * i); zeroise(buf); - copy_mem(&buf[0], output + BLOCK_SIZE * i, left); + copy_mem(&buf[0], output + (BLOCK_SIZE * i), left); for(size_t j = 0; j != sizeof(i); ++j) buf[BLOCK_SIZE - 1 - j] ^= get_byte(sizeof(i)-1-j, i); @@ -94,13 +94,13 @@ void aont_unpackage(BlockCipher* cipher, const size_t blocks = ((input_len - 1) / BLOCK_SIZE); // XOR the blocks into the package key bits - for(u32bit i = 0; i != blocks; ++i) + for(size_t i = 0; i != blocks; ++i) { const size_t left = std::min(BLOCK_SIZE, input_len - BLOCK_SIZE * (i+1)); zeroise(buf); - copy_mem(&buf[0], input + BLOCK_SIZE * i, left); + copy_mem(&buf[0], input + (BLOCK_SIZE * i), left); for(size_t j = 0; j != sizeof(i); ++j) buf[BLOCK_SIZE - 1 - j] ^= get_byte(sizeof(i)-1-j, i); diff --git a/src/stream/ctr/ctr.cpp b/src/stream/ctr/ctr.cpp index 0de0b7b84..d221dc441 100644 --- a/src/stream/ctr/ctr.cpp +++ b/src/stream/ctr/ctr.cpp @@ -97,7 +97,7 @@ void CTR_BE::set_iv(const byte iv[], size_t iv_len) &counter[(i-1)*BLOCK_SIZE], BLOCK_SIZE); - for(u32bit j = 0; j != BLOCK_SIZE; ++j) + for(size_t j = 0; j != BLOCK_SIZE; ++j) if(++counter[i*BLOCK_SIZE + (BLOCK_SIZE-1-j)]) break; } @@ -115,7 +115,7 @@ void CTR_BE::increment_counter() for(size_t i = 0; i != 256; ++i) { - for(u32bit j = 1; j != BLOCK_SIZE; ++j) + for(size_t j = 1; j != BLOCK_SIZE; ++j) if(++counter[i*BLOCK_SIZE + (BLOCK_SIZE-1-j)]) break; } -- cgit v1.2.3 From 39024858da467fd34a4d095ad1770b4c74db02ea Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 1 Mar 2011 13:52:46 +0000 Subject: Fix variable mask warning in Sun C++. Make comment clearer on how to enable stlport4 in Sun C++ --- src/build-data/cc/sunstudio.txt | 4 +++- src/cert/x509cert/x509cert.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/cert') diff --git a/src/build-data/cc/sunstudio.txt b/src/build-data/cc/sunstudio.txt index 91a6ace65..d0b25d144 100644 --- a/src/build-data/cc/sunstudio.txt +++ b/src/build-data/cc/sunstudio.txt @@ -45,7 +45,9 @@ sparc64 -> "-xchip=SUBMODEL" sparc64- -# On Linux, may need -library=stlport4 +# Needed on some Linux distros +#linux -> "-library=stlport4" + sparc64 -> "-xarch=v9" amd64 -> "-m64" diff --git a/src/cert/x509cert/x509cert.cpp b/src/cert/x509cert/x509cert.cpp index 38775271e..7b1d97def 100644 --- a/src/cert/x509cert/x509cert.cpp +++ b/src/cert/x509cert/x509cert.cpp @@ -329,8 +329,8 @@ std::string X509_Certificate::to_string() const continue; out << "Subject " << dn_fields[i] << ":"; - for(size_t i = 0; i != vals.size(); ++i) - out << " " << vals[i]; + for(size_t j = 0; j != vals.size(); ++j) + out << " " << vals[j]; out << "\n"; } @@ -342,8 +342,8 @@ std::string X509_Certificate::to_string() const continue; out << "Issuer " << dn_fields[i] << ":"; - for(size_t i = 0; i != vals.size(); ++i) - out << " " << vals[i]; + for(size_t j = 0; j != vals.size(); ++j) + out << " " << vals[j]; out << "\n"; } -- cgit v1.2.3