mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 18:53:34 +00:00

Add basic tests for providers when using OpenSSL 3.x. PR-URL: https://github.com/nodejs/node/pull/44148 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
25 lines
732 B
JavaScript
25 lines
732 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const providers = require('./providers.cjs');
|
|
const assert = require('node:assert');
|
|
const { fork } = require('node:child_process');
|
|
const { getFips } = require('node:crypto');
|
|
|
|
const option = '--openssl-legacy-provider';
|
|
const execArgv = process.execArgv;
|
|
if (!execArgv.includes(option)) {
|
|
const cp = fork(__filename, { execArgv: [ option ] });
|
|
cp.on('exit', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, 0);
|
|
assert.strictEqual(signal, null);
|
|
}));
|
|
return;
|
|
}
|
|
|
|
// Enabling FIPS will make all legacy provider algorithms unavailable.
|
|
if (getFips()) {
|
|
common.skip('this test cannot be run in FIPS mode');
|
|
}
|
|
providers.testProviderPresent('legacy');
|