mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 06:31:11 +00:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
20 lines
485 B
JavaScript
20 lines
485 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasFipsCrypto)
|
|
common.skip('node compiled without FIPS OpenSSL.');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
const fs = require('fs');
|
|
|
|
const input = 'hello';
|
|
|
|
const dsapri = fs.readFileSync(
|
|
`${common.fixturesDir}/keys/dsa_private_1025.pem`);
|
|
const sign = crypto.createSign('DSS1');
|
|
sign.update(input);
|
|
|
|
assert.throws(function() {
|
|
sign.sign(dsapri);
|
|
}, /PEM_read_bio_PrivateKey failed/);
|