diff options
author | Martin Peck <coder@peertech.org> | 2009-05-23 16:42:44 -0700 |
---|---|---|
committer | Martin Peck <coder@peertech.org> | 2009-05-23 16:42:44 -0700 |
commit | 7703b887f5db0d8d62e9eb87305bb8e2113276f1 (patch) | |
tree | 4cf6f080b0f3ac0f70ff2f4e6e35097c41fcecd0 /src/or/config.c | |
parent | 75f963e9517ba8702fe1ed1d470e28b0462fb3d2 (diff) | |
download | tor-7703b887f5db0d8d62e9eb87305bb8e2113276f1.tar.gz tor-7703b887f5db0d8d62e9eb87305bb8e2113276f1.zip |
Add support for dynamic OpenSSL hardware crypto acceleration engines.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c index a4461a6fe7..0d176670e4 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -222,6 +222,8 @@ static config_var_t _option_vars[] = { #endif OBSOLETE("Group"), V(HardwareAccel, BOOL, "0"), + V(AccelName, STRING, NULL), + V(AccelDir, FILENAME, NULL), V(HashedControlPassword, LINELIST, NULL), V(HidServDirectoryV2, BOOL, "1"), VAR("HiddenServiceDir", LINELIST_S, RendConfigLines, NULL), @@ -444,6 +446,10 @@ static config_var_description_t options_description[] = { * FetchUselessDescriptors */ { "HardwareAccel", "If set, Tor tries to use hardware crypto accelerators " "when it can." }, + { "AccelName", "If set, try to use hardware crypto accelerator with this " + "specific ID." }, + { "AccelDir", "If set, look in this directory for the dynamic hardware " + "engine in addition to OpenSSL default path." }, /* HashedControlPassword */ { "HTTPProxy", "Force Tor to make all HTTP directory requests through this " "host:port (or host:80 if port is not set)." }, @@ -3602,6 +3608,11 @@ options_validate(or_options_t *old_options, or_options_t *options, "testing Tor network!"); } + if (options->AccelName && !options->HardwareAccel) + options->HardwareAccel = 1; + if (options->AccelDir && !options->AccelName) + REJECT("Can't use hardware crypto accelerator dir without engine name."); + return 0; #undef REJECT #undef COMPLAIN @@ -3659,9 +3670,11 @@ options_transition_allowed(or_options_t *old, or_options_t *new_val, return -1; } - if (old->HardwareAccel != new_val->HardwareAccel) { - *msg = tor_strdup("While Tor is running, changing HardwareAccel is " - "not allowed."); + if ((old->HardwareAccel != new_val->HardwareAccel) + || (old->AccelName != new_val->AccelName) + || (old->AccelDir != new_val->AccelDir)) { + *msg = tor_strdup("While Tor is running, changing OpenSSL hardware " + "acceleration engine is not allowed."); return -1; } |