summaryrefslogtreecommitdiff
path: root/external/xmlsec/xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1
blob: bf397bfb91784175da3dfd077ee2e3d8a3924d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 356fdcfaf6e126835ac3bd7f410a3fa4d4a6877b Mon Sep 17 00:00:00 2001
From: lsh123 <aleksey@aleksey.com>
Date: Sat, 13 Jan 2024 18:07:49 -0500
Subject: [PATCH] (xmlsec-nss) Ensure NSS algorithms are initialized (#754)

---
 src/nss/crypto.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/nss/crypto.c b/src/nss/crypto.c
index 6455ec72..7ba0c77a 100644
--- a/src/nss/crypto.c
+++ b/src/nss/crypto.c
@@ -361,8 +361,16 @@ xmlSecCryptoGetFunctions_nss(void) {
 
 static void
 xmlSecNssUpdateAvailableCryptoTransforms(xmlSecCryptoDLFunctionsPtr functions) {
+    SECStatus rv;
     xmlSecAssert(functions != NULL);
 
+    /* in theory NSS should be already initialized but just in case */
+    rv = SECOID_Init();
+    if (rv != SECSuccess) {
+        xmlSecNssError("SECOID_Init", NULL);
+        return;
+    }
+
     /******************************* AES ********************************/
     /* cbc */
     if (xmlSecNssCryptoCheckAlgorithm(SEC_OID_AES_128_CBC) == 0) {
-- 
2.35.3