mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
Pass length of hostname.encode() to X509_VERIFY_PARAM_set1_host (#5083)
* Pass length of hostname.encode() to X509_VERIFY_PARAM_set1_host Passing zero for the size_t length argument of X509_VERIFY_PARAM_set1_host causes MITM Proxy to crash when used with BoringSSL. https://www.openssl.org/docs/man1.1.1/man3/X509_VERIFY_PARAM_set1_host.html https://boringssl.googlesource.com/boringssl/ * Update CHANGELOG.md Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This commit is contained in:
parent
11c22d8a4a
commit
b5c1ef11c1
@ -23,6 +23,7 @@
|
|||||||
* Correct documentation example for User-Agent header modification (#4997, @jamesyale)
|
* Correct documentation example for User-Agent header modification (#4997, @jamesyale)
|
||||||
* Fix random connection stalls (#5040, @EndUser509)
|
* Fix random connection stalls (#5040, @EndUser509)
|
||||||
* Add `n` new flow keybind to mitmweb (#5061, @ianklatzco)
|
* Add `n` new flow keybind to mitmweb (#5061, @ianklatzco)
|
||||||
|
* Fix compatibility with BoringSSL (@pmoulton)
|
||||||
|
|
||||||
## 28 September 2021: mitmproxy 7.0.4
|
## 28 September 2021: mitmproxy 7.0.4
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ def create_proxy_server_context(
|
|||||||
ip: bytes = ipaddress.ip_address(hostname).packed
|
ip: bytes = ipaddress.ip_address(hostname).packed
|
||||||
except ValueError:
|
except ValueError:
|
||||||
SSL._openssl_assert( # type: ignore
|
SSL._openssl_assert( # type: ignore
|
||||||
SSL._lib.X509_VERIFY_PARAM_set1_host(param, hostname.encode(), 0) == 1 # type: ignore
|
SSL._lib.X509_VERIFY_PARAM_set1_host(param, hostname.encode(), len(hostname.encode())) == 1 # type: ignore
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
SSL._openssl_assert( # type: ignore
|
SSL._openssl_assert( # type: ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user