From caaec3ea57d8da82a471eb332e3e49a3e3199a69 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 1 May 2019 10:33:48 -0400 Subject: [PATCH] fix password leaked check --- src/App/Pages/Vault/ViewPageViewModel.cs | 3 ++- src/Core/Services/AuditService.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App/Pages/Vault/ViewPageViewModel.cs b/src/App/Pages/Vault/ViewPageViewModel.cs index 1ca2fdf1cc..a43ed3cd5c 100644 --- a/src/App/Pages/Vault/ViewPageViewModel.cs +++ b/src/App/Pages/Vault/ViewPageViewModel.cs @@ -298,7 +298,8 @@ namespace Bit.App.Pages await _deviceActionService.HideLoadingAsync(); if(matches > 0) { - await _platformUtilsService.ShowDialogAsync(string.Format(AppResources.PasswordExposed, matches)); + await _platformUtilsService.ShowDialogAsync(string.Format(AppResources.PasswordExposed, + matches.ToString("N0"))); } else { diff --git a/src/Core/Services/AuditService.cs b/src/Core/Services/AuditService.cs index e7848b7b57..7724d3c0e9 100644 --- a/src/Core/Services/AuditService.cs +++ b/src/Core/Services/AuditService.cs @@ -29,7 +29,7 @@ namespace Bit.Core.Services public async Task PasswordLeakedAsync(string password) { var hashBytes = await _cryptoFunctionService.HashAsync(password, Enums.CryptoHashAlgorithm.Sha1); - var hash = BitConverter.ToString(hashBytes).ToUpperInvariant(); + var hash = BitConverter.ToString(hashBytes).Replace("-", string.Empty).ToUpperInvariant(); var hashStart = hash.Substring(0, 5); var hashEnding = hash.Substring(5); var response = await _httpClient.GetAsync(string.Concat(PwnedPasswordsApi, hashStart));