diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-07-13 07:19:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 07:19:37 +0000 |
commit | 337a3d5811b55994ca7db97fea94f6b96dfaf57c (patch) | |
tree | 9ae7c7c0cc4dcab669fad94546dc7b12e0eda681 /src/remoteauth/ssl.hpp | |
parent | 9a3f6b472d4995c0d5619edc185836f7abb3bc15 (diff) | |
parent | 5bf5cc75eb8cffb3aed44a6743f1bb87a7b2b00d (diff) | |
download | abaddon-portaudio-337a3d5811b55994ca7db97fea94f6b96dfaf57c.tar.gz abaddon-portaudio-337a3d5811b55994ca7db97fea94f6b96dfaf57c.zip |
Merge pull request #185 from uowuo/remoteauth
Login with QR code/remote auth
Diffstat (limited to 'src/remoteauth/ssl.hpp')
-rw-r--r-- | src/remoteauth/ssl.hpp | 31 |
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)>; |