diff options
author | Andy Quan <andyq@google.com> | 2023-06-02 14:50:13 -0700 |
---|---|---|
committer | Andy Quan <andyq@google.com> | 2023-06-02 14:50:13 -0700 |
commit | d62835f99043f85ecfc1d7283add550b047068f9 (patch) | |
tree | 9f13793d31ef6c216531cc322e5780fe38a84fbe /identity/aidl/vts/Util.cpp | |
parent | 9f3a2e40bf3ca1e866f5c6ec774620b05a06439b (diff) | |
parent | 8c308539d804a6efb2272e4c9e73407241966f34 (diff) |
DO NOT MERGE - Merge tm-qpr3-release TQ3A.230605.010 into tm-platform-merge
Bug: 279962103
Change-Id: I1192811ddd629eab6b0ddfc9c04ff4cf63685346
Diffstat (limited to 'identity/aidl/vts/Util.cpp')
-rw-r--r-- | identity/aidl/vts/Util.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/identity/aidl/vts/Util.cpp b/identity/aidl/vts/Util.cpp index f3d7c30548..4f5c121f95 100644 --- a/identity/aidl/vts/Util.cpp +++ b/identity/aidl/vts/Util.cpp @@ -523,8 +523,24 @@ void verifyAuthKeyCertificate(const vector<uint8_t>& authKeyCertChain) { int64_t allowDriftSecs = 10; EXPECT_LE(-allowDriftSecs, diffSecs); EXPECT_GE(allowDriftSecs, diffSecs); - constexpr uint64_t kSecsInOneYear = 365 * 24 * 60 * 60; - EXPECT_EQ(notBefore + kSecsInOneYear, notAfter); + + // The AIDL spec used to call for "one year in the future (365 + // days)" but was updated to say "current time and 31536000 + // seconds in the future (approximately 365 days)" to clarify that + // this was the original intention. + // + // However a number of implementations interpreted this as a + // "literal year" which started causing problems in March 2023 + // because 2024 is a leap year. Since the extra day doesn't really + // matter (the validity period is specified in the MSO anyway and + // that's what RPs use), we allow both interpretations. + // + // For simplicity, we just require that that notAfter is after + // 31536000 and which also covers the case if there's a leap-day + // and possible leap-seconds. + // + constexpr uint64_t kSecsIn365Days = 365 * 24 * 60 * 60; + EXPECT_LE(notBefore + kSecsIn365Days, notAfter); } vector<RequestNamespace> buildRequestNamespaces(const vector<TestEntryData> entries) { |