summaryrefslogtreecommitdiff
path: root/src/remoteauth/ssl.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-06-30 20:43:08 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-06-30 20:43:08 -0400
commit3b206e11216b383fae0e860e0092f71301fd4425 (patch)
tree857c4fbd120ffe37bef5a108dcbe5e322a45ae14 /src/remoteauth/ssl.hpp
parentec6f18ff1204889afd63f08f255d00ae3a1ef12b (diff)
downloadabaddon-portaudio-3b206e11216b383fae0e860e0092f71301fd4425.tar.gz
abaddon-portaudio-3b206e11216b383fae0e860e0092f71301fd4425.zip
remote auth impl. up to QR code display
Diffstat (limited to 'src/remoteauth/ssl.hpp')
-rw-r--r--src/remoteauth/ssl.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/remoteauth/ssl.hpp b/src/remoteauth/ssl.hpp
new file mode 100644
index 0000000..1753bd3
--- /dev/null
+++ b/src/remoteauth/ssl.hpp
@@ -0,0 +1,31 @@
+#pragma once
+#include <memory>
+#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <openssl/pem.h>
+#include <openssl/rsa.h>
+#include <openssl/sha.h>
+
+struct EVP_PKEY_CTX_deleter {
+ void operator()(EVP_PKEY_CTX *ptr) const {
+ EVP_PKEY_CTX_free(ptr);
+ }
+};
+
+struct EVP_PKEY_deleter {
+ void operator()(EVP_PKEY *ptr) const {
+ EVP_PKEY_free(ptr);
+ }
+};
+
+struct EVP_MD_CTX_deleter {
+ void operator()(EVP_MD_CTX *ptr) const {
+ EVP_MD_CTX_free(ptr);
+ }
+};
+
+using EVP_PKEY_CTX_ptr = std::unique_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_deleter>;
+using EVP_PKEY_ptr = std::unique_ptr<EVP_PKEY, EVP_PKEY_deleter>;
+using EVP_MD_CTX_ptr = std::unique_ptr<EVP_MD_CTX, EVP_MD_CTX_deleter>;
+using BIO_ptr = std::unique_ptr<BIO, decltype(&BIO_free)>;
+using BUF_MEM_ptr = std::unique_ptr<BUF_MEM, decltype(&BUF_MEM_free)>;