Skip to content

Commit 92f4e1b

Browse files
authored
Merge pull request #115 from hfmanson/master
ca signed certs, fixed web templates
2 parents f99e45c + f519291 commit 92f4e1b

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

testdata/Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PGPRSABITS ?= 2048
4141
# The directory with tools, defaulting to ../tool in the git base
4242
# Note that testdata is meant for developers, so assuming git is usually the best
4343
#
44-
TOOLDIR ?= $(shell pwd)/../tool
44+
TOOLDIR ?= $(shell pwd)/../build/tool
4545

4646
#
4747
# Load a few things from tlspool.conf; these are assumed present while testing
@@ -252,15 +252,15 @@ tlspool-test-server-pubkey.pgp:
252252
$(CERTTOOL) --pgp-certificate-info --infile $@ --inraw --outfile $(@:.pgp=.asc)
253253

254254
# Key 3: X.509 Client Certificate
255-
tlspool-test-client-cert.der: tlspool-test-client-cert.template
255+
tlspool-test-client-cert.der: tlspool-test-client-cert.template tlspool-test-ca-cert.der
256256
echo Using PRIVKEY3, '$(PRIVKEY3)'
257-
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY3)' --template=$<
257+
$(CERTTOOL) --outfile $@ --outder --generate-certificate --load-ca-certificate=tlspool-test-ca-cert.pem --load-ca-privkey='$(PRIVKEY5)' --load-privkey='$(PRIVKEY3)' --template=$<
258258
$(CERTTOOL) --certificate-info --infile $@ --inder --outfile $(@:.der=.pem)
259259

260260
# Key 4: X.509 Server Certificate with user@ domain name
261-
tlspool-test-server-cert.der: tlspool-test-server-cert.template
261+
tlspool-test-server-cert.der: tlspool-test-server-cert.template tlspool-test-ca-cert.der
262262
echo Using PRIVKEY4, '$(PRIVKEY4)'
263-
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY4)' --template=$<
263+
$(CERTTOOL) --outfile $@ --outder --generate-certificate --load-ca-certificate=tlspool-test-ca-cert.pem --load-ca-privkey='$(PRIVKEY5)' --load-privkey='$(PRIVKEY4)' --template=$<
264264
$(CERTTOOL) --certificate-info --infile $@ --inder --outfile $(@:.der=.pem)
265265

266266
# Key 5: Test CA (for chained certificates)
@@ -281,14 +281,14 @@ tlspool-test-flying-signer.der: tlspool-test-flying-signer.template
281281
$(CERTTOOL) --certificate-info --infile $@ --inder --outfile $(@:.der=.pem)
282282

283283
# Key 7: X.509 Server Certificate with just a host name
284-
tlspool-test-webhost-cert.der: tlspool-test-webhost-cert.template
284+
tlspool-test-webhost-cert.der: tlspool-test-webhost-cert.template tlspool-test-ca-cert.der
285285
echo Using PRIVKEY7, '$(PRIVKEY7)'
286-
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY7)' --template=$<
286+
$(CERTTOOL) --outfile $@ --outder --generate-certificate --load-ca-certificate=tlspool-test-ca-cert.pem --load-ca-privkey='$(PRIVKEY5)' --load-privkey='$(PRIVKEY7)' --template=$<
287287

288288
# Key 8: X.509 Server Certificate with just a host name
289-
tlspool-test-playground-cert.der: tlspool-test-playground-cert.template
289+
tlspool-test-playground-cert.der: tlspool-test-playground-cert.template tlspool-test-ca-cert.der
290290
echo Using PRIVKEY8, '$(PRIVKEY8)'
291-
$(CERTTOOL) --outfile $@ --outder --generate-self-signed --load-privkey='$(PRIVKEY8)' --template=$<
291+
$(CERTTOOL) --outfile $@ --outder --generate-certificate --load-ca-certificate=tlspool-test-ca-cert.pem --load-ca-privkey='$(PRIVKEY5)' --load-privkey='$(PRIVKEY8)' --template=$<
292292

293293

294294
# Turn a .der into a .keyid

testdata/tlspool-test-ca-cert.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ crl_signing_key
135135
#code_signing_key
136136

137137
# Whether this key will be used to sign OCSP data.
138-
ocsp_signing_key
138+
#ocsp_signing_key
139139

140140
# Whether this key will be used for time stamping.
141141
#time_stamping_key

testdata/tlspool-test-playground-cert.template

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ state = "Freedom"
1818
# country = GR
1919

2020
# The common name of the certificate owner.
21-
cn = "TLS Pool Test X.509 Server"
21+
cn = "TLS Pool Test X.509 Playground Server"
2222

2323
# A user id of the certificate owner.
2424
#uid = "clauper"
@@ -118,15 +118,6 @@ encryption_key
118118
# Whether this certificate will be used for a TLS server
119119
tls_www_server
120120

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-
130121
# Whether this key will be used to sign other certificates.
131122
# cert_signing_key
132123

@@ -137,7 +128,7 @@ crl_signing_key
137128
#code_signing_key
138129

139130
# Whether this key will be used to sign OCSP data.
140-
ocsp_signing_key
131+
#ocsp_signing_key
141132

142133
# Whether this key will be used for time stamping.
143134
#time_stamping_key

testdata/tlspool-test-webhost-cert.template

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ state = "Freedom"
1818
# country = GR
1919

2020
# The common name of the certificate owner.
21-
cn = "TLS Pool Test X.509 Server"
21+
cn = "TLS Pool Test X.509 Webhost Server"
2222

2323
# A user id of the certificate owner.
2424
#uid = "clauper"
@@ -118,15 +118,6 @@ encryption_key
118118
# Whether this certificate will be used for a TLS server
119119
tls_www_server
120120

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-
130121
# Whether this key will be used to sign other certificates.
131122
# cert_signing_key
132123

@@ -137,7 +128,7 @@ crl_signing_key
137128
#code_signing_key
138129

139130
# Whether this key will be used to sign OCSP data.
140-
ocsp_signing_key
131+
#ocsp_signing_key
141132

142133
# Whether this key will be used for time stamping.
143134
#time_stamping_key

0 commit comments

Comments
 (0)