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

Change DSA test key format + adopt test code #264

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Aug 5, 2020

Fixes issue #:
Related #261, #251

Description of the changes being introduced by the pull request:
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 PR 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.

Please verify and check that the pull request fulfils the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

@lukpueh lukpueh requested a review from joshuagl August 5, 2020 11:56
@coveralls
Copy link

coveralls commented Aug 5, 2020

Coverage Status

Coverage increased (+0.0005%) to 98.95% when pulling 15028a4 on lukpueh:fix-gpg-dsa-test into a7308f0 on secure-systems-lab:master.

Copy link
Collaborator

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for resolving this issue @lukpueh !

cryptography for the sake of comparison """
since there's very little we can do to check key parameters are right
we pre-exported the public key to an x.509 SubjectPublicKeyInfo key,
which we can load with cryptography for the sake of comparison """

# export our gpg key, using our functions
key_data = export_pubkey(self.default_keyid, homedir=self.gnupg_home)
our_exported_key = dsa_create_pubkey(key_data)

# load the equivalent ssh key, and make sure that we get the same RSA key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is not an ssh key any more, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and not an rsa key either. 🤦 thanks for catching!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and squashed into 492f7e5

lukpueh and others added 2 commits August 6, 2020 13:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants