From d2ec05cec986f2296acf8362c655e693dd5ddada Mon Sep 17 00:00:00 2001 From: turnoffthiscomputer <98749896+remicolin@users.noreply.github.com> Date: Fri, 17 Oct 2025 23:56:35 +0200 Subject: [PATCH] Add RSA hash algorithm detection in passport parsing --- .../passport_parsing/brutForcePassportSignature.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/utils/passports/passport_parsing/brutForcePassportSignature.ts b/common/src/utils/passports/passport_parsing/brutForcePassportSignature.ts index 9bf800ff1..5fd57c427 100644 --- a/common/src/utils/passports/passport_parsing/brutForcePassportSignature.ts +++ b/common/src/utils/passports/passport_parsing/brutForcePassportSignature.ts @@ -40,6 +40,14 @@ export function brutforceSignatureAlgorithm(passportData: PassportData) { }; } } + const hashAlgorithm = brutforceHashAlgorithm(passportData, 'rsa'); + if (hashAlgorithm) { + return { + signatureAlgorithm: 'rsa', + hashAlgorithm: hashAlgorithm, + saltLength: 0, + }; + } } function brutforceHashAlgorithm(