Skip to content

TSS.Net - would be great to support NativeAOT; current AOT builds with a few warnings and constructs invalid packets #199

Description

@wisemoth

When TSS.Net is built for AOT there are a few warnings (after setting <TrimmerSingleWarn>false</TrimmerSingleWarn>) and, for example, the Tpm2StartupRequest command on the wire is invalid - it is missing the startupType field:

80 01 00 00 00 0A 00 00 01 44

When built to CLR, the field is present:

80 01 00 00 00 0C 00 00 01 44 00 00

minimal repro (with MS TPM Simulator on 127.0.0.1:2321):

using System;
using Tpm2Lib;

namespace TpmTest
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var tpmDevice = new TcpTpmDevice("127.0.0.1", 2321);
            tpmDevice.Connect();

            var tpm = new Tpm2(tpmDevice);
            Console.WriteLine("Power cycle TPM");
            tpmDevice.PowerCycle();

            Console.WriteLine("TPM powered up");
            tpm.Startup(Su.Clear);             // works in CLR, fails in AOT

            Console.WriteLine("TPM started up");
        }
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions