refactor(lib/attestation): cleanup struct token_sign_cntxt
Remove fields from struct token_sign_cntxt that are managed by
runtime/rsi/realm_attest.c
Change-Id: I7adf4d6a1aaf68224cd709c749f7cca7ccacc860
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/lib/attestation/include/attestation_token.h b/lib/attestation/include/attestation_token.h
index 35f8651..6d91a79 100644
--- a/lib/attestation/include/attestation_token.h
+++ b/lib/attestation/include/attestation_token.h
@@ -96,14 +96,6 @@
*/
enum attest_token_gen_state_t state;
struct attest_token_encode_ctx ctx;
-
- /* Number of CCA token bytes left to copy to the Realm */
- size_t cca_token_len;
-
- /* Number of CCA token bytes copied to the Realm */
- size_t copied_len;
-
- unsigned char challenge[ATTEST_CHALLENGE_SIZE];
};
#else /* CBMC */
@@ -194,6 +186,8 @@
unsigned int num_measurements,
const void *rpv_buf,
size_t rpv_len,
+ const void *challenge_buf,
+ size_t challenge_len,
struct token_sign_cntxt *ctx,
void *realm_token_buf,
size_t realm_token_buf_size);
diff --git a/lib/attestation/src/attestation_token.c b/lib/attestation/src/attestation_token.c
index be12d39..1f51609 100644
--- a/lib/attestation/src/attestation_token.c
+++ b/lib/attestation/src/attestation_token.c
@@ -258,6 +258,8 @@
unsigned int num_measurements,
const void *rpv_buf,
size_t rpv_len,
+ const void *challenge_buf,
+ size_t challenge_len,
struct token_sign_cntxt *ctx,
void *realm_token_buf,
size_t realm_token_buf_size)
@@ -293,8 +295,8 @@
QCBOREncode_OpenMap(&(ctx->ctx.cbor_enc_ctx));
/* Add challenge value, which is the only input from the caller. */
- buf.ptr = ctx->challenge;
- buf.len = ATTEST_CHALLENGE_SIZE;
+ buf.ptr = challenge_buf;
+ buf.len = challenge_len;
QCBOREncode_AddBytesToMapN(&(ctx->ctx.cbor_enc_ctx),
CCA_REALM_CHALLENGE,
buf);