From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Cc: Adolf Belka <adolf.belka@ipfire.org>
Subject: [PATCH] update.sh: Core 194 - increment ipsec serial file if x509 set exists
Date: Tue, 29 Apr 2025 12:10:49 +0200 [thread overview]
Message-ID: <20250429101049.10785-1-adolf.belka@ipfire.org> (raw)
- This is related to the fix patch set for bug13737. That patch set works with no problems
if the root/host x509 set is created for the first time with that patch set merged.
However if the x509 is already created previously then the contents of serial will
still be 01 instead of 02.
- This patch checks if the hostcert.pm file exists and that the index.txt file is empty,
and then increments the serial content from 01 to 02. This means that when the x509
is regenerated the system will not complain that 01 cannot be used as it has already
been revoked but will use 02 for the new host and everything works fine after that.
Fixes: bug13737
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
config/rootfiles/core/194/update.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/config/rootfiles/core/194/update.sh b/config/rootfiles/core/194/update.sh
index e1e9dde9b..2ab4ca2a2 100644
--- a/config/rootfiles/core/194/update.sh
+++ b/config/rootfiles/core/194/update.sh
@@ -103,6 +103,11 @@ ldconfig
# Filesytem cleanup
/usr/local/bin/filesystem-cleanup
+# Increment ipsec serial file if x509 certificates present and no content in index.txt
+if [ -e /var/ipfire/certs/hostcert.pm ] && [ -z /var/ipfire/certs/index.txt]; then
+ sed -i "s/01/02/" /var/ipfire/certs/serial
+fi
+
# Start services
/etc/init.d/ipsec restart
/etc/init.d/suricata restart
--
2.49.0
reply other threads:[~2025-04-29 10:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250429101049.10785-1-adolf.belka@ipfire.org \
--to=adolf.belka@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox