2015-11-12 20:49:21 -05:00
|
|
|
'use strict';
|
2016-12-30 18:38:06 -05:00
|
|
|
const common = require('../common');
|
2017-10-06 11:24:51 -06:00
|
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
|
2017-07-01 02:29:09 +03:00
|
|
|
if (!common.hasFipsCrypto)
|
2016-05-11 15:34:52 -04:00
|
|
|
common.skip('node compiled without FIPS OpenSSL.');
|
2015-11-12 20:49:21 -05:00
|
|
|
|
2017-07-01 02:29:09 +03:00
|
|
|
const assert = require('assert');
|
2016-12-30 18:38:06 -05:00
|
|
|
const crypto = require('crypto');
|
2015-11-12 20:49:21 -05:00
|
|
|
|
2017-01-08 13:19:00 +00:00
|
|
|
const input = 'hello';
|
2015-11-12 20:49:21 -05:00
|
|
|
|
2017-10-06 11:24:51 -06:00
|
|
|
const dsapri = fixtures.readKey('dsa_private_1025.pem');
|
2017-09-09 18:41:56 -04:00
|
|
|
const sign = crypto.createSign('SHA1');
|
2015-11-12 20:49:21 -05:00
|
|
|
sign.update(input);
|
|
|
|
|
|
|
|
assert.throws(function() {
|
|
|
|
sign.sign(dsapri);
|
|
|
|
}, /PEM_read_bio_PrivateKey failed/);
|