diff options
author | Matt Caswell <matt@openssl.org> | 2019-06-28 16:29:42 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-07-01 10:18:37 +0100 |
commit | 9a131ad7477f85d40ee96853e60d0de86f5f4e09 (patch) | |
tree | b6fad564674f3cd12da7f9c617fa4c78ed943f48 /test/rc5test.c | |
parent | 792cb4ee8d82e4b063f707fc9f4992271ffd65ab (diff) | |
download | openssl-9a131ad7477f85d40ee96853e60d0de86f5f4e09.tar.gz |
Change RC5_32_set_key to return an int type
If the key is too long we now return an error.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8834)
Diffstat (limited to 'test/rc5test.c')
-rw-r--r-- | test/rc5test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/rc5test.c b/test/rc5test.c index 16f4071730..39a113e859 100644 --- a/test/rc5test.c +++ b/test/rc5test.c @@ -181,7 +181,8 @@ static int test_rc5_ecb(int n) RC5_32_KEY key; unsigned char buf[8], buf2[8]; - RC5_32_set_key(&key, 16, &RC5key[n][0], 12); + if (!TEST_true(RC5_32_set_key(&key, 16, &RC5key[n][0], 12))) + return 0; RC5_32_ecb_encrypt(&RC5plain[n][0], buf, &key, RC5_ENCRYPT); if (!TEST_mem_eq(&RC5cipher[n][0], sizeof(RC5cipher[0]), buf, sizeof(buf))) @@ -203,7 +204,9 @@ static int test_rc5_cbc(int n) i = rc5_cbc_rounds[n]; if (i >= 8) { - RC5_32_set_key(&key, rc5_cbc_key[n][0], &rc5_cbc_key[n][1], i); + if (!TEST_true(RC5_32_set_key(&key, rc5_cbc_key[n][0], + &rc5_cbc_key[n][1], i))) + return 0; memcpy(ivb, &rc5_cbc_iv[n][0], 8); RC5_32_cbc_encrypt(&rc5_cbc_plain[n][0], buf, 8, |