1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-06 02:23:57 +00:00

PM-4739 Add missing field

This commit is contained in:
Carlos Gonçalves
2023-12-06 18:15:45 +00:00
parent c2928b88b0
commit e947d3eebb
5 changed files with 15 additions and 4 deletions

View File

@@ -19,4 +19,3 @@ namespace Bit.Core.Models.Data
public string UriChecksum { get; set; }
}
}

View File

@@ -45,7 +45,8 @@ namespace Bit.Core.Models.Domain
foreach (var uri in Uris)
{
var loginUriView = await uri.DecryptAsync(orgId, key);
if (bypassValidation || (await uri.ValidateChecksum(loginUriView.Uri, orgId, key))) {
if (bypassValidation || (await uri.ValidateChecksum(loginUriView.Uri, orgId, key)))
{
view.Uris.Add(loginUriView);
}
}

View File

@@ -20,6 +20,12 @@ namespace Bit.Core.Models.Domain
public LoginUri(LoginUriData obj, bool alreadyEncrypted = false)
{
Match = obj.Match;
if (obj.UriChecksum != null)
{
UriChecksum = new EncString(obj.UriChecksum);
}
BuildDomainModel(this, obj, _map, alreadyEncrypted);
}
@@ -41,6 +47,11 @@ namespace Bit.Core.Models.Domain
public async Task<bool> ValidateChecksum(string clearTextUri, string orgId, SymmetricCryptoKey key)
{
if (this.UriChecksum == null)
{
return false;
}
// HACK: I don't like resolving this here but I can't see a better way without
// refactoring a lot of things.
var cryptoService = ServiceContainer.Resolve<ICryptoService>();

View File

@@ -27,7 +27,7 @@ namespace Bit.Core.Models.Request
Login = new LoginApi
{
Uris = cipher.Login.Uris?.Select(
u => new LoginUriApi { Match = u.Match, Uri = u.Uri?.EncryptedString }).ToList(),
u => new LoginUriApi { Match = u.Match, Uri = u.Uri?.EncryptedString, UriChecksum = u.UriChecksum?.EncryptedString }).ToList(),
Username = cipher.Login.Username?.EncryptedString,
Password = cipher.Login.Password?.EncryptedString,
PasswordRevisionDate = cipher.Login.PasswordRevisionDate,

View File

@@ -1,4 +1,4 @@
 using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;