Skip to content

Commit 0e05c5c

Browse files
authored
fix: use elliptic DER bytes directly for ECDSA signatures
1 parent 71d617b commit 0e05c5c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

common/src/utils/passports/genMockIdDoc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ function sign(
258258
const msgHash = hash(hashAlgorithm, eContent, 'hex');
259259

260260
const signature = keyPair.sign(msgHash, 'hex');
261-
// @ts-ignore-error toDer gives number[] what is fine for Buffer.from
262-
const signatureBytes = Array.from(Buffer.from(signature.toDER(), 'hex'));
263-
261+
const signatureBytes = Array.from(signature.toDER() as number[]);
264262
return signatureBytes;
265263
} else {
266264
const privKey = forge.pki.privateKeyFromPem(privateKeyPem);

0 commit comments

Comments
 (0)