public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libreswan] f44: Fix automated passwordless "ipsec import" suppor for PKCS12 files
@ 2026-10-28 21:17 Paul Wouters
  0 siblings, 0 replies; only message in thread
From: Paul Wouters @ 2026-10-28 21:17 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libreswan
Branch : f44
Commit : 9974970026924959749ee409f4036c1b8668afac
Author : Paul Wouters <paul.wouters@aiven.io>
Date   : 2026-10-28T17:10:12-04:00
Stats  : +31/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libreswan/c/9974970026924959749ee409f4036c1b8668afac?branch=f44

Log:
Fix automated passwordless "ipsec import" suppor for PKCS12 files

---
diff --git a/libreswan-5.4.1-ipsec_import.patch b/libreswan-5.4.1-ipsec_import.patch
new file mode 100644
index 0000000..06f449c
--- /dev/null
+++ b/libreswan-5.4.1-ipsec_import.patch
@@ -0,0 +1,28 @@
+commit 1437a2158a96a91bc606578e504ae20fa3757485
+Author: Paul Wouters <paul.wouters@aiven.io>
+Date:   Wed Oct 28 17:03:48 2026 -0400
+
+    ipsec import: fix automated passwordless pkcs12 import
+    
+    If the nss db has no password and the pkcs12 file has no passwd,
+    import it without prompting or needing a tty.
+
+diff --git a/programs/ipsec/ipsec.in b/programs/ipsec/ipsec.in
+index ca5ce0ca05..5eb67e2239 100755
+--- a/programs/ipsec/ipsec.in
++++ b/programs/ipsec/ipsec.in
+@@ -755,7 +755,13 @@ ipsec_import() {
+ 	    exit 1
+ 	fi
+ 
+-	@@PK12UTIL@@ -i "${pkcs12bundle}" -d "${IPSEC_NSSDIR_SQL}"
++	# First try blanc password to avoid uselessly prompting interactively
++	@@PK12UTIL@@ -i "${pkcs12bundle}" -d "${IPSEC_NSSDIR_SQL}" -W '' -K '' 2>/dev/null
++	if [ $? -gt 0 ]; then
++	    # Not the empty password for either nss db or pkcs12 file, so prompt user
++	    @@PK12UTIL@@ -i "${pkcs12bundle}" -d "${IPSEC_NSSDIR_SQL}"
++	fi
++
+ 	# check and correct trust bits
+ 	set_nss_db_trusts
+ 	exit 0

diff --git a/libreswan.spec b/libreswan.spec
index 32f2e7c..39c73a0 100644
--- a/libreswan.spec
+++ b/libreswan.spec
@@ -44,6 +44,8 @@ Source3: https://download.libreswan.org/cavs/ikev1_dsa.fax.bz2
 Source4: https://download.libreswan.org/cavs/ikev1_psk.fax.bz2
 Source5: https://download.libreswan.org/cavs/ikev2.fax.bz2
 %endif
+# https://github.com/libreswan/libreswan/commit/1437a2158a96a91bc606578e504ae20fa3757485
+Patch1: libreswan-5.4.1-ipsec_import.patch
 
 BuildRequires: audit-libs-devel
 BuildRequires: bison
@@ -136,6 +138,7 @@ sed -i "s:#[ ]*include \(.*\)\(/crypto-policies/back-ends/libreswan.config\)$:in
 # throws error on s390x
 sed -i "s/SUBDIRS += hunkcheck/#SUBDIRS += hunkcheck/" testing/programs/Makefile
 %endif
+%autopatch -p1
 
 %build
 %make_build \

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-28 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 21:17 [rpms/libreswan] f44: Fix automated passwordless "ipsec import" suppor for PKCS12 files Paul Wouters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox