summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-21 22:10:25 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-21 22:12:24 +0100
commit45bce4b8726edb9773c016125401500e7cace021 (patch)
tree222e818b7a409be69e61e05e0bdf522381b1d878
parentfcd18567c570671284cd06b2f6e68e77df7e9268 (diff)
downloadgnutls-45bce4b8726edb9773c016125401500e7cace021.tar.gz
Added test on UTF-8 certificate generation.
-rw-r--r--tests/cert-tests/Makefile.am2
-rwxr-xr-xtests/cert-tests/template-test18
-rw-r--r--tests/cert-tests/template-utf8.pem19
-rw-r--r--tests/cert-tests/template-utf8.tmpl27
4 files changed, 65 insertions, 1 deletions
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am
index faa998fe9b..f63beb688a 100644
--- a/tests/cert-tests/Makefile.am
+++ b/tests/cert-tests/Makefile.am
@@ -22,7 +22,7 @@
EXTRA_DIST = ca-no-pathlen.pem no-ca-or-pathlen.pem aki-cert.pem \
template-test.key template-test.pem template-test.tmpl \
funny-spacing.pem ca-certs.pem dane-test.rr cert-ecc256.pem \
- bmpstring.pem
+ bmpstring.pem template-utf8.pem template-utf8.tmpl
dist_check_SCRIPTS = pathlen aki template-test pem-decoding dane
diff --git a/tests/cert-tests/template-test b/tests/cert-tests/template-test
index 75f6fab1fb..f1d87ca095 100755
--- a/tests/cert-tests/template-test
+++ b/tests/cert-tests/template-test
@@ -43,11 +43,29 @@ datefudge "2007-04-22" \
diff $srcdir/template-test.pem tmp-tt.pem
rc=$?
+# We're done.
+if test "$rc" != "0"; then
+ echo "Test 1 failed"
+ exit $rc
+fi
+
rm -f tmp-tt.pem
+datefudge "2007-04-22" \
+ $CERTTOOL --generate-self-signed \
+ --load-privkey $srcdir/template-test.key \
+ --template $srcdir/template-utf8.tmpl \
+ --outfile tmp-tt.pem 2>/dev/null
+
+diff $srcdir/template-utf8.pem tmp-tt.pem
+rc=$?
+
# We're done.
if test "$rc" != "0"; then
+ echo "Test 2 (UTF8) failed"
exit $rc
fi
+rm -f tmp-tt.pem
+
exit 0
diff --git a/tests/cert-tests/template-utf8.pem b/tests/cert-tests/template-utf8.pem
new file mode 100644
index 0000000000..4f6615c923
--- /dev/null
+++ b/tests/cert-tests/template-utf8.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIC/TCCAmagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBZMQswCQYDVQQGEwJHUjEk
+MCIGA1UECgwbzpzOtc6zzqzOu863IM61z4TOsc65z4HOr86xMRUwEwYDVQQIDAzO
+kc+Ez4TOuc66zq4xDTALBgNVBAMMBPCfkKgwIhgPMjAwNzA0MjEyMjAwMDBaGA8y
+MDA4MDQyMDIyMDAwMFowWTELMAkGA1UEBhMCR1IxJDAiBgNVBAoMG86czrXOs86s
+zrvOtyDOtc+EzrHOuc+Bzq/OsTEVMBMGA1UECAwMzpHPhM+EzrnOus6uMQ0wCwYD
+VQQDDATwn5CoMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClxs51Q4S/ZJ4C
+JxPxA1n3eS2S7XwvUKQD8S15uYaLBX46u0Sqr4TPE5geHEo49zMtep9y1GttJrAx
+N3AQ+0Lp2J0YZX4ZSfwFlgRogx53hr/t9eUSOxP+MxicGnodaa9HAmB6H7noz9vI
+NDBRlj2MllwAvGHeCA+xNiF/qQDjBQIDAQABo4HQMIHNMAwGA1UdEwEB/wQCMAAw
+gZ0GA1UdIASBlTCBkjCBjwYMKwYBBAGqbAEKYwEAMH8wSAYIKwYBBQUHAgIwPAw6
+zpzOuc6xIM+Azr/Ou865z4TOuc66zq4gz4DOv8+FIM64zq3Ou861zrkgzrTOuc6s
+zrLOsc+DzrzOsTAzBggrBgEFBQcCARYnaHR0cDovL3d3dy5leGFtcGxlLmNvbS9h
+LXBvbGljeS10by1yZWFkMB0GA1UdDgQWBBRdQK3wzpRAlYt+mZQdklQiynI2XzAN
+BgkqhkiG9w0BAQsFAAOBgQBo2g5++u6FKa1MSLEaXl2c6KOxrj0XFkpkWEnajEdn
+H2ApFr/EHZsGWET92s+AAkgJmfmzUB8+uEbSPTNXZnmx8HL5ZrVFwVJ8ZwJDBipQ
+1vgdwpPlxpJp0rIr76xXXmzXsdnCmuvBfiE0KT1/X/Ntm+HkolB7WUVxsIkp3hIS
+1w==
+-----END CERTIFICATE-----
diff --git a/tests/cert-tests/template-utf8.tmpl b/tests/cert-tests/template-utf8.tmpl
new file mode 100644
index 0000000000..1d6c457468
--- /dev/null
+++ b/tests/cert-tests/template-utf8.tmpl
@@ -0,0 +1,27 @@
+# X.509 Certificate options
+#
+# DN options
+
+# The organization of the subject.
+organization = "Μεγάλη εταιρία"
+
+# The name (Koala)
+cn = "🐨"
+
+# The locality of the subject.
+# locality =
+
+# The state of the certificate owner.
+state = "Αττική"
+
+# The country of the subject. Two letter code.
+country = GR
+
+# The serial number of the certificate
+serial = 009
+
+# Certificate policies
+policy1 = 1.3.6.1.4.1.5484.1.10.99.1.0
+policy1_txt = "Μια πολιτική που θέλει διάβασμα"
+policy1_url = http://www.example.com/a-policy-to-read
+