5370 Commits

Author SHA1 Message Date
TakayukiMatsuo
90116a2873
Add support for wolfSSL_EVP_PBE_scrypt (#4345) 2021-09-03 15:49:02 +10:00
David Garske
35cef831bf
Fix for missing heap hint with RSA PSS and WOLFSSL_PSS_LONG_SALT (#4363)
* Fix for missing heap hint with RSA PSS and `WOLFSSL_PSS_LONG_SALT`. This fix will only allocate buffer if it exceeds the local buffer. Added `wc_RsaPSS_CheckPadding_ex2` to support heap hint if required. Fixed asn.c build issue with `NO_CERTS`. Fixed several spelling errors in asn.c. ZD12855.

* Improve the dynamic memory NULL checking in `wc_RsaPSS_CheckPadding_ex2` with `WOLFSSL_PSS_LONG_SALT` defined.
2021-09-03 15:42:31 +10:00
elms
fd77cb8918
fix wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks (#4369)
RFC3394 in must be at least 2 64-bit blocks and output is one block longer.
On Unwrapping the input must then be a minimum of 3 64-bit blocks
2021-09-03 12:48:01 +10:00
Kaleb Himes
a9a1158f46
Remove test cases not supported by ARM64_ASM in FIPS mode - OE25 (#4342) 2021-09-03 08:37:34 +10:00
David Garske
03fba72027
Merge pull request #4361 from julek-wolfssl/GetASNHeader-return
Missing `GetASNHeader` return handling
2021-09-02 09:18:06 -07:00
Juliusz Sosinowicz
abc046b5b7 Missing GetASNHeader return handling 2021-09-02 14:56:58 +02:00
TakayukiMatsuo
56843fbefd
Add support for EVP_sha512_224/256 (#4257) 2021-09-02 14:05:07 +10:00
JacobBarthelmeh
bac0497c35
PKCS7 fix for double free on error case and sanity check on set serial number (#4356)
* check for error value on set serial number

* set pointer in fail case
2021-09-02 09:13:35 +10:00
David Garske
9b6cf56a6e
Expanded support for Curve25519/Curve448 and TLS v1.3 sniffer (#4335)
* Fixes for building with Ed/Curve25519 only. Fix for IoT safe demo to exit after running once. Added `WOLFSSL_DH_EXTRA` to `--enable-all` and `--enable-sniffer`. Cleanup uses of `==` in configure.ac. Various spelling fixes.

* Fix for sniffer with TLS v1.3 session tickets.

* Fix for ASN Template Ed25519 key export (missing version / not setting OID correctly).

* Add key import/export support for Curve25519/Curve448. Refactor of the 25519/448 ASN code to combine duplicate code.

* Refactor of Curve25519 code. Improved public key export to handle generation when only private is set. Improved private scalar buffer sizing.

* Fix for static ephemeral loading of file buffer.

* Added sniffer Curve25519 support and test case.

* Fix for sniffer to not use ECC for X25519 if both are set.

* Fix Curve448 public export when only private is set.

* Fix for `dh_generate_test` for small stack size.

* Reduce stack size use on new asymmetric DER import/export functions. Cleanup pub length calc.

* Fix invalid comment.
2021-09-01 09:28:24 +10:00
John Safranek
078d49ea6f
Merge pull request #4333 from dgarske/evp_devid
EVP key support for heap hint and crypto callbacks
2021-08-30 11:59:27 -07:00
John Safranek
ee07bd3fa9
Merge pull request #4331 from SparkiDev/jenkins_fixes_4
Jenkins nighlty fixes
2021-08-30 10:29:00 -07:00
John Safranek
412528e18b
Merge pull request #4336 from elms/sp_out_of_range
sp_math: error on multiplier larger than curve order
2021-08-27 10:15:42 -07:00
Sean Parkinson
db8f4e4f19 Jenkins nighlty fixes
wolfSSL_Rehandshake(): don't set 'ret' unless HAVE_SESSION_TICKET
defined (otherwise compiler will complain:  warning: Value stored to
'ret' is never read)

AES GCM streaming: fix 64-bit word version to compile and pass testing
Use '--enable-aesgcm=word' to get the word32 or word64 implementation
depending on the availabilty of 64-bit type.
2021-08-27 08:46:39 +10:00
elms
be2ad82e6d sp_math: error on multiplier larger than curve order
zd 12674
2021-08-25 14:59:51 -07:00
John Safranek
cb3f42482b
Merge pull request #4332 from dgarske/zd12791
Improve CRL error codes
2021-08-25 13:57:46 -07:00
John Safranek
3f2abef212
Merge pull request #4321 from haydenroche5/libimobiledevice
Make changes to support libimobiledevice.
2021-08-24 17:19:26 -07:00
David Garske
b8263f44f7 Added new EVP API for creating a private key for use with crypto callbacks. Improvements to heap hint and devId with EVP layer. 2021-08-24 12:14:44 -07:00
David Garske
700b1c56c1 Improve CRL error codes. Add --enable-crl=io option. ZD 12791 2021-08-24 11:12:12 -07:00
Hayden Roche
7ff1351971 Make changes to support libimobiledevice.
- `EVP_PKEY_assign_RSA` should store the private key in DER format, not the
public key.
- The last call to `infoCb` in `wolfSSL_BIO_write` should provide the length of
the data to write.
- We should be able to parse RSA public keys starting with BEGIN RSA PUBLIC KEY
and ending with END RSA PUBLIC KEY.
2021-08-24 08:52:43 -07:00
John Safranek
9c541568fc
Merge pull request #4313 from SparkiDev/rsa_vfy_only
SP RSA verify only: fix to compile
2021-08-23 14:42:56 -07:00
David Garske
6ec28f508e
Merge pull request #4325 from SparkiDev/jenkins_fixes_3
OpenSSL Extra builds: fixes from nightly builds failing
2021-08-23 09:30:15 -07:00
Daniele Lacamera
b56c89bb84 Fix compiler warnings (ZD12802 and others) 2021-08-23 08:12:24 +02:00
Sean Parkinson
4bfd0443a7 OpenSSL Extra builds: fixes from nightly builds failing
Prototype is required when internal.h is not included and GetCA is not
defined.

wolfSSL_EVP_CIPHER_CTX_set_iv_length() is called with CBC cipher in
api.c. Function is not specificly for GCM, though not strictly needed
for CBC.
2021-08-23 12:55:27 +10:00
Sean Parkinson
dbb03cb5a3 SP RSA verify only: fix to compile
Configurations:
./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=2048 --enable-sp-math

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math-all

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math --enable-sp-asm

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=2048 --enable-sp-math --enable-sp-asm
2021-08-20 13:16:58 +10:00
Sean Parkinson
fa8f23284d Maths x86 asm: change asm snippets to get compiling
TFM:
  Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
SP:
  Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
2021-08-20 10:35:49 +10:00
John Safranek
e7ef48d2b7
Merge pull request #3869 from SparkiDev/asn1_template
ASN1 Template: stricter and simpler DER/BER parsing/construction
2021-08-19 12:47:04 -07:00
Daniel Pouzzner
3226e69649
--enable-linuxkm-pie (FIPS Linux kernel module) (#4276)
* Adds `--enable-linuxkm-pie` and associated infrastructure, to support FIPS mode in the Linux kernel module.
* Adds `tests/api.c` missing (void) arglist to `test_SSL_CIPHER_get_xxx()`.
2021-08-19 09:15:52 -07:00
Sean Parkinson
17a569d4dd SRP test: use proper SRP hash type for g++ 2021-08-19 11:40:43 +10:00
Sean Parkinson
d486b89c61 ASN1 Template: stricter and simpler DER/BER parsing/construction
Reduce debug output noise
2021-08-19 11:32:41 +10:00
John Safranek
18314e5a4f
Merge pull request #4309 from dgarske/sniff_cleanups
Improved sniffer statistics and documentation
2021-08-18 16:03:38 -07:00
David Garske
c5f9e55567 Fixes for CMAC compatibility layer with AES CBC disabled. CMAC code cleanups. Fixes for "make check" with AES CBC disabled. 2021-08-18 11:30:18 -07:00
David Garske
d6f5f815e1 Fix for srp_test_digest return code checking. Added GCC-ARM TLS server example. 2021-08-17 11:12:40 -07:00
David Garske
95178e3bdc Use void* on heap hint test. Also previously fixed in hmac.c. 2021-08-17 10:52:50 -07:00
David Garske
89904ce82e Fixes for building without AES CBC and support for PKCS7 without AES CBC. 2021-08-17 10:47:19 -07:00
David Garske
e1f603301b Fixes for SRP with heap hint. 2021-08-17 10:45:50 -07:00
David Garske
c598688f89 Fix for static memory with bucket size matching. 2021-08-17 10:38:27 -07:00
David Garske
69d01afd3a
Merge pull request #4250 from danielinux/iotsafe
IoT-Safe with TLS demo
2021-08-17 08:26:19 -07:00
David Garske
9898b5d82b Various spelling fixes. 2021-08-16 16:31:18 -07:00
Sean Parkinson
9066ab6051 SRP test: increase size of N to support larger digests
Test all digests supported by SRP.
2021-08-17 09:15:07 +10:00
David Garske
c8fd5d552e IoTSafe Improvements. Use new hex to char functions in misc.c. Fix for arm-none-eabi missing nano specs. Cleanups for IoTSafe code, README.md and user_settings.h. Fix linker script to use flash at 0x8000000. Support for TLS v1.3. 2021-08-16 13:13:32 -07:00
Daniele Lacamera
490eeb4003 Support for IoT-Safe with TLS demo 2021-08-16 13:13:30 -07:00
Hayden Roche
c6f0fb11d0
Merge pull request #4253 from julek-wolfssl/lighttpd-1.4.55
Implement `wolfSSL_set_client_CA_list` and add 'HIGH' cipher suite
2021-08-16 15:05:51 -05:00
Hayden Roche
bbb514fa6d Add support for rsyslog.
- Add an --enable-rsyslog option to configure.ac.
- Add a few missing `WOLFSSL_ERROR` calls that were expected by rsyslog unit
  tests.
- Add better documentation around `WOLFSSL_SHUTDOWN_NOT_DONE` and define it to
  be 0 (rather than 2) when `WOLFSSL_ERROR_CODE_OPENSSL` is defined. This is in
  accordance with OpenSSL documentation. Without this change, rsyslog was
  failing to do the bidirectional shutdown properly because it was checking the
  shutdown return value against 0. I'm keeping the old value when
  `WOLFSSL_ERROR_CODE_OPENSSL` isn't defined because it's part of the public
  wolfssl interface (it's in ssl.h).
2021-08-13 23:24:28 -07:00
Juliusz Sosinowicz
6a5f40d698 Code review fixes. 2021-08-14 00:25:00 +02:00
Juliusz Sosinowicz
d4391bd997 Parse distinguished names in DoCertificateRequest
The CA names sent by the server are now being parsed in `DoCertificateRequest` and are saved on a stack in `ssl->ca_names`.
2021-08-14 00:24:08 +02:00
elms
b2380069f0
Merge pull request #4261 from dgarske/rsa_der_pub 2021-08-13 13:36:01 -07:00
David Garske
ec4e336866
Merge pull request #4299 from haydenroche5/evp_pkey_dec_enc_improvements
Make improvements to wolfSSL_EVP_PKEY_encrypt and wolfSSL_EVP_PKEY_decrypt.
2021-08-13 08:10:20 -07:00
Hayden Roche
3be13f7358 Make improvements to wolfSSL_EVP_PKEY_encrypt and wolfSSL_EVP_PKEY_decrypt.
- Handle case where output buffer is NULL. In this case, passed in output buffer
  length pointer should be given the maximum output buffer size needed.
- Add better debug messages.
2021-08-12 18:46:15 -07:00
Juliusz Sosinowicz
7dea1dcd39 OpenResty 1.13.6.2 and 1.19.3.1 support
# New or Updated APIs
- wolfSSL_get_tlsext_status_type
- wolfSSL_X509_chain_up_ref
- wolfSSL_get0_verified_chain
- SSL_CTX_set_cert_cb
- SSL_certs_clear
- SSL_add0_chain_cert ssl_cert_add0_chain_cert
- SSL_add1_chain_cert ssl_cert_add1_chain_cert
- sk_X509_NAME_new_null
- SSL_CTX_set_cert_cb
- SSL_set0_verify_cert_store
- SSL_set_client_CA_list

# Other Changes
- Ignore gdbinit
- Add api.c tests for new API
- Add `WOLFSSL_X509_STORE* x509_store_pt` to `WOLFSSL`
- Add macro to select the `WOLFSSL` specific store when available and the associated `WOLFSSL_CTX` store otherwise. Calls to `ssl->ctx->cm` and `ssl->ctx->x509_store*` were replaced by macros.
- NO-OP when setting existing store
- Add reference counter to `WOLFSSL_X509_STORE`
- Cleanup MD5 redundant declarations
- WOLFSSL_ERROR may map to nothing so make assignment outside of it
- refMutex fields are excluded with SINGLE_THREADED macro
- Chain cert refactor
- Make `wolfSSL_add0_chain_cert` and `wolfSSL_add1_chain_cert` not affect the context associated with the SSL object
- `wolfSSL_CTX_add1_chain_cert` now updates the `ctx->certChain` on success and stores the cert in `ctx->x509Chain` for later free'ing
2021-08-12 23:58:22 +02:00
David Garske
96c223e585
Merge pull request #4288 from julek-wolfssl/get-date-from-cert
Add a test/example for parsing the date from a certificate
2021-08-12 12:52:52 -07:00