mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
PM-115 removed ForceKeyRotation from new cipher encryption model given that another approach will be taken
This commit is contained in:
@@ -27,7 +27,6 @@ namespace Bit.Core.Models.Data
|
||||
CollectionIds = collectionIds?.ToList() ?? response.CollectionIds;
|
||||
Reprompt = response.Reprompt;
|
||||
Key = response.Key;
|
||||
ForceKeyRotation = response.ForceKeyRotation;
|
||||
|
||||
try // Added to address Issue (https://github.com/bitwarden/mobile/issues/1006)
|
||||
{
|
||||
@@ -89,6 +88,5 @@ namespace Bit.Core.Models.Data
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public Enums.CipherRepromptType Reprompt { get; set; }
|
||||
public string Key { get; set; }
|
||||
public bool ForceKeyRotation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Bit.Core.Models.Domain
|
||||
CollectionIds = obj.CollectionIds != null ? new HashSet<string>(obj.CollectionIds) : null;
|
||||
LocalData = localData;
|
||||
Reprompt = obj.Reprompt;
|
||||
ForceKeyRotation = obj.ForceKeyRotation;
|
||||
|
||||
if (obj.Key != null)
|
||||
{
|
||||
@@ -89,7 +88,6 @@ namespace Bit.Core.Models.Domain
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
public EncString Key { get; set; }
|
||||
public bool ForceKeyRotation { get; set; }
|
||||
|
||||
public async Task<CipherView> DecryptAsync()
|
||||
{
|
||||
@@ -195,8 +193,7 @@ namespace Bit.Core.Models.Domain
|
||||
CollectionIds = CollectionIds.ToList(),
|
||||
DeletedDate = DeletedDate,
|
||||
Reprompt = Reprompt,
|
||||
Key = Key?.EncryptedString,
|
||||
ForceKeyRotation = ForceKeyRotation
|
||||
Key = Key?.EncryptedString
|
||||
};
|
||||
BuildDataModel(this, c, new HashSet<string>
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace Bit.Core.Models.Request
|
||||
LastKnownRevisionDate = cipher.RevisionDate;
|
||||
Reprompt = cipher.Reprompt;
|
||||
Key = cipher.Key?.EncryptedString;
|
||||
ForceKeyRotation = cipher.ForceKeyRotation;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
@@ -127,6 +126,5 @@ namespace Bit.Core.Models.Request
|
||||
public DateTime LastKnownRevisionDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
public string Key { get; set; }
|
||||
public bool ForceKeyRotation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,5 @@ namespace Bit.Core.Models.Response
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
public string Key { get; set; }
|
||||
public bool ForceKeyRotation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace Bit.Core.Models.View
|
||||
RevisionDate = c.RevisionDate;
|
||||
DeletedDate = c.DeletedDate;
|
||||
Reprompt = c.Reprompt;
|
||||
ForceKeyRotation = c.ForceKeyRotation;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@@ -51,7 +50,6 @@ namespace Bit.Core.Models.View
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
public SymmetricCryptoKey Key { get; set; }
|
||||
public bool ForceKeyRotation { get; set; }
|
||||
|
||||
public ItemView Item
|
||||
{
|
||||
|
||||
@@ -177,8 +177,7 @@ namespace Bit.Core.Services
|
||||
Type = model.Type,
|
||||
CollectionIds = model.CollectionIds,
|
||||
RevisionDate = model.RevisionDate,
|
||||
Reprompt = model.Reprompt,
|
||||
ForceKeyRotation = model.ForceKeyRotation
|
||||
Reprompt = model.Reprompt
|
||||
};
|
||||
|
||||
key = await UpdateCipherAndGetCipherKeyAsync(cipher, model, key);
|
||||
@@ -210,7 +209,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
if (cipherView.Key != null && !cipherView.ForceKeyRotation)
|
||||
if (cipherView.Key != null)
|
||||
{
|
||||
cipher.Key = await _cryptoService.EncryptAsync(cipherView.Key.Key, key);
|
||||
return cipherView.Key;
|
||||
|
||||
Reference in New Issue
Block a user