From: nsz Date: Wed, 30 Nov 2011 22:45:04 +0000 (+0100) Subject: signature subpacket patch: mark expiration time as critical X-Git-Url: http://nsz.repo.hu/git/?p=epoint;a=commitdiff_plain;h=183f73d4d76d3a9433343d1d4b0be251e77e4c50 signature subpacket patch: mark expiration time as critical --- diff --git a/patches/sig.diff b/patches/sig.diff index 07ef97f..3aa7e85 100644 --- a/patches/sig.diff +++ b/patches/sig.diff @@ -1,6 +1,6 @@ diff -r 221f3eb76b52 src/pkg/crypto/openpgp/packet/signature.go --- a/src/pkg/crypto/openpgp/packet/signature.go Thu Nov 24 08:51:47 2011 -0800 -+++ b/src/pkg/crypto/openpgp/packet/signature.go Wed Nov 30 21:54:03 2011 +0100 ++++ b/src/pkg/crypto/openpgp/packet/signature.go Wed Nov 30 23:44:34 2011 +0100 @@ -163,7 +163,7 @@ const ( creationTimeSubpacket signatureSubpacketType = 2 @@ -31,14 +31,15 @@ diff -r 221f3eb76b52 src/pkg/crypto/openpgp/packet/signature.go subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime}) if sig.IssuerKeyId != nil { -@@ -553,5 +550,56 @@ +@@ -553,5 +550,59 @@ subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) } + if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 { + sigLifetime := make([]byte, 4) + binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs) -+ subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, false, sigLifetime}) ++ // signature expiration is marked as critical ++ subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime}) + } + + // The following subpackets may only appear in self-signatures @@ -46,7 +47,9 @@ diff -r 221f3eb76b52 src/pkg/crypto/openpgp/packet/signature.go + if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 { + keyLifetime := make([]byte, 4) + binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs) -+ subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, false, keyLifetime}) ++ // TODO: ++ // key expiration is marked as critical ++ subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime}) + } + + if sig.IsPrimaryId != nil && *sig.IsPrimaryId {