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

Generated keys are considered "weak" by github.com #127

Closed
doherty opened this issue Oct 16, 2017 · 3 comments
Closed

Generated keys are considered "weak" by github.com #127

doherty opened this issue Oct 16, 2017 · 3 comments

Comments

@doherty
Copy link

doherty commented Oct 16, 2017

I generated an RSA 2048 key following the instructions at Using PIV for SSH through PKCS11, e.g.

yubico-piv-tool -s 9a -a generate -k$key --pin-policy=once --touch-policy=always --algorithm=RSA2048 -o public.pem
yubico-piv-tool -a verify-pin -a selfsign-certificate -s 9a -S "/[email protected]/" -i public.pem -o cert.pem
yubico-piv-tool -a import-certificate -s 9a -i cert.pem  -k$key
ssh-keygen -D /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -e

When adding this key to github, it is rejected:

Key is weak. GitHub recommends using ssh-keygen to generate a RSA key of at least 2048 bits.

The same is true if using the GUI wrapper YubiKey PIV Manager.

However, generating and importing my own, the key is accepted:

ssh-keygen -t rsa -b 2048 -C "[email protected]"
yubico-piv-tool -s 9a -a import-key -k$key --pin-policy=once --touch-policy=always -i id_rsa_2.pem
openssl rsa -in id_rsa_2 -out id_rsa_2.pem -outform pem
yubico-piv-tool -s 9a -a import-key -k$key --pin-policy=once --touch-policy=always -i id_rsa_2.pem
yubico-piv-tool -a verify-pin -a selfsign-certificate -s 9a -S '/[email protected]/' -i id_rsa_2.pub.pkcs8 -o cert.pem
yubico-piv-tool -a import-certificate -s 9a -i cert.pem -k$key
ssh-keygen -D /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -e
@doherty
Copy link
Author

doherty commented Oct 16, 2017

Is github detecting keys affected by ysa-2017-01? (as a side note, how does one subscribe to yubico's security advisory notifications, like [email protected]?)

@klali
Copy link
Member

klali commented Oct 17, 2017

Yes, blocking generation of weak keys is happening, see cd11196 thanks for reminding us about pkcs11 though.

For notifications there is https://www.yubico.com/support/security-advisories/ but we plan to do better shortly.

@klali
Copy link
Member

klali commented Oct 17, 2017

version 1.4.4 blocking key generation for these keys has been released.

@klali klali closed this as completed Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants