Skip to content

Commit 3719104

Browse files
author
root
committed
Added privkey #8 and a certificate "playground.arpa2.lab"
1 parent 935f417 commit 3719104

File tree

2 files changed

+223
-2
lines changed

2 files changed

+223
-2
lines changed

testdata/Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,19 @@ PRIVKEYGEN += privkey7
112112
PRIVKEY7=$(P11URI);id=%30%37;object=obj7label;type=private
113113
endif
114114

115+
PRIVKEY8=$(shell $(P11TOOL) --list-privkeys '$(P11URI)' | sed -e '/object=obj8label/!d' -e 's/^[ \t]*URL: //')
116+
ifeq ($(PRIVKEY8),)
117+
PRIVKEYGEN += privkey8
118+
PRIVKEY8=$(P11URI);id=%30%38;object=obj8label;type=private
119+
endif
120+
115121

116122
#
117123
# General rules for cleaning and filling (together, rebuilding) parts
118124
#
119125

120126
TARGET_PKCS11=$(PRIVKEYGEN)
121-
TARGET_CERT=tlspool-test-client-cert.der tlspool-test-server-cert.der tlspool-test-ca-cert.der tlspool-test-flying-signer.der tlspool-test-webhost-cert.der tlspool-test-srp
127+
TARGET_CERT=tlspool-test-client-cert.der tlspool-test-server-cert.der tlspool-test-ca-cert.der tlspool-test-flying-signer.der tlspool-test-webhost-cert.der tlspool-test-playground-cert.der tlspool-test-srp
122128
TARGET_PGP=tlspool-test-client-pubkey.pgp tlspool-test-server-pubkey.pgp
123129
TARGET_DB=localid.db disclose.db trust.db
124130
TARGET_DBE=tlspool.env
@@ -194,7 +200,7 @@ fill-db: $(TARGET_DBE) $(TARGET_DB)
194200
# $(P11TOOL) --generate-rsa --bits $(RSABITS) --label objXlabel --id objXid --outfile xxx.pem '$(P11URI)'
195201
# ...
196202

197-
.PHONY: privkey1 privkey2 privkey3 privkey4 privkey5 privkey6 privkey7
203+
.PHONY: privkey1 privkey2 privkey3 privkey4 privkey5 privkey6 privkey7 privkey8
198204

199205
privkey1:
200206
@echo 'Generating private key #1 on PKCS #11 token'
@@ -224,6 +230,10 @@ privkey7:
224230
@echo 'Generating private key #7 on PKCS #11 token'
225231
$(P11TOOL) --generate-rsa --bits $(RSABITS) --label=obj7label --id=3037 --outfile=/dev/null '$(P11URI)'
226232

233+
privkey8:
234+
@echo 'Generating private key #8 on PKCS #11 token'
235+
$(P11TOOL) --generate-rsa --bits $(RSABITS) --label=obj8label --id=3038 --outfile=/dev/null '$(P11URI)'
236+
227237

228238
#
229239
# Produce binary DER certificates (without going through the textual "PEM" form)
@@ -275,6 +285,11 @@ tlspool-test-webhost-cert.der: tlspool-test-webhost-cert.template
275285
echo Using PRIVKEY7, '$(PRIVKEY7)'
276286
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY7)' --template=$<
277287

288+
# Key 8: X.509 Server Certificate with just a host name
289+
tlspool-test-playground-cert.der: tlspool-test-playground-cert.template
290+
echo Using PRIVKEY8, '$(PRIVKEY8)'
291+
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY8)' --template=$<
292+
278293

