Commit Graph

4114 Commits

Author SHA1 Message Date
Daniel Pouzzner
535822f4df wolfcrypt/test/test.c: refactor for stack size and namespace control, allowing embedding of wolfcrypt_test() in kernel module. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9ca94d6ca7 wolfcrypt/src/ge_448.c: refactor ge448_double_scalarmult_vartime() to use heap for workspace unless WOLFSSL_NO_MALLOC. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
92df5692b1 wolfcrypt/src/ecc.c: revert to commit g0fa5af9, which has all the necessary fixes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
add78dfba9 wolfcrypt/src/sp_int.c: add _LINUXKM do_div codepaths for a couple more 64 bit divisions, in sp_div_word() and sp_mod_d(). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9ab1df690a wolfcrypt/src/ecc.c: fix uncompilable !WOLFSSL_SP_MATH && WOLFSSL_SMALL_STACK_CACHE implementations of ecc_key_tmp_init() and ecc_key_tmp_free() (the latter misnamed ecc_key_tmp_final()). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
03d5a4eadd wolfcrypt/src/integer.c: mp_div_d(): refactor another 64 bit division to use do_div() when WOLFSSL_LINUXKM. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
2591479866 linuxkm: add macros mapping malloc(), free(), and realloc() to the kernel equivalents, don't set WOLFSSL_NO_MALLOC, and reduce -Wframe-larger-than= from 256k to 64k; tweak fix for HAVE_INTEL_RDSEED conflict with WOLFSSL_LINUXKM; add clean rule to linuxkm/Makefile. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
2bcdfce6df wolfcrypt/src/evp.c: tweak to silence gcc -Wmaybe-uninitialized. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0e480d1a14 Linux KM compilability cont'd: conform to C89isms (declarations before statements); iffdef WOLFSSL_LINUXKM use do_div() for long long division rather than C operator (avoids unresolvable compile-time callouts to libgcc function); misc gating and relocations for includes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0f783077f8 fix stray whitespace 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
dd825d90c4 more LKM WIP: polish up the struct DRBG refactor ("struct DRBG_internal"), tweaks for buildability on 3.x kernels (now builds on 3.x, 4.x, and 5.x up to 5.8.1), move a slew of #[un]def[ines] from wc_port.h to settings.h where they belong, misc cleanup. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
3c2155f4a9 linuxkm WIP -- update for kernels 4.9.x (LTS representative) and 5.8.x (latest). 2020-09-23 18:32:15 -05:00
David Garske
6425ebb60e Linux Kernel Module support using "--enable-linuxkm". 2020-09-23 18:32:15 -05:00
toddouska
2bb8427ab2 Merge pull request #3320 from dgarske/stmcube
STM32 Cube Pack and AES GCM improvements
2020-09-23 14:39:53 -07:00
David Garske
c46301f111 Merge pull request #3328 from ejohnstown/fips-ready-fix
FIPS Ready Windows Fix
2020-09-23 12:18:23 -07:00
David Garske
ecd5a015eb Merge pull request #3317 from ejohnstown/evp-fix
EVP Fix
2020-09-23 11:10:07 -07:00
toddouska
b0998fb030 Merge pull request #3327 from SparkiDev/pkcs11_ecc
PKCS#11 fix: Generate ECC key for decrypt/sign or derive
2020-09-23 09:28:53 -07:00
toddouska
ad00cf0fc8 Merge pull request #3268 from dr-m/intel-intrinsics
Use Intel intrinsic functions for RDSEED and RDRAND
2020-09-23 09:24:47 -07:00
toddouska
2f74817e32 Merge pull request #3288 from embhorn/zd10901
Fix mp_radix_size off by 1 error
2020-09-23 09:19:02 -07:00
John Safranek
07e1baadc9 EVP Fix
Change a few missed strings to use the constant names.
2020-09-22 15:55:46 -07:00
Sean Parkinson
e539322a88 PKCS#11 fix: Generate ECC key for decrypt/sign or derive
Add debugging information to PKCS#11.
2020-09-23 08:30:22 +10:00
John Safranek
54c4258c4b FIPS Ready Windows Fix
1. Modify the WIN10 FIPS solution user_settings.h to check for a
   FIPS Ready flag and to override HAVE_FIPS_VERSION to 3 if set.
2. Removed some redundant constants from the EVP file.
2020-09-22 15:23:36 -07:00
David Garske
99d96246bd Fix for STM32 issue with some Cube HAL versions (such as F777) which could modify non-block aligned bytes in the output buffer during decrypt. For TLS these bytes are the authentication tag. Workaround is to save off the incoming expected authentication tag. ZD 10961. 2020-09-22 15:04:30 -07:00
John Safranek
87d042e37d EVP Fix
Clean up a bad guard check for AES-CTR.
2020-09-22 09:46:27 -07:00
John Safranek
fc425b74fc EVP Fix
Add a few more guard flag checks to leave out things appropriately.
2020-09-22 09:06:30 -07:00
Marko Mäkelä
99a481b28e Use Intel intrinsic functions for RDSEED and RDRAND
Starting with GCC 9 or clang 9, we can actually use <immintrin.h>
without any problems. We only have to flag such
functions where such instructions are being used.

