xref: /third_party/node/test/addons/openssl-providers/test-legacy-provider-option.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/openssl-providers/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../../common');
41cb0ef41Sopenharmony_ciconst providers = require('./providers.cjs');
51cb0ef41Sopenharmony_ciconst assert = require('node:assert');
61cb0ef41Sopenharmony_ciconst { fork } = require('node:child_process');
71cb0ef41Sopenharmony_ciconst { getFips } = require('node:crypto');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst option = '--openssl-legacy-provider';
101cb0ef41Sopenharmony_ciconst execArgv = process.execArgv;
111cb0ef41Sopenharmony_ciif (!execArgv.includes(option)) {
121cb0ef41Sopenharmony_ci  const cp = fork(__filename, { execArgv: [ option ] });
131cb0ef41Sopenharmony_ci  cp.on('exit', common.mustCall((code, signal) => {
141cb0ef41Sopenharmony_ci    assert.strictEqual(code, 0);
151cb0ef41Sopenharmony_ci    assert.strictEqual(signal, null);
161cb0ef41Sopenharmony_ci  }));
171cb0ef41Sopenharmony_ci  return;
181cb0ef41Sopenharmony_ci}
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ci// Enabling FIPS will make all legacy provider algorithms unavailable.
211cb0ef41Sopenharmony_ciif (getFips()) {
221cb0ef41Sopenharmony_ci  common.skip('this test cannot be run in FIPS mode');
231cb0ef41Sopenharmony_ci}
241cb0ef41Sopenharmony_ciproviders.testProviderPresent('legacy');
25

Indexes created Thu Nov 07 10:32:03 CST 2024