Skip to content

Commit

Permalink
Rename Critical to IsCritical and HumanReadable to IsHumanReadable
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Jan 27, 2023
1 parent d115287 commit 08684b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion openpgp/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
6 changes: 3 additions & 3 deletions openpgp/packet/notation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions openpgp/packet/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -964,7 +964,7 @@ func (sig *Signature) buildSubpackets(issuer PublicKey) (subpackets []outputSubp
outputSubpacket{
true,
notationDataSubpacket,
notation.Critical,
notation.IsCritical,
notation.getData(),
})
}
Expand Down

0 comments on commit 08684b7

Please sign in to comment.