$OpenBSD: patch-src_tests_test_name_constraint_cpp,v 1.1.1.1 2017/03/13 15:00:39 bluhm Exp $

commit 6203025a02b052fbaebb4b309104497a22737187
Author: Jack Lloyd <jack@randombit.net>
Date:   Fri Mar 3 22:24:06 2017 -0500

    Change name constraint test to use a fixed reference time
    
    Test certs have expired.

--- src/tests/test_name_constraint.cpp.orig	Tue Jan 10 04:21:31 2017
+++ src/tests/test_name_constraint.cpp	Thu Mar  9 19:36:02 2017
@@ -8,7 +8,7 @@
 
 #if defined(BOTAN_HAS_X509_CERTIFICATES)
   #include <botan/x509path.h>
-  #include <botan/internal/filesystem.h>
+  #include <botan/calendar.h>
 #endif
 
 #include <algorithm>
@@ -65,6 +65,9 @@ class Name_Constraint_Tests : public Test
          std::vector<Test::Result> results;
          const Botan::Path_Validation_Restrictions restrictions(false, 80);
 
+         std::chrono::system_clock::time_point validation_time =
+            Botan::calendar_point(2016,10,21,4,20,0).to_std_timepoint();
+
          for(const auto& t: test_cases)
             {
             Botan::X509_Certificate root(Test::data_file("name_constraint/" + std::get<0>(t)));
@@ -74,7 +77,8 @@ class Name_Constraint_Tests : public Test
 
             trusted.add_certificate(root);
             Botan::Path_Validation_Result path_result = Botan::x509_path_validate(
-               sub, restrictions, trusted, std::get<2>(t), Botan::Usage_Type::TLS_SERVER_AUTH);
+               sub, restrictions, trusted, std::get<2>(t), Botan::Usage_Type::TLS_SERVER_AUTH,
+               validation_time);
 
             if(path_result.successful_validation() && path_result.trust_root() != root)
                path_result = Botan::Path_Validation_Result(Botan::Certificate_Status_Code::CANNOT_ESTABLISH_TRUST);
