From 08684b70d64713df2a8b1ef2c2c6bc7a73dea92b Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Fri, 27 Jan 2023 16:29:45 +0100 Subject: [PATCH] Rename Critical to IsCritical and HumanReadable to IsHumanReadable --- openpgp/keys_test.go | 2 +- openpgp/packet/notation.go | 6 +++--- openpgp/packet/signature.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openpgp/keys_test.go b/openpgp/keys_test.go index 186df7356..357f76100 100644 --- a/openpgp/keys_test.go +++ b/openpgp/keys_test.go @@ -998,7 +998,7 @@ func assertNotationPackets(t *testing.T, keys EntityList) { t.Fatalf("got %d Data Notation subpackets, expected %d", numSigs, numExpected) } - if notations[0].HumanReadable != true { + if notations[0].IsHumanReadable != true { t.Fatalf("got false, expected true") } diff --git a/openpgp/packet/notation.go b/openpgp/packet/notation.go index 5c215c2eb..f4bd97b26 100644 --- a/openpgp/packet/notation.go +++ b/openpgp/packet/notation.go @@ -5,8 +5,8 @@ package packet type Notation struct { Name string Value []byte - Critical bool - HumanReadable bool + IsCritical bool + IsHumanReadable bool } func (not *Notation) getData() []byte { @@ -15,7 +15,7 @@ func (not *Notation) getData() []byte { valueLen := len(not.Value) data := make([]byte, 8 + nameLen + valueLen) - if not.HumanReadable { + if not.IsHumanReadable { data[0] = 0x80 } diff --git a/openpgp/packet/signature.go b/openpgp/packet/signature.go index 235401113..8cd890269 100644 --- a/openpgp/packet/signature.go +++ b/openpgp/packet/signature.go @@ -380,10 +380,10 @@ func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (r } notation := Notation{ - HumanReadable: (subpacket[0] & 0x80) == 0x80, + IsHumanReadable: (subpacket[0] & 0x80) == 0x80, Name: string(subpacket[8: (nameLength + 8)]), Value: subpacket[(nameLength + 8) : (valueLength + nameLength + 8)], - Critical: isCritical, + IsCritical: isCritical, } sig.Notations = append(sig.Notations, notation) @@ -964,7 +964,7 @@ func (sig *Signature) buildSubpackets(issuer PublicKey) (subpackets []outputSubp outputSubpacket{ true, notationDataSubpacket, - notation.Critical, + notation.IsCritical, notation.getData(), }) }