summaryrefslogtreecommitdiff
path: root/auto_tests/encryptsave_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests/encryptsave_test.c')
-rw-r--r--auto_tests/encryptsave_test.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/auto_tests/encryptsave_test.c b/auto_tests/encryptsave_test.c
index 02a29016..f1e768d6 100644
--- a/auto_tests/encryptsave_test.c
+++ b/auto_tests/encryptsave_test.c
@@ -19,16 +19,16 @@
19#include "../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h" 19#include "../toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h"
20#endif 20#endif
21 21
22unsigned char salt[32] = {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}; 22static unsigned char salt[32] = {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};
23unsigned char known_key[crypto_box_BEFORENMBYTES] = {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}; 23static unsigned char known_key[crypto_box_BEFORENMBYTES] = {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};
24const char *pw = "hunter2"; 24static const char *pw = "hunter2";
25unsigned int pwlen = 7; 25static unsigned int pwlen = 7;
26 26
27unsigned char known_key2[crypto_box_BEFORENMBYTES] = {0x7a, 0xfa, 0x95, 0x45, 0x36, 0x8a, 0xa2, 0x5c, 0x40, 0xfd, 0xc0, 0xe2, 0x35, 0x8, 0x7, 0x88, 0xfa, 0xf9, 0x37, 0x86, 0xeb, 0xff, 0x50, 0x4f, 0x3, 0xe2, 0xf6, 0xd9, 0xef, 0x9, 0x17, 0x1}; 27static unsigned char known_key2[crypto_box_BEFORENMBYTES] = {0x7a, 0xfa, 0x95, 0x45, 0x36, 0x8a, 0xa2, 0x5c, 0x40, 0xfd, 0xc0, 0xe2, 0x35, 0x8, 0x7, 0x88, 0xfa, 0xf9, 0x37, 0x86, 0xeb, 0xff, 0x50, 0x4f, 0x3, 0xe2, 0xf6, 0xd9, 0xef, 0x9, 0x17, 0x1};
28// same as above, except standard opslimit instead of extra ops limit for test_known_kdf, and hash pw before kdf for compat 28// same as above, except standard opslimit instead of extra ops limit for test_known_kdf, and hash pw before kdf for compat
29 29
30/* cause I'm shameless */ 30/* cause I'm shameless */
31void accept_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata) 31static void accept_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata)
32{ 32{
33 if (*((uint32_t *)userdata) != 974536) { 33 if (*((uint32_t *)userdata) != 974536) {
34 return; 34 return;
@@ -63,7 +63,7 @@ START_TEST(test_save_friend)
63 tox_callback_friend_request(tox2, accept_friend_request); 63 tox_callback_friend_request(tox2, accept_friend_request);
64 uint8_t address[TOX_ADDRESS_SIZE]; 64 uint8_t address[TOX_ADDRESS_SIZE];
65 tox_self_get_address(tox2, address); 65 tox_self_get_address(tox2, address);
66 uint32_t test = tox_friend_add(tox1, address, (uint8_t *)"Gentoo", 7, 0); 66 uint32_t test = tox_friend_add(tox1, address, (const uint8_t *)"Gentoo", 7, 0);
67 ck_assert_msg(test != UINT32_MAX, "Failed to add friend"); 67 ck_assert_msg(test != UINT32_MAX, "Failed to add friend");
68 68
69 size_t size = tox_get_savedata_size(tox1); 69 size_t size = tox_get_savedata_size(tox1);
@@ -186,7 +186,7 @@ START_TEST(test_keys)
186} 186}
187END_TEST 187END_TEST
188 188
189Suite *encryptsave_suite(void) 189static Suite *encryptsave_suite(void)
190{ 190{
191 Suite *s = suite_create("encryptsave"); 191 Suite *s = suite_create("encryptsave");
192 192
@@ -212,4 +212,3 @@ int main(int argc, char *argv[])
212 212
213 return number_failed; 213 return number_failed;
214} 214}
215