summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-01-02 11:05:21 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-01-02 13:50:40 +0100
commit51eac760a734b604d39c51b1d6103d451b18002d (patch)
tree0ca8c818692af3fe895da19feec38cb74c048b35
parent78b4d1c1c2b55bd59fb1e8428665d6caa70365f8 (diff)
downloadgnutls-51eac760a734b604d39c51b1d6103d451b18002d.tar.gz
tests: added test case with invalid PKCS#8 data
Issue found using oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=363 Relates #156
-rw-r--r--tests/key-tests/Makefile.am2
-rw-r--r--tests/key-tests/data/pkcs8-invalid8.derbin0 -> 596 bytes
-rwxr-xr-xtests/key-tests/pkcs8-invalid2
3 files changed, 2 insertions, 2 deletions
diff --git a/tests/key-tests/Makefile.am b/tests/key-tests/Makefile.am
index 4dc1532a86..cbfbe65bff 100644
--- a/tests/key-tests/Makefile.am
+++ b/tests/key-tests/Makefile.am
@@ -29,7 +29,7 @@ EXTRA_DIST = data/key-ca.pem data/key-user.pem \
data/cert.dsa.1024.pem data/cert.dsa.2048.pem data/cert.dsa.3072.pem \
data/dsa.1024.pem data/dsa.2048.pem data/dsa.3072.pem data/dsa-pubkey-1018.pem \
data/bad-key.pem data/p8key-illegal.pem data/key-illegal.pem data/pkcs8-pbes2-sha256.pem \
- data/pkcs8-pbes1-des-md5.pem
+ data/pkcs8-pbes1-des-md5.pem data/pkcs8-invalid8.der
dist_check_SCRIPTS = key-id pkcs8 pkcs8-decode dsa ecdsa illegal-rsa pkcs8-invalid
diff --git a/tests/key-tests/data/pkcs8-invalid8.der b/tests/key-tests/data/pkcs8-invalid8.der
new file mode 100644
index 0000000000..4caa5281ed
--- /dev/null
+++ b/tests/key-tests/data/pkcs8-invalid8.der
Binary files differ
diff --git a/tests/key-tests/pkcs8-invalid b/tests/key-tests/pkcs8-invalid
index bf2cb96a20..13a4f3473a 100755
--- a/tests/key-tests/pkcs8-invalid
+++ b/tests/key-tests/pkcs8-invalid
@@ -31,7 +31,7 @@ fi
ret=0
for p8 in "pkcs8-invalid1.der 1234" "pkcs8-invalid2.der 1234" "pkcs8-invalid3.der 1234" "pkcs8-invalid4.der 1234" \
- "pkcs8-invalid5.der 1234" "pkcs8-invalid6.der 1234" "pkcs8-invalid7.der 1234";do
+ "pkcs8-invalid5.der 1234" "pkcs8-invalid6.der 1234" "pkcs8-invalid7.der 1234" "pkcs8-invalid8.der password";do
set -- ${p8}
file="$1"
passwd="$2"