From 0fe5f3c5d743a7e4c63580a67066935f9e23a2f4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 17 Nov 2016 17:03:21 +0100 Subject: core: add "khash" API to src/basic/ (as wrapper around kernel AF_ALG) Let's take inspiration from bluez's ELL library, and let's move our cryptographic primitives away from libgcrypt and towards the kernel's AF_ALG cryptographic userspace API. In the long run we should try to remove the dependency on libgcrypt, in favour of using only the kernel's own primitives, however this is unlikely to happen anytime soon, as the kernel does not provide Elliptic Curve APIs to userspace at this time, and we need them for the DNSSEC cryptographic. This commit only covers hashing for now, symmetric encryption/decryption or even asymetric encryption/decryption is not available for now. "khash" is little more than a lightweight wrapper around the kernel's AF_ALG socket API. --- Makefile.am | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 6c350b0ec4..6ea367b9a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -938,7 +938,9 @@ libbasic_la_SOURCES = \ src/basic/alloc-util.h \ src/basic/alloc-util.c \ src/basic/format-util.h \ - src/basic/nss-util.h + src/basic/nss-util.h \ + src/basic/khash.h \ + src/basic/khash.c nodist_libbasic_la_SOURCES = \ src/basic/errno-from-name.h \ @@ -4045,6 +4047,16 @@ test_id128_LDADD = \ tests += \ test-id128 +# ------------------------------------------------------------------------------ +test_hash_SOURCES = \ + src/test/test-hash.c + +test_hash_LDADD = \ + libsystemd-shared.la + +tests += \ + test-hash + # ------------------------------------------------------------------------------ bin_PROGRAMS += \ -- cgit v1.2.3-54-g00ecf