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 Jul 16, 2024
1 parent 9c1877a commit 0b33f7b
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 @@ -433,7 +433,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 0b33f7b

Please sign in to comment.