aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-17 22:12:39 +0000
committerlloyd <[email protected]>2010-09-17 22:12:39 +0000
commitf69375f3a137af835bd6e74dd5c5a1e94c882d8c (patch)
treec9fe1adb6a77153d16d1a33c5455f7e85a5533e2
parentf9d51dc97769c8dcda90221543f743a72391b2c2 (diff)
Add strict comparisons for X509_Time
-rw-r--r--src/asn1/asn1_obj.h2
-rw-r--r--src/asn1/asn1_tm.cpp6
2 files changed, 8 insertions, 0 deletions
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); }
+
}