Skip to content

Commit

Permalink
[test suite] ensure HMAC key string is equal to SHA512_BLOCK_LEN in l…
Browse files Browse the repository at this point in the history
…ength (fixes ASAN warning)
  • Loading branch information
mrash committed Jul 24, 2015
1 parent 01beb31 commit 6116419
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/fko-wrapper/fko_wrapper.c
Expand Up @@ -25,8 +25,14 @@
#define DO_DIGEST 1
#define RAW_DIGEST 2
#define MAX_LINE_LEN 3000 /* really long for fuzzing tests */
#define ENC_KEY "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" /* 32 bytes */
#define HMAC_KEY "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 32 bytes */

/* We use HMAC and encryption keys that are as long as the max
* sizes since we pass in bogus key lengths. That is, libfko
* functions cannot be expected to handle key lengths that are
* longer than the key buffers themselves.
*/
#define ENC_KEY "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" /* 32 bytes (RIJNDAEL_MAX_KEYSIZE) */
#define HMAC_KEY "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 128 bytes (SHA512_BLOCK_LEN) */

#define IS_EMPTY_LINE(x) ( \
x == '#' || x == '\n' || x == '\r' || x == ';' || x == '\0' \
Expand Down Expand Up @@ -744,4 +750,6 @@ display_ctx(fko_ctx_t ctx)
printf(" Final SPA Data: %s\n", spa_data);

spa_calls += 31;

return;
}

0 comments on commit 6116419

Please sign in to comment.