Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ZerXes
Tor
Commits
9f38ba19
Commit
9f38ba19
authored
May 09, 2003
by
Roger Dingledine
Browse files
make router_dump_token only for debugging; clean backslashes
svn:r287
parent
6973ccb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/or/directory.c
View file @
9f38ba19
...
...
@@ -46,7 +46,7 @@ void directory_initiate_fetch(routerinfo_t *router) {
if
(
router
->
signing_pkey
)
conn
->
pkey
=
crypto_pk_dup_key
(
router
->
signing_pkey
);
else
{
log
(
LOG_ERR
,
"No signing key known for directory %s; signature won
\
'
t be checked"
,
conn
->
address
);
log
(
LOG_ERR
,
"No signing key known for directory %s; signature won't be checked"
,
conn
->
address
);
conn
->
pkey
=
NULL
;
}
...
...
src/or/main.c
View file @
9f38ba19
...
...
@@ -654,7 +654,7 @@ build_directory(directory_t *dir) {
routers
=
(
routerinfo_t
**
)
malloc
(
sizeof
(
routerinfo_t
*
)
*
(
nfds
+
1
));
if
(
!
routers
)
{
log
(
LOG_ERR
,
"build_directory(): couldn
\
'
t allocate space for routerinfo"
);
log
(
LOG_ERR
,
"build_directory(): couldn't allocate space for routerinfo"
);
return
-
1
;
}
if
(
my_routerinfo
)
{
...
...
@@ -671,7 +671,7 @@ build_directory(directory_t *dir) {
continue
;
/* we only want to list ones that successfully handshaked */
router
=
router_get_by_addr_port
(
conn
->
addr
,
conn
->
port
);
if
(
!
router
)
{
log
(
LOG_ERR
,
"build_directory(): couldn
\
'
t find router %d:%d!"
,
log
(
LOG_ERR
,
"build_directory(): couldn't find router %d:%d!"
,
conn
->
addr
,
conn
->
port
);
continue
;
}
...
...
@@ -735,11 +735,11 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir,
cp
=
s
+
i
;
if
(
crypto_SHA_digest
(
s
,
i
,
digest
))
{
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn
\
'
t compute digest"
);
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn't compute digest"
);
return
-
1
;
}
if
(
crypto_pk_private_sign
(
private_key
,
digest
,
20
,
signature
)
<
0
)
{
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn
\
'
t sign digest"
);
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn't sign digest"
);
return
-
1
;
}
...
...
@@ -749,7 +749,7 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir,
i
=
strlen
(
s
);
cp
=
s
+
i
;
if
(
base64_encode
(
cp
,
maxlen
-
i
,
signature
,
128
)
<
0
)
{
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn
\
'
t base64-encode signature %d/%d"
);
log
(
LOG_ERR
,
"dump_signed_directory_to_string(): couldn't base64-encode signature %d/%d"
);
return
-
1
;
}
...
...
src/or/routers.c
View file @
9f38ba19
...
...
@@ -376,6 +376,7 @@ _router_get_next_token(char **s, directory_token_t *tok) {
}
}
#ifdef DEBUG_ROUTER_TOKENS
static
void
router_dump_token
(
directory_token_t
*
tok
)
{
int
i
;
...
...
@@ -411,7 +412,6 @@ router_dump_token(directory_token_t *tok) {
return
;
}
#ifdef DEBUG_ROUTER_TOKENS
static
int
router_get_next_token
(
char
**
s
,
directory_token_t
*
tok
)
{
int
i
;
...
...
@@ -511,7 +511,7 @@ static int router_get_dir_hash(char *s, char *digest)
int
router_get_dir_from_string
(
char
*
s
,
crypto_pk_env_t
*
pkey
)
{
if
(
router_get_dir_from_string_impl
(
s
,
&
directory
,
pkey
))
{
log
(
LOG_ERR
,
"router_get_dir_from_string: Couldn
\
'
t parse directory."
);
log
(
LOG_ERR
,
"router_get_dir_from_string: Couldn't parse directory."
);
return
-
1
;
}
if
(
router_resolve_directory
(
directory
))
{
...
...
@@ -660,7 +660,7 @@ router_resolve_directory(directory_t *dir)
for
(
i
=
0
;
i
<
max
;
++
i
)
{
remove
=
0
;
if
(
router_resolve
(
dir
->
routers
[
i
]))
{
log
(
LOG_INFO
,
"Couldn
\
'
t resolve router %s; removing"
,
log
(
LOG_INFO
,
"Couldn't resolve router %s; removing"
,
dir
->
routers
[
i
]
->
address
);
remove
=
1
;
routerinfo_free
(
dir
->
routers
[
i
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment