-
Notifications
You must be signed in to change notification settings - Fork 120
KeyID calculation appears to assume v4 fingerprints #268
Copy link
Copy link
Closed
Description
public_key.go returns string slices of the fingerprint for long and short KeyIDs, but the slice offsets assume v4 fingerprints:
// KeyIdString returns the public key's fingerprint in capital hex
// (e.g. "6C7EE1B8621CC013").
func (pk *PublicKey) KeyIdString() string {
return fmt.Sprintf("%X", pk.Fingerprint[12:20])
}
// KeyIdShortString returns the short form of public key's fingerprint
// in capital hex, as shown by gpg --list-keys (e.g. "621CC013").
func (pk *PublicKey) KeyIdShortString() string {
return fmt.Sprintf("%X", pk.Fingerprint[16:20])
}
go-crypto/openpgp/packet/public_key.go
Line 1048 in d703f49
| // KeyIdString returns the public key's fingerprint in capital hex |
For v6 (and v5) keys the long keyID should be the first eight octets of the fingerprint, and the short keyID is not defined.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels