From 015bd25acaa44db9d3fe81f637bf2791403ec2d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:32:01 +0000 Subject: [PATCH] chore: sync ncrypto from Node.js v26.5.0 Node-Base-Commit: 2022edf3e32ce28ee08b17f8566243a090dacd95 Node-Target-Commit: bebd1b8d92bf4cc917844d6335ed1ecf9c2a75fb --- .github/sync-node-ncrypto.json | 2 +- include/ncrypto.h | 1 + src/ncrypto.cpp | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/sync-node-ncrypto.json b/.github/sync-node-ncrypto.json index 7c8001c..f41682b 100644 --- a/.github/sync-node-ncrypto.json +++ b/.github/sync-node-ncrypto.json @@ -1,3 +1,3 @@ { - "node_commit": "2022edf3e32ce28ee08b17f8566243a090dacd95" + "node_commit": "bebd1b8d92bf4cc917844d6335ed1ecf9c2a75fb" } diff --git a/include/ncrypto.h b/include/ncrypto.h index 8a817c1..f115c84 100644 --- a/include/ncrypto.h +++ b/include/ncrypto.h @@ -1238,6 +1238,7 @@ class SSLPointer final { std::optional getServerName() const; X509View getCertificate() const; EVPKeyPointer getPeerTempKey() const; + std::optional getNegotiatedGroup() const; const SSL_CIPHER* getCipher() const; bool isServer() const; diff --git a/src/ncrypto.cpp b/src/ncrypto.cpp index 16d9d89..51d45e7 100644 --- a/src/ncrypto.cpp +++ b/src/ncrypto.cpp @@ -3219,6 +3219,17 @@ EVPKeyPointer SSLPointer::getPeerTempKey() const { return EVPKeyPointer(raw_key); } +std::optional SSLPointer::getNegotiatedGroup() const { +#if OPENSSL_VERSION_PREREQ(3, 5) + if (!ssl_) return std::nullopt; + const char* group = SSL_get0_group_name(get()); + if (group == nullptr) return std::nullopt; + return group; +#else + return std::nullopt; +#endif +} + std::optional SSLPointer::getCipherName() const { auto cipher = getCipher(); if (cipher == nullptr) return std::nullopt;