279294
# Turn a .der into a .keyid
280295
%.keyid: %.der
@@ -310,6 +325,7 @@ localid.db: tlspool.env
310325
$(TOOLDIR)/set_localid $(CONFFILE) testcli@tlspool.arpa2.lab valexp,client,server '1' /dev/null
311326
$(TOOLDIR)/set_localid $(CONFFILE) testsrv@tlspool.arpa2.lab valexp,client,server '1' /dev/null
312327
$(TOOLDIR)/set_localid $(CONFFILE) tlspool.arpa2.lab x.509,server,client '$(PRIVKEY7)' tlspool-test-webhost-cert.der
328+
$(TOOLDIR)/set_localid $(CONFFILE) tlspool.arpa2.lab x.509,server,client '$(PRIVKEY8)' tlspool-test-playground-cert.der
313329
chown $(DMNUSR):$(DMNGRP) $(BDBENV)/* $@
314330

315331
disclose.db: tlspool.env localid.db
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# X.509 Certificate options
2+
#
3+
# DN options
4+
5+
# The organization of the subject.
6+
organization = "ARPA2 Laboratories"
7+
8+
# The organizational unit of the subject.
9+
unit = "Test Servers"
10+
11+
# The locality of the subject.
12+
locality = "Internet"
13+
14+
# The state of the certificate owner.
15+
state = "Freedom"
16+
17+
# The country of the subject. Two letter code.
18+
# country = GR
19+
20+
# The common name of the certificate owner.
21+
cn = "TLS Pool Test X.509 Server"
22+
23+
# A user id of the certificate owner.
24+
#uid = "clauper"
25+
26+
# Set domain components
27+
#dc = "name"
28+
#dc = "domain"
29+
30+
# If the supported DN OIDs are not adequate you can set
31+
# any OID here.
32+
# For example set the X.520 Title and the X.520 Pseudonym
33+
# by using OID and string pairs.
34+
#dn_oid = 2.5.4.12 Dr.
35+
#dn_oid = 2.5.4.65 jackal
36+
37+
# This is deprecated and should not be used in new
38+
# certificates.
39+
# pkcs9_email = "none@@none.org"
40+
41+
# An alternative way to set the certificate's distinguished name directly
42+
# is with the "dn" option. The attribute names allowed are:
43+
# C (country), street, O (organization), OU (unit), title, CN (common name),
44+
# L (locality), ST (state), placeOfBirth, gender, countryOfCitizenship,
45+
# countryOfResidence, serialNumber, telephoneNumber, surName, initials,
46+
# generationQualifier, givenName, pseudonym, dnQualifier, postalCode, name,
47+
# businessCategory, DC, UID, jurisdictionOfIncorporationLocalityName,
48+
# jurisdictionOfIncorporationStateOrProvinceName,
49+
# jurisdictionOfIncorporationCountryName, XmppAddr, and numeric OIDs.
50+
51+
#dn = "cn = Nikos,st = New\, Something,C=GR,surName=Mavrogiannopoulos,2.5.4.9=Arkadias"
52+
53+
# The serial number of the certificate
54+
# Comment the field for a time-based serial number.
55+
serial = 001
56+
57+
# In how many days, counting from today, this certificate will expire.
58+
# Use -1 if there is no expiration date.
59+
expiration_days = 70
60+
61+
# Alternatively you may set concrete dates and time. The GNU date string
62+
# formats are accepted. See:
63+
# http://www.gnu.org/software/tar/manual/html_node/Date-input-formats.html
64+
65+
#activation_date = "2004-02-29 16:21:42"
66+
#expiration_date = "2025-02-29 16:24:41"
67+
68+
# X.509 v3 extensions
69+
70+
# A dnsname in case of a WWW server.
71+
#dns_name = "www.none.org"
72+
#dns_name = "www.morethanone.org"
73+
dns_name = "playground.arpa2.lab"
74+
dns_name = "localhost"
75+
76+
# A subject alternative name URI
77+
#uri = "http://www.example.com"
78+
79+
# An IP address in case of a server.
80+
#ip_address = "192.168.1.1"
81+
82+
# An email in case of a person
83+
# email = "testsrv@tlspool.arpa2.lab"
84+
85+
# Challenge password used in certificate requests
86+
# challenge_password = 123456
87+
88+
# Password when encrypting a private key
89+
#password = secret
90+
91+
# An URL that has CRLs (certificate revocation lists)
92+
# available. Needed in CA certificates.
93+
#crl_dist_points = "http://www.getcrl.crl/getcrl/"
94+
95+
# Whether this is a CA certificate or not
96+
# ca
97+
98+
# Whether this certificate will be used to sign data (needed
99+
# in TLS DHE ciphersuites). This is the digitalSignature flag
100+
# in RFC5280 terminology.
101+
signing_key
102+
103+
# Whether this certificate will be used to encrypt data (needed
104+
# in TLS RSA ciphersuites). Note that it is preferred to use different
105+
# keys for encryption and signing. This is the keyEncipherment flag
106+
# in RFC5280 terminology.
107+
encryption_key
108+
109+
110+
# for microsoft smart card logon
111+
# key_purpose_oid = 1.3.6.1.4.1.311.20.2.2
112+
113+
### Other predefined key purpose OIDs
114+
115+
# Whether this certificate will be used for a TLS client
116+
#tls_www_client
117+
118+
# Whether this certificate will be used for a TLS server
119+
tls_www_server
120+
121+
# Whether this certificate will be used to sign data (needed
122+
# in TLS DHE ciphersuites).
123+
signing_key
124+
125+
# Whether this certificate will be used to encrypt data (needed
126+
# in TLS RSA ciphersuites). Note that it is preferred to use different
127+
# keys for encryption and signing.
128+
encryption_key
129+
130+
# Whether this key will be used to sign other certificates.
131+
# cert_signing_key
132+
133+
# Whether this key will be used to sign CRLs.
134+
crl_signing_key
135+
136+
# Whether this key will be used to sign code.
137+
#code_signing_key
138+
139+
# Whether this key will be used to sign OCSP data.
140+
ocsp_signing_key
141+
142+
# Whether this key will be used for time stamping.
143+
#time_stamping_key
144+
145+
# Whether this key will be used for IPsec IKE operations.
146+
#ipsec_ike_key
147+
148+
### end of key purpose OIDs
149+
150+
# When generating a certificate from a certificate
151+
# request, then honor the extensions stored in the request
152+
# and store them in the real certificate.
153+
#honor_crq_extensions
154+
155+
# Path length contraint. Sets the maximum number of
156+
# certificates that can be used to certify this certificate.
157+
# (i.e. the certificate chain length)
158+
#path_len = -1
159+
#path_len = 2
160+
161+
# OCSP URI
162+
# ocsp_uri = http://my.ocsp.server/ocsp
163+
164+
# CA issuers URI
165+
# ca_issuers_uri = http://my.ca.issuer
166+
167+
# Certificate policies
168+
#policy1 = 1.3.6.1.4.1.5484.1.10.99.1.0
169+
#policy1_txt = "This is a long policy to summarize"
170+
#policy1_url = http://www.example.com/a-policy-to-read
171+
172+
#policy2 = 1.3.6.1.4.1.5484.1.10.99.1.1
173+
#policy2_txt = "This is a short policy"
174+
#policy2_url = http://www.example.com/another-policy-to-read
175+
176+
# Name constraints
177+
178+
# DNS
179+
#nc_permit_dns = example.com
180+
#nc_exclude_dns = test.example.com
181+
182+
# EMAIL
183+
#nc_permit_email = "nmav@@ex.net"
184+
185+
# Exclude subdomains of example.com
186+
#nc_exclude_email = .example.com
187+
188+
# Exclude all e-mail addresses of example.com
189+
#nc_exclude_email = example.com
190+
191+
192+
# Options for proxy certificates
193+
#proxy_policy_language = 1.3.6.1.5.5.7.21.1
194+
195+
196+
# Options for generating a CRL
197+
198+
# The number of days the next CRL update will be due.
199+
# next CRL update will be in 43 days
200+
#crl_next_update = 43
201+
202+
# this is the 5th CRL by this CA
203+
# Comment the field for a time-based number.
204+
#crl_number = 5
205+

0 commit comments

Comments
 (0)