The unified diff between revisions [be13ff67..] and [5a1d14c4..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/x509stor.cpp'
#
#
# patch "src/x509stor.cpp"
# from [5c903762b417e604483e8cc8488f4b6f97e427bb]
# to [b885de41c4d7fef9b57d9a6468103d7642358a19]
#
============================================================
--- src/x509stor.cpp 5c903762b417e604483e8cc8488f4b6f97e427bb
+++ src/x509stor.cpp b885de41c4d7fef9b57d9a6468103d7642358a19
@@ -18,6 +18,24 @@ namespace {
namespace {
/*************************************************
+* Do a validity check *
+*************************************************/
+s32bit validity_check(const X509_Time& start, const X509_Time& end,
+ u64bit current_time)
+ {
+ const u32bit ALLOWABLE_SLIP =
+ global_config().option_as_time("x509/validity_slack");
+
+ const s32bit NOT_YET_VALID = -1, VALID_TIME = 0, EXPIRED = 1;
+
+ if(start.cmp(current_time + ALLOWABLE_SLIP) > 0)
+ return NOT_YET_VALID;
+ if(end.cmp(current_time - ALLOWABLE_SLIP) < 0)
+ return EXPIRED;
+ return VALID_TIME;
+ }
+
+/*************************************************
* Compare the value of unique ID fields *
*************************************************/
bool compare_ids(const MemoryVector<byte>& id1,