Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;

Expand Down Expand Up @@ -115,8 +116,12 @@ ref MemoryMarshal.GetReference(input),

internal static void EvpCipherSetInputLength(SafeEvpCipherCtxHandle ctx, int inputLength)
{
ref byte nullRef = ref MemoryMarshal.GetReference(Span<byte>.Empty);
if (!EvpCipherUpdate(ctx, ref nullRef, out _, ref nullRef, inputLength))
if (!EvpCipherUpdate(
ctx,
ref Unsafe.NullRef<byte>(),
out _,
ref Unsafe.NullRef<byte>(),
inputLength))
{
throw CreateOpenSslCryptographicException();
}
Expand Down Expand Up @@ -229,8 +234,7 @@ internal static void EvpCipherSetCcmTag(SafeEvpCipherCtxHandle ctx, ReadOnlySpan

internal static void EvpCipherSetCcmTagLength(SafeEvpCipherCtxHandle ctx, int tagLength)
{
ref byte nullRef = ref MemoryMarshal.GetReference(Span<byte>.Empty);
if (!EvpCipherSetCcmTag(ctx, ref nullRef, tagLength))
if (!EvpCipherSetCcmTag(ctx, ref Unsafe.NullRef<byte>(), tagLength))
{
throw CreateOpenSslCryptographicException();
}
Expand Down