toofishes / python-pgpdump

PGP packet parser library
Other
55 stars 26 forks source link

Support SecretKey (and SecretSubKey) packets (w/ tests) #10

Closed abeluck closed 11 years ago

abeluck commented 12 years ago

I've added parsing of Secret[Sub]Key packets. You can parse nearly all data fields (except count and checksum).

If the packets are not protected, you can even access the raw private key material. If the packets are protected (i.e., encrypted) you cannot. In the future I might add support for decrypting the encrypted packets, but that would be quite some work as there are a bunch of cipher and hash algos.

FYI: you can export unprotected subkey packets with the following gnupg options: --export-options export-reset-subkey-passwd,export-minimal --export-secret-subkeys KEYID

abeluck commented 12 years ago

In case you're interested, Guardian Project will be using this in our OTR file converter utility, with the end goal of keeping your OTR key in your PGP keyring as a subkey for central identity management.

toofishes commented 12 years ago

I took only a quick glance at this, but thanks! I'll definitely be merging the work when I get a chance to review it a bit more.

Quick note- I noticed you used a lot of end-of-line comments. I tend to be biased against these, so adjusting them to match the commenting style elsewhere would be great.

abeluck commented 12 years ago

Dan McGee:

I took only a quick glance at this, but thanks! I'll definitely be merging the work when I get a chance to review it a bit more.

Great!

Quick note- I noticed you used a lot of end-of-line comments. I tend to be biased against these, so adjusting them to match the commenting style elsewhere would be great.

Ah yea, I meant to clean those up. I tend to use EOL comments when working through the spec just so I can remember wtf I'm doing. I'll update the request shortly.

abeluck commented 11 years ago

Heya toofishes, it took awhlie, but I finally got around to cleaning up the comments.

We'd love to get this merged into an upcoming release if possible, so we can rely on pgpdump on pypi as a dependency :)

Let me know if there are any other outstanding concerns

toofishes commented 11 years ago

Sure; I'll try to review and merge this weekend and get another tagged release out the door. Thanks again!

toofishes commented 11 years ago

Most of this is on master; I didn't do a merge of the branch so I could tweak the commits a bit to ensure Python 3 compatibility. Let me know if I missed anything.

abeluck commented 11 years ago

Superb, thanks so much @toofishes