blob: 6055a9b4c47862390dc94bd9ff0f1966865d60df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasFipsCrypto) {
common.skip('node compiled without FIPS OpenSSL.');
return;
}
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/);
|