Skip to content

Commit a631fb2

Browse files
committed
CVPN-1554 Use WolfSSL private key patch
Use the official fix from WolfSSL PR: wolfSSL/wolfssl#8196 instead of our own implementation to enable private key fields in key share entry when we are using post-quantum KEM.
1 parent 0666efc commit a631fb2

File tree

3 files changed

+25
-33
lines changed

3 files changed

+25
-33
lines changed

wolfssl-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn copy_wolfssl(dest: &Path) -> std::io::Result<PathBuf> {
4444

4545
const PATCH_DIR: &str = "patches";
4646
const PATCHES: &[&str] = &[
47-
"disable-falcon-dilithium.patch",
47+
"include-private-key-fields-for-kyber.patch",
4848
"make-kyber-mlkem-available.patch",
4949
"fix-kyber-mlkem-benchmark.patch",
5050
"fix-mlkem-get-curve-name.patch",

wolfssl-sys/patches/disable-falcon-dilithium.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 5d61ca94c05561aefb11dfab4e15682c249c3746 Mon Sep 17 00:00:00 2001
2+
From: Sean Parkinson <[email protected]>
3+
Date: Mon, 18 Nov 2024 08:29:16 +1000
4+
Subject: [PATCH] KeyShareEntry: include private key fields for KYBER
5+
6+
Originallt HAVE_PQC and then changed to HAVE_FALCON and HAVE_DILITHIUM.
7+
The KEM PQC algorithm is actually KYBER.
8+
---
9+
wolfssl/internal.h | 2 +-
10+
1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+
diff --git a/wolfssl/internal.h b/wolfssl/internal.h
13+
index 70c99818e5..2519f09d8c 100644
14+
--- a/wolfssl/internal.h
15+
+++ b/wolfssl/internal.h
16+
@@ -3539,7 +3539,7 @@ typedef struct KeyShareEntry {
17+
word32 keyLen; /* Key size (bytes) */
18+
byte* pubKey; /* Public key */
19+
word32 pubKeyLen; /* Public key length */
20+
-#if !defined(NO_DH) || defined(HAVE_FALCON) || defined(HAVE_DILITHIUM)
21+
+#if !defined(NO_DH) || defined(WOLFSSL_HAVE_KYBER)
22+
byte* privKey; /* Private key - DH and PQ KEMs only */
23+
word32 privKeyLen;/* Only for PQ KEMs. */
24+
#endif

0 commit comments

Comments
 (0)