From f69375f3a137af835bd6e74dd5c5a1e94c882d8c Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 17 Sep 2010 22:12:39 +0000 Subject: Add strict comparisons for X509_Time --- src/asn1/asn1_obj.h | 2 ++ src/asn1/asn1_tm.cpp | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'src/asn1') diff --git a/src/asn1/asn1_obj.h b/src/asn1/asn1_obj.h index 0672e6a44..068ed1565 100644 --- a/src/asn1/asn1_obj.h +++ b/src/asn1/asn1_obj.h @@ -145,6 +145,8 @@ bool BOTAN_DLL operator==(const X509_Time&, const X509_Time&); bool BOTAN_DLL operator!=(const X509_Time&, const X509_Time&); bool BOTAN_DLL operator<=(const X509_Time&, const X509_Time&); bool BOTAN_DLL operator>=(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator<(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator>(const X509_Time&, const X509_Time&); bool BOTAN_DLL operator==(const X509_DN&, const X509_DN&); bool BOTAN_DLL operator!=(const X509_DN&, const X509_DN&); diff --git a/src/asn1/asn1_tm.cpp b/src/asn1/asn1_tm.cpp index 01d31cfbd..2f4de39fa 100644 --- a/src/asn1/asn1_tm.cpp +++ b/src/asn1/asn1_tm.cpp @@ -271,9 +271,15 @@ bool operator==(const X509_Time& t1, const X509_Time& t2) { return (t1.cmp(t2) == 0); } bool operator!=(const X509_Time& t1, const X509_Time& t2) { return (t1.cmp(t2) != 0); } + bool operator<=(const X509_Time& t1, const X509_Time& t2) { return (t1.cmp(t2) <= 0); } bool operator>=(const X509_Time& t1, const X509_Time& t2) { return (t1.cmp(t2) >= 0); } +bool operator<(const X509_Time& t1, const X509_Time& t2) + { return (t1.cmp(t2) < 0); } +bool operator>(const X509_Time& t1, const X509_Time& t2) + { return (t1.cmp(t2) > 0); } + } -- cgit v1.2.3