1 diff -r 221f3eb76b52 src/pkg/crypto/openpgp/packet/signature.go
2 --- a/src/pkg/crypto/openpgp/packet/signature.go Thu Nov 24 08:51:47 2011 -0800
3 +++ b/src/pkg/crypto/openpgp/packet/signature.go Fri Dec 02 01:39:57 2011 +0100
5 // parseSignatureSubpackets parses subpackets of the main signature packet. See
6 // RFC 4880, section 5.2.3.1.
7 func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) {
8 + hasCreationTime := false
10 for len(subpackets) > 0 {
11 - subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed)
12 + var packetType signatureSubpacketType
14 + packetType, subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed)
18 + if packetType == creationTimeSubpacket {
19 + hasCreationTime = true
23 - if sig.CreationTime == 0 {
24 + if !hasCreationTime {
25 err = error_.StructuralError("no creation time in signature")
31 // parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1.
32 -func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) {
33 +func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (packetType signatureSubpacketType, rest []byte, err error) {
34 // RFC 4880, section 5.2.3.1
37 - packetType signatureSubpacketType