Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/sync-node-ncrypto.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"node_commit": "2022edf3e32ce28ee08b17f8566243a090dacd95"
"node_commit": "bebd1b8d92bf4cc917844d6335ed1ecf9c2a75fb"
}
1 change: 1 addition & 0 deletions include/ncrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ class SSLPointer final {
std::optional<const std::string_view> getServerName() const;
X509View getCertificate() const;
EVPKeyPointer getPeerTempKey() const;
std::optional<std::string_view> getNegotiatedGroup() const;
const SSL_CIPHER* getCipher() const;
bool isServer() const;

Expand Down
11 changes: 11 additions & 0 deletions src/ncrypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3219,6 +3219,17 @@ EVPKeyPointer SSLPointer::getPeerTempKey() const {
return EVPKeyPointer(raw_key);
}

std::optional<std::string_view> 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<std::string_view> SSLPointer::getCipherName() const {
auto cipher = getCipher();
if (cipher == nullptr) return std::nullopt;
Expand Down
Loading