You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SignFinal error no longer returned, instead returning a PEM routines:PEM_read_bio:no start line error #408
In fooling around with iojs v1.0.1, I ran the unit tests for GoogleCloudPlatform/gcloud-node which were passing on latest node 0.10.x and now a single test is no longer passing.
It appears that when attempting to sign a PEM, during a failure, a SignFinal error is no longer returned. Instead the error message returned is now error:0906D06C:PEM routines:PEM_read_bio:no start line. I've monkey-patched the test here: googleapis/google-cloud-node#346 but this doesn't handle any other sort of SignFinal error.
I looked at the changelog and it gave no indication that this was a breaking change so I'm assuming it was an unintentional change.
varcrypto=require('crypto');varpem='this is a bad key with no start line';varsign=crypto.createSign('RSA-SHA256');sign.update('abcdef');// datavarsig=sign.sign(pem,'hex');
On io.js v1.0.1 stacktrace:
# ~ $ node crypto-test.js
crypto.js:309
var ret = this._handle.sign(toBuf(key), null, passphrase);
^
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Error (native)
at Sign.sign (crypto.js:309:26)
at Object.<anonymous> (/Users/ryanseys/crypto-test.js:6:16)
at Module._compile (module.js:446:26)
at Object.Module._extensions..js (module.js:464:10)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
at Function.Module.runMain (module.js:487:10)
at startup (node.js:111:16)
at node.js:809:3
On node 0.10.33 stacktrace:
# ~ $ /usr/local/Cellar/node/0.10.33_1/bin/node crypto-test.js
140735116468992:error:0906D06C:PEM routines:PEM_read_bio:no start line:../deps/openssl/openssl/crypto/pem/pem_lib.c:703:Expecting: ANY PRIVATE KEY
crypto.js:429
var ret = this._binding.sign(toBuf(key));
^
Error: SignFinal error
at Sign.sign (crypto.js:429:27)
at Object.<anonymous> (/Users/ryanseys/crypto-test.js:6:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Thanks, I see what you're saying now. It's an intentional change actually, one that also exists in joyent/node@v0.11 (can't find the commit just now but the change was made sometime last year.)
Activity
bnoordhuis commentedon Jan 14, 2015
If you can put together a standalone test case (i.e. a single script that uses only core modules), I or @indutny will take a look. Thanks.
ryanseys commentedon Jan 14, 2015
Certainly! Here's a standalone test case:
On io.js v1.0.1 stacktrace:
On node 0.10.33 stacktrace:
bnoordhuis commentedon Jan 14, 2015
Thanks, I see what you're saying now. It's an intentional change actually, one that also exists in joyent/node@v0.11 (can't find the commit just now but the change was made sometime last year.)
ryanseys commentedon Jan 14, 2015
Ah, okay. I kinda figured that's what happened. I should have checked with the latest node 0.11.x first. Cheers!