summaryrefslogtreecommitdiff
path: root/src/authAlgoFactory.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2018-06-08 23:58:57 +0200
committerChristian Pointner <equinox@anytun.org>2018-06-08 23:58:57 +0200
commitf605e5fe4a44d6c9d849f6558535f8aac60761fa (patch)
treefad359213a53406cbe07a0df54888cf463e0b155 /src/authAlgoFactory.cpp
parentfix include (diff)
add support for openssl 1.1
Diffstat (limited to 'src/authAlgoFactory.cpp')
-rw-r--r--src/authAlgoFactory.cpp9
1 files changed, 8 insertions, 1 deletions
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 {