new file mode 100644
@@ -0,0 +1,43 @@
+From c59fad13330727ff65ce015055bc28cece4e38f7 Mon Sep 17 00:00:00 2001
+From: John Schanck <jschanck@mozilla.com>
+Date: Mon, 30 Sep 2024 17:01:39 +0000
+Subject: [PATCH] Bug 1921768 - allow null phKey in NSC_DeriveKey. r=rrelyea
+
+Differential Revision: https://phabricator.services.mozilla.com/D224134
+
+--HG--
+extra : moz-landing-system : lando
+
+CVE: CVE-2024-11705
+Upstream-Status: Backport [https://github.com/mozilla/nss/commit/c59fad13330727ff65ce015055bc28cece4e38f7]
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+---
+ nss/lib/softoken/pkcs11c.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/nss/lib/softoken/pkcs11c.c b/nss/lib/softoken/pkcs11c.c
+index f06c2b43c..76665e5a4 100644
+--- a/nss/lib/softoken/pkcs11c.c
++++ b/nss/lib/softoken/pkcs11c.c
+@@ -7273,8 +7273,9 @@ NSC_DeriveKey(CK_SESSION_HANDLE hSession,
+ /*
+ * now lets create an object to hang the attributes off of
+ */
+- if (phKey)
++ if (phKey) {
+ *phKey = CK_INVALID_HANDLE;
++ }
+
+ key = sftk_NewObject(slot); /* fill in the handle later */
+ if (key == NULL) {
+@@ -8820,7 +8821,9 @@ NSC_DeriveKey(CK_SESSION_HANDLE hSession,
+ crv = sftk_handleObject(key, session);
+ session->lastOpWasFIPS = key->isFIPS;
+ sftk_FreeSession(session);
+- *phKey = key->handle;
++ if (phKey) {
++ *phKey = key->handle;
++ }
+ sftk_FreeObject(key);
+ }
+ return crv;
@@ -38,6 +38,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/security/nss/releases/${VERSION_DIR}/src/$
file://0008-Bug-2083709-Remove-eMudhra-emSign-Root-CA-C1-and-emS.patch \
file://0009-Bug-2084101-Remove-eMudhra-emSign-Root-CA-G3-from-NS.patch \
file://CVE-2024-11704.patch \
+ file://CVE-2024-11705.patch \
"
SRC_URI[sha256sum] = "f549cc33d35c0601674bfacf7c6ad683c187595eb4125b423238d3e9aa4209ce"