Daniel Pouzzner
7e99ccc782
wolfcrypt/src/wc_port.c, wolfssl/wolfcrypt/wc_port.h: refactor WOLFSSL_GMTIME gmtime() into gmtime_r(), and always define HAVE_GMTIME_R when defined(WOLFSSL_GMTIME).
2023-11-15 00:09:22 -06:00
Sean Parkinson
c4677927bc
AES GCM ARM64: Replace hardware crypto assembly with generated code
...
Optimized assembly of AES GCM for ARM64 using hardware crypto
instructions.
Code replaced between "START..." and "END...".
2023-11-14 09:24:05 +10:00
JacobBarthelmeh
c903a8c4a6
Merge pull request #6854 from SparkiDev/aes_bit_sliced
...
AES bitsliced implementation added
2023-11-10 17:10:19 -07:00
Sean Parkinson
3ab0fc1ba4
SP C: support e up to 64-bits
...
SP C code only supported one digit worth of e which is less than 64 or
32.
Change is to support up to 64 bit of e using sp_uint64 to hold value.
2023-11-10 09:58:51 +10:00
JacobBarthelmeh
49a219e0d1
Merge pull request #6930 from Frauschi/zephyr_fix
...
Fixes for the Zephyr port
2023-11-09 12:56:34 -07:00
JacobBarthelmeh
73d3277b74
Merge pull request #6947 from SparkiDev/sp_arm64_mont_red_4_fix
...
SP ARM64 asm: fix Montgomery reduction by 4
2023-11-09 08:39:52 -07:00
Tobias Frauenschläger
081b34919c
Zephyr: improve order of random seed sources
...
When using Zephyr, we also want to use the proper wc_GenerateSeed
method. However, if one of the defines is set (e.g., NO_STM32_RNG), the
Zephyr option is ignored, although it would work. Hence, we have to
change the order in which these settings for the source of a random seed
are evaluated.
Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com >
2023-11-09 10:41:54 +01:00
Tobias Frauenschläger
182eaa0b63
Zephyr: add support for RTC time
...
For ASN date validation, the actual wall clock time is needed from an
RTC. This commit adds support to read the RTC time in case it is
available in the Zephyr system. If the RTC is not available or an error
occurs during the readout, we fallback to the old implementation which
only supports relative time since boot.
Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com >
2023-11-09 10:41:54 +01:00
Tobias Frauenschläger
9d880fe161
Zephyr: Fix deprecation warning for rand32.h
...
Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com >
2023-11-09 10:41:54 +01:00
JacobBarthelmeh
3332b036d5
Merge pull request #6950 from SparkiDev/srtp_kdf_fix
...
SRTP KDF: Don't use i outside loop
2023-11-08 23:13:40 -07:00
Sean Parkinson
168747615c
SP Cortex-M: branch long explicitly for IAR
...
GCC doesn't like explicit wide branch instruction but will use
appropriate instruction implicitly.
IAR won't widen branch instruction unless explicitly told.
2023-11-09 08:27:42 +10:00
Sean Parkinson
716cb450aa
SRTP KDF: Don't use i outside loop
...
When shifting index down, first XOR outside loop isn't meant to use i.
2023-11-08 15:04:46 +10:00
David Garske
0fa47e9e28
Merge pull request #6943 from SparkiDev/iar_inline_asm_no_register
...
Thumb2 inline ASM: IAR doesn't do register variables
2023-11-07 14:23:44 -08:00
JacobBarthelmeh
8921a720a1
Merge pull request #6888 from SparkiDev/srtp_kdf
...
SRTP/SRTCP KDF: add implementation
2023-11-07 10:11:43 -07:00
JacobBarthelmeh
a6de9cd06f
Merge pull request #6942 from SparkiDev/sp_int_sqr_volatile
...
SP int: ARM64 optimization issue
2023-11-07 10:09:25 -07:00
Sean Parkinson
cefe108cab
Thumb2 inline ASM: IAR doesn't do register variables
...
IAR doesn't parse register variable declarations with specified
registers. IAR doesn't even honor the register keyword.
Can use small negative but IAR doesn't like it.
Specify the positive value instead.
Add a small code size version of mont_reduce_full using umlal and umaal.
Make 'asm' usage in variables use keyword '__asm__'.
Explicitly don't inline some functions when compiling with IAR.
2023-11-07 16:12:07 +10:00
Sean Parkinson
01c3345c7a
SP ARM64 asm: fix Montgomery reduction by 4
...
Handle add overflow properly in generic Montgomery reduction for 4
words. Used when reducing back to order of P-256 curve.
2023-11-07 11:39:03 +10:00
Sean Parkinson
8c3e1dbf48
SRTP/SRTCP KDF: add implementation
...
Add implementation of SRTP KDF and SRTCP KDF.
One shot APIs compatible with SP 800-135 and ACVP testing.
Tests added to test.c.
Benchmarking added.
Doxygen added.
2023-11-07 10:33:14 +10:00
JacobBarthelmeh
8569e76a87
Merge pull request #6915 from bigbrett/typo-fix-DecodeBasicCAConstraint
...
fix typo in WOLFSSL_ENTER function name
2023-11-03 13:53:23 -06:00
Sean Parkinson
5b863dcb12
AES bitsliced implementation added
...
AES bitsliced implementation that is cache attack safe.
Configure with:
--enable-aes-bitslice
or define:
WC_AES_BITSLICE
HAVE_AES_ECB
HAVE_AES_DIRECT
Very slow for CBC, CFB, OFB and any mode that uses a previous encrypt
block to calculate current.
CTR, GCM, XTS can parallelize the data and be much faster.
Added AES-ECB test to test.c.
2023-11-03 14:19:58 +10:00
Sean Parkinson
cfb6560468
SP int: ARM64 optimization issue
...
Make variables volatile to avoid compiler optimization issues.
2023-11-03 08:08:29 +10:00
JacobBarthelmeh
c8af4edd74
Merge pull request #6940 from bandi13/takeInConstParameters
...
Can guarantee not to modify arguments of `mp_isodd` and `mp_iszero`
2023-11-02 15:45:51 -06:00
Andras Fekete
49b9764c52
Can guarantee not to modify arguments of mp_isodd and mp_iszero
2023-11-02 16:00:57 -04:00
JacobBarthelmeh
96977d1480
Merge pull request #6900 from julek-wolfssl/zd/16868
...
EVP_EncodeBlock should not append a newline
2023-11-02 09:20:39 -06:00
lealem47
2ee94023f9
Merge pull request #6937 from dgarske/stm32wl
...
Support for the STM32WL55 and PKA improvements for ECC parameters
2023-11-01 17:44:22 -06:00
David Garske
33e12e3537
Support for the STM32WL55 and PKA improvements for ECC parameters. Fixes #6386 and Fixes #6396 .
2023-11-01 13:55:31 -07:00
JacobBarthelmeh
9e34ed937e
Merge pull request #6927 from dgarske/crl_no_date
...
Add build option for disabling CRL date check
2023-11-01 14:48:28 -06:00
JacobBarthelmeh
21f34ef028
Merge pull request #6905 from bandi13/moreCodeSonarFixes
...
Don't nag about leaked resources
2023-11-01 14:46:02 -06:00
JacobBarthelmeh
026c4bcbc7
Merge pull request #6902 from dgarske/various_20231020
...
Fixes for PKCS w/out RSA and Cert/CSR signing with unknown OID
2023-11-01 10:58:10 -06:00
JacobBarthelmeh
a3ea84d8e8
Merge pull request #6917 from SparkiDev/sp_int_no_sp_digit
...
SP int: don't use sp_digit as the type is sp_int_digit
2023-11-01 10:57:07 -06:00
jordan
34f349e510
Used codespell and fixed obvious typos.
2023-11-01 10:35:12 -05:00
Sean Parkinson
2e37ff4e45
SP int: don't use sp_digit as the type is sp_int_digit
...
Stop casting to the wrong type. SP int code use sp_int_digit and
sp_digit can be a different signedness.
2023-11-01 13:38:23 +10:00
David Garske
cdef51f537
Add build option for disabling CRL date check (WOLFSSL_NO_CRL_DATE_CHECK). ZD 16675
2023-10-30 15:45:33 -07:00
JacobBarthelmeh
33c4054cbb
Fix for CID 299748 memory leak in error case
2023-10-27 14:36:51 -06:00
JacobBarthelmeh
7b20a5597c
Fix for CID 330399 memory leak on error case
2023-10-27 14:11:21 -06:00
Andras Fekete
42c241dbbf
Avoid use of uninitialized array
2023-10-27 15:38:46 -04:00
Andras Fekete
21d465cf9a
Fix possible double free
2023-10-27 15:31:28 -04:00
JacobBarthelmeh
16b842992d
fix for CID 330416 memory leak
2023-10-27 13:27:30 -06:00
JacobBarthelmeh
449fb9c581
Fix for report CID 330424 wrong sizeof argument
2023-10-27 13:20:50 -06:00
Brett Nicholas
5277065c3c
fix typo in WOLFSSL_ENTER function name
2023-10-26 13:01:05 -06:00
Daniel Pouzzner
7821c48e65
wolfcrypt/src/sp_int.c: add cast in sp_to_unsigned_bin_len_ct() to mollify -Wconversion.
2023-10-25 23:40:21 -05:00
JacobBarthelmeh
6d8136c63e
Merge pull request #6896 from SparkiDev/rsa_to_bin_len_ct
...
RSA: convert to bin with length in constant time
2023-10-25 08:34:37 -06:00
David Garske
cf1dcdf402
Fix for adding signature where OID is not found. Currently our AddSignature function will add without OID, which is invalid. For example RSA is disabled and CSR tries to use CTC_SHA256wRSA. The wc_SignCert_ex will succeed and report success, but the CSR/Cert will be invalid (missing sigType OID).
2023-10-20 16:29:59 -07:00
Juliusz Sosinowicz
8cd6cd175d
EVP_EncodeBlock should not append a newline
2023-10-20 13:20:11 +02:00
Sean Parkinson
fcf1406675
RSA: convert to bin with length in constant time
...
Add mp_to_unsigned_bin_len_ct() which puts a number into a buffer with
padding in constant time.
Call mp_to_unsigned_bin_len_ct() in RSA when encoding result of
exponentiation.
2023-10-20 14:04:36 +10:00
Sean Parkinson
4ac795961b
ARMv7a SHA256: explicit size on vmov
...
For SHA256 using NEON on ARM32, change vmov instruction that is moving
from scalar to general-purpose register to have explicit size (32 bits).
May be needed by some compilers.
2023-10-20 10:21:57 +10:00
JacobBarthelmeh
1abaa94120
Merge pull request #6889 from SparkiDev/sm2_priv_import_range
...
ECC SM2 import private key: check less than order-1
2023-10-19 17:12:07 -06:00
Sean Parkinson
abd7bb3ac3
ECC SM2 import private key: check less than order-1
...
SM2 curves must have private key less than order-1 instead of order.
2023-10-19 17:29:25 +10:00
Brett
d805e06469
add AesEax struct to header for public use
2023-10-18 09:23:39 -06:00
David Garske
bc0643803d
Merge pull request #6873 from JacobBarthelmeh/coverity
...
Coverity scan touch up
2023-10-17 14:44:33 -07:00