summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-07 15:25:31 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-11 13:59:41 +0200
commit2b518f533126a3098a08999e8d62825787a8212c (patch)
treeabffbc31e594c7d8a3a7358e294b3d6080f79d4d /tests
parent206414e55543e34ece06337132767f1887f569d7 (diff)
downloadgnutls-2b518f533126a3098a08999e8d62825787a8212c.tar.gz
tests: added checks for the decoding of various PKCS#7 structures
Diffstat (limited to 'tests')
-rw-r--r--tests/suite/Makefile.am6
-rw-r--r--tests/suite/data/ca.pem103
-rw-r--r--tests/suite/data/test1.catbin0 -> 329485 bytes
-rw-r--r--tests/suite/data/test1.cat.databin0 -> 322522 bytes
-rw-r--r--tests/suite/data/test1.cat.out147
-rw-r--r--tests/suite/data/test2.catbin0 -> 329940 bytes
-rw-r--r--tests/suite/data/test2.cat.databin0 -> 322977 bytes
-rw-r--r--tests/suite/data/test2.cat.out147
-rwxr-xr-xtests/suite/pkcs7-cat80
9 files changed, 481 insertions, 2 deletions
diff --git a/tests/suite/Makefile.am b/tests/suite/Makefile.am
index ea5d2d2cbc..6ef7456071 100644
--- a/tests/suite/Makefile.am
+++ b/tests/suite/Makefile.am
@@ -30,7 +30,9 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/tests/suite/ecore/src/include \
-I$(top_srcdir)/tests/suite/ecore/src/lib
-EXTRA_DIST = crl/long.crl crl/long.pem
+EXTRA_DIST = crl/long.crl crl/long.pem data/test1.cat data/test2.cat \
+ data/test1.cat.data data/test2.cat.data \
+ data/test1.cat.out data/test2.cat.out data/ca.pem
check_PROGRAMS = rng
AM_LDFLAGS = -no-install
@@ -87,7 +89,7 @@ EXTRA_DIST += testcompat-main-polarssl testcompat-main-openssl testcompat-common
testpkcs11.pkcs15 testpkcs11.softhsm testpkcs11.sc-hsm
nodist_check_SCRIPTS = testsrn.sh chain.sh invalid-cert.sh \
testpkcs11.sh testrng.sh testcompat-polarssl.sh testcompat-openssl.sh \
- testrandom.sh
+ testrandom.sh pkcs7-cat
if ENABLE_PKCS11
nodist_check_SCRIPTS += testpkcs11.sh crl-test
diff --git a/tests/suite/data/ca.pem b/tests/suite/data/ca.pem
new file mode 100644
index 0000000000..884a191539
--- /dev/null
+++ b/tests/suite/data/ca.pem
@@ -0,0 +1,103 @@
+-----BEGIN CERTIFICATE-----
+MIIFaDCCBFCgAwIBAgITMwAAAB4ljnxCUcXR+gABAAAAHjANBgkqhkiG9w0BAQUF
+ADCBizELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT
+B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjE1MDMGA1UE
+AxMsTWljcm9zb2Z0IFdpbmRvd3MgSGFyZHdhcmUgQ29tcGF0aWJpbGl0eSBQQ0Ew
+HhcNMTUwODE4MTgwMzU5WhcNMTYxMTE4MTgwMzU5WjCBoDELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT
+FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjENMAsGA1UECxMETU9QUjE7MDkGA1UEAxMy
+TWljcm9zb2Z0IFdpbmRvd3MgSGFyZHdhcmUgQ29tcGF0aWJpbGl0eSBQdWJsaXNo
+ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0T8mJvC7jS8JlVaBK
+u2QmH32PEXDADrEY550UUhMshTNjGiPOKAOlWyyWqNfjgv1D/gvr8TrKU/VNPagm
+g6hWCBhPR+4gf9U4MfrBGaJ1D/7GtrpiczVrLb8OjdiyILO1gRxrBJ1F9GB4ClK8
+JeFq2GZV3kdwKi9+fZiuNnd/bMmE41V5nGc0Y9/iaRCx/fevstXY02ugS7b2SWAM
+E9eEuToXtFekE50dPACxLzJKMkRlGAnZaCc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2E0bodj6
+L54/LlUWa8kTo/0=
+-----END CERTIFICATE-----
+
diff --git a/tests/suite/data/test1.cat b/tests/suite/data/test1.cat
new file mode 100644
index 0000000000..543e62a74a
--- /dev/null
+++ b/tests/suite/data/test1.cat
Binary files differ
diff --git a/tests/suite/data/test1.cat.data b/tests/suite/data/test1.cat.data
new file mode 100644
index 0000000000..e0bac4c436
--- /dev/null
+++ b/tests/suite/data/test1.cat.data
Binary files differ
diff --git a/tests/suite/data/test1.cat.out b/tests/suite/data/test1.cat.out
new file mode 100644
index 0000000000..9a78cd1bcd
--- /dev/null
+++ b/tests/suite/data/test1.cat.out
@@ -0,0 +1,147 @@
+eContent Type: 1.3.6.1.4.1.311.10.1
+Signers:
+ Signer's issuer DN: C=US,ST=Washington,L=Redmond,O=Microsoft Corporation,CN=Microsoft Windows Hardware Compatibility PCA
+ Signer's serial: 330000001e258e7c4251c5d1fa00010000001e
+ Signature Algorithm: RSA-SHA1
+ Signed Attributes:
+ 1.3.6.1.4.1.311.2.1.12: 3064a030802e004800650077006c006500740074002d005000610063006b00610072006400200043006f006d00700061006e0079a130802e687474703a2f2f7777772e6d6963726f736f66742e636f6d2f776864632f68636c2f64656661756c742e6d737078
+ 1.2.840.113549.1.9.4: 04141c448883117564c1fe830b2833c0ef6b83030c0e
+ 1.3.6.1.4.1.311.2.1.11: 300c060a2b060104018237020115
+ 1.2.840.113549.1.9.3: 06092b0601040182370a01
+ Unsigned Attributes:
+ 1.2.840.113549.1.9.6: 3082021102010130818e3077310b3009060355040613025553311330110603550408130a57617368696e67746f6e3110300e060355040713075265646d6f6e64311e301c060355040a13154d6963726f736f667420436f72706f726174696f6e3121301f060355040313184d6963726f736f66742054696d652d5374616d7020504341021333000000af5347776c1bf1a3020000000000af300906052b0e03021a0500a05d301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3136303931333231313930395a302306092a864886f70d01090431160414d488cf8097e0d20f170aa7cff5414d9dc2f28f7b300d06092a864886f70d01010505000482010016dcd01f53ac52f8f37898f02352716c9de8dcdee53a2dfb243d503b31f252878e54c5716cd2f2237b82a1269322c50ed304c00a85e50c47b3ce43b2dfff9d1d8032541e28216281e715407b8cbe565fee869aa0e6fb6f421c1c5516c7fead80c1c2117998b0a754bb0683971d78a864707349514121bf2158305d672f8800ea02bd266c198afc22449f4579d7f0db337919accd8f8093539e1d24e5c89c0c1f9734ea8f9bec2ce9ff9f22f9649069b759ba05967742615a3953645572eddb4c5006b6fd4c6226beded0038548ed82d3993b17b473ca75e9891d524be5c39ec422d7a78baaa475bf1aa0e196d7db1858edcacea1ef34b2655772ab8fca3c7766
+
+Number of certificates: 4
+
+-----BEGIN CERTIFICATE-----
+MIIEwzCCA6ugAwIBAgITMwAAAK9TR3dsG/GjAgAAAAAArzANBgkqhkiG9w0BAQUF
+ADB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH
+UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQD
+ExhNaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EwHhcNMTYwNTAzMTcxMzI1WhcNMTcw
+ODAzMTcxMzI1WjCBszELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x
+EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv
+bjENMAsGA1UECxMETU9QUjEnMCUGA1UECxMebkNpcGhlciBEU0UgRVNOOjMxQzUt
+MzBCQS03QzkxMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNl
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIU6bFARsNjTYwC3p63c
+eKHrpHQuCZTbNDUUaayYlNptTs9au9YI+P9IBOKErcKjXkxftzeQaum86O7IGQlJ
+Pvqr0Cms32bitA6yECmWddujRimd4ULql8Imc452jaG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jvc29mdC5j
+b20vcGtpL2NlcnRzL01pY3Jvc29mdFJvb3RDZXJ0LmNydDATBgNVHSUEDDAKBggr
+BgEFBQcDCDANBgkqhkiG9w0BAQUFAAOCAgEAEJeKw1wDRDbd6bStd9vOeVFNAbEu
+dHFbbQwTq86+e4+4LtQSooxtYrhXAstOIBNQmd16QOJXu69YmhzhHQGGrLt48ovQ
+7DsB7uK+jwoFyI1I4vBTFd1Pq5Lk541q1YDB5pTyBi+FA+mRKiQicPv2/OR4mS4N
+9wficLwYTp2OawpylbihOZxnLcVRDupiXD8WmIsgP+IHGjL5zDFKdjE9K3ILyOpw
+Pf+FChPfwgphjvDXuBfrTot/xTUrXqO/67x9C0J71FNyIe4wyrt4ZVxbARcKFA7S
+2hSY9Ty5ZlizLS/n+YWGzFFW6J1wlGysOUzU9nm/qhh6YinvopspNAZ3GmLJPR5t
+H4LwC8csu89Ds+X57H2146SodDW4TsVxIxImdgs8UoxxWkZDFLyzs7BNZ8ifQv+A
+eSGAnhUwZuhCEl4ayJ4iIdBD6Svpu/RIzCzU2DKATCYqSCRfWupW76bemZ3KOm+9
+gSd0BhHudiG/m4LBJ1S2sWo9iaF2YbRuoROmv6pH8BJv/YoybLL+31HIjCPJZr2d
+HYcSZAI9La9Zj7jkIeW1sMpjtHhUBdRBLlCslLCleKuzoJZ1GtmShxN1Ii8yqAhu
+oFuMJb+g74TKIdbrHk/Jmu5J4PcBZW+JC33Iacjmbuqnl84xKf8OxVtc2E0bodj6
+L54/LlUWa8kTo/0=
+-----END CERTIFICATE-----
+
diff --git a/tests/suite/data/test2.cat b/tests/suite/data/test2.cat
new file mode 100644
index 0000000000..ec9139976b
--- /dev/null
+++ b/tests/suite/data/test2.cat
Binary files differ
diff --git a/tests/suite/data/test2.cat.data b/tests/suite/data/test2.cat.data
new file mode 100644
index 0000000000..5f180d151f
--- /dev/null
+++ b/tests/suite/data/test2.cat.data
Binary files differ
diff --git a/tests/suite/data/test2.cat.out b/tests/suite/data/test2.cat.out
new file mode 100644
index 0000000000..6adb270810
--- /dev/null
+++ b/tests/suite/data/test2.cat.out
@@ -0,0 +1,147 @@
+eContent Type: 1.3.6.1.4.1.311.10.1
+Signers:
+ Signer's issuer DN: C=US,ST=Washington,L=Redmond,O=Microsoft Corporation,CN=Microsoft Windows Hardware Compatibility PCA
+ Signer's serial: 330000001e258e7c4251c5d1fa00010000001e
+ Signature Algorithm: RSA-SHA1
+ Signed Attributes:
+ 1.3.6.1.4.1.311.2.1.12: 3064a030802e004800650077006c006500740074002d005000610063006b00610072006400200043006f006d00700061006e0079a130802e687474703a2f2f7777772e6d6963726f736f66742e636f6d2f776864632f68636c2f64656661756c742e6d737078
+ 1.2.840.113549.1.9.4: 0414fb79d8e67defba00ef1e59f52d1bfe48543e320d
+ 1.3.6.1.4.1.311.2.1.11: 300c060a2b060104018237020115
+ 1.2.840.113549.1.9.3: 06092b0601040182370a01
+ Unsigned Attributes:
+ 1.2.840.113549.1.9.6: 3082021102010130818e3077310b3009060355040613025553311330110603550408130a57617368696e67746f6e3110300e060355040713075265646d6f6e64311e301c060355040a13154d6963726f736f667420436f72706f726174696f6e3121301f060355040313184d6963726f736f66742054696d652d5374616d7020504341021333000000af5347776c1bf1a3020000000000af300906052b0e03021a0500a05d301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3136303931333231313931305a302306092a864886f70d01090431160414d30b7ae4807d078967bbca1018cd9ec3dcca3cba300d06092a864886f70d010105050004820100210ee74cf8daffba41d2c99e5d9a3214f4b1121c722e7f4b52fa6042d377f22f126cbbfbd8fcf96af71d7c6887ede977b189a76c17aec9b36befd6ad7c6ad7c92e2a1bc5954deb19b21f55622843b960ff23bd250fec65d40ec172049da38e5a0e407392420ea316704774a524ee1b40df7c32248b3d8f61452c0e4ab1730992ec68e6c496c90380ca9e12313dc823113f5280a7283bcd6251da3381e510443fe3dc7001b4ccdee2565d2923ff28323c05e4f7095a3c1bdb1e0f26ef566f4d7d6d44f8d06423908c64c70d0b029ce2218b814a55e7008983a46630d49387319b92beb3957099c0e20bc057b921cd5be4684576f86b7678324504f7274893db8a
+
+Number of certificates: 4
+
+-----BEGIN CERTIFICATE-----
+MIIEwzCCA6ugAwIBAgITMwAAAK9TR3dsG/GjAgAAAAAArzANBgkqhkiG9w0BAQUF
+ADB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH
+UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQD
+ExhNaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EwHhcNMTYwNTAzMTcxMzI1WhcNMTcw
+ODAzMTcxMzI1WjCBszELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x
+EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv
+bjENMAsGA1UECxMETU9QUjEnMCUGA1UECxMebkNpcGhlciBEU0UgRVNOOjMxQzUt
+MzBCQS03QzkxMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNl
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIU6bFARsNjTYwC3p63c
+eKHrpHQuCZTbNDUUaayYlNptTs9au9YI+P9IBOKErcKjXkxftzeQaum86O7IGQlJ
+Pvqr0Cms32bitA6yECmWddujRimd4ULql8Imc452jaG1pjiPfq8uZcTgYHkJ5/AM
+Q+K2NuGTLEw4//BTmnBMOugRKUuUZcVQZG+E9wot5slnIe1p/VgYpt8DejA4crXF
+zAeAXtj4XEY7NdE351GaIET0Y1LeKdWjnwhz2dqjhX2BJE/HDid/HYv3bnrgHBlH
+fmOTkaB799B8amERbJjNJfqrCKofWxUBWq7R1iStUCFjSSvt+Q/OS2aoYsLXObA2
+rwIDAQABo4IBCTCCAQUwHQYDVR0OBBYEFGgYUtBYbEj/U4U9IDez4/ZMdPF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LwYTp2OawpylbihOZxnLcVRDupiXD8WmIsgP+IHGjL5zDFKdjE9K3ILyOpw
+Pf+FChPfwgphjvDXuBfrTot/xTUrXqO/67x9C0J71FNyIe4wyrt4ZVxbARcKFA7S
+2hSY9Ty5ZlizLS/n+YWGzFFW6J1wlGysOUzU9nm/qhh6YinvopspNAZ3GmLJPR5t
+H4LwC8csu89Ds+X57H2146SodDW4TsVxIxImdgs8UoxxWkZDFLyzs7BNZ8ifQv+A
+eSGAnhUwZuhCEl4ayJ4iIdBD6Svpu/RIzCzU2DKATCYqSCRfWupW76bemZ3KOm+9
+gSd0BhHudiG/m4LBJ1S2sWo9iaF2YbRuoROmv6pH8BJv/YoybLL+31HIjCPJZr2d
+HYcSZAI9La9Zj7jkIeW1sMpjtHhUBdRBLlCslLCleKuzoJZ1GtmShxN1Ii8yqAhu
+oFuMJb+g74TKIdbrHk/Jmu5J4PcBZW+JC33Iacjmbuqnl84xKf8OxVtc2E0bodj6
+L54/LlUWa8kTo/0=
+-----END CERTIFICATE-----
+
diff --git a/tests/suite/pkcs7-cat b/tests/suite/pkcs7-cat
new file mode 100755
index 0000000000..6e32375cf2
--- /dev/null
+++ b/tests/suite/pkcs7-cat
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# This file is part of GnuTLS.
+#
+# GnuTLS is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GnuTLS is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GnuTLS; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#set -e
+
+srcdir="${srcdir:-.}"
+CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+DIFF="${DIFF:-diff -b -B}"
+if ! test -z "${VALGRIND}"; then
+ VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
+fi
+OUTFILE=out-pkcs7.$$.tmp
+
+#try verification
+${VALGRIND} "${CERTTOOL}" --inder --p7-verify --infile "${srcdir}/data/test1.cat" --load-certificate "${srcdir}/data/ca.pem"
+rc=$?
+
+if test "${rc}" != "0"; then
+ echo "${FILE}: PKCS7 verification failed"
+ exit ${rc}
+fi
+
+# try parsing
+for FILE in test1.cat test2.cat; do
+${VALGRIND} "${CERTTOOL}" --inder --p7-info --infile "${srcdir}/data/${FILE}" > "${OUTFILE}"
+rc=$?
+
+# We're done.
+if test "${rc}" != "0"; then
+ echo "${FILE}: PKCS7 decoding failed"
+ exit ${rc}
+fi
+
+${DIFF} "${OUTFILE}" "${srcdir}/data/${FILE}.out" #>/dev/null
+if test "$?" != "0"; then
+ echo "${FILE}: PKCS7 decoding didn't produce the correct file"
+ exit 1
+fi
+done
+
+rm -f "${OUTFILE}"
+#test output files
+
+for FILE in test1.cat test2.cat; do
+${VALGRIND} "${CERTTOOL}" --inder --p7-info --p7-show-data --infile "${srcdir}/data/${FILE}" --outfile "${OUTFILE}"
+rc=$?
+
+# We're done.
+if test "${rc}" != "0"; then
+ echo "${FILE}: PKCS7 decoding failed"
+ exit ${rc}
+fi
+
+${DIFF} "${OUTFILE}" "${srcdir}/data/${FILE}.data" >/dev/null
+if test "$?" != "0"; then
+ echo "${FILE}: PKCS7 decoding data didn't produce the correct file"
+ exit 1
+fi
+done
+
+rm -f "${OUTFILE}"
+
+exit 0