diff options
author | Bernhard Schmidt <berni@debian.org> | 2017-12-30 22:21:14 +0100 |
---|---|---|
committer | Bernhard Schmidt <berni@debian.org> | 2017-12-30 22:21:14 +0100 |
commit | 166ec510cb88cc1213ba6f441ffb372836fbddd3 (patch) | |
tree | 8a8160ebeff4eaa8924367dbca91ff89fccbbb2d /tests/unit_tests/openvpn/test_tls_crypt.c | |
parent | 1e5f64f1519f3e43bdd34e2975c9c97840779592 (diff) | |
parent | 75286879ecd00a15e21cb9126643fef0316bd47f (diff) |
Merge tag 'debian/2.4.4-2' into stretch-backports
openvpn Debian release 2.4.4-2
Diffstat (limited to 'tests/unit_tests/openvpn/test_tls_crypt.c')
-rw-r--r-- | tests/unit_tests/openvpn/test_tls_crypt.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/unit_tests/openvpn/test_tls_crypt.c b/tests/unit_tests/openvpn/test_tls_crypt.c index 9b82035..0a6a08f 100644 --- a/tests/unit_tests/openvpn/test_tls_crypt.c +++ b/tests/unit_tests/openvpn/test_tls_crypt.c @@ -39,7 +39,7 @@ #include <setjmp.h> #include <cmocka.h> -#include "tls_crypt.h" +#include "tls_crypt.c" #include "mock_msg.h" @@ -60,23 +60,13 @@ setup(void **state) { struct test_context *ctx = calloc(1, sizeof(*ctx)); *state = ctx; - ctx->kt.cipher = cipher_kt_get("AES-256-CTR"); - ctx->kt.digest = md_kt_get("SHA256"); - if (!ctx->kt.cipher) - { - printf("No AES-256-CTR support, skipping test.\n"); - return 0; - } - if (!ctx->kt.digest) + struct key key = { 0 }; + + ctx->kt = tls_crypt_kt(); + if (!ctx->kt.cipher || !ctx->kt.digest) { - printf("No HMAC-SHA256 support, skipping test.\n"); return 0; } - ctx->kt.cipher_length = cipher_kt_key_size(ctx->kt.cipher); - ctx->kt.hmac_length = md_kt_size(ctx->kt.digest); - - struct key key = { 0 }; - init_key_ctx(&ctx->co.key_ctx_bi.encrypt, &key, &ctx->kt, true, "TEST"); init_key_ctx(&ctx->co.key_ctx_bi.decrypt, &key, &ctx->kt, false, "TEST"); |