From d7da931854ccf2ace7d75b09a3b89b2e4f111e8e Mon Sep 17 00:00:00 2001 From: roschnor <35103237+roschnor@users.noreply.github.com> Date: Tue, 24 May 2022 15:27:08 +0200 Subject: [PATCH] Update crypto.ts Never be true, because of this.container.session.slot.getMechanisms() only gets "ECDSA" so set some cases to "ECDSA". --- src/mechs/ec/crypto.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mechs/ec/crypto.ts b/src/mechs/ec/crypto.ts index 13bbafb..26645de 100644 --- a/src/mechs/ec/crypto.ts +++ b/src/mechs/ec/crypto.ts @@ -139,6 +139,15 @@ export class EcCrypto implements types.IContainer { public getAlgorithm(p11AlgorithmName: string | number) { const mechanisms = this.container.session.slot.getMechanisms(); + switch (p11AlgorithmName) { + case "ECDSA": + case "ECDSA_SHA1": + case "ECDSA_SHA256": + case "ECDSA_SHA384": + case "ECDSA_SHA512": + p11AlgorithmName = "ECDSA"; + break; + } let EC: string | undefined; for (let i = 0; i < mechanisms.length; i++) { const mechanism = mechanisms.tryGetItem(i);