aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_crypto.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-04 15:48:42 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-04 15:48:42 +0000
commitbfeaccab3dc438565ef03fa961fee49805fd6eb8 (patch)
tree517ee94a20886f04c78a05a553831f5b081fed76 /res/res_crypto.c
parent151774c059eebca84557de8bed5495b523bdd8b2 (diff)
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@600 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_crypto.c')
-rwxr-xr-xres/res_crypto.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c
index 5ac2e441b..61eb1328e 100755
--- a/res/res_crypto.c
+++ b/res/res_crypto.c
@@ -28,7 +28,10 @@
#include <dirent.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
#include "../asterisk.h"
+#include "../astconf.h"
/*
* Asterisk uses RSA keys with SHA-1 message digests for its
@@ -460,14 +463,14 @@ static void crypto_load(int ifd, int ofd)
}
ast_pthread_mutex_unlock(&keylock);
/* Load new keys */
- dir = opendir(AST_KEY_DIR);
+ dir = opendir((char *)ast_config_AST_KEY_DIR);
if (dir) {
while((ent = readdir(dir))) {
- try_load_key(AST_KEY_DIR, ent->d_name, ifd, ofd, &note);
+ try_load_key((char *)ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, &note);
}
closedir(dir);
} else
- ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", AST_KEY_DIR);
+ ast_log(LOG_WARNING, "Unable to open key directory '%s'\n", (char *)ast_config_AST_KEY_DIR);
if (note) {
ast_log(LOG_NOTICE, "Please run the command 'init keys' to enter the passcodes for the keys\n");
}
@@ -531,9 +534,9 @@ static int init_keys(int fd, int argc, char *argv[])
while(key) {
/* Reload keys that need pass codes now */
if (key->ktype & KEY_NEEDS_PASSCODE) {
- kn = key->fn + strlen(AST_KEY_DIR) + 1;
+ kn = key->fn + strlen(ast_config_AST_KEY_DIR) + 1;
strncpy(tmp, kn, sizeof(tmp));
- try_load_key(AST_KEY_DIR, tmp, fd, fd, &ign);
+ try_load_key((char *)ast_config_AST_KEY_DIR, tmp, fd, fd, &ign);
}
key = key->next;
}