[or-cvs] Load hardware acceleration options when/where available. C...

Nick Mathewson nickm at seul.org
Mon Jun 20 18:56:37 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv22033/src/or

Modified Files:
	config.c main.c or.h 
Log Message:
Load hardware acceleration options when/where available.  Can anybody test this?

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.364
retrieving revision 1.365
diff -u -d -r1.364 -r1.365
--- config.c	15 Jun 2005 18:34:46 -0000	1.364
+++ config.c	20 Jun 2005 18:56:34 -0000	1.365
@@ -135,6 +135,7 @@
   VAR("HttpProxyAuthenticator",STRING, HttpProxyAuthenticator,NULL),
   VAR("HttpsProxy",          STRING,   HttpsProxy,           NULL),
   VAR("HttpsProxyAuthenticator",STRING,HttpsProxyAuthenticator,NULL),
+  VAR("HardwareAccel",       BOOL,     HardwareAccel,        "1"),
   VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
   VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
@@ -1662,6 +1663,11 @@
     return -1;
   }
 
+  if (old->HardwareAccel != new_val->HardwareAccel) {
+    log_fn(LOG_WARN,"During reload, changing HardwareAccel is not allowed. Failing.");
+    return -1;
+  }
+
   return 0;
 }
 

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.520
retrieving revision 1.521
diff -u -d -r1.520 -r1.521
--- main.c	20 Jun 2005 09:38:29 -0000	1.520
+++ main.c	20 Jun 2005 18:56:35 -0000	1.521
@@ -1320,7 +1320,7 @@
     log_fn(LOG_WARN,"You are running Tor as root. You don't need to, and you probably shouldn't.");
 #endif
 
-  crypto_global_init();
+  crypto_global_init(get_options()->HardwareAccel);
   if (crypto_seed_rng()) {
     log_fn(LOG_ERR, "Unable to seed random number generator. Exiting.");
     return -1;

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.618
retrieving revision 1.619
diff -u -d -r1.618 -r1.619
--- or.h	19 Jun 2005 20:40:41 -0000	1.618
+++ or.h	20 Jun 2005 18:56:35 -0000	1.619
@@ -1137,6 +1137,8 @@
                            * long do we wait before exiting? */
   int SafeLogging; /**< Boolean: are we allowed to log sensitive strings
                     * such as addresses (0), or do we scrub them first (1)? */
+  int HardwareAccel; /**< Boolean: Should we enable OpenSSL hardware
+                      * acceleration where available? */
 } or_options_t;
 
 #define MAX_SOCKS_REPLY_LEN 1024



More information about the tor-commits mailing list