Repository navigation
Conversation
acd67d6 to
8d69824
Compare
|
Fixed line length and code style issues using |
ec836bd to
de56ba9
Compare
eb55e4d to
5c8feb8
Compare
|
@ploxiln Is this feature something you would be interested in merging into |
|
Yes ... but my fork has new-openssh-format support, and that new format has the key type string sort of in the middle. I may want more refactoring in order to avoid copying a significant chunk of the new-format parsing code. (There is also a bit of round-about-ness converting between a file-object and a list of lines, which I might prefer some refactoring of... for example, |
|
It seems that for this feature to work without doing redundant work (doing multiple passes over the file content), it's necessary to split out significant parts of logic from the While reading the code, I didn't much like the ping-ponging of logic between |
|
The helper methods on the PKey class are very similar to just having helper functions in pkey.py ... but they also organize and reference constants like |
5c8feb8 to
5cfe07e
Compare
|
I rebased this on paramiko master; merging #1343 invalidated the old patch. The new work is mostly based on ploxiln#57 but still has some rough edges. In particular, #1567 should be merged before this. Until then, some tests are broken. |
|
Thanks for this, I like the overall idea here, though I haven't yet read the entire patch in depth. Basic thoughts:
|
|
My initial thoughts:
The reason I didn't want to do it like that is because that would create a circular dependency between I'm open to renaming this API but I don't particularly like the name (I also dislike how paramiko mixes private and public keys in one class. Lumping more stuff into one class only makes that worse. Although the breakage from "fixing" that is probably not worth it)
It shouldn't. The |
5cfe07e to
255b95a
Compare
|
I created a separate PR #1571 to unify duplicated logic in Ed25519Key, that refactor doesn't really belong in this PR. |
The Ed25519Key class contained key parsing and decryption logic for OPENSSH-format keys before that code became generic. Now that paramiko#1343 is merged, this logic becomes redundant and can be removed. This cleanup was extracted from ploxiln#13 and the original author @ploxiln is credited as commit author even though I (@intgr) am submitting this pull request. Signed-off-by: Marti Raudsepp <[email protected]>
255b95a to
82e69f0
Compare
Two new functions were created: * load_private_key(key_str, password=None) * load_private_key_file(filename, password=None) Previously there was no way to auto-load any key type. Many downstream users re-implemented this logic themselves, which is pointless duplication and could easily become outdated when new key types are added. This functionality required a significant refactoring of key creation code paths, but none of the public interfaces have changed. Signed-off-by: Marti Raudsepp <[email protected]>
82e69f0 to
15522b9
Compare
|
I see this hasn't been worked on in a few months. Wondering what can be done to move it along. Right now I'm going to have to ask users of our application to manually input the type of key they are using. Not an ideal solution. |
|
This PR depends on the refactoring in #1571 -- getting that merged would be the first step. @bitprophet Have you had a chance to look at it? |
|
@Apreche I was recently made aware of this post by bitprophet (maintainer of Paramiko): http://bitprophet.org/blog/2020/07/02/help-wanted/ So maybe if you or someone else steps up to review #1571 and this PR, it can be sped up. Although few people are familiar with the project's coding style, I'm not sure how helpful code review by independent developers could be. |
|
@intgr I'd love to help with this, but I'm not sure how much help I can be. The PRs look fine to me from a Python perspective, but I have no familiarity with the projects themselves or their architecture to make any further judgements. |
Previously there was no way to auto-load any key type. Many downstream
users re-implemented this logic themselves, which is pointless
duplication and could easily become outdated when new key types are
added.
It's also likely that they will implement it badly, for example: https://github.com/tokoyami/pySCP/blob/c4c3ac7ec39965e0fe4274e8e43428a9210988c7/connector.py#L13-L29 :)
Two new functions were created:
This functionality required a significant refactoring of key creation
code paths, but none of the public interfaces have changed.