summaryrefslogtreecommitdiffstats
path: root/src/shared/openssl-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-12 15:08:17 +0100
committerLennart Poettering <lennart@poettering.net>2019-12-09 18:38:59 +0100
commit3f6370198305a744c8d8950183ff077e607cd3eb (patch)
treed915f9c1f48cc44fac10b5c410a7fcbd889d752f /src/shared/openssl-util.h
parentseccomp: real syscall numbers are >= 0 (diff)
downloadsystemd-3f6370198305a744c8d8950183ff077e607cd3eb.tar.xz
systemd-3f6370198305a744c8d8950183ff077e607cd3eb.zip
shared: add openssl helpers
Diffstat (limited to 'src/shared/openssl-util.h')
-rw-r--r--src/shared/openssl-util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shared/openssl-util.h b/src/shared/openssl-util.h
new file mode 100644
index 0000000000..dcb9c9ffa6
--- /dev/null
+++ b/src/shared/openssl-util.h
@@ -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);