aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/openvpn/test_auth_token.c
diff options
context:
space:
mode:
authorAntonio Quartulli2020-05-07 15:59:09 +0200
committerGert Doering2020-05-07 16:58:08 +0200
commitcb2e9218f2bc73fa22da1f6e850e5fe97f689730 (patch)
tree56b19ebd6295f47b1b2e92c61691ee1b0f246910 /tests/unit_tests/openvpn/test_auth_token.c
parent4dddca52a8432095dd85ff652fae61a2aedb3785 (diff)
downloadopenvpn-cb2e9218f2bc73fa22da1f6e850e5fe97f689730.zip
openvpn-cb2e9218f2bc73fa22da1f6e850e5fe97f689730.tar.gz
convert *_inline attributes to bool
Carrying around the INLINE_TAG is not really efficient, because it requires a strcmp() to be performed every time we want to understand if the data is stored inline or not. Convert all the *_inline attributes to bool to make the logic easier and checks more efficient. Signed-off-by: Antonio Quartulli <a@unstable.cc> Acked-by: Arne Schwabe <arne@rfc2549.org> Message-Id: <20200507135909.21227-1-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19854.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'tests/unit_tests/openvpn/test_auth_token.c')
-rw-r--r--tests/unit_tests/openvpn/test_auth_token.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit_tests/openvpn/test_auth_token.c b/tests/unit_tests/openvpn/test_auth_token.c
index 6b30dfb..dbde863 100644
--- a/tests/unit_tests/openvpn/test_auth_token.c
+++ b/tests/unit_tests/openvpn/test_auth_token.c
@@ -341,7 +341,7 @@ auth_token_test_random_keys(void **state)
ctx->multi.auth_token = strdup(random_token);
free_key_ctx(&ctx->multi.opt.auth_token_key);
- auth_token_init_secret(&ctx->multi.opt.auth_token_key, INLINE_FILE_TAG, random_key);
+ auth_token_init_secret(&ctx->multi.opt.auth_token_key, random_key, true);
/* Zero the hmac part to ensure we have a newly generated token */
zerohmac(ctx->multi.auth_token);
@@ -361,12 +361,12 @@ auth_token_test_key_load(void **state)
struct test_context *ctx = (struct test_context *) *state;
free_key_ctx(&ctx->multi.opt.auth_token_key);
- auth_token_init_secret(&ctx->multi.opt.auth_token_key, INLINE_FILE_TAG, zeroinline);
+ auth_token_init_secret(&ctx->multi.opt.auth_token_key, zeroinline, true);
strcpy(ctx->up.password, now0key0);
assert_true(verify_auth_token(&ctx->up, &ctx->multi, &ctx->session));
free_key_ctx(&ctx->multi.opt.auth_token_key);
- auth_token_init_secret(&ctx->multi.opt.auth_token_key, INLINE_FILE_TAG, allx01inline);
+ auth_token_init_secret(&ctx->multi.opt.auth_token_key, allx01inline, true);
assert_false(verify_auth_token(&ctx->up, &ctx->multi, &ctx->session));
}