-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Why does SSH support only 1024 bit DSA keys in 3.0? #5373
Comments
Because OpenSSH supports only 1024-bit DSA keys. If there are other SSH server that support other lengths, then it would be OK to relax it. |
Basically, this has to do with RFC 4253 mandating that SHA-1 be used as a hash for the "ssh-dss" signature blob. More detail about this can be found in https://bugzilla.mindrot.org/show_bug.cgi?id=1647. |
Thanks for the quick reply and the pointer! I wasn't aware of that restriction. We were using the ssh format only to store a DSA public key from a test gpg keychain as stand-alone file. I guess we can close this issue. |
DSA is also slowly being deprecated and removed from the ecosystem (for example, Go: golang/go#40337). We have no plans for removal on our end at this time, but similarly we're not interested in expanding DSA support further. |
A recent pyca/cryptography update dropped support for DSA ssh public keys with bit size other than 1024, which broke our tests. See pyca/cryptography#5373 This commit changes the test key format to X.509 SubjectPublicKeyInfo PEM and updates the corresponding test code. ``` ssh-keygen -f C242A830DAAF1C2BEF604A9EF033A3A3E267B3B1.ssh \ -e -m pkcs8 > C242A830DAAF1C2BEF604A9EF033A3A3E267B3B1.pem ``` Note: ssh-keygen mistakingly calls the format pkcs8 although it is X.509 SubjectPublicKeyInfo PEM.
A recent pyca/cryptography update dropped support for DSA ssh public keys with bit size other than 1024, which broke our tests. See pyca/cryptography#5373 This commit changes the test key format to X.509 SubjectPublicKeyInfo PEM and updates the corresponding test code. ``` ssh-keygen -f C242A830DAAF1C2BEF604A9EF033A3A3E267B3B1.ssh \ -e -m pkcs8 > C242A830DAAF1C2BEF604A9EF033A3A3E267B3B1.pem ``` Note: ssh-keygen mistakingly calls the format pkcs8 although it is X.509 SubjectPublicKeyInfo PEM.
Is there a reason why the ssh serialization module does not support DSA keys with a bit length greater than 1024 in cryptography version 3.0? I could not find any information in the corresponding PR (#5146), git log or changelog.
These are the relevant lines that were released in 3.0.
cryptography/src/cryptography/hazmat/primitives/serialization/ssh.py
Lines 330 to 333 in 143f56f
And here is a serialization/deserialization snippet that worked fine on cryptography 2.9 but raises said ValueError in 3.0:
Context:
The update just broke some test code in a project I maintain (secure-systems-lab/securesystemslib#261). I'm fine in changing the test code, I just wanted to know if the change was intentional? Thanks! :)
(cc @markokr, @reaperhulk, @joshuagl)
The text was updated successfully, but these errors were encountered: