aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-08 06:26:38 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-08 06:26:38 +0000
commita6a5784bcaae042ba931a98a64b227e9a5a38157 (patch)
treeecdc6fc17ced544a04d7437732761a08df1e5cbb /src/or/config.c
parentace475f01cf8fd6f2cd95e61c08b43d8296e2c88 (diff)
downloadtor-a6a5784bcaae042ba931a98a64b227e9a5a38157.tar
tor-a6a5784bcaae042ba931a98a64b227e9a5a38157.tar.gz
add CertFile, Nickname
write new certfile if you don't have one already set up a tls context on startup svn:r432
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 694488fa1..3ac16d993 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -192,6 +192,8 @@ static void config_assign(or_options_t *options, struct config_line *list) {
config_compare(list, "PrivateKeyFile", CONFIG_TYPE_STRING, &options->PrivateKeyFile) ||
config_compare(list, "SigningPrivateKeyFile", CONFIG_TYPE_STRING, &options->SigningPrivateKeyFile) ||
config_compare(list, "RouterFile", CONFIG_TYPE_STRING, &options->RouterFile) ||
+ config_compare(list, "CertFile", CONFIG_TYPE_STRING, &options->CertFile) ||
+ config_compare(list, "Nickname", CONFIG_TYPE_STRING, &options->Nickname) ||
/* int options */
config_compare(list, "MaxConn", CONFIG_TYPE_INT, &options->MaxConn) ||
@@ -244,6 +246,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
options->NewCircuitPeriod = 60; /* once a minute */
options->TotalBandwidth = 800000; /* at most 800kB/s total sustained incoming */
options->NumCpus = 1;
+ options->CertFile = "default.cert";
// options->ReconnectPeriod = 6001;
/* get config lines from /etc/torrc and assign them */
@@ -352,6 +355,11 @@ int getconfig(int argc, char **argv, or_options_t *options) {
result = -1;
}
+ if(options->OnionRouter && options->Nickname == NULL) {
+ log_fn(LOG_ERR,"Nickname required for OnionRouter, but not found.");
+ return -1;
+ }
+
if(options->DirPort > 0 && options->SigningPrivateKeyFile == NULL) {
log(LOG_ERR,"SigningPrivateKeyFile option required for DirServer, but not found.");
result = -1;