Closed stevealx closed 5 years ago
$ openssl req -new -engine tpm2tss -keyform engine -key 0x81800003 -out csr1 -subj /CN=test engine "tpm2tss" set. Enter password for user key: WARNING:esys:src/tss2-esys/api/Esys_FlushContext.c:234:Esys_FlushContext_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_FlushContext.c:89:Esys_FlushContext() Esys Finish ErrorCode (0x000001c4) $
$ openssl req -new -engine tpm2tss -keyform engine -key 0x81800003 -out csr1 -subj /CN=test
engine "tpm2tss" set.
Enter password for user key:
WARNING:esys:src/tss2-esys/api/Esys_FlushContext.c:234:Esys_FlushContext_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_FlushContext.c:89:Esys_FlushContext() Esys Finish ErrorCode (0x000001c4)
$
Copying the KEY_TYPE_HANDLE logic from rsa_priv_enc) to ecdsa_sign() seems to fix the issue.
(with patch applied)
$ openssl req -new -engine tpm2tss -keyform engine -key 0x81800003 -out csr1 -subj /CN=test engine "tpm2tss" set. Enter password for user key: $
If this seems reasonable, I can submit a PR with the change.
Thanks for the observation. Could you point out what exactly you copied ? Also, PR is always appreciated ! Best if it has a test-case that uncovers the problem being fixed...
$ openssl req -new -engine tpm2tss -keyform engine -key 0x81800003 -out csr1 -subj /CN=test
engine "tpm2tss" set.
Enter password for user key:
WARNING:esys:src/tss2-esys/api/Esys_FlushContext.c:234:Esys_FlushContext_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_FlushContext.c:89:Esys_FlushContext() Esys Finish ErrorCode (0x000001c4)
$
Copying the KEY_TYPE_HANDLE logic from rsa_priv_enc) to ecdsa_sign() seems to fix the issue.
(with patch applied)
$ openssl req -new -engine tpm2tss -keyform engine -key 0x81800003 -out csr1 -subj /CN=test
engine "tpm2tss" set.
Enter password for user key:
$
If this seems reasonable, I can submit a PR with the change.