Skip to content

fix instantiation of key types and key_type_from_name - #34

Merged
pkittenis merged 3 commits into
ParallelSSH:masterfrom
enkore:keygen
Dec 4, 2020
Merged

fix instantiation of key types and key_type_from_name#34
pkittenis merged 3 commits into
ParallelSSH:masterfrom
enkore:keygen

Conversation

@enkore

@enkore enkore commented Nov 25, 2020

Copy link
Copy Markdown
Contributor
  • Fixed key_type_from_name
  • The KeyType classes were built in a somewhat weird way (though I understand this was probably due to them being cdef and the resulting restrictions, i.e. _type = ... simply isn't allowed on a cdef field, so things got awkward). Due to this, just doing "keytypes.RSAKey()" and using that object as a key type would always fail. This is now fixed. E.g. key.generate(keytypes.RSAKey(), 4096) works now.
  • Added Ed25519 key type.
  • Added examples/keygen.py. The resulting keys are directly interoperable with ssh(1) from OpenSSH.

(eref 42d478fb6976)

@pkittenis pkittenis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the interest.

Not sure this is the right way to approach this. The existing key types are cdefs so they can be typed. This removes that typing.

This looks like an issue with key.generate.

Comment thread examples/keygen.py
@enkore

enkore commented Dec 4, 2020

Copy link
Copy Markdown
Contributor Author

Good points, I redid the change using cdefs and added a test for this.

Comment thread ssh/keytypes.pyx Outdated
Comment thread ssh/keytypes.pyx Outdated
@pkittenis

Copy link
Copy Markdown
Member

Looks great, thanks for making these changes.

Couple more minor points in review.

@pkittenis
pkittenis merged commit 0050e88 into ParallelSSH:master Dec 4, 2020
@pkittenis

pkittenis commented Dec 4, 2020

Copy link
Copy Markdown
Member

Thanks for the contribution. 👍

Added another test for keygen which we did not have.

@enkore
enkore deleted the keygen branch December 4, 2020 16:21
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.

2 participants