Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fcf7585 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fixed issue converting Asn1 time to posix on 32-bit systems." into main...

Merge "Fixed issue converting Asn1 time to posix on 32-bit systems." into main am: 5c7dd08f am: 1cd5d233

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2977478



Change-Id: Ic0d8e0d1900eea7634cf9b2b0e42a2e8b809d5a2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a512bd8b 1cd5d233
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1086,6 +1086,7 @@ TEST_P(NewKeyGenerationTest, RsaWithSpecifiedValidity) {
    };
    for (auto notBefore : test_vector_not_before_millis) {
        uint64_t notAfter = notBefore + 378691200000 /* 12 years milliseconds*/;
        SCOPED_TRACE(testing::Message() << "notBefore: " << notBefore << " notAfter: " << notAfter);
        ASSERT_EQ(ErrorCode::OK,
                  GenerateKey(AuthorizationSetBuilder()
                                      .RsaSigningKey(2048, 65537)
@@ -1101,14 +1102,14 @@ TEST_P(NewKeyGenerationTest, RsaWithSpecifiedValidity) {

        const ASN1_TIME* not_before = X509_get0_notBefore(cert.get());
        ASSERT_NE(not_before, nullptr);
        time_t not_before_time;
        ASSERT_EQ(ASN1_TIME_to_time_t(not_before, &not_before_time), 1);
        int64_t not_before_time;
        ASSERT_EQ(ASN1_TIME_to_posix(not_before, &not_before_time), 1);
        EXPECT_EQ(not_before_time, (notBefore / 1000));

        const ASN1_TIME* not_after = X509_get0_notAfter(cert.get());
        ASSERT_NE(not_after, nullptr);
        time_t not_after_time;
        ASSERT_EQ(ASN1_TIME_to_time_t(not_after, &not_after_time), 1);
        int64_t not_after_time;
        ASSERT_EQ(ASN1_TIME_to_posix(not_after, &not_after_time), 1);
        EXPECT_EQ(not_after_time, (notAfter / 1000));
    }
}