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:
@@ -19,4 +19,3 @@ namespace Bit.Core.Models.Data
|
||||
public string UriChecksum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
||||
Reference in New Issue
Block a user