From f5fd8de48204e3a3c2a0fcdb11e81ffef614e553 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Wed, 1 Jan 2014 14:07:39 -0500 Subject: [PATCH] [test suite] better loop output for fko-wrapper --- test/fko-wrapper/fko_wrapper.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/test/fko-wrapper/fko_wrapper.c b/test/fko-wrapper/fko_wrapper.c index dd68317a..32c26e85 100644 --- a/test/fko-wrapper/fko_wrapper.c +++ b/test/fko-wrapper/fko_wrapper.c @@ -73,6 +73,9 @@ test_loop(int new_ctx_flag, int destroy_ctx_flag) int i, j; char *spa_data = NULL; + printf("[+] test_loop(): %s, %s\n", + new_ctx_flag == NEW_CTX ? "NEW_CTX" : "NO_NEW_CTX", + destroy_ctx_flag == CTX_DESTROY ? "DESTROY_CTX" : "NO_DESTROY_CTX"); printf("fko_new(): %s\n", fko_errstr(fko_new(&ctx))); fko_destroy(ctx); ctx = NULL; @@ -186,17 +189,17 @@ test_loop(int new_ctx_flag, int destroy_ctx_flag) ctx_update(&ctx, new_ctx_flag, destroy_ctx_flag, DO_PRINT); } - printf("fko_new_with_data(): %s\n", + printf("fko_new_with_data(): %s (data: %s)\n", fko_errstr(fko_new_with_data(&decrypt_ctx, spa_data, NULL, - 0, FKO_ENC_MODE_CBC, NULL, 0, FKO_HMAC_SHA256))); + 0, FKO_ENC_MODE_CBC, NULL, 0, FKO_HMAC_SHA256)), spa_data); /* verify hmac, decrypt, and display ctx all together*/ for (i=0; i" : enc_data); + printf(" Encoded Data: %s\n", enc_data == NULL ? "" : enc_data); printf("SPA Data Digest: %s\n", spa_digest == NULL ? "" : spa_digest); printf(" HMAC: %s\n", hmac_data == NULL ? "" : hmac_data); + printf(" Final SPA Data: %s\n", spa_data); - if (enc_data != NULL && spa_digest != NULL) - printf(" Plaintext: %s:%s\n", enc_data, spa_digest); - - printf("\nFinal Packed/Encrypted/Encoded Data:\n\n%s\n\n", spa_data); + spa_calls += 31; }