From 0b33f7b5b0cdf6c96e63a6ef65a1436579079065 Mon Sep 17 00:00:00 2001 From: Aron Wussler Date: Thu, 14 Mar 2024 12:31:10 +0100 Subject: [PATCH] Fix HMAC generation (#204) Generate an AEAD subkey when requesting an HMAC primary key. --- openpgp/v2/key_generation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpgp/v2/key_generation.go b/openpgp/v2/key_generation.go index a5f41391..3029fae7 100644 --- a/openpgp/v2/key_generation.go +++ b/openpgp/v2/key_generation.go @@ -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: