summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/cert-invalid-time.derbin0 -> 1136 bytes
-rwxr-xr-xtests/decoding14
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bea3310..0b45543 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,6 +25,7 @@ LDADD = ../lib/libtasn1.la ../gl/libgnu.la
EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c mscat.asn \
Test_encoding.asn pkix.asn TestIndef.p12 choice.asn coding-decoding2.asn \
TestIndef2.p12 TestIndef3.der TestCertOctetOverflow.der \
+ cert-invalid-time.der \
libtasn1.supp ocsp-basic-response.der spc_pe_image_data.der \
invalid-x509/id-000000.der invalid-x509/id-000001.der \
invalid-x509/id-000002.der invalid-x509/id-000003.der \
diff --git a/tests/cert-invalid-time.der b/tests/cert-invalid-time.der
new file mode 100644
index 0000000..994ea3f
--- /dev/null
+++ b/tests/cert-invalid-time.der
Binary files differ
diff --git a/tests/decoding b/tests/decoding
index dd2c685..200a8b8 100755
--- a/tests/decoding
+++ b/tests/decoding
@@ -28,4 +28,18 @@ if test $? != 1;then
exit 1
fi
+# test decoding of certificate with invalid time field
+$VALGRIND $ASN1DECODING -s $ASN1PKIX cert-invalid-time.der PKIX1.Certificate
+if test $? != 1;then
+ echo "Decoding with invalid time succeeded when not expected"
+ exit 1
+fi
+
+# test decoding of certificate with invalid time field
+$VALGRIND $ASN1DECODING -t $ASN1PKIX cert-invalid-time.der PKIX1.Certificate
+if test $? != 0;then
+ echo "Decoding with invalid time failed when not expected"
+ exit 1
+fi
+
exit 0