Add x509_time_future()
diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data
index f9a5366..166be68 100644
--- a/tests/suites/test_suite_x509parse.data
+++ b/tests/suites/test_suite_x509parse.data
@@ -170,6 +170,30 @@
 depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_RSA_C
 x509_time_expired:"data_files/test-ca.crt":"valid_to":0
 
+X509 Time Future #1
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/server5.crt":"valid_from":0
+
+X509 Time Future #2
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/server5.crt":"valid_to":1
+
+X509 Time Future #3
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/server5-future.crt":"valid_from":1
+
+X509 Time Future #4
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/server5-future.crt":"valid_to":1
+
+X509 Time Future #5
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/test-ca2.crt":"valid_from":0
+
+X509 Time Future #6
+depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECP_C
+x509_time_future:"data_files/test-ca2.crt":"valid_to":1
+
 X509 Certificate verification #1 (Revoked Cert, Expired CRL)
 depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_SHA1_C:POLARSSL_RSA_C:POLARSSL_PKCS1_V15
 x509_verify:"data_files/server1.crt":"data_files/test-ca.crt":"data_files/crl_expired.pem":"NULL":POLARSSL_ERR_X509_CERT_VERIFY_FAILED:BADCERT_REVOKED | BADCRL_EXPIRED:"NULL"
diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function
index d992c1d..8638235 100644
--- a/tests/suites/test_suite_x509parse.function
+++ b/tests/suites/test_suite_x509parse.function
@@ -166,6 +166,26 @@
 }
 /* END_CASE */
 
+/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_USE_C */
+void x509_time_future( char *crt_file, char *entity, int result )
+{
+    x509_crt   crt;
+
+    x509_crt_init( &crt );
+
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
+
+    if( strcmp( entity, "valid_from" ) == 0 )
+        TEST_ASSERT( x509_time_future( &crt.valid_from ) == result );
+    else if( strcmp( entity, "valid_to" ) == 0 )
+        TEST_ASSERT( x509_time_future( &crt.valid_to ) == result );
+    else
+        TEST_ASSERT( "Unknown entity" == 0 );
+
+    x509_crt_free( &crt );
+}
+/* END_CASE */
+
 /* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C */
 void x509parse_crt( char *crt_data, char *result_str, int result )
 {