]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: add openssl helpers
authorLennart Poettering <lennart@poettering.net>
Tue, 12 Nov 2019 14:08:17 +0000 (15:08 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 Dec 2019 17:38:59 +0000 (18:38 +0100)
src/shared/meson.build
src/shared/openssl-util.h [new file with mode: 0644]

index fc0ee28f55e7990a53182b0b094eaa10965351ed..088e302249e68a1091b6cb42a9d962e22bc4d4eb 100644 (file)
@@ -132,6 +132,7 @@ shared_sources = files('''
         nscd-flush.h
         nsflags.c
         nsflags.h
+        openssl-util.h
         os-util.c
         os-util.h
         output-mode.c
diff --git a/src/shared/openssl-util.h b/src/shared/openssl-util.h
new file mode 100644 (file)
index 0000000..dcb9c9f
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include <openssl/pem.h>
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(X509*, X509_free);
+DEFINE_TRIVIAL_CLEANUP_FUNC(X509_NAME*, X509_NAME_free);
+DEFINE_TRIVIAL_CLEANUP_FUNC(EVP_PKEY_CTX*, EVP_PKEY_CTX_free);
+DEFINE_TRIVIAL_CLEANUP_FUNC(EVP_CIPHER_CTX*, EVP_CIPHER_CTX_free);