mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 00:19:41 +00:00

Replace `common.fixturesDir` with usage of the `common.fixtures` module PR-URL: https://github.com/nodejs/node/pull/15950 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
20 lines
479 B
JavaScript
20 lines
479 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
if (!common.hasFipsCrypto)
|
|
common.skip('node compiled without FIPS OpenSSL.');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
const input = 'hello';
|
|
|
|
const dsapri = fixtures.readKey('dsa_private_1025.pem');
|
|
const sign = crypto.createSign('SHA1');
|
|
sign.update(input);
|
|
|
|
assert.throws(function() {
|
|
sign.sign(dsapri);
|
|
}, /PEM_read_bio_PrivateKey failed/);
|