diff options
author | Roger Dingledine <arma@torproject.org> | 2002-09-04 06:29:28 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-09-04 06:29:28 +0000 |
commit | ddc2b69a282e9ed3378d8e19dbf6bb48c069717a (patch) | |
tree | 36daec41d3e86e9d59f7672819a2b4a301209486 /src/or/main.c | |
parent | 5948f1431c3e2d82589cc936af52a55cfa376cef (diff) | |
download | tor-ddc2b69a282e9ed3378d8e19dbf6bb48c069717a.tar tor-ddc2b69a282e9ed3378d8e19dbf6bb48c069717a.tar.gz |
onion proxies now work (i think)
svn:r96
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/or/main.c b/src/or/main.c index f755c4fd8..adf36008b 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -198,8 +198,9 @@ unsigned char *router_create_onion(unsigned int *route, int routelen, int *len, +/* FIXME can we cut this function out? */ connection_t *connect_to_router_as_op(routerinfo_t *router) { - return connection_connect_to_router_as_op(router, prkey, options.ORPort); + return connection_connect_to_router_as_op(router, options.ORPort); } void connection_watch_events(connection_t *conn, short events) { @@ -418,16 +419,18 @@ int do_main_loop(void) { return -1; } - /* load the private key */ - prkey = crypto_new_pk_env(CRYPTO_PK_RSA); - if (!prkey) { - log(LOG_ERR,"Error creating a crypto environment."); - return -1; - } - if (crypto_pk_read_private_key_filename(prkey, options.PrivateKeyFile)) - { - log(LOG_ERR,"Error loading private key."); - return -1; + /* load the private key, if we're supposed to have one */ + if(ROLE_IS_OR(global_role)) { + prkey = crypto_new_pk_env(CRYPTO_PK_RSA); + if (!prkey) { + log(LOG_ERR,"Error creating a crypto environment."); + return -1; + } + if (crypto_pk_read_private_key_filename(prkey, options.PrivateKeyFile)) + { + log(LOG_ERR,"Error loading private key."); + return -1; + } } /* start-up the necessary connections based on global_role. This is where we |