Skip to content

Commit

Permalink
Skip other people signatures only if they have thrown an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkorin committed Aug 2, 2019
1 parent b785b22 commit 5ea49ae
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions openpgp/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,16 @@ EachPacket:
continue
}

// These are signatures by other people on this key. Let's just ignore them
// from the beginning, since they shouldn't affect our key decoding one way
// or the other.
if pkt.IssuerKeyId != nil && *pkt.IssuerKeyId != e.PrimaryKey.KeyId {
continue
}

// If this is a signature made by the keyholder, and the signature has stubbed out
// critical packets, then *now* we need to bail out.
if e := pkt.StubbedOutCriticalError; e != nil {
return nil, e
if err := pkt.StubbedOutCriticalError; err != nil {
// These are signatures by other people on this key. Let's just ignore them
// from the beginning, since they shouldn't affect our key decoding one way
// or the other.
if pkt.IssuerKeyId != nil && *pkt.IssuerKeyId != e.PrimaryKey.KeyId {
continue
}
// If this is a signature made by the keyholder, and the signature has stubbed out
// critical packets, then *now* we need to bail out.
return nil, err
}

// Next handle the case of a self-signature. According to RFC8440,
Expand Down

0 comments on commit 5ea49ae

Please sign in to comment.