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
Mike Perry
Tor
Commits
f39ca8a3
Commit
f39ca8a3
authored
Apr 16, 2003
by
Roger Dingledine
Browse files
further cleanup, test.c still has some bugs
svn:r241
parent
97d847b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/or/circuit.c
View file @
f39ca8a3
...
...
@@ -144,7 +144,7 @@ int circuit_init(circuit_t *circ, int aci_type, onion_layer_t *layer) {
unsigned
char
digest1
[
20
];
unsigned
char
digest2
[
20
];
struct
timeval
start
,
end
;
int
time_passed
;
long
time_passed
;
assert
(
circ
&&
circ
->
onion
);
...
...
@@ -518,7 +518,7 @@ int circuit_consider_sending_sendme(circuit_t *circ, int edge_type) {
void
circuit_close
(
circuit_t
*
circ
)
{
connection_t
*
conn
;
circuit_t
*
youngest
;
circuit_t
*
youngest
=
NULL
;
assert
(
circ
);
if
(
options
.
APPort
)
...
...
src/or/command.c
View file @
f39ca8a3
...
...
@@ -10,7 +10,7 @@ void command_time_process_cell(cell_t *cell, connection_t *conn,
int
*
num
,
int
*
time
,
void
(
*
func
)(
cell_t
*
,
connection_t
*
))
{
struct
timeval
start
,
end
;
int
time_passed
;
long
time_passed
;
*
num
+=
1
;
...
...
src/or/config.c
View file @
f39ca8a3
...
...
@@ -222,6 +222,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
options
->
loglevel
=
LOG_DEBUG
;
options
->
CoinWeight
=
0
.
8
;
options
->
LinkPadding
=
0
;
options
->
MaxConn
=
900
;
options
->
DirFetchPeriod
=
600
;
options
->
KeepalivePeriod
=
300
;
options
->
MaxOnionsPending
=
10
;
...
...
src/or/test.c
View file @
f39ca8a3
...
...
@@ -280,15 +280,15 @@ test_crypto() {
crypto_cipher_set_iv
(
env2
,
"12345678901234567890"
);
crypto_cipher_encrypt_init_cipher
(
env1
);
crypto_cipher_decrypt_init_cipher
(
env2
);
/* Try encrypting 512 chars. */
crypto_cipher_encrypt
(
env1
,
data1
,
512
,
data2
);
crypto_cipher_decrypt
(
env2
,
data2
,
512
,
data3
);
test_memeq
(
data1
,
data3
,
512
);
if
(
str_ciphers
[
i
]
!=
CRYPTO_CIPHER_IDENTITY
)
{
test_memneq
(
data1
,
data2
,
512
);
}
else
{
if
(
str_ciphers
[
i
]
==
CRYPTO_CIPHER_IDENTITY
)
{
test_memeq
(
data1
,
data2
,
512
);
}
else
{
test_memneq
(
data1
,
data2
,
512
);
}
/* Now encrypt 1 at a time, and get 1 at a time. */
for
(
j
=
512
;
j
<
560
;
++
j
)
{
...
...
@@ -399,13 +399,53 @@ test_crypto() {
}
void
test_util
()
{
struct
timeval
start
,
end
;
start
.
tv_sec
=
5
;
start
.
tv_usec
=
5000
;
end
.
tv_sec
=
5
;
end
.
tv_usec
=
5000
;
test_eq
(
0L
,
tv_udiff
(
&
start
,
&
end
));
end
.
tv_usec
=
7000
;
test_eq
(
2000L
,
tv_udiff
(
&
start
,
&
end
));
end
.
tv_sec
=
6
;
test_eq
(
1002000L
,
tv_udiff
(
&
start
,
&
end
));
end
.
tv_usec
=
0
;
test_eq
(
995000L
,
tv_udiff
(
&
start
,
&
end
));
end
.
tv_sec
=
4
;
test_eq
(
0L
,
tv_udiff
(
&
start
,
&
end
));
}
int
main
(
int
c
,
char
**
v
)
{
#if 0
or_options_t options; /* command-line and config-file options */
if(getconfig(c,v,&options))
exit(1);
#endif
log
(
LOG_ERR
,
NULL
);
/* make logging quieter */
setup_directory
();
puts
(
"========================= Buffers
=
========================="
);
puts
(
"=========================
=
Buffers ========================="
);
test_buffers
();
puts
(
"========================== Crypto =========================="
);
test_crypto
();
test_crypto
();
/* this seg faults :( */
puts
(
"========================== Util ============================"
);
test_util
();
puts
(
""
);
return
0
;
}
...
...
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