diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2020-07-13 15:55:32 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-07-13 09:01:58 -0700 |
commit | 0d7522b7df80e45c379ad76addfddd51d0e56e9d (patch) | |
tree | 6d9448f2d3109e4736eda37ab2d2be2482a94dba /meta-networking | |
parent | 4b181cc35a09374d79b22e34048d8e104cd6788e (diff) | |
download | meta-openembedded-0d7522b7df80e45c379ad76addfddd51d0e56e9d.tar.gz |
freeradius: fix the existed certificate error
Fixes the occasional error:
# cd /etc/raddb/certs
# ./bootstrap
[snip]
openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key 'whatever' -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
Using configuration from ./client.cnf
Check that the request matches the signature
Signature ok
ERROR:There is already a certificate for /C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
The matching entry has the following details
Type :Valid
Expires on :200908024833Z
Serial Number :02
File name :unknown
Subject Name :/C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
make: *** [Makefile:128: client.crt] Error 1
Add the check to fix the above error and it does the same for server.crt.
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
2 files changed, 56 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/freeradius/files/0001-raddb-certs-Makefile-fix-the-existed-certificate-err.patch b/meta-networking/recipes-connectivity/freeradius/files/0001-raddb-certs-Makefile-fix-the-existed-certificate-err.patch new file mode 100644 index 000000000..669f363e7 --- /dev/null +++ b/meta-networking/recipes-connectivity/freeradius/files/0001-raddb-certs-Makefile-fix-the-existed-certificate-err.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 084f5467672f2ae37003b77e8f8706772f3da3ec Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Mon, 13 Jul 2020 07:01:45 +0000 | ||
4 | Subject: [PATCH] raddb/certs/Makefile: fix the existed certificate error | ||
5 | |||
6 | Fixes: | ||
7 | # ./bootstrap | ||
8 | [snip] | ||
9 | openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key 'whatever' -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf | ||
10 | Using configuration from ./client.cnf | ||
11 | Check that the request matches the signature | ||
12 | Signature ok | ||
13 | ERROR:There is already a certificate for /C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org | ||
14 | The matching entry has the following details | ||
15 | Type :Valid | ||
16 | Expires on :200908024833Z | ||
17 | Serial Number :02 | ||
18 | File name :unknown | ||
19 | Subject Name :/C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org | ||
20 | make: *** [Makefile:128: client.crt] Error 1 | ||
21 | |||
22 | Add the check to fix the above error and it does the same for server.crt. | ||
23 | |||
24 | Upstream-Status: Pending | ||
25 | |||
26 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
27 | --- | ||
28 | raddb/certs/Makefile | 4 ++-- | ||
29 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
30 | |||
31 | diff --git a/raddb/certs/Makefile b/raddb/certs/Makefile | ||
32 | index 5cbfd467ce..77eec9baa1 100644 | ||
33 | --- 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 | |||
38 | server.crt: server.csr ca.key ca.pem | ||
39 | - $(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 | |||
47 | client.crt: client.csr ca.pem ca.key | ||
48 | - $(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 | -- | ||
54 | 2.26.2 | ||
55 | |||
diff --git a/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.20.bb b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.20.bb index 005ca47da..d2046d72e 100644 --- a/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.20.bb +++ b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.20.bb | |||
@@ -27,6 +27,7 @@ SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.0.x;lfs=0 | |||
27 | file://freeradius-fix-error-for-expansion-of-macro.patch \ | 27 | file://freeradius-fix-error-for-expansion-of-macro.patch \ |
28 | file://0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \ | 28 | file://0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \ |
29 | file://0001-rlm_python3-add-PY_INC_DIR-in-search-dir.patch \ | 29 | file://0001-rlm_python3-add-PY_INC_DIR-in-search-dir.patch \ |
30 | file://0001-raddb-certs-Makefile-fix-the-existed-certificate-err.patch \ | ||
30 | file://radiusd.service \ | 31 | file://radiusd.service \ |
31 | file://radiusd-volatiles.conf \ | 32 | file://radiusd-volatiles.conf \ |
32 | " | 33 | " |