blob: cbac98928498298248e5ee7c621a95e99ea87e16 [file] [log] [blame]
Andrew Geisslerc5535c92023-01-27 16:10:19 -06001From 0f9f18fc330fe88080be13e43f300fbf7ba4a85a Mon Sep 17 00:00:00 2001
Andrew Geissler748a4832020-07-24 16:24:21 -05002From: Mingli Yu <mingli.yu@windriver.com>
3Date: Mon, 13 Jul 2020 07:01:45 +0000
4Subject: [PATCH] raddb/certs/Makefile: fix the existed certificate error
5
6Fixes:
7 # ./bootstrap
8 [snip]
9openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key 'whatever' -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
10Using configuration from ./client.cnf
11Check that the request matches the signature
12Signature ok
13ERROR:There is already a certificate for /C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
14The matching entry has the following details
15Type :Valid
16Expires on :200908024833Z
17Serial Number :02
18File name :unknown
19Subject Name :/C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
20make: *** [Makefile:128: client.crt] Error 1
21
22Add the check to fix the above error and it does the same for server.crt.
23
24Upstream-Status: Pending
25
26Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
27---
28 raddb/certs/Makefile | 4 ++--
29 1 file changed, 2 insertions(+), 2 deletions(-)
30
31diff --git a/raddb/certs/Makefile b/raddb/certs/Makefile
Andrew Geisslerc5535c92023-01-27 16:10:19 -060032index c9fbc9e864..d064fe252d 100644
Andrew Geissler748a4832020-07-24 16:24:21 -050033--- a/raddb/certs/Makefile
34+++ b/raddb/certs/Makefile
35@@ -92,7 +92,7 @@ server.csr server.key: server.cnf
36 chmod g+r server.key
37
Andrew Geisslerc5535c92023-01-27 16:10:19 -060038 server.crt: ca.key ca.pem server.csr
Andrew Geissler748a4832020-07-24 16:24:21 -050039- $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
40+ @[ -f server.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
41
42 server.p12: server.crt
43 $(OPENSSL) pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
44@@ -117,7 +117,7 @@ client.csr client.key: client.cnf
45 chmod g+r client.key
46
Andrew Geisslerc5535c92023-01-27 16:10:19 -060047 client.crt: ca.key ca.pem client.csr
Andrew Geissler748a4832020-07-24 16:24:21 -050048- $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
49+ @[ -f client.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
50
51 client.p12: client.crt
52 $(OPENSSL) pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
53--
Andrew Geisslerc5535c92023-01-27 16:10:19 -0600542.25.1
Andrew Geissler748a4832020-07-24 16:24:21 -050055