|
|
e56592 |
From 380d5f9ec3aa1f5e456598fe66d275467660177b Mon Sep 17 00:00:00 2001
|
|
|
e56592 |
From: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
|
e56592 |
Date: Thu, 16 Jan 2020 09:27:04 -0800
|
|
|
e56592 |
Subject: [PATCH] esys: fixup compute_encrypted_salt err handling in
|
|
|
e56592 |
Esys_StartAuthSession
|
|
|
e56592 |
|
|
|
e56592 |
Use return_state_if_error() macro for compute_encrypted_salt()
|
|
|
e56592 |
error handling in Esys_StartAuthSession to maintain the correct
|
|
|
e56592 |
context state.
|
|
|
e56592 |
|
|
|
e56592 |
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
|
e56592 |
---
|
|
|
e56592 |
src/tss2-esys/api/Esys_StartAuthSession.c | 13 ++++---------
|
|
|
e56592 |
1 file changed, 4 insertions(+), 9 deletions(-)
|
|
|
e56592 |
|
|
|
e56592 |
diff --git a/src/tss2-esys/api/Esys_StartAuthSession.c b/src/tss2-esys/api/Esys_StartAuthSession.c
|
|
|
e56592 |
index 3ccd842a7572..1717928a717d 100644
|
|
|
e56592 |
--- a/src/tss2-esys/api/Esys_StartAuthSession.c
|
|
|
e56592 |
+++ b/src/tss2-esys/api/Esys_StartAuthSession.c
|
|
|
e56592 |
@@ -223,20 +223,15 @@ Esys_StartAuthSession_Async(
|
|
|
e56592 |
TSS2_RC r2;
|
|
|
e56592 |
r2 = iesys_compute_encrypted_salt(esysContext, tpmKeyNode,
|
|
|
e56592 |
&encryptedSaltAux);
|
|
|
e56592 |
- return_if_error(r2, "Error in parameter encryption.");
|
|
|
e56592 |
+ return_state_if_error(r2, _ESYS_STATE_INIT, "Error in parameter encryption.");
|
|
|
e56592 |
|
|
|
e56592 |
if (nonceCaller == NULL) {
|
|
|
e56592 |
r2 = iesys_crypto_hash_get_digest_size(authHash,&authHash_size);
|
|
|
e56592 |
- if (r2 != TSS2_RC_SUCCESS) {
|
|
|
e56592 |
- LOG_ERROR("Error: initialize auth session (%x).", r2);
|
|
|
e56592 |
- return r2;
|
|
|
e56592 |
- }
|
|
|
e56592 |
+ return_state_if_error(r2, _ESYS_STATE_INIT, "Error in hash_get_digest_size.");
|
|
|
e56592 |
+
|
|
|
e56592 |
r2 = iesys_crypto_random2b(&esysContext->in.StartAuthSession.nonceCallerData,
|
|
|
e56592 |
authHash_size);
|
|
|
e56592 |
- if (r2 != TSS2_RC_SUCCESS) {
|
|
|
e56592 |
- LOG_ERROR("Error: initialize auth session (%x).", r2);
|
|
|
e56592 |
- return r2;
|
|
|
e56592 |
- }
|
|
|
e56592 |
+ return_state_if_error(r2, _ESYS_STATE_INIT, "Error in crypto_random2b.");
|
|
|
e56592 |
esysContext->in.StartAuthSession.nonceCaller
|
|
|
e56592 |
= &esysContext->in.StartAuthSession.nonceCallerData;
|
|
|
e56592 |
nonceCaller = esysContext->in.StartAuthSession.nonceCaller;
|
|
|
e56592 |
--
|
|
|
e56592 |
2.27.0
|
|
|
e56592 |
|