aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-03-06 14:37:29 +0100
committerGuilhem Moulin <guilhem@fripost.org>2024-03-06 14:42:46 +0100
commiteb254348085047702ee37e405d171d894dc5ffff (patch)
tree48ff92d327463fe15bd2e5011aedb33ab4a4a806
parent53a296f8b629e002b13f328c74ff905963f75dc4 (diff)
tests/certs/generate: Generate X.509 version 3 CA.
And pass CA:TRUE as basic constraint. This fixes the test suite with OpenSSL 3.2 with defaults to X.509v3 and CA:FALSE.
-rwxr-xr-xtests/certs/generate7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/certs/generate b/tests/certs/generate
index 8e9c451..f449764 100755
--- a/tests/certs/generate
+++ b/tests/certs/generate
@@ -22,7 +22,12 @@ genpkey() {
# generate CA (we intentionally throw away the private key and serial
# file to avoid reuse)
genpkey "$cadir/ca.key" -algorithm RSA
-openssl req -new -x509 -rand /dev/urandom -subj "/OU=$OU/CN=Fake Root CA" -key "$cadir/ca.key" -out ./ca.crt
+openssl req -new -x509 -rand /dev/urandom \
+ -subj "/OU=$OU/CN=Fake Root CA" \
+ -addext subjectKeyIdentifier="hash" \
+ -addext authorityKeyIdentifier="keyid:always,issuer" \
+ -addext basicConstraints="critical,CA:TRUE" \
+ -key "$cadir/ca.key" -out ./ca.crt
SERIAL=1
new() {