diff options
Diffstat (limited to 'tests/cert-tests')
-rw-r--r-- | tests/cert-tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/cert-tests/data/userid.pem | 59 | ||||
-rwxr-xr-x | tests/cert-tests/userid | 36 |
3 files changed, 97 insertions, 2 deletions
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am index 87d372b6cd..664ee347cc 100644 --- a/tests/cert-tests/Makefile.am +++ b/tests/cert-tests/Makefile.am @@ -45,14 +45,14 @@ EXTRA_DIST = data/ca-no-pathlen.pem data/no-ca-or-pathlen.pem data/aki-cert.pem data/template-rsa-sha3-256.pem data/template-rsa-sha3-512.pem data/template-rsa-sha3-224.pem \ data/template-rsa-sha3-384.pem \ data/name-constraints-ip2.pem data/chain-md5.pem data/gost-cert.pem \ - templates/template-tlsfeature.tmpl \ + templates/template-tlsfeature.tmpl data/userid.pem \ data/template-tlsfeature.pem data/template-tlsfeature.csr \ templates/template-tlsfeature-crq.tmpl templates/arb-extensions.tmpl data/arb-extensions.pem \ data/arb-extensions.csr dist_check_SCRIPTS = pathlen aki certtool invalid-sig email \ pkcs7 pkcs7-broken-sigs privkey-import name-constraints certtool-long-cn crl provable-privkey \ - provable-dh + provable-dh userid if !HAVE_BUGGY_LIBIDN dist_check_SCRIPTS += certtool-utf8 diff --git a/tests/cert-tests/data/userid.pem b/tests/cert-tests/data/userid.pem new file mode 100644 index 0000000000..2f3474745b --- /dev/null +++ b/tests/cert-tests/data/userid.pem @@ -0,0 +1,59 @@ +# This file contains a X.509 certificate with a UID field, encoded as +# an IA5String rather than DirectoryString (i.e., TeletexString, +# PrintableString, UniversalString, UTF8String, or BMPString) which is +# the correct approach. For compatibility, it seems good to make sure +# that newer versions of GnuTLS continue to be able to read such +# certificates. + +# Thanks to Max Kellermann <max@duempel.org> who reported this problem +# to gnutls-dev@gnupg.org, see Message-ID: +# <20061220125309.GA2668@roonstrasse.net>. + +# Copyright (C) 2006-2010, 2012 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. + +X.509 certificate info: + +Version: 3 +Serial Number (hex): 00 +Subject: UID=simon +Issuer: UID=simon +Signature Algorithm: RSA-SHA +Validity: + Not Before: Wed Dec 27 10:28:27 2006 + Not After: Thu Dec 28 10:28:30 2006 +Subject Public Key Info: + Public Key Algorithm: RSA (512 bits) +modulus: + bd:a2:fc:48:9e:c0:4c:e9:57:d0:48:17:58:6e:1f: + 74:e3:15:d5:80:db:9d:31:0b:dd:29:a2:f3:05:45: + 80:70:78:02:fe:9c:a1:92:f3:86:47:ea:f7:e9:36: + 8c:28:10:fd:fa:3f:1d:74:7b:bb:f3:0e:8b:99:44: + 05:0e:11:6f: +public exponent: + 01:00:01: + +X.509 Extensions: + Basic Constraints: (critical) + CA:FALSE + Subject Key ID: + 5E:AE:28:4A:25:2D:BD:EC:74:DC:71:E1:5E:23:9A:96:05:D8:4B:D7 + +Other information: + MD5 Fingerprint: E3:26:D8:E5:5F:54:AA:34:B9:DF:4C:1C:D6:82:CF:F2 + SHA1 Fingerprint: 5F:6E:FB:6D:B5:85:81:63:A8:1A:DC:9F:50:75:0D:57:56:53:FB:83 + Public Key ID: 5E:AE:28:4A:25:2D:BD:EC:74:DC:71:E1:5E:23:9A:96:05:D8:4B:D7 + + +-----BEGIN CERTIFICATE----- +MIIBRjCB86ADAgECAgEAMAsGCSqGSIb3DQEBBTAXMRUwEwYKCZImiZPyLGQBARYF +c2ltb24wHhcNMDYxMjI3MDkyODI3WhcNMDYxMjI4MDkyODMwWjAXMRUwEwYKCZIm +iZPyLGQBARYFc2ltb24wWTALBgkqhkiG9w0BAQEDSgAwRwJAvaL8SJ7ATOlX0EgX +WG4fdOMV1YDbnTEL3Smi8wVFgHB4Av6coZLzhkfq9+k2jCgQ/fo/HXR7u/MOi5lE +BQ4RbwIDAQABoy8wLTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRerihKJS297HTc +ceFeI5qWBdhL1zALBgkqhkiG9w0BAQUDQQBUuTMcLeWAXr6ihKcEdMm+pIRc5XGb +5Y7m+47risTzyqpPnDzwXI4vJm4BxHmCQg8oarkBNHaKv7nA6hCFi48w +-----END CERTIFICATE----- diff --git a/tests/cert-tests/userid b/tests/cert-tests/userid new file mode 100755 index 0000000000..912e0c94ad --- /dev/null +++ b/tests/cert-tests/userid @@ -0,0 +1,36 @@ +#!/bin/sh + +# Copyright (C) 2006, 2008, 2010, 2012 Free Software Foundation, Inc. +# +# Author: Simon Josefsson +# +# 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. + +srcdir="${srcdir:-.}" +CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}" + +"${CERTTOOL}" --certificate-info --infile "${srcdir}/data/userid.pem" >out 2>&1 +RET=$? +if [ ${RET} != 0 ]; then + echo "Error in userid:" + cat out + exit 1 +fi + +rm -f out + +exit 0 |