Daniel Pouzzner
7dedfe08ef
cryptonly and linuxkm fixes: fix --enable-all[-crypto] with --enable-opensslextra and --enable-cryptonly (build failures detected by multi-test linuxkm-all-asm-cryptonly-opensslextra-pie after merge of 54f2d56300 and e2bbacd548).
2023-11-19 17:22:46 -06:00
Sean Parkinson
3ea0fb30dd
AES XTS x64 ASM: add AVX1 and AESNI implementations
...
Adding AES-XTS AVX1 and AESNI implementations.
Fix name in comment at top of x64 assembly files.
2023-09-28 14:44:23 -05:00
Daniel Pouzzner
63e167e974
linuxkm/linuxkm_wc_port.h: add missing prototype for my__show_free_areas().
2023-09-11 21:27:25 -05:00
Daniel Pouzzner
f6f8d2eda3
add WC_DO_NOTHING macro to wolfssl/wolfcrypt/types.h, with default expansion "do {} while (0)", and globally refactor to use the macro where appropriate, annotating intended-null macros-with-args with "/* null expansion */";
...
tweak several #includes of settings.h to include types.h instead (all of these are for clarity, as types.h is indirectly included by later #includes), and add #include <wolfssl/wolfcrypt/types.h> where missing;
remove trailing semicolons from PRAGMA*() macro invocations as they are unneeded and can be harmful (inducing frivolous -Wdeclaration-after-statement etc.).
2023-07-14 09:50:01 -05:00
Daniel Pouzzner
e35cb5bc3d
linuxkm/linuxkm_wc_port.h: override definition of __is_constexpr() from /usr/src/linux/include/linux/const.h with warning-free __builtin_constant_p().
2023-06-08 14:43:05 -05:00
Daniel Pouzzner
fffff657de
cleanups: line length, WOLFSSL_SMALL_STACK_STATIC, and SAVE_VECTOR_REGISTERS() failure trap in benchmark.c, proper path to benchmark.c in linuxkm/module_hooks.c, and proper casting in aes.c. also harmonized semantics and prototype of bench_ripemd().
2023-05-17 13:00:46 -05:00
Daniel Pouzzner
4f4842fce6
linuxkm/linuxkm_memory.c: refactor SAVE/RESTORE_VECTOR_REGISTERS() to be per-process rather than per-CPU, and add migrate_disable/enable() to kernel_fpu_begin/end() because preempt_disable() is just a barrier on _PREEMPT_VOLUNTARY kernels;
...
linuxkm/linuxkm_wc_port.h: activate SAVE/RESTORE_VECTOR_REGISTERS() whenever defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) for benchmark.c support, independent of vector crypto features;
fix and optimize various alignment issues with stack and heap allocations;
fix macro definitions for XMALLOC/XREALLOC/XFREE to correctly use kvmalloc and friends when defined(HAVE_KVMALLOC), and to use wolfSSL_Malloc() and friends when defined(WOLFSSL_TRACK_MEMORY);
purge stale LINUXKM_SIMD_IRQ code.
2023-05-17 01:44:36 -05:00
Daniel Pouzzner
ec9beaab41
linuxkm: add coverage for Linux 6.4+ module memory layout refactor; also, refactor WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS to make it settable independent of WOLFSSL_AESNI etc.
2023-05-09 23:53:49 -05:00
Daniel Pouzzner
448f1ec9e7
linuxkm: in {save,restore}_vector_registers_x86(), check if vector register file has already been saved and invalidated, and if so, inhibit the kernel_fpu_{begin,end}() wrap and instead just use preempt_{disable,enable}() wraps.
2023-04-27 17:48:32 -05:00
Daniel Pouzzner
c08878ac94
configure.ac: include both -I. and -I$srcdir for "circular dependency" test, so that ${build_pwd}/wolfssl/options.h is found in out-of-tree builds; streamline scripting that dynamically sets $TRIM;
...
linuxkm/module_exports.c.template: include wolfssl/wolfcrypt/wolfmath.h, to bring in wc_GetMathInfo() prototype;
src/ssl.c: move "Global pointer to constant BN on" to src/ssl_bn.c; and in wolfSSL_Cleanup(), call the new wolfSSL_BN_free_one() rather than using ad hoc cleanup logic;
src/ssl_bn.c: add bn_one and wolfSSL_BN_free_one();
src/ssl_asn1.c: fix bugprone-macro-parentheses in bufLenOrNull(); refactor wolfSSL_ASN1_TIME_diff() to avoid floating point math; use intermediate tm_year variable in wolfssl_asn1_time_to_tm() to avoid target-specific type conflicts on tm->tm_year; use "FALL_THROUGH", not "/* fall-through */", in wolfSSL_ASN1_TYPE_set (clang-diagnostic-implicit-fallthrough);
wolfcrypt/src/ecc.c: fix identicalInnerCondition in ecc_mul2add();
wolfcrypt/src/integer.c: refactor OPT_CAST()s in mp_grow() to unconditional casts as elsewhere, to mollify a confused cppcheck-all-intmath;
tests/api.c: reformat some overlong lines.
2023-04-03 15:49:39 -05:00
Daniel Pouzzner
aecb37c032
linuxkm/module_hooks.c: wc_SetSeed_Cb(wc_GenerateSeed) in wolfssl_init() #ifdef WC_RNG_SEED, regardless of whether wolfcrypt_test() will be called.
2023-03-03 22:00:24 -06:00
Daniel Pouzzner
022d0e7c89
linuxkm/module_exports.c.template: include hpke.h if HAVE_HPKE.
2023-01-25 23:36:55 -06:00
Jacob Barthelmeh
9dcc48c8f7
update copyright to 2023
2022-12-30 17:12:11 -07:00
Daniel Pouzzner
cb1b20dc8e
linuxkm/: accomodate refactoring in kernel 6.2+ of cpu_number to be an element of the pcpu_hot`structure.
2022-12-26 21:03:04 -06:00
Daniel Pouzzner
c8c107a09e
linuxkm/: fixes to deal with kernel 6.1+ show_free_areas() mess.
2022-10-18 13:34:24 -05:00
Daniel Pouzzner
23b16c09d7
linuxkm/Makefile: add support for $KBUILD_EXTRA_FLAGS.
2022-09-15 13:16:27 -05:00
Daniel Pouzzner
542c53f3ac
snip out errant "#/" strings added to various text files by copyright boilerplate update in 8eaa85e412.
2022-07-20 18:23:28 -05:00
David Garske
564f79c91a
Merge pull request #5371 from douzzer/20220719-linuxkm-get_thread_size-no-thunks
...
linuxkm: inhibit thunk generation in get_thread_size.
2022-07-20 11:48:48 -07:00
Jacob Barthelmeh
8eaa85e412
update copyright year to 2022
2022-07-19 10:44:31 -06:00
Daniel Pouzzner
0dac3ec022
linuxkm: inhibit thunk generation in get_thread_size.
2022-07-19 10:20:04 -05:00
Daniel Pouzzner
f414e65d4b
linuxkm: eliminate duplicative WOLFSSL_KTHREADS macro (just use WOLFSSL_LINUXKM).
2022-06-14 12:45:30 -05:00
Daniel Pouzzner
a22da10956
linuxkm: tweak setup of wolfSSL_Mutex to assure complete type availability in applications (client modules).
2022-06-14 09:45:33 -05:00
Daniel Pouzzner
26673a0f28
where appropriate, use strcmp/strcasecmp, not strncmp/strncasecmp;
...
add macro XSTRCASECMP();
update XSTRNCASECMP() for XC32 >= 1.00 to use strncasecmp.
2022-05-10 12:20:12 -05:00
Daniel Pouzzner
af8865d13e
linuxkm_wc_port.h: move several more definitions outside the BUILDING_WOLFSSL gate, as they are needed for applications to include various wolfssl headers.
2022-05-04 13:16:45 -05:00
Anthony Hu
9ea40f3a9c
Purge IDEA cipher
2022-01-31 15:29:25 -05:00
Anthony Hu
b957a6e872
Purge Rabbit cipher
2022-01-28 13:13:53 -05:00
Daniel Pouzzner
84f7d812d3
linuxkm/module_exports.c.template: include siphash.h.
2022-01-21 01:25:48 -06:00
Anthony Hu
c2860cb311
Get rid of HC-128
2022-01-17 18:11:54 -05:00
Daniel Pouzzner
49fc54ef1f
linuxkm/linuxkm_wc_port.h: move XMALLOC/XREALLOC/XFREE definitions outside BUILDING_WOLFSSL gate as-was, for back-compat.
2022-01-08 02:41:02 -06:00
Daniel Pouzzner
ff4c6e5d7b
linuxkm: relocate WOLFSSL_LINUXKM code in wolfssl/wolfcrypt/wc_port.h and wolfcrypt/src/memory.c to linuxkm/{linuxkm_wc_port.h,linuxkm_memory.c}, and gate SIMD in IRQ handlers on -DLINUXKM_SIMD_IRQ in prep for Linux 5.16;
...
linuxkm: when -DWOLFCRYPT_ONLY, don't include ssl.h in module_exports.c.template and module_hooks.c, and fix gating to work right with that;
wolfssl/wolfcrypt/types.h: add support for a WOLFSSL_XFREE_NO_NULLNESS_CHECK gate (used in cppcheck analysis).
2022-01-07 22:39:38 -06:00
Masashi Honma
ace5d444a4
Fix failure of make distclean when linuxkm is enabled
...
$ make distclean
Making distclean in linuxkm
make[1]: Entering directory '/home/honma/git/wolfssl/linuxkm'
make[1]: *** No rule to make target 'distclean'. Stop.
make[1]: Leaving directory '/home/honma/git/wolfssl/linuxkm'
make: *** [Makefile:6431: distclean-recursive] Error 1
Signed-off-by: Masashi Honma <masashi.honma@gmail.com >
2021-11-22 05:50:38 +09:00
Masashi Honma
30a01a0758
Fix failure of check at commiting when linuxkm is enabled
...
Making check in linuxkm
make[2]: Entering directory '/home/honma/git/wolfssl/linuxkm'
make[2]: warning: -j13 forced in submake: resetting jobserver mode.
make[2]: *** No rule to make target 'check'. Stop.
make[2]: Leaving directory '/home/honma/git/wolfssl/linuxkm'
make[1]: *** [Makefile:6431: check-recursive] Error 1
make[1]: Leaving directory '/home/honma/git/wolfssl'
make: *** [Makefile:6901: check] Error 2
Signed-off-by: Masashi Honma <masashi.honma@gmail.com >
2021-11-22 05:50:38 +09:00
Daniel Pouzzner
313d29f752
linuxkm: in module_hooks.c, refactor WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED gates to WOLFSSL_LINUXKM_SIMD_X86, and add updateFipsHash().
2021-11-09 22:02:17 -06:00
Daniel Pouzzner
11ffb037ba
linuxkm/module_exports.c.template: remove accidentally added MSC clause.
2021-11-08 17:35:10 -06:00
Daniel Pouzzner
beebd1411d
linuxkm/module_hooks.c: fix whitespace, and update code around WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE and updateFipsHash().
2021-11-08 17:35:10 -06:00
Daniel Pouzzner
6f18ba15b0
linuxkm: accommodate printk()->_printk() renaming in kernel 5.15+.
2021-11-01 11:49:56 -06:00
Daniel Pouzzner
742492cb5e
linuxkm/Makefile: fix module sign-file error handling.
2021-11-01 11:49:48 -06:00
Daniel Pouzzner
8ee49cd50c
linuxkm: in module_hooks.c:wolfssl_init(), add support for WC_RNG_SEED_CB.
2021-10-26 20:24:29 -05:00
Daniel Pouzzner
071be3171e
linuxkm: in module_hooks.c, fix logic+gating around CONFIG_MODULE_SIG and WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE.
2021-10-26 20:24:29 -05:00
Daniel Pouzzner
073bef579b
linuxkm: add missing #ifdef OPENSSL_EXTRA around openssl includes in module_exports.c.template, and add an assert to configure.ac disallowing linuxkm+opensslextra.
2021-10-26 20:24:29 -05:00
Daniel Pouzzner
fc73c6dbea
linuxkm: fix Makefile to properly pivot module signature on CONFIG_MODULE_SIG==y; remove not-yet-kernel-compatible asm files from the ASFLAGS_FPU_DISABLE_SIMD_ENABLE list, matching the OBJECT_FILES_NON_STANDARD list, for clarity.
2021-10-26 20:24:28 -05:00
Daniel Pouzzner
aca43cfe52
linuxkm/Kbuild: include -fno-omit-frame-pointer in HOST_EXTRACFLAGS, in case the target kernel has profiling enabled; remove the "always := $(hostprogs)" rule, as it doesn't work and causes warnings on kernel 5.10.
2021-10-26 20:24:28 -05:00
Daniel Pouzzner
6160da243d
linuxkm: use EXPORT_SYMBOL_NS_GPL() for exports.
2021-10-26 20:24:28 -05:00
Daniel Pouzzner
3745b1c9db
linuxkm: fix clean rules/definitions to not pick up top level Makefile, and to clean up empty object directories.
2021-10-26 20:24:27 -05:00
Daniel Pouzzner
19b33d5a76
configure.ac: don't include rc2 in enable-all or enable-all-crypto (memory leaks).
2021-10-26 20:24:27 -05:00
Daniel Pouzzner
b77000bcfb
add smallstack codepath to ecc_test_sign_vectors(), and add missing rc2.h include to linuxkm/module_exports.c.template.
2021-10-26 20:24:27 -05:00
Daniel Pouzzner
947a0d6a2f
autotools/Makefiles: enable reproducible build by default for FIPS, and add -DHAVE_REPRODUCIBLE_BUILD to AM_CFLAGS;
...
refactor the HAVE_WC_INTROSPECTION mechanism to pass build params via $output_objdir/.build_params rather than abusing autotools config.h to pass them;
add support for EXTRA_CFLAGS on the make command line;
in FIPS builds, exclude pkcallbacks from --enable-all;
linuxkm: move test.o out of PIE container (uses function pointers as operands).
2021-10-26 20:24:27 -05:00
Daniel Pouzzner
5293180566
linuxkm/module_exports.c.template: tweaks for FIPS compatibility.
2021-10-26 20:24:26 -05:00
Daniel Pouzzner
34e88b0605
linuxkm: properly pass {AM_,}CPPFLAGS to Kbuild, and include kdf.h in module_exports.c.template.
2021-10-26 20:24:26 -05:00
Anthony Hu
33cb823148
Remove legacy NTRU and OQS ( #4418 )
...
* Remove NTRU and OQS
* Keep the DTLS serialization format backwards compatible.
* Remove n from mygetopt_long() call.
* Fix over-zealous deletion.
* Resolve problems found by @SparkiDev
2021-09-24 08:37:53 +10:00