Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c42935b

Browse filesBrowse files
davidbenevanlucas
authored andcommitted
crypto: add compat logic for "DSS1" and "dss1"
In OpenSSL 1.1.0, EVP_dss1() is removed. These hash names were exposed in Node's public API, so add compatibility hooks for them. PR-URL: #16130 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent 5c24fc3 commit c42935b
Copy full SHA for c42935b

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4080,6 +4080,14 @@ SignBase::~SignBase() {
40804080

40814081
SignBase::Error SignBase::Init(const char* sign_type) {
40824082
CHECK_EQ(mdctx_, nullptr);
4083+
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
4084+
// Historically, "dss1" and "DSS1" were DSA aliases for SHA-1
4085+
// exposed through the public API.
4086+
if (strcmp(sign_type, "dss1") == 0 ||
4087+
strcmp(sign_type, "DSS1") == 0) {
4088+
sign_type = "SHA1";
4089+
}
4090+
#endif
40834091
const EVP_MD* md = EVP_get_digestbyname(sign_type);
40844092
if (md == nullptr)
40854093
return kSignUnknownDigest;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.