Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rfc9421/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function parseRFC9421RequestOrResponse(
if (!inputIsValid) throw new Error('signatureInput');

const factory = new RFC9421SignatureBaseFactory(
request, undefined, undefined, undefined,
request, undefined, options?.additionalSfvTypeDictionary, undefined,
options?.requiredComponents?.rfc9421 || options?.requiredInputs?.rfc9421,
);
const results = new Map<string, ParsedRFC9421SignatureValueWithBase>();
Expand Down
4 changes: 2 additions & 2 deletions src/rfc9421/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function verifyRFC9421Signature(
if (importedKeys.length === 0) {
importedKeys = await Promise.all(
Array.from(keys.values())
.map(key => parseAndImportPublicKey(key, ['verify']))
.map(key => parseAndImportPublicKey(key, ['verify']), alg)
);
}

Expand Down Expand Up @@ -127,7 +127,7 @@ export async function verifyRFC9421Signature(

for (const [label, parsed, key] of toVerify) {
try {
const { publicKey, algorithm } = await parseAndImportPublicKey(key, ['verify']);
const { publicKey, algorithm } = await parseAndImportPublicKey(key, ['verify'], alg);

const verify = await (await getWebcrypto()).subtle.verify(
algorithm, publicKey, base64.parse(parsed.signature), textEncoder.encode(parsed.base)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function parseSignInfo(algorithm: string | undefined, real: ParsedAlgorit
if (namedCurve !== 'P-384') {
throw new KeyHashValidationError(`curve is not P-384: ${namedCurve}`);
}
return { name: 'ECDSA', hash: 'SHA-256', namedCurve };
return { name: 'ECDSA', hash: 'SHA-384', namedCurve };
}

//#region Draft
Expand Down