Merge commit 'b2ae9530a405e02a50476c04fc7196c5e9863ad6'
This commit is contained in:
@@ -1,30 +1,41 @@
|
||||
function(target_link_toxcore target)
|
||||
if(TARGET toxcore_static)
|
||||
target_link_libraries(${target} PRIVATE toxcore_static)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE toxcore_shared)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_executable(save-generator save-generator.c)
|
||||
target_link_modules(save-generator toxcore misc_tools)
|
||||
target_link_libraries(save-generator PRIVATE misc_tools)
|
||||
target_link_toxcore(save-generator)
|
||||
|
||||
add_executable(strkey strkey.c)
|
||||
target_link_modules(strkey toxcore ${LIBSODIUM_LIBRARIES})
|
||||
target_link_libraries(strkey PRIVATE ${LIBSODIUM_LIBRARIES})
|
||||
target_link_toxcore(strkey)
|
||||
|
||||
add_executable(create_bootstrap_keys create_bootstrap_keys.c)
|
||||
target_link_modules(create_bootstrap_keys ${LIBSODIUM_LIBRARIES})
|
||||
target_link_libraries(create_bootstrap_keys PRIVATE ${LIBSODIUM_LIBRARIES})
|
||||
target_link_toxcore(create_bootstrap_keys)
|
||||
|
||||
add_executable(create_minimal_savedata create_minimal_savedata.c)
|
||||
target_link_modules(create_minimal_savedata ${LIBSODIUM_LIBRARIES})
|
||||
target_link_libraries(create_minimal_savedata PRIVATE ${LIBSODIUM_LIBRARIES})
|
||||
|
||||
add_executable(create_savedata create_savedata.c)
|
||||
target_link_modules(create_savedata toxcore ${LIBSODIUM_LIBRARIES})
|
||||
target_link_libraries(create_savedata PRIVATE ${LIBSODIUM_LIBRARIES})
|
||||
target_link_toxcore(create_savedata)
|
||||
|
||||
add_executable(sign sign.c)
|
||||
target_link_modules(sign ${LIBSODIUM_LIBRARIES} misc_tools)
|
||||
target_link_libraries(sign PRIVATE ${LIBSODIUM_LIBRARIES} misc_tools)
|
||||
|
||||
add_executable(cracker_simple cracker_simple.c)
|
||||
target_link_modules(cracker_simple ${LIBSODIUM_LIBRARIES} misc_tools)
|
||||
target_link_libraries(cracker_simple ${LIBSODIUM_LIBRARIES} misc_tools)
|
||||
|
||||
# MSVC doesn't support OpenMP
|
||||
if(NOT MSVC)
|
||||
find_package(OpenMP)
|
||||
if(OpenMP_C_FOUND)
|
||||
add_executable(cracker cracker.c)
|
||||
target_link_modules(cracker ${LIBSODIUM_LIBRARIES})
|
||||
target_link_libraries(cracker OpenMP::OpenMP_C)
|
||||
target_link_libraries(cracker PRIVATE OpenMP::OpenMP_C ${LIBSODIUM_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -41,7 +41,7 @@ static bool create_tox(const unsigned char *const secret_key, Tox **const tox)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool print_savedata(Tox *const tox)
|
||||
static bool print_savedata(const Tox *const tox)
|
||||
{
|
||||
const size_t savedata_size = tox_get_savedata_size(tox);
|
||||
uint8_t *const savedata = (uint8_t *)malloc(savedata_size);
|
||||
|
@@ -61,7 +61,7 @@ static void tox_connection_callback(Tox *tox, Tox_Connection connection, void *u
|
||||
}
|
||||
}
|
||||
|
||||
static void print_information(Tox *tox)
|
||||
static void print_information(const Tox *tox)
|
||||
{
|
||||
uint8_t tox_id[TOX_ADDRESS_SIZE];
|
||||
char tox_id_str[TOX_ADDRESS_SIZE * 2];
|
||||
|
2
external/toxcore/c-toxcore/other/fun/sign.c
vendored
2
external/toxcore/c-toxcore/other/fun/sign.c
vendored
@@ -21,7 +21,7 @@
|
||||
#include "../../testing/misc_tools.h" // hex_string_to_bin
|
||||
#include "../../toxcore/ccompat.h"
|
||||
|
||||
static int load_file(char *filename, unsigned char **result)
|
||||
static int load_file(const char *filename, unsigned char **result)
|
||||
{
|
||||
int size = 0;
|
||||
FILE *f = fopen(filename, "rb");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Generates Tox's key pairs, checking if a certain string is in the public key.
|
||||
*
|
||||
* Requires sodium or nacl library.
|
||||
* Requires sodium library.
|
||||
*
|
||||
* There seem to be some problems with the code working on Windows -- it works
|
||||
* when built in debug mode with MinGW 4.8, but it doesn't work correctly when
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#define PRINT_TRIES_COUNT
|
||||
|
||||
static void print_key(unsigned char *key)
|
||||
static void print_key(const unsigned char *key)
|
||||
{
|
||||
for (size_t i = 0; i < crypto_box_PUBLICKEYBYTES; ++i) {
|
||||
if (key[i] < 16) {
|
||||
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
} while (!found);
|
||||
} else {
|
||||
unsigned char *p = public_key + offset;
|
||||
const unsigned char *p = public_key + offset;
|
||||
|
||||
do {
|
||||
#ifdef PRINT_TRIES_COUNT
|
||||
|
Reference in New Issue
Block a user