1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Fix key rotation being broken due to org ciphers being included (#4522)

This commit is contained in:
Bernd Schoolmann
2024-07-17 15:21:32 +02:00
committed by GitHub
parent 59cbe3e428
commit 88d5a97a86

View File

@ -28,12 +28,18 @@ public class CipherRotationValidator : IRotationValidator<IEnumerable<CipherWith
var result = new List<Cipher>();
var existingCiphers = await _cipherRepository.GetManyByUserIdAsync(user.Id, UseFlexibleCollections);
if (existingCiphers == null || existingCiphers.Count == 0)
if (existingCiphers == null)
{
return result;
}
foreach (var existing in existingCiphers)
var existingUserCiphers = existingCiphers.Where(c => c.OrganizationId == null);
if (existingUserCiphers.Count() == 0)
{
return result;
}
foreach (var existing in existingUserCiphers)
{
var cipher = ciphers.FirstOrDefault(c => c.Id == existing.Id);
if (cipher == null)