Skip to content

Commit

Permalink
Fix OCSP timebomb in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Oct 1, 2024
1 parent 36e0307 commit 4af07fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/ocsp/ocsp_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ TEST(OCSPTest, TestGoodOCSP) {
// This will cause the function to fail in two places, once when checking
// if "(current_time + nsec) > thisupd [Status Not Yet Valid]", and a second
// time when checking if "nextupd > (current_time - nsec) [Status Expired]".
// The inverse happens when |thisupd| is outdated.
ERR_clear_error();
EXPECT_FALSE(OCSP_check_validity(thisupd, nextupd, -time(nullptr), -1));
err = ERR_get_error();
EXPECT_EQ(OCSP_R_STATUS_NOT_YET_VALID, ERR_GET_REASON(err));
Expand Down

0 comments on commit 4af07fc

Please sign in to comment.