summaryrefslogtreecommitdiff
path: root/src/uanytun.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uanytun.c')
-rw-r--r--src/uanytun.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/uanytun.c b/src/uanytun.c
index b72c7fb..8725b40 100644
--- a/src/uanytun.c
+++ b/src/uanytun.c
@@ -67,11 +67,20 @@ int init_libgcrypt()
return -1;
}
+#ifndef NO_SEC_MEM
gcry_error_t err = gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0);
if(err) {
log_printf(ERR, "failed initialize secure memory: %s/%s", gcry_strerror(err), gcry_strsource(err));
return -1;
}
+#else
+ gcry_error_t err = gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
+ if(err) {
+ log_printf(ERR, "failed disable secure memory: %s/%s", gcry_strerror(err), gcry_strsource(err));
+ return -1;
+ }
+#endif
+
// Tell Libgcrypt that initialization has completed.
err = gcry_control(GCRYCTL_INITIALIZATION_FINISHED);
if(err) {