Skip to content

node v0.12 doesn't prompt for a PEM password. #61

@papertigers

Description

@papertigers

If your ssh-agent doesn't contain your key on node v0.10 and you use an sdc-* tool you are prompted for a password:

$ sdc-listimages
Enter PEM pass phrase:
140735298188048:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../deps/openssl/openssl/crypto/evp/evp_enc.c:544:
140735298188048:error:0906A065:PEM routines:PEM_do_header:bad decrypt:../deps/openssl/openssl/crypto/pem/pem_lib.c:483:

crypto.js:429
 var ret = this._binding.sign(toBuf(key));
                         ^
Error: SignFinal error
   at Sign.sign (crypto.js:429:27)
   at Object.signWithPrivateKey [as func] (/usr/local/lib/node_modules/smartdc/node_modules/smartdc-auth/lib/index.js:448:33)
   at /usr/local/lib/node_modules/smartdc/node_modules/smartdc-auth/node_modules/vasync/lib/vasync.js:190:20
   at process._tickCallback (node.js:442:13)

On node v0.12 if your agent is empty and you use an sdc-* tool you never get the prompt and just see the error message:

$ sdc-listimages
crypto.js:327
 var ret = this._handle.sign(toBuf(key), null, passphrase);
                        ^
Error: error:0906A068:PEM routines:PEM_do_header:bad password read
   at Error (native)
   at Sign.sign (crypto.js:327:26)
   at Object.signWithPrivateKey [as func] (/usr/local/lib/node_modules/smartdc/node_modules/smartdc-auth/lib/index.js:448:33)
   at Immediate._onImmediate (/usr/local/lib/node_modules/smartdc/node_modules/smartdc-auth/node_modules/vasync/lib/vasync.js:200:20)
   at processImmediate [as _immediateCallback] (timers.js:358:17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions