1
0
forked from cory/tildefriends

Add libsodium to the tree and build what's needed from source.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3859 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-03-08 03:42:47 +00:00
parent efc5eb2aff
commit 352f33f5a1
584 changed files with 140249 additions and 2 deletions
Makefile
deps/libsodium
.github
.gitignoreAUTHORSChangeLogLICENSEMakefile.amMakefile.inREADME.markdownTHANKSaclocal.m4appveyor.ymlautogen.shazure-pipelines.yml
build-aux
builds
configureconfigure.ac
contrib
dist-build
lgtm.ymllibsodium-uninstalled.pc.inlibsodium.pc.inlibsodium.slnlibsodium.vcxprojlibsodium.vcxproj.filterslogo.png
m4
msvc-scripts
packaging
regen-msvc
src
Makefile.amMakefile.in
libsodium
Makefile.amMakefile.in
crypto_aead
aes256gcm
chacha20poly1305
xchacha20poly1305
crypto_auth
crypto_box
crypto_core
crypto_generichash
crypto_hash
crypto_kdf
crypto_kx
crypto_onetimeauth
crypto_pwhash
crypto_scalarmult
crypto_secretbox
crypto_secretstream
crypto_shorthash
crypto_sign
crypto_stream
crypto_verify
sodium
include
Makefile.amMakefile.insodium.h
sodium
core.hcrypto_aead_aes256gcm.hcrypto_aead_chacha20poly1305.hcrypto_aead_xchacha20poly1305.hcrypto_auth.hcrypto_auth_hmacsha256.hcrypto_auth_hmacsha512.hcrypto_auth_hmacsha512256.hcrypto_box.hcrypto_box_curve25519xchacha20poly1305.hcrypto_box_curve25519xsalsa20poly1305.hcrypto_core_ed25519.hcrypto_core_hchacha20.hcrypto_core_hsalsa20.hcrypto_core_ristretto255.hcrypto_core_salsa20.hcrypto_core_salsa2012.hcrypto_core_salsa208.hcrypto_generichash.hcrypto_generichash_blake2b.hcrypto_hash.hcrypto_hash_sha256.hcrypto_hash_sha512.hcrypto_kdf.hcrypto_kdf_blake2b.hcrypto_kx.hcrypto_onetimeauth.hcrypto_onetimeauth_poly1305.hcrypto_pwhash.hcrypto_pwhash_argon2i.hcrypto_pwhash_argon2id.hcrypto_pwhash_scryptsalsa208sha256.hcrypto_scalarmult.hcrypto_scalarmult_curve25519.hcrypto_scalarmult_ed25519.hcrypto_scalarmult_ristretto255.hcrypto_secretbox.hcrypto_secretbox_xchacha20poly1305.hcrypto_secretbox_xsalsa20poly1305.hcrypto_secretstream_xchacha20poly1305.hcrypto_shorthash.hcrypto_shorthash_siphash24.hcrypto_sign.hcrypto_sign_ed25519.hcrypto_sign_edwards25519sha512batch.hcrypto_stream.hcrypto_stream_chacha20.hcrypto_stream_salsa20.hcrypto_stream_salsa2012.hcrypto_stream_salsa208.hcrypto_stream_xchacha20.hcrypto_stream_xsalsa20.hcrypto_verify_16.hcrypto_verify_32.hcrypto_verify_64.hexport.h
private
randombytes.hrandombytes_internal_random.hrandombytes_sysrandom.hruntime.hutils.hversion.h.in
randombytes
sodium
test
Makefile.amMakefile.inconstcheck.sh
default
Makefile.amMakefile.inaead_aes256gcm.caead_aes256gcm.expaead_aes256gcm2.caead_aes256gcm2.expaead_chacha20poly1305.caead_chacha20poly1305.expaead_chacha20poly13052.caead_chacha20poly13052.expaead_xchacha20poly1305.caead_xchacha20poly1305.expauth.cauth.expauth2.cauth2.expauth3.cauth3.expauth5.cauth5.expauth6.cauth6.expauth7.cauth7.expbox.cbox.expbox2.cbox2.expbox7.cbox7.expbox8.cbox8.expbox_easy.cbox_easy.expbox_easy2.cbox_easy2.expbox_seal.cbox_seal.expbox_seed.cbox_seed.expchacha20.cchacha20.expcmptest.hcodecs.ccodecs.expcore1.ccore1.expcore2.ccore2.expcore3.ccore3.expcore4.ccore4.expcore5.ccore5.expcore6.ccore6.expcore_ed25519.ccore_ed25519.expcore_ristretto255.ccore_ristretto255.exped25519_convert.ced25519_convert.expgenerichash.cgenerichash.expgenerichash2.cgenerichash2.expgenerichash3.cgenerichash3.exphash.chash.exphash3.chash3.expindex.html.tplkdf.ckdf.expkeygen.ckeygen.expkx.ckx.expmetamorphic.cmetamorphic.expmisuse.cmisuse.exponetimeauth.conetimeauth.exponetimeauth2.conetimeauth2.exponetimeauth7.conetimeauth7.exppre.js.incpwhash_argon2i.cpwhash_argon2i.exppwhash_argon2id.cpwhash_argon2id.exppwhash_scrypt.cpwhash_scrypt.exppwhash_scrypt_ll.cpwhash_scrypt_ll.exprandombytes.crandombytes.expscalarmult.cscalarmult.expscalarmult2.cscalarmult2.expscalarmult5.cscalarmult5.expscalarmult6.cscalarmult6.expscalarmult7.cscalarmult7.expscalarmult8.cscalarmult8.expscalarmult_ed25519.cscalarmult_ed25519.expscalarmult_ristretto255.cscalarmult_ristretto255.expsecretbox.csecretbox.expsecretbox2.csecretbox2.expsecretbox7.csecretbox7.expsecretbox8.csecretbox8.expsecretbox_easy.csecretbox_easy.expsecretbox_easy2.csecretbox_easy2.expsecretstream.csecretstream.expshorthash.cshorthash.expsign.csign.expsiphashx24.csiphashx24.expsodium_core.csodium_core.expsodium_utils.csodium_utils.expsodium_utils2.csodium_utils2.expsodium_utils3.csodium_utils3.expsodium_version.csodium_version.expstream.cstream.expstream2.cstream2.expstream3.cstream3.expstream4.cstream4.expverify1.cverify1.expwasi-test-wrapper.shwintest.batxchacha20.cxchacha20.exp
quirks

