Compare commits
No commits in common. "344b4375f9dafc4671d70832d42b56af4fb1f28b" and "e03c651cef03225df056e97c9edfd14027b28828" have entirely different histories.
344b4375f9
...
e03c651cef
2
dependencies/tlibc
vendored
2
dependencies/tlibc
vendored
@ -1 +1 @@
|
|||||||
Subproject commit bb3b096262106fcc503c03b1555ca196d5b780e9
|
Subproject commit 2c8e6fc601a868851d8ce50f77b391e6a9b7e656
|
||||||
@ -1,24 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
CBUILD_VERSION=2.3.0
|
CBUILD_VERSION=2.2.3
|
||||||
|
|
||||||
PROJECT="tcp-chat"
|
PROJECT="tcp-chat"
|
||||||
CMP_C="gcc"
|
CMP_C="gcc"
|
||||||
CMP_CPP="g++"
|
CMP_CPP="g++"
|
||||||
STD_C="c99"
|
STD_C="c99"
|
||||||
STD_CPP="c++11"
|
STD_CPP="c++11"
|
||||||
WARN_C="-Wall -Wextra
|
WARN_C="-Wall -Wextra -Werror=return-type -Werror=pointer-arith -Wno-unused-parameter"
|
||||||
-Wduplicated-branches
|
WARN_CPP="-Wall -Wextra -Werror=return-type -Werror=pointer-arith -Wno-unused-parameter"
|
||||||
-Wduplicated-cond
|
|
||||||
-Wformat=2
|
|
||||||
-Wmissing-include-dirs
|
|
||||||
-Wshadow
|
|
||||||
-Werror=return-type
|
|
||||||
-Werror=pointer-arith
|
|
||||||
-Werror=init-self
|
|
||||||
-Werror=incompatible-pointer-types"
|
|
||||||
WARN_CPP="$WARN_C"
|
|
||||||
SRC_C="$(find src -name '*.c')"
|
SRC_C="$(find src -name '*.c')"
|
||||||
SRC_CPP="$(find src -name '*.cpp')"
|
#SRC_CPP="$(find src -name '*.cpp')"
|
||||||
|
|
||||||
# Directory with dependency configs.
|
# Directory with dependency configs.
|
||||||
# See cbuild/example_dependency_configs
|
# See cbuild/example_dependency_configs
|
||||||
@ -33,7 +24,7 @@ ENABLED_DEPENDENCIES='tlibc bearssl'
|
|||||||
# └── profile/ - gcc *.gcda profiling info files
|
# └── profile/ - gcc *.gcda profiling info files
|
||||||
OBJDIR="obj"
|
OBJDIR="obj"
|
||||||
OUTDIR="bin"
|
OUTDIR="bin"
|
||||||
STATIC_LIB_FILE="$PROJECT.a"
|
STATIC_LIB_FILE="lib$PROJECT.a"
|
||||||
|
|
||||||
INCLUDE="-Isrc -Idependencies/BearSSL/inc -Idependencies/tlibc/include"
|
INCLUDE="-Isrc -Idependencies/BearSSL/inc -Idependencies/tlibc/include"
|
||||||
|
|
||||||
@ -69,61 +60,61 @@ case "$TASK" in
|
|||||||
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects -fdata-sections -ffunction-sections -Wl,--gc-sections"
|
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects -fdata-sections -ffunction-sections -Wl,--gc-sections"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
POST_TASK_SCRIPT="@cbuild/default_tasks/strip_exec.sh"
|
POST_TASK_SCRIPT="tasks/strip.sh"
|
||||||
;;
|
;;
|
||||||
# creates executable with debug info and no optimizations
|
# creates executable with debug info and no optimizations
|
||||||
build_exec_dbg)
|
build_exec_dbg)
|
||||||
C_ARGS="-O0 -g3"
|
C_ARGS="-O0 -g3"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# creates shared library
|
# creates shared library
|
||||||
build_shared_lib)
|
build_shared_lib)
|
||||||
C_ARGS="-O2 -fpic -flto -shared"
|
C_ARGS="-O2 -fpic -flto -shared"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS -Wl,-soname,$SHARED_LIB_FILE"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS -Wl,-soname,$SHARED_LIB_FILE"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_shared_lib.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_shared_lib.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# creates shared library with debug symbols and no optimizations
|
# creates shared library with debug symbols and no optimizations
|
||||||
build_shared_lib_dbg)
|
build_shared_lib_dbg)
|
||||||
C_ARGS="-O0 -g3 -fpic -shared"
|
C_ARGS="-O0 -g3 -fpic -shared"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS -Wl,-soname,$SHARED_LIB_FILE"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS -Wl,-soname,$SHARED_LIB_FILE"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_shared_lib.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_shared_lib.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# creates static library
|
# creates static library
|
||||||
build_static_lib)
|
build_static_lib)
|
||||||
C_ARGS="-O2 -fpic -fdata-sections -ffunction-sections"
|
C_ARGS="-O2 -fpic -fdata-sections -ffunction-sections"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_static_lib.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# creates static library with debug symbols and no optimizations
|
# creates static library with debug symbols and no optimizations
|
||||||
build_static_lib_dbg)
|
build_static_lib_dbg)
|
||||||
C_ARGS="-O0 -g3"
|
C_ARGS="-O0 -g3"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
PRE_TASK_SCRIPT=""
|
PRE_TASK_SCRIPT=
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/build_static_lib.sh"
|
TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# executes $EXEC_FILE
|
# executes $EXEC_FILE
|
||||||
exec)
|
exec)
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/exec.sh"
|
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||||
;;
|
;;
|
||||||
# executes $EXEC_FILE with valgrind memory checker
|
# executes $EXEC_FILE with valgrind memory checker
|
||||||
valgrind)
|
valgrind)
|
||||||
VALGRIND_ARGS="-s --read-var-info=yes --track-origins=yes --fullpath-after=$(pwd)/ --leak-check=full --show-leak-kinds=all"
|
VALGRIND_ARGS="-s --read-var-info=yes --track-origins=yes --fullpath-after=$(pwd)/ --leak-check=full --show-leak-kinds=all"
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/valgrind.sh"
|
TASK_SCRIPT=cbuild/default_tasks/valgrind.sh
|
||||||
;;
|
;;
|
||||||
# generates profiling info
|
# generates profiling info
|
||||||
profile)
|
profile)
|
||||||
@ -134,13 +125,12 @@ case "$TASK" in
|
|||||||
# -pg adds code to executable, that generates file containing function call info (gmon.out)
|
# -pg adds code to executable, that generates file containing function call info (gmon.out)
|
||||||
# -fprofile-generate generates executable with profiling code
|
# -fprofile-generate generates executable with profiling code
|
||||||
# -fprofile-prefix-path sets path where profiling info about objects will be saved
|
# -fprofile-prefix-path sets path where profiling info about objects will be saved
|
||||||
C_ARGS="-O2 -flto=auto -fuse-linker-plugin
|
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-generate -fprofile-prefix-path=$(realpath $OBJDIR)/objects"
|
||||||
-fprofile-generate -fprofile-prefix-path=$(realpath $OBJDIR)/objects"
|
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/profile.sh"
|
TASK_SCRIPT=cbuild/default_tasks/profile.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# compiles program with -pg and runs it with gprof
|
# compiles program with -pg and runs it with gprof
|
||||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||||
@ -149,14 +139,12 @@ case "$TASK" in
|
|||||||
OUTDIR="$OUTDIR/gprof"
|
OUTDIR="$OUTDIR/gprof"
|
||||||
# arguments that emit some call counter code and disable optimizations to see function names
|
# arguments that emit some call counter code and disable optimizations to see function names
|
||||||
# https://github.com/msys2/MINGW-packages/issues/8503#issuecomment-1365475205
|
# https://github.com/msys2/MINGW-packages/issues/8503#issuecomment-1365475205
|
||||||
C_ARGS="-O0 -g -pg -no-pie -fno-omit-frame-pointer
|
C_ARGS="-O0 -g -pg -no-pie -fno-omit-frame-pointer -fno-inline-functions -fno-inline-functions-called-once -fno-optimize-sibling-calls -fopenmp"
|
||||||
-fno-inline-functions -fno-inline-functions-called-once
|
|
||||||
-fno-optimize-sibling-calls -fopenmp"
|
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/gprof.sh"
|
TASK_SCRIPT=cbuild/default_tasks/gprof.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# compiles program and runs it with callgrind (part of valgrind)
|
# compiles program and runs it with callgrind (part of valgrind)
|
||||||
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
# uses gprof2dot python script to generate function call tree (pip install gprof2dot)
|
||||||
@ -168,9 +156,9 @@ case "$TASK" in
|
|||||||
C_ARGS="-O2 -flto=auto -fuse-linker-plugin"
|
C_ARGS="-O2 -flto=auto -fuse-linker-plugin"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/callgrind.sh"
|
TASK_SCRIPT=cbuild/default_tasks/callgrind.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# compiles executable with sanitizers and executes it to find errors and warnings
|
# compiles executable with sanitizers and executes it to find errors and warnings
|
||||||
sanitize)
|
sanitize)
|
||||||
@ -178,19 +166,19 @@ case "$TASK" in
|
|||||||
C_ARGS="-O0 -g3 -fsanitize=undefined,address"
|
C_ARGS="-O0 -g3 -fsanitize=undefined,address"
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
PRE_TASK_SCRIPT="@cbuild/default_tasks/build_exec.sh"
|
PRE_TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/exec.sh"
|
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||||
POST_TASK_SCRIPT=""
|
POST_TASK_SCRIPT=
|
||||||
;;
|
;;
|
||||||
# rebuilds specified dependencies
|
# rebuilds specified dependencies
|
||||||
# EXAMPLE: `cbuild rebuild_dependencies=libexample1,fonts`
|
# EXAMPLE: `cbuild rebuild_dependencies=libexample1,fonts`
|
||||||
# 'all' can be specified to rebuild all dependencies
|
# 'all' can be specified to rebuild all dependencies
|
||||||
rebuild_dependencies)
|
rebuild_dependencies)
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/rebuild_dependencies.sh"
|
TASK_SCRIPT=cbuild/default_tasks/rebuild_dependencies.sh
|
||||||
;;
|
;;
|
||||||
# deletes generated files
|
# deletes generated files
|
||||||
clean)
|
clean)
|
||||||
TASK_SCRIPT="@cbuild/default_tasks/clean.sh"
|
TASK_SCRIPT=cbuild/default_tasks/clean.sh
|
||||||
;;
|
;;
|
||||||
# nothing to do
|
# nothing to do
|
||||||
"" | no_task)
|
"" | no_task)
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Project user config is ignored by git.
|
|
||||||
# Here you can add variables that users might want to change
|
|
||||||
# on their local machine, without commiting to the repository.
|
|
||||||
|
|
||||||
# Directory where you install dependencies.
|
|
||||||
# Do not confuse with DEPENDENCY_CONFIGS_DIR
|
|
||||||
# Example:
|
|
||||||
# libexample source code is at `../libexample`, and dependency config
|
|
||||||
# that specifies how to build this lib is at `dependencies/libexample.config`
|
|
||||||
DEPENDENCIES_DIR=".."
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "tlibc/collections/List.h"
|
#include "tlibc/string/StringBuilder.h"
|
||||||
|
|
||||||
void ClientCredentials_destroy(ClientCredentials* cred){
|
void ClientCredentials_destroy(ClientCredentials* cred){
|
||||||
if(!cred)
|
if(!cred)
|
||||||
@ -22,19 +22,18 @@ Result(void) ClientCredentials_tryConstruct(ClientCredentials* cred,
|
|||||||
cred->username = str_copy(username);
|
cred->username = str_copy(username);
|
||||||
|
|
||||||
// concat password and username
|
// concat password and username
|
||||||
List(u8) data_to_hash = List_alloc_size(password.size + username.size + PASSWORD_HASH_SIZE);
|
StringBuilder sb = StringBuilder_alloc(username.size + password.size + 1);
|
||||||
Defer(free(data_to_hash.data));
|
Defer(StringBuilder_destroy(&sb));
|
||||||
List_push_size(&data_to_hash, password.data, password.size);
|
StringBuilder_append_str(&sb, password);
|
||||||
List_push_size(&data_to_hash, username.data, username.size);
|
StringBuilder_append_str(&sb, username);
|
||||||
|
Array(u8) password_and_username = str_castTo_Array(StringBuilder_getStr(&sb));
|
||||||
|
|
||||||
// lvl 1 hash - is used as AES key for user data
|
// lvl 1 hash - is used as AES key for user data
|
||||||
cred->user_data_key = Array_alloc(u8, PASSWORD_HASH_SIZE);
|
cred->user_data_key = Array_alloc(u8, PASSWORD_HASH_SIZE);
|
||||||
hash_password(List_castTo_Array(data_to_hash), cred->user_data_key.data, PASSWORD_HASH_LVL_ROUNDS);
|
hash_password(password_and_username, cred->user_data_key.data, __PASSWORD_HASH_LVL_ITERATIONS);
|
||||||
// concat lvl 1 hash to data_to_hash
|
|
||||||
List_push_size(&data_to_hash, cred->user_data_key.data, cred->user_data_key.size);
|
|
||||||
// lvl 2 hash - is used for authentification
|
// lvl 2 hash - is used for authentification
|
||||||
cred->token = Array_alloc(u8, PASSWORD_HASH_SIZE);
|
cred->token = Array_alloc(u8, PASSWORD_HASH_SIZE);
|
||||||
hash_password(List_castTo_Array(data_to_hash), cred->token.data, PASSWORD_HASH_LVL_ROUNDS);
|
hash_password(cred->user_data_key, cred->token.data, __PASSWORD_HASH_LVL_ITERATIONS);
|
||||||
|
|
||||||
AESBlockEncryptor_construct(&cred->user_data_aes_enc, cred->user_data_key, AESBlockEncryptor_DEFAULT_CLASS);
|
AESBlockEncryptor_construct(&cred->user_data_aes_enc, cred->user_data_key, AESBlockEncryptor_DEFAULT_CLASS);
|
||||||
AESBlockDecryptor_construct(&cred->user_data_aes_dec, cred->user_data_key, AESBlockDecryptor_DEFAULT_CLASS);
|
AESBlockDecryptor_construct(&cred->user_data_aes_dec, cred->user_data_key, AESBlockDecryptor_DEFAULT_CLASS);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Result(void) ServerLink_parse(cstr server_link_cstr, EndpointIPv4* server_end_ou
|
|||||||
Return RESULT_VOID;
|
Return RESULT_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result(ServerConnection*) ServerConnection_open(cstr server_link_cstr){
|
Result(ServerConnection*) ServerConnection_open(ClientCredentials* client_credentials, cstr server_link_cstr){
|
||||||
Deferral(16);
|
Deferral(16);
|
||||||
|
|
||||||
ServerConnection* conn = (ServerConnection*)malloc(sizeof(ServerConnection));
|
ServerConnection* conn = (ServerConnection*)malloc(sizeof(ServerConnection));
|
||||||
|
|||||||
@ -25,8 +25,6 @@ Result(void) Client_createFromConfig(cstr config_path){
|
|||||||
bool success = false;
|
bool success = false;
|
||||||
Defer(if(!success) Client_free(client));
|
Defer(if(!success) Client_free(client));
|
||||||
|
|
||||||
(void)config_path;
|
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
Return RESULT_VALUE(p, client);
|
Return RESULT_VALUE(p, client);
|
||||||
}
|
}
|
||||||
@ -154,7 +152,7 @@ static Result(void) commandExec(Client* client, str command, bool* stop){
|
|||||||
|
|
||||||
printf("connecting to server...\n");
|
printf("connecting to server...\n");
|
||||||
try(client->server_connection, p,
|
try(client->server_connection, p,
|
||||||
ServerConnection_open(new_server_link.data));
|
ServerConnection_open(&client->cred, new_server_link.data));
|
||||||
printf("connection established\n");
|
printf("connection established\n");
|
||||||
|
|
||||||
// TODO: request server info
|
// TODO: request server info
|
||||||
|
|||||||
@ -28,7 +28,8 @@ typedef struct ServerConnection {
|
|||||||
EncryptedSocketTCP sock;
|
EncryptedSocketTCP sock;
|
||||||
} ServerConnection;
|
} ServerConnection;
|
||||||
|
|
||||||
Result(ServerConnection*) ServerConnection_open(cstr server_link_cstr);
|
Result(ServerConnection*) ServerConnection_open(ClientCredentials* client_credentials,
|
||||||
|
cstr server_link_cstr);
|
||||||
|
|
||||||
void ServerConnection_close(ServerConnection* conn);
|
void ServerConnection_close(ServerConnection* conn);
|
||||||
|
|
||||||
|
|||||||
@ -12,10 +12,11 @@
|
|||||||
/// @brief hashes password multiple times using its own hash as salt
|
/// @brief hashes password multiple times using its own hash as salt
|
||||||
/// @param password some byte array
|
/// @param password some byte array
|
||||||
/// @param out_buffer u8[PASSWORD_HASH_SIZE]
|
/// @param out_buffer u8[PASSWORD_HASH_SIZE]
|
||||||
/// @param rounds number of rounds
|
/// @param iterations number of iterations
|
||||||
void hash_password(Array(u8) password, u8* out_buffer, i32 rounds);
|
void hash_password(Array(u8) password, u8* out_buffer, i32 iterations);
|
||||||
#define PASSWORD_HASH_SIZE 32
|
#define PASSWORD_HASH_SIZE 32
|
||||||
#define PASSWORD_HASH_LVL_ROUNDS 1e5
|
|
||||||
|
#define __PASSWORD_HASH_LVL_ITERATIONS 1e5
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// //
|
// //
|
||||||
|
|||||||
@ -4,8 +4,6 @@ Result(char*) __sendErrorMessage(ClientConnection* conn, PacketHeader* req_head,
|
|||||||
u32 msg_buf_size, cstr format, va_list argv)
|
u32 msg_buf_size, cstr format, va_list argv)
|
||||||
{
|
{
|
||||||
Deferral(4);
|
Deferral(4);
|
||||||
(void)req_head;
|
|
||||||
|
|
||||||
//TODO: limit ErrorMessage size to fit into EncryptedSocketTCP.internal_buffer_size
|
//TODO: limit ErrorMessage size to fit into EncryptedSocketTCP.internal_buffer_size
|
||||||
Array(u8) err_buf = Array_alloc(u8, msg_buf_size);
|
Array(u8) err_buf = Array_alloc(u8, msg_buf_size);
|
||||||
bool err_complete = false;
|
bool err_complete = false;
|
||||||
|
|||||||
4
tasks/strip.sh
Normal file
4
tasks/strip.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
exe_path="$OUTDIR/$EXEC_FILE"
|
||||||
|
myprint "${BLUE}stripping symbols from ${WHITE}$exe_path"
|
||||||
|
strip -s "$exe_path"
|
||||||
Loading…
Reference in New Issue
Block a user