summaryrefslogtreecommitdiff
path: root/tests/unit_tests/openvpn/test_tls_crypt.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:57:11 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-10-02 06:57:11 +0200
commit5196d94f84f23057406cb15be7c49a39a05f912d (patch)
treea47dad26e006bd9aa52e7de32c39d75965a2a98d /tests/unit_tests/openvpn/test_tls_crypt.c
parent1cc61feca65e1593f3cbe69af692e31c3042a8a6 (diff)
parenta6daf938f5f616a4a67caa6580b0c99e9a8c3779 (diff)
Updated version 2.4.4 from 'upstream/2.4.4'
with Debian dir 140f8169d27cc56f891366cfbea8aff1659cd942
Diffstat (limited to 'tests/unit_tests/openvpn/test_tls_crypt.c')
-rw-r--r--tests/unit_tests/openvpn/test_tls_crypt.c20
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");