From f605e5fe4a44d6c9d849f6558535f8aac60761fa Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 8 Jun 2018 23:58:57 +0200 Subject: add support for openssl 1.1 --- src/authAlgoFactory.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/authAlgoFactory.cpp') diff --git a/src/authAlgoFactory.cpp b/src/authAlgoFactory.cpp index b859f33..e30a4b4 100644 --- a/src/authAlgoFactory.cpp +++ b/src/authAlgoFactory.cpp @@ -48,6 +48,7 @@ #include "authAlgoFactory.h" #include "authAlgo.h" +#include "anytunError.h" AuthAlgo* AuthAlgoFactory::create(std::string const& type, kd_dir_t dir) @@ -57,7 +58,13 @@ AuthAlgo* AuthAlgoFactory::create(std::string const& type, kd_dir_t dir) } #ifndef NO_CRYPT else if(type == "sha1") { - return new Sha1AuthAlgo(dir); + Sha1AuthAlgo* a = new Sha1AuthAlgo(dir); + if(!a || !(a->Init())) { + if(a) + delete a; + AnytunError::throwErr() << "failed to initialize SHA1 auth algo"; + } + return a; } #endif else { -- cgit v1.2.3