Skip to content

Commit

Permalink
Fix ECDH using v6 keys (#233)
Browse files Browse the repository at this point in the history
When using ECDH with v6 keys, the fingerprint length is not 20 bytes,
so the KDF param is not 45 bytes.
  • Loading branch information
twiss authored Sep 26, 2024
1 parent 7852179 commit 77090fe
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions openpgp/ecdh/ecdh.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ func buildKey(pub *PublicKey, zb []byte, curveOID, fingerprint []byte, stripLead
if _, err := param.Write(fingerprint[:]); err != nil {
return nil, err
}
if param.Len()-len(curveOID) != 45 {
return nil, errors.New("ecdh: malformed KDF Param")
}

// MB = Hash ( 00 || 00 || 00 || 01 || ZB || Param );
h := pub.KDF.Hash.New()
Expand Down

0 comments on commit 77090fe

Please sign in to comment.