Fix reused reference of notation array in input

With the new salt notation, the original input array was mutated, which is undesirable, but
it also led to an error when signing with multiple keys, since duplicate salt notations were
detected.
This commit is contained in:
larabr 2024-04-02 13:51:38 +02:00
parent c6daa090b3
commit 7982713f3d

View File

@ -218,7 +218,7 @@ export async function createSignaturePacket(dataToSign, privateKey, signingKeyPa
Object.assign(signaturePacket, signatureProperties);
signaturePacket.publicKeyAlgorithm = signingKeyPacket.algorithm;
signaturePacket.hashAlgorithm = await getPreferredHashAlgo(privateKey, signingKeyPacket, date, userID, config);
signaturePacket.rawNotations = notations;
signaturePacket.rawNotations = [...notations];
await signaturePacket.sign(signingKeyPacket, dataToSign, date, detached, config);
return signaturePacket;
}