Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PKCS#5 AES-256-CBC encrypted private keys #50

Closed
wants to merge 1 commit into from

Commits on May 31, 2018

  1. Support PKCS#5 AES-256-CBC encrypted private keys

    Add support for parsing PKCS#5 private keys encrypted with AES-256-CBC. 
    Previous to this fix only 128 bits keys were supported:
    
    openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:6553 -outform pem -out key.priv
    openssl rsa -aes128 -in key.priv -passout pass:pass -out key128.priv.crypt
    openssl rsa -aes256 -in key.priv -passout pass:pass -out key256.priv.crypt
    
    sshpk.parsePrivateKey(fs.readFileSync('key128.priv.crypt'), 'pem', { passphrase : 'pass'})  // this also worked ok before this patch
    sshpk.parsePrivateKey(fs.readFileSync('key256.priv.crypt'), 'pem', { passphrase : 'pass'})  // this not, but now is ok
    nahuel committed May 31, 2018
    Copy the full SHA
    0b23fd3 View commit details
    Browse the repository at this point in the history