Skip to content

Commit 8d275ac

Browse files
committed
wip
1 parent 5f240c2 commit 8d275ac

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/DataProtection/DataProtection/src/KeyManagement/KeyRingBasedDataProtector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal sealed unsafe class KeyRingBasedDataProtector : IDataProtector, IPersis
3434
private readonly IKeyRingProvider _keyRingProvider;
3535
private readonly ILogger? _logger;
3636

37-
private static readonly int _magicHeaderKeyIdSize = (sizeof(uint) + sizeof(Guid));
37+
private static readonly int _magicHeaderKeyIdSize = sizeof(uint) + sizeof(Guid);
3838

3939
public KeyRingBasedDataProtector(IKeyRingProvider keyRingProvider, ILogger? logger, string[]? originalPurposes, string newPurpose)
4040
{

src/DataProtection/DataProtection/src/Managed/ManagedAuthenticatedEncryptor.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -416,19 +416,6 @@ public byte[] Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> additiona
416416
additionalAuthenticatedData.Validate();
417417
var plainTextSpan = plaintext.AsSpan();
418418

419-
#if NET10_0_OR_GREATER
420-
var size = GetEncryptedSize(plainTextSpan.Length);
421-
var retVal = new byte[size];
422-
if (!TryEncrypt(plaintext.AsSpan(), additionalAuthenticatedData.AsSpan(), retVal, out var bytesWritten))
423-
{
424-
// TODO understand what we really expect here
425-
throw Error.CryptCommon_GenericError();
426-
}
427-
428-
Debug.Assert(bytesWritten == size, "bytesWritten == size");
429-
return retVal;
430-
#endif
431-
432419
try
433420
{
434421
var keyModifierLength = KEY_MODIFIER_SIZE_IN_BYTES;

0 commit comments

Comments
 (0)