Skip to content

Commit

Permalink
Allow empty key flags subpackets
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Jul 8, 2024
1 parent c25e074 commit 9bf9242
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions openpgp/packet/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,10 @@ func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (r
}
case keyFlagsSubpacket:
// Key flags, section 5.2.3.21
sig.FlagsValid = true
if len(subpacket) == 0 {
err = errors.StructuralError("empty key flags subpacket")
return
}
sig.FlagsValid = true
if subpacket[0]&KeyFlagCertify != 0 {
sig.FlagCertify = true
}
Expand Down

0 comments on commit 9bf9242

Please sign in to comment.