The benefit of using intrinsic functions over inline assembler
is that the compiler is given more flexibility. In particular,
clang -fsanitize=memory (MemorySanitizer, MSAN) will not raise
bogus alarms about memory being uninitialized.

Both intrinsic functions are available starting with GCC 5 and
clang 3.8. The RDRAND wrapper is available starting with clang 3.7
via <immintrin.h>. Before GCC 9 and clang 9, the RDSEED wrapper is
not available via <immintrin.h> but via <x86intrin.h>, and only after
jumping through some hoops to enable it.
2020-09-22 09:45:46 +03:00
Takashi Kojo
83cdd1c314 fix NO_DH guard 2020-09-22 07:30:21 +09:00
John Safranek
4f8dbf4f3e EVP Fix
There are some cases when the EVP wrapper code could call strncmp with
a null pointer. This was refactored to remove this possibility.
2020-09-21 14:31:42 -07:00
toddouska
47a720bdc6 Merge pull request #3315 from SparkiDev/evp_xts
EVP XTS key length: two keys used so double length
2020-09-21 13:56:35 -07:00
toddouska
1274a01dc7 Merge pull request #3289 from dgarske/wpas_small
Fixes for building `--enable-wpas=small` with WPA Supplicant v2.7
2020-09-21 13:37:58 -07:00
Sean Parkinson
d7525f0f86 EVP XTS key length: two keys used so double length 2020-09-21 11:02:07 +10:00
David Garske
0ae9adcfd9 Add Xilinx SDK printf support. 2020-09-18 09:16:31 -07:00
David Garske
63e993b9c1 Fix to allow XTIME override for Xilinx. Spelling fixes in Xilinx README.md. 2020-09-18 09:16:31 -07:00
David Garske
cd6283d3a2 Fix last commit macro logic. 2020-09-18 09:14:41 -07:00
David Garske
d37adefe98 Fixes for edge case builds with certificate req/gen/ext without --enable-opensslextra. 2020-09-18 09:14:41 -07:00
Elms
cd077d74c1 CortexM SP ASM compiling for IAR 6.70
* asm can handle pointers but not arrays, use redirection pointers
 * branch width must be specified explicitly
2020-09-16 16:23:51 -07:00
toddouska
0694eafb5e Merge pull request #3286 from dgarske/aesctr_aesni
Fix for AES CTR with AESNI
2020-09-16 15:11:11 -07:00
toddouska
fe92fa6f3f Merge pull request #3282 from SparkiDev/sp_mod_exp_bits
SP mod exp: support exponents of different lengths
2020-09-16 15:07:31 -07:00
toddouska
86e5a2c528 Merge pull request #3276 from SparkiDev/jacobi_iterative
ECC mp_jacobi: iterative implementation
2020-09-16 15:04:20 -07:00
toddouska
533bc099eb Merge pull request #3265 from SparkiDev/cpuid_set
Allow the CPU Id flags to be programmatically set
2020-09-16 15:00:30 -07:00
toddouska
ab7408f7d6 Merge pull request #3258 from dgarske/nxp_hw
Fixes for NXP MMCAU/LTC mutex locking and build
2020-09-16 14:57:58 -07:00
toddouska
a3fca7f593 Merge pull request #3247 from JacobBarthelmeh/Compatibility-Layer
Compatiblity Layer Fixes for serial number / ASN1 time / and order of name components
2020-09-16 14:53:51 -07:00
Eric Blankenhorn
5d69c9f1dc Move neg check 2020-09-15 09:12:45 -05:00
Eric Blankenhorn
6451c4e471 Fix for negative values 2020-09-14 10:00:02 -05:00
David Garske
2ac5835ee8 Fix for CAAM to evaluate before the keylen check. Added checking to make sure keylen cannot overrun buffer. 2020-09-11 15:07:31 -07:00
John Safranek
01ad4d59a1 Merge pull request #3263 from douzzer/20200828-neg-SN-invalid-padding
GetASNInt(): check for invalid padding on negative integer.
2020-09-11 08:48:43 -07:00
Eric Blankenhorn
4688f5fa59 Handle leading zero 2020-09-11 08:39:34 -05:00
David Garske
6fcdd848c9 Refactor of AES wc_AesSetKeyLocal and wc_AesSetKey for software only use. Added missing aes argument check on wc_AesSetKeyDirect. 2020-09-10 15:57:36 -07:00
Eric Blankenhorn
78a1670334 Fix mp_radix_size off by 1 error 2020-09-10 09:58:26 -05:00
David Garske
dfc8ed5a73 Fix for AES CTR with AESNI. The flag to indicate use of AES was not set with wc_AesSetKeyDirect. 2020-09-09 14:53:08 -07:00