public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Wouters <paul.wouters@aiven.io>
To: git-commits@fedoraproject.org
Subject: [rpms/libreswan] f43: Fix automated passwordless "ipsec import" suppor for PKCS12 files
Date: Wed, 28 Oct 2026 21:18:04 GMT	[thread overview]
Message-ID: <179322228428.1.93636705681726154.rpms-libreswan-997497002692@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/libreswan
Branch : f43
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=f43

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 \

                 reply	other threads:[~2026-10-28 21:18 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=179322228428.1.93636705681726154.rpms-libreswan-997497002692@fedoraproject.org \
    --to=paul.wouters@aiven.io \
    --cc=git-commits@fedoraproject.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