Skip to content

Commit 268ee44

Browse files
committed
slice correctly!
1 parent a37b0d5 commit 268ee44

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/DataProtection/DataProtection/src/KeyManagement/KeyManagementOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal static TimeSpan MaxServerClockSkew
111111
/// <remarks>
112112
/// Settable for testing.
113113
/// </remarks>
114-
internal TimeSpan DefaultKeyResolverRetryDelay { get; set; } = TimeSpan.FromMilliseconds(200);
114+
internal TimeSpan DefaultKeyResolverRetryDelay { get; set; } = TimeSpan.FromMilliseconds(200.0);
115115

116116
/// <summary>
117117
/// Controls the lifetime (number of days before expiration)

src/DataProtection/DataProtection/src/SP800_108/ManagedSP800_108_CTR_HMACSHA512.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static void DeriveKeys(byte[] kdk, ReadOnlySpan<byte> label, ReadOnlySpan
9494
CryptoUtil.Assert(prfOutputSizeInBytes == prfOutput.Length, "prfOutputSizeInBytes == prfOutput.Length");
9595
var numBytesToCopyThisIteration = Math.Min(prfOutputSizeInBytes, outputCount);
9696

97-
prfOutput.CopyTo(output.AsSpan().Slice(outputOffset, numBytesToCopyThisIteration));
97+
prfOutput.AsSpan().Slice(0, numBytesToCopyThisIteration).CopyTo(output.Array!.AsSpan().Slice(start: outputOffset));
9898
Array.Clear(prfOutput, 0, prfOutput.Length); // contains key material, so delete it
9999

100100
// adjust offsets

0 commit comments

Comments
 (0)