summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cert-tests/Makefile.am2
-rw-r--r--tests/cert-tests/p7-combined.out82
-rwxr-xr-xtests/cert-tests/pkcs719
3 files changed, 102 insertions, 1 deletions
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am
index 5f21bd7295..b4c3ff5b51 100644
--- a/tests/cert-tests/Makefile.am
+++ b/tests/cert-tests/Makefile.am
@@ -31,7 +31,7 @@ EXTRA_DIST = ca-no-pathlen.pem no-ca-or-pathlen.pem aki-cert.pem \
invalid-sig.pem email-certs/chain.exclude.test.example.com email-certs/chain.test.example.com \
email-certs/chain.invalid.example.com email-certs/chain.test.example.com-2 \
single-ca.p7b single-ca.p7b.out full.p7b full.p7b.out detached.p7b \
- pkcs7-detached.txt
+ pkcs7-detached.txt p7-combined.out
dist_check_SCRIPTS = pathlen aki template-test pem-decoding dane crq certtool invalid-sig email \
pkcs7
diff --git a/tests/cert-tests/p7-combined.out b/tests/cert-tests/p7-combined.out
new file mode 100644
index 0000000000..2332d255e3
--- /dev/null
+++ b/tests/cert-tests/p7-combined.out
@@ -0,0 +1,82 @@
+-----BEGIN PKCS7-----
+MIIO1AYJKoZIhvcNAQcCoIIOxTCCDsECAQExADALBgkqhkiG9w0BBwWggg6nMIIB
++jCCAaGgAwIBAgIETd4LiTAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0G
+A1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9y
+aXR5MQ8wDQYDVQQIEwZMZXV2ZW4xJTAjBgNVBAMTHEdudVRMUyBjZXJ0aWZpY2F0
+ZSBhdXRob3JpdHkwHhcNMTEwNTI2MDgxMjU4WhcNMTIxMjI0MTkxNjI5WjAhMQsw
+CQYDVQQGEwJCRTESMBAGA1UEAxMJbG9jYWxob3N0ME4wEAYHKoZIzj0CAQYFK4EE
+ACEDOgAE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MCAwEAAaNVMFMwDAYDVR0TAQH/BAIwADATBgNV
+HSUEDDAKBggrBgEFBQcDATAPBgNVHQ8BAf8EBQMDB6AAMB0GA1UdDgQWBBSSU9Zx
+ufhoqrNT9o31OUVmnKflMTANBgkqhkiG9w0BAQsFAAOCATEAmL9IicHm5hUTzPy6
+7aCJ5YZFMHNosnkfiAKA+y3JuCFVjcW3VhvPw3bu0PDZIjpjksUEhnAeQjMqO8QU
+CMVCknN8PjnA7jTHMxZfk67PH5owCVH+LZScKK0qfuQUgUVrDdcRIfzbJxd0tMyU
+Gm6ee1ip4AaN2l9g4bhvKGi2WL7FrDZHN/aoOHQjgfMivmH/CAiH68KPKSV1XUzr
+1Qkoq3uZ+WkIosYC0i7N+vEZzj9EaqFLqFbVEa5E42gFUFeNcg/HIduPo1B4XVo5
+y5A9UkMzv+qJBxqSzIUnqD00uFtS7u8gubb/6sWQ00fFUZDi5j5SuR55GL794iS+
+RzJasANrqtvD2/ZgRAi2LBlHovBDf/AHl1er7KC4aknOCObDTfKk6bhD5/CE1xpy
+FF2CGqEAMQA=
+-----END PKCS7-----
diff --git a/tests/cert-tests/pkcs7 b/tests/cert-tests/pkcs7
index 6f3f9e166c..4868e9b489 100755
--- a/tests/cert-tests/pkcs7
+++ b/tests/cert-tests/pkcs7
@@ -27,6 +27,7 @@ if ! test -z "${VALGRIND}";then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
fi
OUTFILE=out-pkcs7.tmp
+OUTFILE2=out2-pkcs7.tmp
for FILE in single-ca.p7b full.p7b;do
$VALGRIND $CERTTOOL --inder --p7-info --infile $srcdir/$FILE >$OUTFILE
@@ -93,7 +94,25 @@ if test "$rc" != "0"; then
exit $rc
fi
+# Test cert combination
+
+FILE="p7-combined"
+cat $srcdir/../certs/cert*.pem >$OUTFILE2
+$VALGRIND $CERTTOOL --p7-generate --load-certificate $OUTFILE2 >$OUTFILE
+rc=$?
+
+if test "$rc" != "0"; then
+ echo "$FILE: PKCS7 struct generation failed"
+ exit $rc
+fi
+
+$DIFF $OUTFILE p7-combined.out >/dev/null
+if test "$?" != "0"; then
+ echo "$FILE: PKCS7 generation didn't produce the correct file"
+ exit 1
+fi
rm -f $OUTFILE
+rm -f $OUTFILE2
exit 0