Skip to content

Commit

Permalink
Fix HMAC generation (#204)
Browse files Browse the repository at this point in the history
Generate an AEAD subkey when requesting an HMAC primary key.
  • Loading branch information
wussler authored and lubux committed Oct 1, 2024
1 parent 85bc845 commit b04e354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openpgp/v2/key_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func newDecrypter(config *packet.Config) (decrypter interface{}, err error) {
return x25519.GenerateKey(config.Random())
case packet.PubKeyAlgoEd448, packet.PubKeyAlgoX448: // When passing Ed448, we generate an x448 subkey
return x448.GenerateKey(config.Random())
case packet.ExperimentalPubKeyAlgoAEAD:
case packet.ExperimentalPubKeyAlgoHMAC, packet.ExperimentalPubKeyAlgoAEAD: // When passing HMAC, we generate an AEAD subkey
cipher := algorithm.CipherFunction(config.Cipher())
return symmetric.AEADGenerateKey(config.Random(), cipher)
default:
Expand Down

0 comments on commit b04e354

Please sign in to comment.