Skip to content

Commit df6d9ba

Browse files
committed
fix: preserve md5 if not in fips mode
1 parent 3f6b321 commit df6d9ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/meteor/app/2fa/server/code/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ function getFingerprintFromConnection(connection: IMethodConnection): string {
6060
clientAddress: connection.clientAddress,
6161
});
6262

63-
return crypto.createHash('sha256').update(data).digest('hex');
63+
const algorithm = crypto.getFips() ? 'sha256' : 'md5';
64+
return crypto.createHash(algorithm).update(data).digest('hex');
6465
}
6566

6667
function getRememberDate(from: Date = new Date()): Date | undefined {

0 commit comments

Comments
 (0)