Skip to content

Kmac.IsSupported returns different value in RemoteExecutor #100412

@vcsjones

Description

@vcsjones

Consider this unit test:

[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
public void IsSupportedInRemoteExecutor()
{
    Assert.True(Kmac128.IsSupported);

    RemoteExecutor.Invoke(static () =>
    {
        return Kmac128.IsSupported ? RemoteExecutor.SuccessExitCode : 0;
    }).Dispose();
}

On a system with OpenSSL 3, this will fail in the remote executor. This is peculiar, because the assert outside of the remote executor passes, but then fails in the remote executor. When run in the remote executor, in

internal static SafeEvpMacHandle? Kmac128 { get; } = EvpMacFetch(HashAlgorithmNames.KMAC128);
internal static SafeEvpMacHandle? Kmac256 { get; } = EvpMacFetch(HashAlgorithmNames.KMAC256);

The properties are null, implying the EvpMacFetch got a haveFeature of 0.

We should investigate the cause of this as there are only two options.

  1. It is a bug in RemoteExecutor and it should be fixed.
  2. It is a bug in how we are resolving the EVP_MAC and it should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions