Описание
Мы хотим использовать TPM для инициализации в Linux с помощью .netcore.
Вызов RegisterAsync для ProvisiongDeviceClient завершается с ошибкой TpmException: « Ошибка {Binding} была возвращена для команды ActivateCredential. »
GetEndorsementKey () работает.
В качестве транспортной технологии используется HTTP (ProvisioningTransportHandlerHttp).
Приложение работает в док-контейнере с подключенным устройством TPM.
Мы получаем ту же проблему, если запускаем пример Azure непосредственно на хосте:
https://github.com/Azure-Samples/azure-iot-samples-csharp/blob/master/provisioning/Samples/device/Common/ProvisioningDeviceClientSample.cs
Системная информация
- ОС: Debian GNU / Linux 9.5 (растяжка)
- Докер: версия 18.09.1, сборка 4c52b90
- .NET Target Framework приложения: библиотека .Net Standard 2.0, используемая в консольном проекте .Net Core 2.1
- SDK:
- Microsoft.Azure.Devices.Client: v1.20.1
- Microsoft.Azure.Devices.Provisioning.Security.Tpm: v1.1.5
Сведения об исключении
Исключение транспорта HTTP. (Tpm2Lib.TpmException)
Ошибка {Binding} была возвращена для команды ActivateCredential.
[Code=TpmRc.Binding],[RawCode=0x2E5,741]
[ErrorEntity=Parameter], [ParmNum=2]
[ParmName=secret]
at Tpm2Lib.Tpm2.ProcessError(TpmSt responseTag, UInt32 responseParamSize, TpmRc resultCode, TpmStructureBase inParms)
at Tpm2Lib.Tpm2.DispatchMethod(TpmCc ordinal, TpmStructureBase inParms, Type expectedResponseType, TpmStructureBase& outParms, Int32 numInHandlesNotUsed, Int32 numOutHandlesNotUsed)
at Tpm2Lib.Tpm2.ActivateCredential(TpmHandle activateHandle, TpmHandle keyHandle, IdObject credentialBlob, Byte[] secret)
at Microsoft.Azure.Devices.Provisioning.Security.SecurityProviderTpmHsm.ActivateIdentityKey(Byte[] encryptedKey)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.ProvisioningSasBuilder.ExtractServiceAuthKey(SecurityProviderTpm securityProvider, String hostName, Byte[] activation)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.TpmDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.RuntimeRegistration.RegisterDeviceWithHttpMessagesAsync(String registrationId, String idScope, DeviceRegistration deviceRegistration, Nullable`1 forceRegistration, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.RuntimeRegistrationExtensions.RegisterDeviceAsync(IRuntimeRegistration operations, String registrationId, String idScope, DeviceRegistration deviceRegistration, Nullable`1 forceRegistration, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.ProvisioningTransportHandlerHttp.RegisterAsync(ProvisioningTransportRegisterMessage message, CancellationToken cancellationToken). Microsoft.Azure.Devices.Provisioning.Client.ProvisioningTransportException: HTTP transport exception ---> Tpm2Lib.TpmException: Error {Binding} was returned for command ActivateCredential.
Результат tpm2_rc_decode с 0x2E5
error layer
hex: 0x0
identifier: TSS2_TPM_ERROR_LEVEL
description: Error produced by the TPM
format 1 error code
hex: 0x25
identifier: TPM_RC_BINDING
description: public and sensitive portions of an object are not cryptographically bound
parameter
hex: 0x200
identifier: TPM_RC_2
description: (null)