From 04ab1fd8c61a4ba6d02b86167c90320e43099f41 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 23 Dec 2009 00:13:44 +0000 Subject: Add FIXME note to Certificate_Policies::encode_inner --- src/cert/x509/x509_ext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cert') diff --git a/src/cert/x509/x509_ext.cpp b/src/cert/x509/x509_ext.cpp index e88b5a268..9a03c9d23 100644 --- a/src/cert/x509/x509_ext.cpp +++ b/src/cert/x509/x509_ext.cpp @@ -471,8 +471,10 @@ class Policy_Information : public ASN1_Object */ MemoryVector Certificate_Policies::encode_inner() const { + // FIXME +#if 1 throw Exception("Certificate_Policies::encode_inner: Bugged"); - +#else std::vector policies; return DER_Encoder() @@ -480,6 +482,7 @@ MemoryVector Certificate_Policies::encode_inner() const .encode_list(policies) .end_cons() .get_contents(); +#endif } /* -- cgit v1.2.3 From e4bc193fd6232da46a3676f1e21e7a14bf5b1a6f Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 23 Dec 2009 01:09:09 +0000 Subject: Avoid MSVC warning 4800 about implicit conversion from T to bool. Mostly because it makes the code slightly more explicit. --- src/cert/x509/pkcs10.cpp | 2 +- src/constructs/tss/tss.h | 2 +- src/libstate/lookup.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cert') diff --git a/src/cert/x509/pkcs10.cpp b/src/cert/x509/pkcs10.cpp index 5617cece4..81bb58555 100644 --- a/src/cert/x509/pkcs10.cpp +++ b/src/cert/x509/pkcs10.cpp @@ -186,7 +186,7 @@ std::vector PKCS10_Request::ex_constraints() const */ bool PKCS10_Request::is_CA() const { - return info.get1_u32bit("X509v3.BasicConstraints.is_ca"); + return (info.get1_u32bit("X509v3.BasicConstraints.is_ca") > 0); } /* diff --git a/src/constructs/tss/tss.h b/src/constructs/tss/tss.h index 45d64d9cb..c8b0242d8 100644 --- a/src/constructs/tss/tss.h +++ b/src/constructs/tss/tss.h @@ -45,7 +45,7 @@ class BOTAN_DLL RTSS_Share byte share_id() const; u32bit size() const { return contents.size(); } - bool initialized() const { return contents.size(); } + bool initialized() const { return (contents.size() > 0); } private: SecureVector contents; }; diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index 3b49116f6..090c25fca 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -71,7 +71,7 @@ HashFunction* get_hash(const std::string& algo_spec) bool have_hash(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_hash_function(algo_spec); + return (af.prototype_hash_function(algo_spec) != 0); } /** @@ -80,7 +80,7 @@ bool have_hash(const std::string& algo_spec) const MessageAuthenticationCode* retrieve_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_mac(algo_spec); + return (af.prototype_mac(algo_spec) != 0); } /** @@ -89,7 +89,7 @@ const MessageAuthenticationCode* retrieve_mac(const std::string& algo_spec) MessageAuthenticationCode* get_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.make_mac(algo_spec); + return (af.make_mac(algo_spec) != 0); } /** @@ -98,7 +98,7 @@ MessageAuthenticationCode* get_mac(const std::string& algo_spec) bool have_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_mac(algo_spec); + return (af.prototype_mac(algo_spec) != 0); } /** -- cgit v1.2.3 From 4b0e73bef1bc729219c7b4446e33644c170b0922 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 23 Dec 2009 01:22:54 +0000 Subject: Time was saved to a u32bit. Would really bite me in 2106 :) --- src/cert/x509/x509opt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cert') diff --git a/src/cert/x509/x509opt.cpp b/src/cert/x509/x509opt.cpp index c6421d9ca..0702ebf19 100644 --- a/src/cert/x509/x509opt.cpp +++ b/src/cert/x509/x509opt.cpp @@ -84,7 +84,7 @@ X509_Cert_Options::X509_Cert_Options(const std::string& initial_opts, path_limit = 0; constraints = NO_CONSTRAINTS; - const u32bit now = system_time(); + const u64bit now = system_time(); start = X509_Time(now); end = X509_Time(now + expiration_time_in_seconds); -- cgit v1.2.3