From 24e69b2956248c982542c9238664d1e95be5b852 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 12:56:26 +0200 Subject: [PATCH] more printf() clean-up * remove last occurences in non-test code * minimize in tests --- src/encauth/eax/eax_test.c | 3 +-- src/encauth/ocb/ocb_test.c | 3 +-- src/encauth/ocb3/ocb3_test.c | 3 +-- src/misc/hkdf/hkdf.c | 12 ------------ src/misc/hkdf/hkdf_test.c | 4 ---- src/misc/pkcs5/pkcs_5_test.c | 9 +++------ 6 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index d3f5533..7d29ee7 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -242,8 +242,7 @@ int eax_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].msglen, tests[x].plaintext, tests[x].msglen, "EAX", x)) { #ifdef LTC_TEST_DBG - printf("\n\nEAX: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nEAX: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index d39dbb9..74431f7 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -191,8 +191,7 @@ int ocb_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)) { #ifdef LTC_TEST_DBG - printf("\n\nOCB: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nOCB: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index d6b9d6f..bcb5d67 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -201,8 +201,7 @@ int ocb3_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) { #ifdef LTC_TEST_DBG - printf("\n\nOCB3: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nOCB3: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index a4e2634..0db4ed9 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -128,18 +128,6 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, XFREE(extracted); return err; } -#if 0 - { - int j; - printf("\nPRK: 0x"); - for(j=0; j < hashsize; j++) { - printf("%02x ", extracted[j]); - } - for(j=0; j < hashsize; j++) { - printf("%02x ", extracted[j]); - } - } -#endif err = hkdf_expand(hash_idx, info, infolen, extracted, hashsize, out, outlen); zeromem(extracted, hashsize); XFREE(extracted); diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index 5879323..632cea9 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -273,10 +273,6 @@ int hkdf_test(void) if(compare_testvector(OKM, cases[i].OKM_l, cases[i].OKM, (size_t)cases[i].OKM_l, "HKDF", cases[i].num)) { failed++; -#if LTC_TEST_DBG > 1 - } else { - printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num); -#endif } } diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index d46ab20..3788fa4 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -176,8 +176,7 @@ int pkcs_5_test (void) cases_5_2[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_2 test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg2() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; } @@ -194,8 +193,7 @@ int pkcs_5_test (void) cases_5_1[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_1 test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg1() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; } @@ -212,8 +210,7 @@ int pkcs_5_test (void) cases_5_1o[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_1o test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg1_openssl() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; }