-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wolfCrypt CSharp Wrapper #3166
wolfCrypt CSharp Wrapper #3166
Conversation
342cff2
to
06aa280
Compare
06aa280
to
c51f2dc
Compare
Can one of the admins verify this patch? |
c51f2dc
to
97ca279
Compare
Retest this please Failed "PRB-single-flag.txt_140" ->
|
a5e7c91
to
315cc9c
Compare
@wolfSSL-Bot , this work is at a good checkpoint to review. More work is planned for the wolfCrypt CSharp wrapper, but the ECC, ED25519/Curve25519 and RSA should be ready/done. |
840bfdc
to
0b0cd76
Compare
Retest this please. Multi-test failure, but history not retained long enough |
@aidangarske PR has merge conflicts and needs rebase / force-push. |
c13dbf3
to
4b282ff
Compare
6c118e1
to
71aacf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
analyzers found some issues. these should all reproduce easily using wolfssl-multi-test.sh
.
[sanitizer-all-intelasm-c-fallback-fuzzer] [11 of 36] [f5e0ae6d3a]
seed=2082989074
configure... real 0m21.179s user 0m8.599s sys 0m14.451s
build... real 2m36.996s user 10m21.038s sys 0m18.323s
check... real 0m32.027s user 0m30.537s sys 0m21.660s
=================================================================
==1028==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x7f32f32f9837 in malloc /tmp/portage/sys-devel/gcc-14.1.1_p20240720/work/gcc-14-20240720/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f32f1b52e10 in wc_debug_CipherLifecycleInit wolfcrypt/src/memory.c:1681
#2 0x5587f122f991 in aesccm_128_test wolfcrypt/test/test.c:15870
#3 0x5587f12cde1c in aesccm_test wolfcrypt/test/test.c:16062
#4 0x5587f1333ccd in cryptocb_test wolfcrypt/test/test.c:58640
#5 0x5587f1338e66 in wolfcrypt_test wolfcrypt/test/test.c:2364
#6 0x5587f136d7bf in testsuite_test testsuite/testsuite.c:178
#7 0x7f32f0444189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#8 0x7f32f044424a in __libc_start_main_impl ../csu/libc-start.c:360
#9 0x5587f122a9b4 in _start ../sysdeps/x86_64/start.S:115
Direct leak of 4 byte(s) in 1 object(s) allocated from:
#0 0x7f32f32f9837 in malloc /tmp/portage/sys-devel/gcc-14.1.1_p20240720/work/gcc-14-20240720/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f32f1b52e10 in wc_debug_CipherLifecycleInit wolfcrypt/src/memory.c:1681
#2 0x5587f122f991 in aesccm_128_test wolfcrypt/test/test.c:15870
#3 0x5587f133821e in aesccm_test wolfcrypt/test/test.c:16062
#4 0x5587f133821e in wolfcrypt_test wolfcrypt/test/test.c:1948
#5 0x5587f136d7bf in testsuite_test testsuite/testsuite.c:178
#6 0x7f32f0444189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#7 0x7f32f044424a in __libc_start_main_impl ../csu/libc-start.c:360
#8 0x5587f122a9b4 in _start ../sysdeps/x86_64/start.S:115
SUMMARY: AddressSanitizer: 8 byte(s) leaked in 2 allocation(s).
sanitizer-all-intelasm-c-fallback-fuzzer fail_analytic_check
failed config: '--srcdir' '.' '--disable-jobserver' '--enable-option-checking=fatal' '--enable-all' '--enable-testcert' '--enable-intelasm' 'CPPFLAGS=-DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_OLD_PRIME_CHECK' 'CC=gcc-14' 'LDFLAGS=-g -fno-omit-frame-pointer -fsanitize-recover=all -fsanitize=address,pointer-subtract,leak,undefined,float-cast-overflow,float-divide-by-zero,bounds-strict -fsanitize-recover=all ' 'CFLAGS=-DWC_DEBUG_CIPHER_LIFECYCLE -g -fno-omit-frame-pointer -fsanitize=address,pointer-subtract,leak,undefined,float-cast-overflow,float-divide-by-zero,bounds-strict -fsanitize-recover=all --param=max-vartrack-size=128000000 -DWC_AES_C_DYNAMIC_FALLBACK -DWC_C_DYNAMIC_FALLBACK -DDEBUG_VECTOR_REGISTER_ACCESS -DDEBUG_VECTOR_REGISTER_ACCESS_FUZZING'
BUILD_ENV: 'FAIL_BUILD_CODENAME=fail_analytic_build' 'MAX_FIPS_CODE_SZ=10000000'
RUN_ENV: 'LD_LIBRARY_PATH=/tmp/tmp.4346_11739/wolfssl_test_workdir.1723/wolfssl/src/.libs:/usr/lib/gcc/x86_64-pc-linux-gnu/14:/usr/lib/gcc/x86_64-pc-linux-gnu/14/32' 'ASAN_OPTIONS=halt_on_error=0 color=always log_path=sanitizer_log.asan ' 'UBSAN_OPTIONS=halt_on_error=0 color=always log_path=sanitizer_log.ubsan ' 'LSAN_OPTIONS=halt_on_error=0 color=always log_path=sanitizer_log.lsan ' 'MSAN_OPTIONS=halt_on_error=0 color=always log_path=sanitizer_log.msan ' 'TSAN_OPTIONS=halt_on_error=0 color=always log_path=sanitizer_log.tsan '
[fips-140-3-dev-optest-acvp-sp-noasm] [28 of 36] [f5e0ae6d3a]
setting up FIPS "dev"... done [fips="master" (09a71ef37e), wolfCrypt=current OID under test (f5e0ae6d3a)]
configure... real 0m11.077s user 0m4.037s sys 0m8.120s
build... real 0m11.427s user 1m4.288s sys 0m6.745s
fixing FIPS hash... done.
check... real 0m6.303s user 0m7.792s sys 0m2.193s
build op_test... real 0m3.957s user 0m3.758s sys 0m0.185s
run op_test... byte* in: INVALID
word32 sz: VALID
STATUS INDICATOR: -173 (Bad function argument) line 3913
--- end case ---
--- start case ---
struct Aes: VALID
byte* out: VALID
byte* in: VALID
word32 sz: SKIPPED (depend on operator to get right or optional)
STATUS INDICATORdouble free or corruption (out)
optest failed with status 134.
fips-140-3-dev-optest-acvp-sp-noasm fail_run_optest
failed config: '--srcdir' '.' '--disable-jobserver' '--enable-option-checking=fatal' '--enable-sp-math-all' '--disable-asm' 'CPPFLAGS=-DHAVE_FORCE_FIPS_FAILURE -DWOLFSSL_DH_EXTRA -DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_DH_EXTRA -pedantic' '--enable-fips=dev'
[clang-tidy-asn-template-sp-all-small-stack] [36 of 36] [f5e0ae6d3a]
configure... real 0m27.054s user 0m11.874s sys 0m17.074s
build...01ce04733a (<[email protected]> 2024-09-24 14:29:46 -0700 14063) aes->isAllocated = 0;
/tmp/tmp.4346_11739/wolfssl_test_workdir.1723/wolfssl/wolfcrypt/src/aes.c:14063:22: warning: Access to field 'isAllocated' results in a dereference of a null pointer (loaded from variable 'aes') [clang-analyzer-core.NullDereference]
14063 | aes->isAllocated = 0;
| ^
[...]
clang-tidy-asn-template-sp-all-small-stack fail_build
failed config: '--srcdir' '.' '--disable-jobserver' '--enable-option-checking=fatal' '--enable-all' '--enable-testcert' '--enable-asn=template' '--enable-sp-math-all' '--enable-smallstack' '--enable-smallstackcache' 'CPPFLAGS=-DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_OLD_PRIME_CHECK -pedantic -DSP_ALLOC -DWOLFSSL_CLANG_TIDY' 'CC=/home/douzzer/com/wolfssl/src/testing/git-hooks/clang-tidy-builder.sh' 'CLANG=/usr/lib/llvm/20/bin/clang-20' 'CFLAGS=-Wunreachable-code-aggressive -Wthread-safety -Wloop-analysis -Wenum-compare-conditional -fcolor-diagnostics -fcomplete-member-pointers -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-language-extension-token -Wunreachable-code-break -Wunreachable-code-return -Wimplicit-fallthrough'
BUILD_ENV: 'CLANG_TIDY=/usr/lib/llvm/20/bin/clang-tidy' 'CLANG=/usr/lib/llvm/20/bin/clang-20' 'CLANG_TIDY_EXTRA_ARGS=--use-color=1 -line-filter=[{"name":"asn1.h","lines":[[1,166]]},{"name":".c"},{"name":".h"},{"name":".s"},{"name":".S"},{"name":".i"}]' 'CLANG_OVERRIDE_CFLAGS=' 'FAIL_BUILD_CODENAME=fail_analytic_build' 'MAX_FIPS_CODE_SZ=10000000'
* Adds RNG, ECC(ECIES and ECDHE), RSA, ED25519/Curve25519, AES-GCM, and Hashing to the CSharp wrapper. * Adds GitHub action for building the CSharp wrapper solution and running wolfCrypt test and a TLS server/client example. * Adds "new" API's for wolfCrypt for platforms that cannot tolerate the structs directly. * Fixes for several scan-build warnings.
…located is initialized to 0.
371efa9
to
59389a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that several of the affected files under wrapper/
, both existing and new in this PR, lack EOF linebreaks. OK to fix in a followup PR.
Description