crypto: check for OpenSSL errors when signing
authorP.S.V.R <pmq2001@gmail.com>
Tue, 18 Aug 2015 02:32:21 +0000 (10:32 +0800)
committerFedor Indutny <fedor@indutny.com>
Tue, 18 Aug 2015 04:38:12 +0000 (21:38 -0700)
commit00bffa6c758038dca039fd9114912c0430114c08
treecb4fe9c885bf7d936c78a6f142cea63d58c68a36
parent102939ada5bda712993541ef2a3bedd5b31316d2
crypto: check for OpenSSL errors when signing

Errors might be injected into OpenSSL's error stack
without the return value of `PEM_read_bio_PrivateKey` being set to
`nullptr`. See the test of `test_bad_rsa_privkey.pem` for an
example.

PR-URL: https://github.com/nodejs/node/pull/2342
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/node_crypto.cc
test/fixtures/test_bad_rsa_privkey.pem [new file with mode: 0644]
test/parallel/test-crypto.js