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

pgpdump reports key expiration time as absolute instead of relative #24

Open
dkg opened this issue Jun 13, 2018 · 0 comments
Open

pgpdump reports key expiration time as absolute instead of relative #24

dkg opened this issue Jun 13, 2018 · 0 comments

Comments

@dkg
Copy link
Contributor

dkg commented Jun 13, 2018

pgpdump states a key expiration time subpacket as an absolute time in seconds since the epoch, but https://tools.ietf.org/html/rfc4880#section-5.2.3.6 indicates that it should be read as "seconds after key creation" instead. compare with gpg --list-packets:

0 dkg@alice:/tmp/cdtemp.Tvk0D4$ pgpdump < 000015-002.sig 
Old: Signature Packet(tag 2)(549 bytes)
	Ver 4 - new
	Sig type - Subkey Binding Signature(0x18).
	Pub alg - RSA Encrypt or Sign(pub 1)
	Hash alg - SHA512(hash 10)
	Hashed Sub: key flags(sub 27)(1 bytes)
		Flag - This key may be used for authentication
	Hashed Sub: signature creation time(sub 2)(4 bytes)
		Time - Wed Jan 21 15:54:17 EST 2015
	Hashed Sub: key expiration time(sub 9)(4 bytes)
		Time - Thu Aug  4 01:50:07 EDT 1977
	Sub: issuer key ID(sub 16)(8 bytes)
		Key ID - 0xCCD2ED94D21739E9
	Hash left 2 bytes - 98 20 
	RSA m^d mod n(4094 bits) - ...
		-> PKCS-1
0 dkg@alice:/tmp/cdtemp.Tvk0D4$ gpg2 --list-packets < 000015-002.sig 
# off=0 ctb=89 tag=2 hlen=3 plen=549
:signature packet: algo 1, keyid CCD2ED94D21739E9
	version 4, created 1421873657, md5len 0, sigclass 0x18
	digest algo 10, begin of digest 98 20
	hashed subpkt 27 len 1 (key flags: 20)
	hashed subpkt 2 len 4 (sig created 2015-01-21)
	hashed subpkt 9 len 4 (key expires after 7y217d5h50m)
	subpkt 16 len 8 (issuer key ID CCD2ED94D21739E9)
	data: [4094 bits]
0 dkg@alice:/tmp/cdtemp.Tvk0D4$ 

in particular, the claim about 1977 in pgpdump is bogus :)

it should either display the expiration date as a temporal offset, or it should calculate the actual absolute date.

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

No branches or pull requests

1 participant