summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-01-10 14:45:03 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-01-10 14:45:03 +0100
commit11da583a2261e148db733e4b6e1543a3bfca44a6 (patch)
tree903c4573332362832e34f6f4163fa391ab099c7f
parent32a1593c71b0aff90cd92ed0cea15fe9da2d2831 (diff)
downloadgnutls-11da583a2261e148db733e4b6e1543a3bfca44a6.tar.gz
tests: added check for XMPP othername generation
-rw-r--r--tests/cert-tests/Makefile.am3
-rwxr-xr-xtests/cert-tests/othername-test26
-rw-r--r--tests/cert-tests/template-othername-xmpp.pem21
-rw-r--r--tests/cert-tests/template-othername-xmpp.tmpl70
4 files changed, 118 insertions, 2 deletions
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am
index 51b2d1ef62..a6d1ac844a 100644
--- a/tests/cert-tests/Makefile.am
+++ b/tests/cert-tests/Makefile.am
@@ -35,7 +35,8 @@ EXTRA_DIST = ca-no-pathlen.pem no-ca-or-pathlen.pem aki-cert.pem \
template-generalized.tmpl privkey1.pem privkey2.pem privkey3.pem \
name-constraints-ip.pem cert-invalid-utf8.der very-long-dn.pem \
provable3072.pem provable2048.pem provable-dsa2048.pem provable-dsa2048-fips.pem \
- template-unique.tmpl template-unique.pem template-othername.tmpl template-othername.pem
+ template-unique.tmpl template-unique.pem template-othername.tmpl template-othername.pem \
+ template-othername-xmpp.tmpl template-othername-xmpp.pem
dist_check_SCRIPTS = pathlen aki certtool invalid-sig email \
pkcs7 privkey-import name-constraints certtool-long-cn crl provable-privkey
diff --git a/tests/cert-tests/othername-test b/tests/cert-tests/othername-test
index 413e873dd2..0197331f7c 100755
--- a/tests/cert-tests/othername-test
+++ b/tests/cert-tests/othername-test
@@ -57,10 +57,34 @@ done
# We're done.
if test "${rc}" != "0"; then
- echo "Test 1 failed"
+ echo "Test 1 (othername) failed"
exit ${rc}
fi
+rc=1
+counter=1
+
+while [ "${rc}" != "0" -a $counter -le 3 ]; do
+ datefudge "2007-04-22" \
+ "${CERTTOOL}" --generate-self-signed \
+ --load-privkey "${srcdir}/template-test.key" \
+ --template "${srcdir}/template-othername-xmpp.tmpl" \
+ --outfile ${OUTFILE} 2>/dev/null
+
+ ${DIFF} "${srcdir}/template-othername-xmpp.pem" ${OUTFILE} >/dev/null 2>&1
+ rc=$?
+ test ${rc} != 0 && sleep 3
+ counter=`expr $counter + 1`
+done
+
+# We're done.
+if test "${rc}" != "0"; then
+ echo "Test 1 (xmpp) failed"
+ exit ${rc}
+fi
+
+
+
rm -f ${OUTFILE}
exit 0
diff --git a/tests/cert-tests/template-othername-xmpp.pem b/tests/cert-tests/template-othername-xmpp.pem
new file mode 100644
index 0000000000..e842185796
--- /dev/null
+++ b/tests/cert-tests/template-othername-xmpp.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDajCCAtOgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBbMQwwCgYDVQQDEwNOaWsx
+DzANBgNVBAgTBkF0dGlraTELMAkGA1UEBhMCR1IxGjAYBgNVBAQTEU1hdnJvZ2lh
+bm5vcG91bG9zMREwDwYDVQQJEwhBcmthZGlhczAeFw0wNzA0MjIwMDAwMDBaFw0x
+NDA1MjUwMDAwMDBaMFsxDDAKBgNVBAMTA05pazEPMA0GA1UECBMGQXR0aWtpMQsw
+CQYDVQQGEwJHUjEaMBgGA1UEBBMRTWF2cm9naWFubm9wb3Vsb3MxETAPBgNVBAkT
+CEFya2FkaWFzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClxs51Q4S/ZJ4C
+JxPxA1n3eS2S7XwvUKQD8S15uYaLBX46u0Sqr4TPE5geHEo49zMtep9y1GttJrAx
+N3AQ+0Lp2J0YZX4ZSfwFlgRogx53hr/t9eUSOxP+MxicGnodaa9HAmB6H7noz9vI
+NDBRlj2MllwAvGHeCA+xNiF/qQDjBQIDAQABo4IBPDCCATgwDwYDVR0TAQH/BAUw
+AwEB/zCBsAYDVR0RBIGoMIGlggx3d3cubm9uZS5vcmeCE3d3dy5tb3JldGhhbm9u
+ZS5vcmeCF3d3dy5ldmVubW9yZXRoYW5vbmUub3JnhwTAqAEBoCMGCCsGAQUFBwgF
+oBcMFWp1bGlldEBpbS5leGFtcGxlLmNvbaAdBggrBgEFBQcIBaARDA9oZWxsb0Bo
+ZWxsby5vcmeBDW5vbmVAbm9uZS5vcmeBDndoZXJlQG5vbmUub3JnMBMGA1UdJQQM
+MAoGCCsGAQUFBwMJMA4GA1UdDwEB/wQEAwIGADAdBgNVHQ4EFgQUXUCt8M6UQJWL
+fpmUHZJUIspyNl8wLgYDVR0fBCcwJTAjoCGgH4YdaHR0cDovL3d3dy5nZXRjcmwu
+Y3JsL2dldGNybC8wDQYJKoZIhvcNAQELBQADgYEACmit1cT6QSfXM4cFCq7nc8wD
+dAzsBBroGh5cI8+LeHjX+8AmWg29HL+kOSJfBvt6iEuUtL1tCX/6ce5HH5kuG6GX
+VJLHBb55dweQMdCOW/NJBRFQpbwGyEfSa/d/9y+8f8pffT7VCqBzPWGYFAKW5Ldy
+i3tHbwOVpEgkRXUSLqU=
+-----END CERTIFICATE-----
diff --git a/tests/cert-tests/template-othername-xmpp.tmpl b/tests/cert-tests/template-othername-xmpp.tmpl
new file mode 100644
index 0000000000..90c78c01c2
--- /dev/null
+++ b/tests/cert-tests/template-othername-xmpp.tmpl
@@ -0,0 +1,70 @@
+# X.509 Certificate options
+#
+# DN options
+
+dn = "cn=Nik,st=Attiki,C=GR,surName=Mavrogiannopoulos,2.5.4.9=Arkadias"
+
+# The serial number of the certificate
+serial = 7
+
+# In how many days, counting from today, this certificate will expire.
+expiration_days = 2590
+
+# X.509 v3 extensions
+
+# A dnsname in case of a WWW server.
+dns_name = "www.none.org"
+dns_name = "www.morethanone.org"
+
+xmpp_name = juliet@im.example.com
+xmpp_name = hello@hello.org
+
+# An IP address in case of a server.
+ip_address = "192.168.1.1"
+
+dns_name = "www.evenmorethanone.org"
+
+# An email in case of a person
+email = "none@none.org"
+
+# An URL that has CRLs (certificate revocation lists)
+# available. Needed in CA certificates.
+crl_dist_points = "http://www.getcrl.crl/getcrl/"
+
+email = "where@none.org"
+
+# Whether this is a CA certificate or not
+ca
+
+# Whether this certificate will be used for a TLS client
+#tls_www_client
+
+# Whether this certificate will be used for a TLS server
+#tls_www_server
+
+# Whether this certificate will be used to sign data (needed
+# in TLS DHE ciphersuites).
+signing_key
+
+# Whether this certificate will be used to encrypt data (needed
+# in TLS RSA ciphersuites). Note that it is preferred to use different
+# keys for encryption and signing.
+#encryption_key
+
+# Whether this key will be used to sign other certificates.
+cert_signing_key
+
+# Whether this key will be used to sign CRLs.
+#crl_signing_key
+
+# Whether this key will be used to sign code.
+#code_signing_key
+
+# Whether this key will be used to sign OCSP data.
+ocsp_signing_key
+
+# Whether this key will be used for time stamping.
+#time_stamping_key
+
+# Whether this key will be used for IPsec IKE operations.
+#ipsec_ike_key