15052 Commits

Author SHA1 Message Date
Elms
23f4aadf27 GCC makefile: allow overriding and provide more flexibility
- older GCC and additional platforms
 - `NO_EXAMPLES` to exclude building .o files
 - add FIPS optional
2021-09-23 14:55:34 -07:00
John Safranek
79787eaaa4
Merge pull request #4419 from anhu/set1_groups_list
Make quantum-safe groups available to the compatibility layer.
2021-09-23 10:28:02 -07:00
John Safranek
a4609c612f
Merge pull request #4413 from kabuobeid/wpas_keying
Add HAVE_KEYING_MATERIAL requirement to WPAS, to use wolfSSL_export_keying_material
2021-09-23 10:20:34 -07:00
John Safranek
8818df2d34
Merge pull request #4415 from elms/ppc/define_gates_64bit_literals
Define gate fixes and sha3 64bit literal definitions
2021-09-23 10:18:03 -07:00
Anthony Hu
58a02495fe Make the quantum-safe groups available to the OpenSSL compatibility layer. 2021-09-22 15:28:44 -04:00
Eric Blankenhorn
e6e7795140
Make subj alt name order match openSSL (#4406) 2021-09-22 10:29:57 +10:00
John Safranek
df30a88dc6
Merge pull request #4414 from JacobBarthelmeh/devcrypto
update macro guard on SHA256 transform call
2021-09-21 10:03:51 -07:00
John Safranek
63a3eef97a
Merge pull request #4403 from dgarske/zd12852_sniffer
Sniffer improvements for handling TCP ack unseen and retransmission issues
2021-09-21 09:53:27 -07:00
John Safranek
7ec7faddef
Merge pull request #4405 from anhu/truncating_last_char
Fix for `set1_curves_list` ignoring last character
2021-09-21 08:49:53 -07:00
David Garske
34c6e8f975
Merge pull request #4407 from douzzer/linuxkm-SIMD-IRQ
linuxkm-SIMD-IRQ
2021-09-20 14:57:38 -07:00
Elms
ef33445316 Define gate fixes and sha3 64bit literal definitions
Found when supporting PPC750
2021-09-20 13:48:34 -07:00
Daniel Pouzzner
6d715130a2 linuxkm: cleanups and smallstack refactors related to WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED, associated linuxkm-SIMD-IRQ PR, and associated peer review:
smallstack refactors for wolfcrypt/src/rsa.c:wc_CheckProbablePrime_ex() and wolfcrypt/src/pwdbased.c:wc_PKCS12_PBKDF_ex();

add WARN_UNUSED_RESULT macro to types.h;

text format cleanup;

fix internal.c:LowResTimer() implementation.

refactor tls13.c:TimeNowInMilliseconds() for kernel 4.9 and 3.16 compat.

use ktime_get_coarse_real_ts64() only for kernel 5.x+.  in kernel 4.x, use its older form, current_kernel_time64(), and in 3.x, use getnstimeofday().

linuxkm/module_hooks.c: fix wolfssl_init() pie code to be compatible with kernel 4.4-;

fix allocate_wolfcrypt_irq_fpu_states() return codes to all be wolfcrypt codes, and in calling code, pass up that code (suggested by dgarske peer review).
2021-09-20 13:46:51 -05:00
Daniel Pouzzner
ec21dd6d13 miscellaneous buildability fixes:
configure.ac: fix ed25519/sha512 dependency test to not misfire when ENABLED_32BIT;

wolfssl/wolfcrypt/curve{25519,448}.h: fix redundant typedefs of curve{25519,448}_key (fixes -Wpedantic warnings);

configure.ac: fix for "ISO C forbids an empty translation unit [-Werror=pedantic]", re wolfcrypt/src/sp_c{32,64}.c;

configure.ac: fixes for --enable-32bit versus pedantic "ISO C forbids an empty translation unit", including explicit exclusion of 32bit-incompatible algorithms from enable-all and enable-all-crypto sets;

tests/api.c: fixes for a couple inadequately gated SHA2 dependencies;

tests/api.c:test_wolfSSL_set_alpn_protos(): fix prototype missing (void);

wolfcrypt/src/misc.c and wolfssl/wolfcrypt/misc.h: fix ForceZero() definition and NO_INLINE prototype to not counterfactually constify the mem ptr, to avoid -Wmaybe-uninitialized from gcc11;

wolfcrypt/src/des3.c: drop obsolete register qualifier from declaration in DesSetKey(), for c++17 compatibility;

src/ssl.c:wolfSSL_BN_mod_word(): fix cast of arg2 to mp_mod_d().
2021-09-20 13:38:52 -05:00
David Garske
753a931196
Merge pull request #4416 from SparkiDev/mp_submod_addmod_ct
SP math, TFM: constant time addmod, submod
2021-09-20 11:37:45 -07:00
David Garske
a62f103899
Merge pull request #4412 from anhu/level
Convert post-quantum algorithm group names
2021-09-20 11:27:20 -07:00
Daniel Pouzzner
83e0e19e03 linuxkm feature additions:
add build-time support for module signing using native Linux facility;

add support for alternative licenses using WOLFSSL_LICENSE macro;

improve load-time kernel log messages;

add support for sp-math-all asm/AVX2 acceleration;

add error-checking and return in SAVE_VECTOR_REGISTERS();

implement support for x86 accelerated crypto from interrupt handlers, gated on WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED:

  * wolfcrypt_irq_fpu_states
  * am_in_hard_interrupt_handler()
  * allocate_wolfcrypt_irq_fpu_states()
  * free_wolfcrypt_irq_fpu_states()
  * save_vector_registers_x86()
  * restore_vector_registers_x86()

add WOLFSSL_LINUXKM_SIMD, WOLFSSL_LINUXKM_SIMD_X86, and WOLFSSL_LINUXKM_SIMD_ARM macros for more readable gating.
2021-09-20 10:27:13 -05:00
Daniel Pouzzner
2629b8b1fb wolfcrypt/src/wc_port.c LINUXKM time(): use ktime_get_coarse_real_ts64 instead of ktime_get_real_seconds, to avoid GPL-only function, and fix the calculation in the kernel 3.x codepath. 2021-09-20 10:27:13 -05:00
Daniel Pouzzner
1209908468 tests/api.c: fix key size in test_wc_ecc_shared_secret(). 2021-09-20 10:27:13 -05:00
Daniel Pouzzner
45e9872714 wolfcrypt/benchmark: fix output buffer size in bench_eccEncrypt(). 2021-09-20 10:27:13 -05:00
Anthony Hu
ebf1168240 Documenting the level meanings 2021-09-20 10:11:49 -04:00
Anthony Hu
c733be728f Trivial change to re-trigger jenkins. 2021-09-20 08:37:56 -04:00
Sean Parkinson
f63fac82cd SP math, TFM: constant time addmod, submod
Improve performance of fp_submod_ct() and fp_addmod_ct().
Improve performance of sp_submod_ct() and sp_addmod_ct().
2021-09-20 10:12:21 +10:00
Kaleb Himes
9bd300e07d
AESNI in FIPS mode does not support zero length inputs (#4411)
* AESNI in FIPS mode does not support zero length inputs

* Update note to specifically note AESNI
2021-09-20 08:29:15 +10:00
JacobBarthelmeh
f447e4c1fa update macro guard on SHA256 transform call 2021-09-17 15:06:13 -07:00
Kareem Abuobeid
5c3c2dd1bf Add HAVE_KEYING_MATERIAL requirement to WPAS, to use wolfSSL_export_keying_material 2021-09-17 14:53:01 -07:00
David Garske
b14e9c1134 Sniffer improvements for handling TCP out of order, ack unseen and retransmission issues. 2021-09-17 13:16:39 -07:00
Anthony Hu
79cc6be806 Make jenkins happy 2021-09-17 15:50:06 -04:00
Anthony Hu
13d4722678 Convert post-quantum algorithm group names
... from using parameter set names from the papers to NIST levels.
2021-09-17 13:28:34 -04:00
John Safranek
ffa13f314b
Merge pull request #4409 from SparkiDev/tfm_submod_ct
TFM: fp_submod_ct fix check for greater
2021-09-17 08:41:20 -07:00
John Safranek
bb70fee1ec
Merge pull request #4390 from anhu/hybridizing
Hybridizing NIST ECC groups with the OQS groups.
2021-09-16 22:01:39 -07:00
Sean Parkinson
9623797064 TFM: fp_submod_ct fix check for greater
a can be greater than modulus.
Update fp_montgomery_reduce_mulx() to reflect the updates to
fp_montgomery_reduce_ex().
2021-09-17 10:12:07 +10:00
Anthony Hu
5151cc289e Make clang happy. 2021-09-16 14:41:19 -04:00
John Safranek
4380e8b94a
Merge pull request #4391 from JacobBarthelmeh/Sniffer
add sanity check on buffer size
2021-09-16 09:36:48 -07:00
John Safranek
3503be2c13
Merge pull request #4362 from JacobBarthelmeh/wolfCLU
add wolfclu enable option and remove test macro guard
2021-09-15 13:57:50 -07:00
Anthony Hu
07656e371c Parameter sanity check and a unit test. 2021-09-15 16:29:55 -04:00
John Safranek
71e8d3ca3c
Merge pull request #4358 from SparkiDev/arm_sha512_crypto
AARCH64 SHA512: implementation using crypto instructions added
2021-09-15 09:51:09 -07:00
Anthony Hu
4f3c55988b We were ignoring the last character of the group name. 2021-09-15 12:50:04 -04:00
Juliusz Sosinowicz
4ad8b07c1c
wolfSSL_PEM_write_bio_PUBKEY needs to write only the public part (#4354)
* `wolfSSL_PEM_write_bio_PUBKEY` needs to write only the public part

The `wolfSSL_PEM_write_bio_PUBKEY` output can't contain the private portion of the key. This output could be used to distribute the public key and if it contains the private part then it gets leaked to others.

* Add heap hint to `wolfSSL_RSA_To_Der`

* Correct function name in logs
2021-09-15 17:34:43 +10:00
Sean Parkinson
17c2e9e1cd AARCH64 SHA512: implementation using crypto instructions added
Use --enable-armasm=sha512-crypto or define WOLFSSL_ARMASM_CRYPTO_SHA512
to use SHA512 cryptographic instructions.
Checks system register for the feature before using the SHA512
instructions.
Added SHA512 input data alignment test.
Add support for SHA512/224 and SHA512/256 to ARM port.
2021-09-15 12:05:48 +10:00
David Garske
d86aed210b
Merge pull request #4398 from SparkiDev/cppcheck_fixes_7
cppcheck fixes and a config fix
2021-09-14 18:19:30 -07:00
Hideki Miyazaki
d9767207b7
call alpn selection call-back at server side only (#4377)
* call alpn selection call-back at server side only

* addressed review comment

* addressed jenkins failure
2021-09-15 10:02:18 +10:00
David Garske
3c21996002
Merge pull request #4353 from SparkiDev/pkcs11_static_link
PKCS #11: support static linking with PKCS #11 library
2021-09-14 15:26:52 -07:00
David Garske
4be3b2b351
Merge pull request #4401 from embhorn/gh4400
Fix overflow check in ClientMemSend
2021-09-14 12:20:32 -07:00
David Garske
9c3d3ffcd2
Merge pull request #4396 from kabuobeid/iotsafe_header
Fix exporting iotsafe functions by adding missing include in iotsafe.c.
2021-09-14 10:01:44 -07:00
Eric Blankenhorn
2274d0b773 Fix overflow check in ClientMemSend 2021-09-14 11:17:01 -05:00
Sean Parkinson
142c7a9892 cppcheck fixes and a config fix
./configure --disable-rsa --disable-ecc --disable-dsa
--enable-curve25519 --disable-ed25519 --disable-curve448
--disable-ed448 --enable-cryptonly

suites.c, testsuite.c: ensure port is an integer for snprintf.

unit.c: make memFailCount an integer for printf.

aes.c:
  Reduce variable scope.
  Check aes is not NULL before use in GHASH implementations.
XTS check sz is greater than or equal to a AES_BLOCK_SIZE rather than
0 as another block is processed.
  wc_AesXtsEncrypt, wc_AesXtsEncrypt - simplify braces and ifdefs
wc_AesEcbEncrypt - subtracting from sz is unnecessary as is unused
after.

asn.c:
StoreKey, StoreEccKey - compiler doesn't see ret != 0 when publicKey
is NULL.
  DecodeAuthInfo - count is not used when after break.
  DecodeSubtree - don't use min and max as variables (already macros).
SetEccPublicKey - initialize pubSz and set sz regardless for
compiler's sake.
wc_EncodeName_ex - use unique variable 'namesASN'; ret isn't set after
last check.
SetEccPublicKey - simplify code by using else rather than check ret
wasn't set.
  DecodeAsymKey - ret not modified in non-template implementaiton.
  SetAsymKeyDer - ret still at initialized value here.
DecodeResponseData - ensure dataASN is freed when single->next->status
failed to allocate.

test.c:
  curve255519_der_test() can't be compiled when NO_ASN is defined.

types.h:
  cast to the appropriate type in EXIT_TEST
test.h
don't return anything when THREAD_RETURN is void and EXIT_TEST is for
threading with stack size.
2021-09-14 16:08:26 +10:00
Hideki Miyazaki
ab3bbf11e9
add ASN1_R_HEADER_TOO_LONG case (#4392)
* add ASN1_R_HEADER_TOO_LONG case

* addressed review comments
2021-09-14 12:32:30 +10:00
TakayukiMatsuo
c8bcfe4763
Add implementation to make wolfSSL_BIO_flush work for WOLFSSL_BIO_FILE (#4395) 2021-09-14 10:08:55 +10:00
Kareem
39ce723577 Fix exporting iotsafe functions by adding missing include in iotsafe.c. 2021-09-13 16:45:18 -07:00
Hideki Miyazaki
4d49ab6342
add store finished message on Tls13 (#4381)
* add to store finished message on Tls13

* addressed jenkins failure

* jenkins failures

sanity check for size before copying memory

* remove check of finishSz

* addressed review comments
2021-09-14 09:22:16 +10:00