-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
-@@ -163,7 +163,7 @@
+diff -r 7ec969250bfc src/pkg/crypto/openpgp/packet/signature.go
+--- a/src/pkg/crypto/openpgp/packet/signature.go Tue Dec 27 09:49:19 2011 -0500
++++ b/src/pkg/crypto/openpgp/packet/signature.go Fri Dec 30 22:56:55 2011 +0100
+@@ -164,7 +164,7 @@
const (
creationTimeSubpacket signatureSubpacketType = 2
signatureExpirationSubpacket signatureSubpacketType = 3
prefSymmetricAlgosSubpacket signatureSubpacketType = 11
issuerSubpacket signatureSubpacketType = 16
prefHashAlgosSubpacket signatureSubpacketType = 21
-@@ -235,7 +235,7 @@
+@@ -225,11 +225,7 @@
+ return
+ }
+ t := binary.BigEndian.Uint32(subpacket)
+- if t == 0 {
+- sig.CreationTime = time.Time{}
+- } else {
+- sig.CreationTime = time.Unix(int64(t), 0)
+- }
++ sig.CreationTime = time.Unix(int64(t), 0)
+ case signatureExpirationSubpacket:
+ // Signature expiration time, section 5.2.3.10
+ if !isHashed {
+@@ -241,7 +237,7 @@
}
sig.SigLifetimeSecs = new(uint32)
*sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket)
// Key expiration time, section 5.2.3.6
if !isHashed {
return
-@@ -541,10 +541,7 @@
-
- func (sig *Signature) buildSubpackets() (subpackets []outputSubpacket) {
- creationTime := make([]byte, 4)
-- creationTime[0] = byte(sig.CreationTime >> 24)
-- creationTime[1] = byte(sig.CreationTime >> 16)
-- creationTime[2] = byte(sig.CreationTime >> 8)
-- creationTime[3] = byte(sig.CreationTime)
-+ binary.BigEndian.PutUint32(creationTime, sig.CreationTime)
- subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime})
-
- if sig.IssuerKeyId != nil {
-@@ -553,5 +550,56 @@
+@@ -556,5 +552,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
+ 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 {