184
deps/libsodium/test/default/misuse.c vendored Normal file

@@ -0,0 +1,184 @@
#define TEST_NAME "misuse"
#include "cmptest.h"
#ifdef HAVE_CATCHABLE_ABRT
# include <signal.h>
static void
sigabrt_handler_15(int sig)
{
(void) sig;
exit(0);
}
# ifndef SODIUM_LIBRARY_MINIMAL
static void
sigabrt_handler_14(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_15);
assert(crypto_box_curve25519xchacha20poly1305_easy
(guard_page, guard_page, crypto_stream_xchacha20_MESSAGEBYTES_MAX - 1,
guard_page, guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_13(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_14);
assert(crypto_box_curve25519xchacha20poly1305_easy_afternm
(guard_page, guard_page, crypto_stream_xchacha20_MESSAGEBYTES_MAX - 1,
guard_page, guard_page) == -1);
exit(1);
}
# endif
static void
sigabrt_handler_12(int sig)
{
(void) sig;
# ifdef SODIUM_LIBRARY_MINIMAL
signal(SIGABRT, sigabrt_handler_15);
# else
signal(SIGABRT, sigabrt_handler_13);
# endif
assert(crypto_pwhash_str_alg((char *) guard_page,
"", 0U, 1U, 1U, -1) == -1);
exit(1);
}
static void
sigabrt_handler_11(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_12);
assert(crypto_box_easy(guard_page, guard_page,
crypto_stream_xsalsa20_MESSAGEBYTES_MAX,
guard_page, guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_10(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_11);
assert(crypto_box_easy_afternm(guard_page, guard_page,
crypto_stream_xsalsa20_MESSAGEBYTES_MAX,
guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_9(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_10);
assert(sodium_base642bin(guard_page, 1, (const char *) guard_page, 1,
NULL, NULL, NULL, -1) == -1);
exit(1);
}
static void
sigabrt_handler_8(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_9);
assert(sodium_bin2base64((char *) guard_page, 1, guard_page, 1,
sodium_base64_VARIANT_ORIGINAL) == NULL);
exit(1);
}
static void
sigabrt_handler_7(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_8);
assert(sodium_bin2base64((char *) guard_page, 1,
guard_page, 1, -1) == NULL);
exit(1);
}
static void
sigabrt_handler_6(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_7);
assert(sodium_pad(NULL, guard_page, SIZE_MAX, 16, 1) == -1);
exit(1);
}
static void
sigabrt_handler_5(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_6);
assert(crypto_aead_xchacha20poly1305_ietf_encrypt(guard_page, NULL, NULL, UINT64_MAX,
NULL, 0, NULL,
guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_4(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_5);
assert(crypto_aead_chacha20poly1305_ietf_encrypt(guard_page, NULL, NULL, UINT64_MAX,
NULL, 0, NULL,
guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_3(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_4);
assert(crypto_aead_chacha20poly1305_encrypt(guard_page, NULL, NULL, UINT64_MAX,
NULL, 0, NULL,
guard_page, guard_page) == -1);
exit(1);
}
static void
sigabrt_handler_2(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_3);
#if SIZE_MAX > 0x4000000000ULL
randombytes_buf_deterministic(guard_page, 0x4000000001ULL, guard_page);
#else
abort();
#endif
exit(1);
}
static void
sigabrt_handler_1(int sig)
{
(void) sig;
signal(SIGABRT, sigabrt_handler_2);
assert(crypto_kx_server_session_keys(NULL, NULL, guard_page, guard_page,
guard_page) == -1);
exit(1);
}
int
main(void)
{
signal(SIGABRT, sigabrt_handler_1);
assert(crypto_kx_client_session_keys(NULL, NULL, guard_page, guard_page,
guard_page) == -1);
return 1;
}
#else
int
main(void)
{
return 0;
}
#endif