You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using an M1 macbook and trying to to simulate an iot device using the Microsoft.Azure.Devices packages.
When I try to create the SecurityProviderTpmHsm I get an error Unable to load shared library 'bcrypt.dll' or one of its dependencies.
The Microsoft.Azure.Devices.Provisioning.Security.Tpm package has a dependency on this library and the error originates from this library.
It seems that this library uses bcrypt. I noticed that work has been done in #105 to make this library cross platform compatible. But since then no new nuget package has been released.
Is it possible to release a new version? And hopefully that fixes the problem...
Stack trace
Unable to load shared library 'bcrypt.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libbcrypt.dll, 0x0001): tried: 'libbcrypt.dll' (no such file), '/usr/local/lib/libbcrypt.dll' (no such file), '/usr/lib/libbcrypt.dll' (no such file), '/Users/tom/Documents/GitHub/Geras.Cloud/src/Geras.DataGenerator/bin/Debug/net6.0/libbcrypt.dll' (no such file)
at Tpm2Lib.Native.BCryptOpenAlgorithmProvider(UIntPtr& AlgProvider, String AlgId, String Implementation, UInt32 Flags)
at Tpm2Lib.BCryptAlgorithm.Open(String algName, UInt32 flags)
at Tpm2Lib.BCryptAlgorithm..ctor(String algName, UInt32 flags)
at Tpm2Lib.CryptoLib.Hmac(TpmAlgId hashAlgId, Byte[] key, Byte[] data)
at Tpm2Lib.KDF.KDFa(TpmAlgId hmacHash, Byte[] hmacKey, String label, Byte[] contextU, Byte[] contextV, Int32 numBitsRequired)
at Tpm2Lib.PRNG.FillRandBuf()
at Tpm2Lib.PRNG.SetRngRandomSeed()
at Tpm2Lib.PRNG.GetRandomBytes(Int32 numBytes)
at Tpm2Lib.Tpm2.CancelSafeStartAuthSession(TpmSe sessionType, TpmAlgId authHash, Int32 nonceCallerSize)
at Tpm2Lib.Tpm2.PrepareRequestSessions(CommandInfo commandInfo, TpmHandle[] inHandles)
at Tpm2Lib.Tpm2.DispatchMethod(TpmCc ordinal, TpmStructureBase inParms, Type expectedResponseType, TpmStructureBase& outParms, Int32 numInHandlesNotUsed, Int32 numOutHandlesNotUsed)
at Tpm2Lib.Tpm2.CreatePrimary(TpmHandle primaryHandle, SensitiveCreate inSensitive, TpmPublic inPublic, Byte[] outsideInfo, PcrSelection[] creationPCR, TpmPublic& outPublic, CreationData& creationData, Byte[]& creationHash, TkCreation& creationTicket)
at Microsoft.Azure.Devices.Provisioning.Security.SecurityProviderTpmHsm.ReadOrCreatePersistedKey(TpmHandle persHandle, TpmHandle hierarchy, TpmPublic template)
at Microsoft.Azure.Devices.Provisioning.Security.SecurityProviderTpmHsm.CacheEkAndSrk()
at Microsoft.Azure.Devices.Provisioning.Security.SecurityProviderTpmHsm..ctor(String registrationId, Tpm2Device tpm)
Code
var tpmDevice = new TcpTpmDevice("127.0.0.1", 2321);
tpmDevice.Connect();
tpmDevice.PowerCycle();
using (var tpm2 = new Tpm2(tpmDevice))
{
tpm2.Startup(Su.Clear);
}
new SecurityProviderTpmHsm(GetRegistrationID(), tpmDevice);
(Not a maintainer, so can't speak authoritatively about future NuGet package releases of this library)
Since this repository is open source, one workaround to the NuGet problem would be to submodule this repo from yours, and then link the csproj from your csproj:
I confirm the same happens on FreeBSD and Linux using the latest but ancient nuget package 2.1.1. We also managed to workaround this by ProjectReferencing TSS.Net.csproj and Microsoft.Azure.Devices.Provisioning.Security.Tpm.csproj in chain from our device project
I am using an M1 macbook and trying to to simulate an iot device using the Microsoft.Azure.Devices packages.
When I try to create the SecurityProviderTpmHsm I get an error Unable to load shared library 'bcrypt.dll' or one of its dependencies.
The Microsoft.Azure.Devices.Provisioning.Security.Tpm package has a dependency on this library and the error originates from this library.
It seems that this library uses bcrypt. I noticed that work has been done in #105 to make this library cross platform compatible. But since then no new nuget package has been released.
Is it possible to release a new version? And hopefully that fixes the problem...
Stack trace
Code
Issue on azure iot sdk csharp: Azure/azure-iot-sdk-csharp#2362
The text was updated successfully, but these errors were encountered: