Skip to content

Commit

Permalink
Fix analyzing of subpacket in sig packet
Browse files Browse the repository at this point in the history
  • Loading branch information
spiegel-im-spiegel committed Nov 7, 2019
1 parent c433ca4 commit ebc1f54
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ require (
github.com/spf13/cobra v0.0.5
github.com/spiegel-im-spiegel/errs v0.3.2
github.com/spiegel-im-spiegel/gocli v0.10.1
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 h1:PDpCLFAH/YIX0QpHPf2eO7L4rC2OOirBrKtXTLLiNTY=
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
3 changes: 2 additions & 1 deletion packet/tags/sub27.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (s *sub27) Parse() (*info.Item, error) {
return rootInfo, errs.Wrap(err, "illegal flag")
}
rootInfo.Add(values.Flag2Item(flag&0x04, "This key may be used as an additional decryption subkey (ADSK)."))
rootInfo.Add(values.Flag2Item(flag&0xfb, fmt.Sprintf("Unknown flag2(%#02x)", flag&0xfb)))
rootInfo.Add(values.Flag2Item(flag&0x08, "This key may be used for timestamping."))
rootInfo.Add(values.Flag2Item(flag&0xf3, fmt.Sprintf("Unknown flag2(%#02x)", flag&0xf3)))
}

//other flags
Expand Down
5 changes: 5 additions & 0 deletions packet/tags/sub29.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func (s *sub29) Parse() (*info.Item, error) {
name = reasonNames.Get(int(code), "Unknown reason")
}
rootInfo.Value = fmt.Sprintf("%s (%d)", name, code)

if s.reader.Rest() > 0 {
b, _ := s.reader.Read2EOF()
rootInfo.Add(values.NewText(b, "Additional information").ToItem(s.cxt.Debug()))
}
return rootInfo, nil
}

Expand Down

0 comments on commit ebc1f54

Please sign in to comment.