summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dnstls-openssl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-09-09 17:55:36 +0200
committerLennart Poettering <lennart@poettering.net>2021-09-28 17:03:31 +0200
commitc2fa92e7e8907d9658646595261fa2d3433e6e4b (patch)
tree770cf1806ec34eea966caf8c7a3a1c8f628b07f6 /src/resolve/resolved-dnstls-openssl.c
parentd5fcc5b0532269d2450ed15a2bddca937f123ea9 (diff)
downloadsystemd-c2fa92e7e8907d9658646595261fa2d3433e6e4b.tar.gz
dissect-image: optionally, validate dm-verity signatures in userspace
Getting certificates for dm-verity roothash signing into the trusted kernel keychain is a royal PITA (means recompiling or rebooting with shim), hence let's add a minimal userspace PKCS7 validation as well. The mechanism is really simple and compatible with the verification the kernel does. The only difference is that the certificates are searched in /etc/verity.d/*.crt (and similar dirs in /usr/lib/, …). We'll first try validation by passing the PKCS#7 data to the kernel, but if that doesn't work we'll see if one of the certificates found that way works and then attempt to attach the image without passing the PKCS#7 data to the kernel. This makes it very easy to have fully validated GPT disk images. For example, just copy the 'mkosi.secure-boot.crt' file you have in your mkosi build dir to /etc/verity.d/ and things should just work.
Diffstat (limited to 'src/resolve/resolved-dnstls-openssl.c')
-rw-r--r--src/resolve/resolved-dnstls-openssl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/resolve/resolved-dnstls-openssl.c b/src/resolve/resolved-dnstls-openssl.c
index 17af90d4cc..cba3f14f2d 100644
--- a/src/resolve/resolved-dnstls-openssl.c
+++ b/src/resolve/resolved-dnstls-openssl.c
@@ -9,13 +9,11 @@
#include <openssl/x509v3.h>
#include "io-util.h"
+#include "openssl-util.h"
#include "resolved-dns-stream.h"
#include "resolved-dnstls.h"
#include "resolved-manager.h"
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SSL*, SSL_free, NULL);
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(BIO*, BIO_free, NULL);
-
static int dnstls_flush_write_buffer(DnsStream *stream) {
ssize_t ss;