diff options
author | Daniel Danzberger <daniel@dd-wrt.com> | 2019-12-08 21:14:08 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2020-01-05 17:23:11 +0100 |
commit | 30cebb4fc78e49e0432a404f7c9dd8c9a93b3cc3 (patch) | |
tree | e582995436d1ab354ddd04eb8ebdc930d4b31b17 | |
parent | 77de09f381188eba3ada542c18898e7bc59e3e43 (diff) | |
download | ustream-ssl-30cebb4fc78e49e0432a404f7c9dd8c9a93b3cc3.tar.gz |
ustream-ssl: mbedtls: fix ssl client verification
The ustream_ssl_update_own_cert() function should, like the name suggests, only
update the local ssl peer's own certificate and not the any of the CA's.
By overwriting the CA's certifcates when setting the own certificate, the code
broke SSL client verification.
This bug was only triggerd when:
ustream_ssl_context_set_crt_file()
was called after
ustream_ssl_context_add_ca_crt_file()
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
-rw-r--r-- | ustream-mbedtls.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c index 85bbb1c..74c27a5 100644 --- a/ustream-mbedtls.c +++ b/ustream-mbedtls.c @@ -182,16 +182,9 @@ static void ustream_ssl_update_own_cert(struct ustream_ssl_ctx *ctx) if (!ctx->cert.version) return; - if (!ctx->server) { - mbedtls_ssl_conf_ca_chain(&ctx->conf, &ctx->cert, NULL); - return; - } - if (!ctx->key.pk_info) return; - if (ctx->cert.next) - mbedtls_ssl_conf_ca_chain(&ctx->conf, ctx->cert.next, NULL); mbedtls_ssl_conf_own_cert(&ctx->conf, &ctx->cert, &ctx->key); } |