-
Bug
-
Resolution: Fixed
-
Major
-
None
EC2 keypair fingerprints are generated in two different ways. Currently the EC2 plugin only recognizes keypairs generated via AWS. No imported keypairs are allowed.
If you generate a public key from the private using ssh-keygen (ssh-keygen -y -f privatekey.pem) and then upload the public key, the fingerprint is calculated off the public key instead of the private key.
You generate the same public key fingerprint that amazon gets via:
openssl rsa -in privatekey.pem -outform DER -pubout | openssl md5 -c
If I put in the ec2 plugin a private key that I generated and then uploaded the public key, the ec2 plugin cannot find the proper resulting fingerprint from the public key.
Could the plugin be updated to either allow entering a public key and private key or have it generate a public key fingerprint as well as the private key fingerprint and check for either?
[JENKINS-17683] Incorrect hash calculated for custom SSH keys
Description |
Original:
EC2 keypair fingerprints are generated in two different ways. Currently the EC2 plugin only recognizes keypairs generated via AWS. No imported keypairs are allowed. If AWS generates the keypair, the following command can generate the fingerprint resulting from the private key being hashed: openssl rsa -in privatekey.pem -outform DER -pubout | openssl sha1 -c If you generate a public key from the private using ssh-keygen (ssh-keygen -y -f privatekey.pem) and then upload the public key, the fingerprint is calculated off the public key instead of the private key. You generate the same public key fingerprint that amazon gets via: openssl rsa -in privatekey.pem -outform DER -pubout | openssl md5 -c If I put in the ec2 plugin a private key that I generated and then uploaded the public key, the ec2 plugin cannot find the proper resulting fingerprint from the public key. Could the plugin be updated to either allow entering a public key and private key or have it generate a public key fingerprint as well as the private key fingerprint and check for either? |
New:
EC2 keypair fingerprints are generated in two different ways. Currently the EC2 plugin only recognizes keypairs generated via AWS. No imported keypairs are allowed. If you generate a public key from the private using ssh-keygen (ssh-keygen -y -f privatekey.pem) and then upload the public key, the fingerprint is calculated off the public key instead of the private key. You generate the same public key fingerprint that amazon gets via: openssl rsa -in privatekey.pem -outform DER -pubout | openssl md5 -c If I put in the ec2 plugin a private key that I generated and then uploaded the public key, the ec2 plugin cannot find the proper resulting fingerprint from the public key. Could the plugin be updated to either allow entering a public key and private key or have it generate a public key fingerprint as well as the private key fingerprint and check for either? |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 148863 ] | New: JNJira + In-Review [ 192912 ] |
To convert an OpenSSH compatible public to to the PKCS#1 PEM encoded: ssh-keygen -f key.pub -e -m pem