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
dffc8e35
Commit
dffc8e35
authored
Jan 03, 2013
by
Nick Mathewson
🎨
Browse files
Whoops; make that unit test actually pass :/
parent
27ac306d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/test_crypto.c
View file @
dffc8e35
...
...
@@ -1016,6 +1016,7 @@ test_crypto_curve25519_persist(void *arg)
char
*
content
=
NULL
;
const
char
*
cp
;
struct
stat
st
;
size_t
taglen
;
(
void
)
arg
;
...
...
@@ -1034,9 +1035,11 @@ test_crypto_curve25519_persist(void *arg)
content
=
read_file_to_str
(
fname
,
RFTS_BIN
,
&
st
);
tt_assert
(
content
);
tt_assert
(
!
strcmpstart
(
content
,
"== c25519v1: testing =="
));
cp
=
content
+
strlen
(
"== c25519v1: testing =="
);
tt_int_op
(
st
.
st_size
,
==
,
64
+
strlen
(
"== c25519v1: testing =="
));
taglen
=
strlen
(
"== c25519v1: testing =="
);
tt_int_op
(
st
.
st_size
,
==
,
32
+
CURVE25519_PUBKEY_LEN
+
CURVE25519_SECKEY_LEN
);
tt_assert
(
fast_memeq
(
content
,
"== c25519v1: testing =="
,
taglen
));
tt_assert
(
tor_mem_is_zero
(
content
+
taglen
,
32
-
taglen
));
cp
=
content
+
32
;
test_memeq
(
keypair
.
seckey
.
secret_key
,
cp
,
CURVE25519_SECKEY_LEN
);
...
...
@@ -1050,7 +1053,7 @@ test_crypto_curve25519_persist(void *arg)
tt_int_op
(
-
1
,
==
,
curve25519_keypair_read_from_file
(
&
keypair2
,
&
tag
,
fname
));
content
[
6
4
]
^=
0xff
;
content
[
6
9
]
^=
0xff
;
tt_int_op
(
0
,
==
,
write_bytes_to_file
(
fname
,
content
,
st
.
st_size
,
1
));
tt_int_op
(
-
1
,
==
,
curve25519_keypair_read_from_file
(
&
keypair2
,
&
tag
,
fname
));
...
...
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