add a few sigalg names for caution

This commit is contained in:
0xturboblitz
2024-04-10 19:52:46 -07:00
parent e4f4e3bead
commit fc2e528561

View File

@@ -6,6 +6,7 @@
export function toStandardName(jmrtdName: string): string {
switch (jmrtdName) {
// hash functions
case "SHA-1":
case "SHA1":
@@ -22,6 +23,7 @@ export function toStandardName(jmrtdName: string): string {
case "SHA-512":
case "SHA512":
return "sha512";
// sig algs
case "SHA1withECDSA":
return "ecdsa-with-SHA1";
@@ -53,8 +55,16 @@ export function toStandardName(jmrtdName: string): string {
return "rsassa-pss";
case "SHA256withRSAandMGF1":
return "id-mgf1"
// added this one for iOS
case "rsaEncryption":
return "sha256WithRSAEncryption"; // added this one for iOS
// for security
case "SHA256WITHRSA":
case "SHA256withRSA":
case "sha256withRSA":
case "sha256withrsa":
case "SHA256WITHRSAENCRYPTION":
return "sha256WithRSAEncryption";
default:
console.log(`JMRTD sig alg or hash function ${jmrtdName} not found in mapping, returning it as it is`);
return jmrtdName;