diff options
Diffstat (limited to 'auto_tests/encryptsave_test.c')
-rw-r--r-- | auto_tests/encryptsave_test.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/auto_tests/encryptsave_test.c b/auto_tests/encryptsave_test.c index 48a43c86..365a9dbb 100644 --- a/auto_tests/encryptsave_test.c +++ b/auto_tests/encryptsave_test.c | |||
@@ -2,27 +2,24 @@ | |||
2 | #include "config.h" | 2 | #include "config.h" |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include "check_compat.h" | ||
6 | |||
7 | #include <stdint.h> | 5 | #include <stdint.h> |
8 | #include <stdlib.h> | 6 | #include <stdlib.h> |
9 | #include <string.h> | 7 | #include <string.h> |
10 | #include <sys/types.h> | 8 | #include <sys/types.h> |
11 | #include <time.h> | ||
12 | 9 | ||
13 | #include "helpers.h" | ||
14 | |||
15 | #include "../toxcore/tox.h" | ||
16 | |||
17 | #include "../toxcore/ccompat.h" | ||
18 | #include "../toxcore/crypto_core.h" | ||
19 | #include "../toxencryptsave/toxencryptsave.h" | ||
20 | #ifdef VANILLA_NACL | 10 | #ifdef VANILLA_NACL |
21 | #include "../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h" | 11 | #include "../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h" |
22 | #else | 12 | #else |
23 | #include <sodium.h> | 13 | #include <sodium.h> |
24 | #endif | 14 | #endif |
25 | 15 | ||
16 | #include "../testing/misc_tools.h" | ||
17 | #include "../toxcore/ccompat.h" | ||
18 | #include "../toxcore/crypto_core.h" | ||
19 | #include "../toxcore/tox.h" | ||
20 | #include "../toxencryptsave/toxencryptsave.h" | ||
21 | #include "check_compat.h" | ||
22 | |||
26 | static unsigned char test_salt[TOX_PASS_SALT_LENGTH] = {0xB1, 0xC2, 0x09, 0xEE, 0x50, 0x6C, 0xF0, 0x20, 0xC4, 0xD6, 0xEB, 0xC0, 0x44, 0x51, 0x3B, 0x60, 0x4B, 0x39, 0x4A, 0xCF, 0x09, 0x53, 0x4F, 0xEA, 0x08, 0x41, 0xFA, 0xCA, 0x66, 0xD2, 0x68, 0x7F}; | 23 | static unsigned char test_salt[TOX_PASS_SALT_LENGTH] = {0xB1, 0xC2, 0x09, 0xEE, 0x50, 0x6C, 0xF0, 0x20, 0xC4, 0xD6, 0xEB, 0xC0, 0x44, 0x51, 0x3B, 0x60, 0x4B, 0x39, 0x4A, 0xCF, 0x09, 0x53, 0x4F, 0xEA, 0x08, 0x41, 0xFA, 0xCA, 0x66, 0xD2, 0x68, 0x7F}; |
27 | static unsigned char known_key[TOX_PASS_KEY_LENGTH] = {0x29, 0x36, 0x1c, 0x9e, 0x65, 0xbb, 0x46, 0x8b, 0xde, 0xa1, 0xac, 0xf, 0xd5, 0x11, 0x81, 0xc8, 0x29, 0x28, 0x17, 0x23, 0xa6, 0xc3, 0x6b, 0x77, 0x2e, 0xd7, 0xd3, 0x10, 0xeb, 0xd2, 0xf7, 0xc8}; | 24 | static unsigned char known_key[TOX_PASS_KEY_LENGTH] = {0x29, 0x36, 0x1c, 0x9e, 0x65, 0xbb, 0x46, 0x8b, 0xde, 0xa1, 0xac, 0xf, 0xd5, 0x11, 0x81, 0xc8, 0x29, 0x28, 0x17, 0x23, 0xa6, 0xc3, 0x6b, 0x77, 0x2e, 0xd7, 0xd3, 0x10, 0xeb, 0xd2, 0xf7, 0xc8}; |
28 | static const char *pw = "hunter2"; | 25 | static const char *pw = "hunter2"; |
@@ -207,7 +204,6 @@ static Suite *encryptsave_suite(void) | |||
207 | int main(void) | 204 | int main(void) |
208 | { | 205 | { |
209 | setvbuf(stdout, nullptr, _IONBF, 0); | 206 | setvbuf(stdout, nullptr, _IONBF, 0); |
210 | srand((unsigned int) time(nullptr)); | ||
211 | 207 | ||
212 | Suite *encryptsave = encryptsave_suite(); | 208 | Suite *encryptsave = encryptsave_suite(); |
213 | SRunner *test_runner = srunner_create(encryptsave); | 209 | SRunner *test_runner = srunner_create(encryptsave); |