GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix crypto-dh error message for OpenSSL 3.x · nodejs/node@41ca113

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-crypto-dh.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-crypto-dh.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-dh.js
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,15 @@ const crypto = require('crypto');
8585
}, wrongBlockLength);
8686
}
8787

88-
assert.throws(() => {
89-
dh3.computeSecret('');
90-
}, { message: common.hasOpenSSL3 ?
91-
'error:02800080:Diffie-Hellman routines::invalid secret' :
92-
'Supplied key is too small' });
88+
{
89+
const v = crypto.constants.OPENSSL_VERSION_NUMBER;
90+
const hasOpenSSL3WithNewErrorMessage = (v >= 0x300000c0 && v <= 0x30100000) || (v >= 0x30100040 && v <= 0x30200000);
91+
assert.throws(() => {
92+
dh3.computeSecret('');
93+
}, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ?
94+
'error:02800080:Diffie-Hellman routines::invalid secret' :
95+
'Supplied key is too small' });
96+
}
9397
}
9498

9599
// Through a fluke of history, g=0 defaults to DH_GENERATOR (2).

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.