Commit Graph

107 Commits

Author SHA1 Message Date
Juliusz Sosinowicz e78f7f734e Add Apache 2.4.51 support
- Define `OPENSSL_COMPATIBLE_DEFAULTS` and `WOLFSSL_NO_OCSP_ISSUER_CHECK` for Apache config
- Fix `SSL_set_timeout` to match OpenSSL signature
- Implement `pkey` in `X509_INFO`
- Detect attempt to connect with plain HTTP
- Implement `wolfSSL_OCSP_request_add1_nonce`
- Set `ssl->cipher.bits` when calling `wolfSSL_get_current_cipher`
- Use custom flush method in `wolfSSL_BIO_flush` when set in BIO method
- Set the TLS version options in the `ssl->options` at the end of ClientHello parsing
- Don't modify the `ssl->version` when in a handshake (`ssl->msgsReceived.got_client_hello` is set)
- `wolfSSL_get_shutdown` returns a full bidirectional return when the SSL object is cleared. `wolfSSL_get_shutdown` calls `wolfSSL_clear` on a successful shutdown so if we detect a cleared SSL object, assume full shutdown was performed.
2021-12-16 12:39:38 +01:00
Daniel Pouzzner 0b4f34d62a typographic cleanup: fix whitespace, remove unneeded UTF-8, convert C++ comment constructs to C. 2021-11-08 17:35:05 -06:00
Sean Parkinson 69d5405e91 Merge pull request #4350 from cconlon/pythonCompatD
OpenSSL compatibility fixes: BIO_set_nbio(), SHA3 NID, WOLFSSL_PYTHON
2021-10-12 08:14:34 +10:00
David Garske 847b8f9a1f Reduce openssl verbosity in BIO due to PEM_X509_INFO_read_bio reading 1 byte at a time. Remove duplicate PEM_X509_INFO_read_bio macro. (#4428) 2021-09-28 08:21:23 +10:00
Chris Conlon 9e4ab9b638 Add BIO_up_ref(), PEM_read_DHparam(), EVP_MD_nid() (#4348)
* add BIO_up_ref

* add PEM_read_DHparams()

* add EVP_MD_nid()

* exclude PEM_read_DHparams when NO_FILESYSTEM defined

* review feedback: single threaded, indents, EVP_MD_nid
2021-09-27 08:20:37 +10:00
Chris Conlon 82a3d79c2f unnecessary variable init, else formatting in bio.c 2021-09-23 11:26:17 -06:00
Hayden Roche ec0335cdb3 Use WOLFSSL_SUCCESS instead of 1. 2021-09-19 17:20:55 -07:00
Jacob Barthelmeh 3f534e7e07 return macro and macro guards 2021-09-19 17:20:55 -07:00
Chris Conlon f6b91f04ed BIO_set_nbio() should always return 1, check input bio for NULL before using 2021-09-19 17:20:54 -07:00
TakayukiMatsuo c8bcfe4763 Add implementation to make wolfSSL_BIO_flush work for WOLFSSL_BIO_FILE (#4395) 2021-09-14 10:08:55 +10:00
Eric Blankenhorn 649aa9c95f Add error handling to wolfSSL_BIO_get_len (#4385) 2021-09-10 08:15:30 +10: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 2c62880fd2 flags update
1. Fixed typo in ifdef for HAVE_ED448.
2. Fixed typos in comments in sha512.
3. Add include config.h to bio.c.
2021-08-06 11:28:20 -06:00
David Garske c6c7dfd5db Merge pull request #4053 from SparkiDev/cppcheck_fixes_6
cppcheck: fixes from reviewing report
2021-06-09 12:51:30 -07:00
Sean Parkinson c6646ae9c8 Merge pull request #4044 from julek-wolfssl/ZD12270
Check for XREAD when XFREAD fails
2021-06-09 09:48:25 +10:00
Sean Parkinson 2c6285ccba cppcheck: fixes from reviewing report 2021-05-20 17:55:06 +10:00
Juliusz Sosinowicz 58e7d5388a Check for XREAD when XFREAD fails
On Windows we would always fail with `NOT_COMPILED_IN` when reading a  file BIO.
2021-05-17 16:57:53 +02:00
David Garske c88afdef87 Fixes for building with WOLFSSL_USER_IO (with no built-in socket support). Related to issue #3998. 2021-05-06 11:07:05 -07:00
Juliusz Sosinowicz beff4daf7e Refactor wolfSSL_BIO_BASE64_write to simplify its logic 2021-04-08 19:11:55 +02:00
David Garske f298bb9f22 Peer review feedback. 2021-04-08 08:06:45 -07:00
David Garske 4747ba9ccb Fix for BIO base64 write valgrind issue. 2021-04-07 12:23:26 -07:00
David Garske 5ebe5d071f Fixes for wolfSSL_BIO_BASE64_write changes. 2021-04-05 14:35:47 -07:00
Juliusz Sosinowicz 1a9d59c185 front may be unused and generate a warning 2021-04-05 14:35:47 -07:00
Juliusz Sosinowicz d257cf5003 Return error when using not compiled in BIO
Refactor base64 BIO write into static function
2021-04-05 14:35:47 -07:00
David Garske 5b751d9eaa Fix for possible unused label "exit_chain". 2021-04-05 14:35:47 -07:00
David Garske 8984ce03e9 Refactor BIO read/write to use switch. 2021-04-05 14:35:47 -07:00
David Garske 072e6e010c Handle the BIO want read in BioReceive. 2021-04-05 14:35:47 -07:00
David Garske 5c762afb94 Fix for BIO with callbacks not called after PR #3824 (was always returning WANT_READ). 2021-04-05 14:35:47 -07:00
Jacob Barthelmeh c729318ddd update copyright date 2021-03-11 13:42:46 +07:00
JacobBarthelmeh 4ad1b52108 Merge pull request #3824 from julek-wolfssl/ssl-bio-use-chain
WOLFSSL_BIO_SSL BIO should use remaining chain for IO
2021-03-10 18:21:09 +07:00
Juliusz Sosinowicz d7838155e5 WOLFSSL_BIO_SSL BIO should use remaining chain for IO
This is accomplished by passing the next BIO in the chain in to the `wolfSSL_set_bio` API.
2021-03-10 10:13:42 +01:00
TakayukiMatsuo 871933e3e8 Add s comment to wolfSSL_BIO_tell 2021-03-04 15:41:03 +09:00
TakayukiMatsuo 362d2a2d68 Moved int pos declaration at the top the func 2021-02-24 01:07:45 +09:00
TakayukiMatsuo 9e4dcfb66c Add wolfSSL_BIO_tell 2021-02-23 11:12:12 +09:00
Juliusz Sosinowicz 77c730361e Jenkins fixes 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz 7df8f2e2bb Internal unit tests 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz 753a3babc8 OpenSSL Compat layer
Implement/stub:
- wolfSSL_NCONF_get_number
- wolfSSL_EVP_PKEY_CTX_ctrl_str
- wolfSSL_PKCS12_verify_mac
- wc_PKCS12_verify_ex
- wolfSSL_BIO_new_fd
- wolfSSL_X509_sign_ctx
- wolfSSL_ASN1_STRING_cmp
- wolfSSL_ASN1_TIME_set_string
- X509V3_EXT_add_nconf
- X509V3_set_nconf
Implement TXT_DB functionality:
- wolfSSL_TXT_DB_read
- wolfSSL_TXT_DB_free
- wolfSSL_TXT_DB_create_index
- wolfSSL_TXT_DB_get_by_index
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz 4aa30d0bde Add CSR parsing capabilities to ParseCertRelative and wc_GetPubX509
- wolfSSL_BIO_get_mem_data now returns the last memory BIO in the chain
- Change wolfSSL_BIO_pending calls to wolfSSL_BIO_get_len calls to get accurate length depending on BIO
- Refactor X509 and X509_REQ functions to reuse similar code
- X509 and X509_REQ i2d functions now generate their DER outputs instead of returning the input DER
- Signature generated by wolfSSL_X509_resign_cert is now saved in the x509->sig buffer and added when calling *i2d
- Add test_wolfSSL_d2i_X509_REQ
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz 1a50d8e028 WIP
- wolfSSL_BIO_ctrl_pending ignore BASE64 bio's as well now
- Save the last Finished messages sent or received in the WOLFSSL struct
- Implement wolfSSL_CTX_set_max_proto_version
- wolfSSL_d2i_X509_bio now uses wolfSSL_BIO_read so that the entire chain is properly read from the BIO
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz a7ec58003e PKCS7 changes
- Allow PKCS7_EncodeSigned to be called with a zero content length
- wc_HashUpdate now doesn't error out on zero length data
- First cert in wolfSSL_PKCS7_encode_certs is treated as main cert and the PKCS7 struct is initialized with it
- wolfSSL_BIO_get_mem_data returns the buffer from the last bio in chain
2020-12-17 14:26:49 +01:00
Elms 86b2118550 Address some cppcheck issues 2020-10-19 11:47:53 -07:00
David Garske 6d5731b8e9 Fixes for HMAC_CTX cleanup not being called to free SHA2 resources with WOLFSSL_SMALL_STACK_CACHE. Added return code checking and cleanup for openssl_test. 2020-08-26 09:45:26 -07:00
Tesfa Mael 890500c1b1 Fix Coverity 2020-07-08 08:20:43 -07:00
Eric Blankenhorn 1487917214 Fix EVP_MD_CTX_type to return NID 2020-04-14 14:27:21 -05:00
Jacob Barthelmeh 51d55ed1c8 account for different peer certificate in test case, g++ build fix, static memory size increase 2020-02-20 17:28:33 -06:00
Eric Blankenhorn 258382048d Fix test failures 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh 65732c2269 add bio retry and set close tests 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh 3137312911 update to implementation of BIO_MD type 2020-02-20 17:28:32 -06:00
Sean Parkinson 55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
JacobBarthelmeh 6b4551c012 Merge pull request #2654 from cariepointer/qt-512-513
Add Qt 5.12 and 5.13 support
2020-01-10 17:34:23 -07:00