summaryrefslogtreecommitdiff
path: root/ustream-internal.h
Commit message (Collapse)AuthorAgeFilesLines
* ustream-openssl: wolfSSL: fix certificate validationPetr Štetiar2020-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently wolfSSL doesn't validate any certificates, quoting from README: wolfSSL takes a different approach to certificate verification than OpenSSL does. The default policy for the client is to verify the server, this means that if you don't load CAs to verify the server you'll get a connect error, no signer error to confirm failure (-188). If you want to mimic OpenSSL behavior of having SSL_connect succeed even if verifying the server fails and reducing security you can do this by calling: wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); before calling wolfSSL_new();. Though it's not recommended. wolfSSL simply behaves differently then OpenSSL so once you set SSL_VERIFY_NONE wolfSSL doesn't care about the certificates anymore so every call to SSL_get_verify_result() is going to succeed (returns X509_V_OK) even for invalid certificates and current OpenSSL based post connection verification logic thus doesn't work. So in order to get the validation working we need to use SSL_VERIFY_PEER for wolfSSL by default and allow disabling it explicitly by new `context_set_require_validation()` call. In order to keep the same error handling/messages via `notify_verify_error()` callback we as well need to handle certificate errors manually. Fixes: FS#3465 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* add support for specifying usable ciphersJo-Philipp Wich2020-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a new ustream_ssl_ops.context_set_ciphers() function which allows to specify the usable ciphers for TLS context which is useful to restrict the accepted cipher subset especially for ustream-ssl server applications. For the OpenSSL backend, the given cipher string is passed as-is to the SSL_CTX_set_cipher_list(). For mbedTLS, the given string is split on colons and each item of the list is resolved through mbedtls_ssl_get_ciphersuite_id() to construct a numeric list of allowed ciphers. Note that OpenSSL and mbedTLS use different names for their ciphers but both implementations simply ignore unknown names, so it is possible to specify cipherstrings which are applicable to either library, e.g. `-ALL:ECDHE- ECDSA-AES128-GCM-SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` would enable ChaCha20/Poly1305 in both OpenSSL and mbedTLS. Another crucial difference between the libraries is that the cipherstring in mbedTLS is effectively a whitelist of allowed ciphers while, without additional syntax elements, OpenSSL's cipherstring merely appends ciphers to the default selection. Ref: https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_cipher_list.html Ref: https://tls.mbed.org/api/ssl_8h.html#a9914cdf5533e813e1ea7ca52981aa006 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Remove CyaSSL, WolfSSL < 3.10.4 supportEneas U de Queiroz2019-09-201-3/+0
| | | | | | | | | | This updates the CyaSSL names to wolfSSL, and removes obsolete code to support old versions of the library < v3.10.4. Some #include statements were moved around, so that wolfssl/options.h is loaded before any other wolfssl/openssl header. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* remove polarssl supportFelix Fietkau2017-01-091-2/+0
| | | | | | polarssl (aka mbedTLS 1.3) has been EOL since end of 2016 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ustream-ssl: cyassl compatibility with build time optionsKarl Palsson2016-06-071-0/+3
| | | | | | | | | | Adds a HAVE_CYASSL definition to be consistent with polar/mbedtls. Uses that definition to include the wolfssl build time options. This enables the correct pullin of the "remainder" of the wolfssl openssl compatibility options, if they were enabled in the build of wolfssl in the first place. Signed-off-by: Karl Palsson <karlp@etactica.com>
* add mbedtls variantFelix Fietkau2016-01-151-1/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* implement certificate validation (including CN verification)Felix Fietkau2014-03-251-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* give the main context a type instead of making it void *Felix Fietkau2014-03-151-5/+5
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* add polarssl supportFelix Fietkau2013-02-041-0/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* split cyassl and openssl sources, add ssl library abstractionFelix Fietkau2013-02-041-0/+41
Signed-off-by: Felix Fietkau <nbd@openwrt.org>