Skip to content

Commit

Permalink
gopasspwgh-1917: SubKey Capabilities are also in PrimaryKey Caps (upp…
Browse files Browse the repository at this point in the history
…ercase)

RELEASE_NOTES=[FEATURE] Parse GPG-PrimaryKeyCaps for the entire Key and subKeys

Signed-off-by: Thomas Mantl <thomas.mantl@redgears.net>
  • Loading branch information
TM2500 committed Nov 25, 2021
1 parent a3fe25c commit a9e0509
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/backend/crypto/gpg/colons/parse_colons.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,20 @@ func Parse(reader io.Reader) gpg.KeyList {

func parseKeyCaps(field string) gpg.Capabilities {
keycaps := gpg.Capabilities{}
caps := strings.ToLower(field)

if strings.Contains(caps, "S") {
if strings.Contains(field, "S") {
keycaps.Sign = true
}
if strings.Contains(caps, "E") {
if strings.Contains(field, "E") {
keycaps.Encrypt = true
}
if strings.Contains(caps, "C") {
if strings.Contains(field, "C") {
keycaps.Certify = true
}
if strings.Contains(caps, "A") {
if strings.Contains(field, "A") {
keycaps.Authentication = true
}
if strings.Contains(caps, "D") {
if strings.Contains(field, "D") {
keycaps.Deactivated = true
}

Expand Down

0 comments on commit a9e0509

Please sign in to comment.