Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CryptoPkg/TlsLib: TlsSetVerifyHost: parse IP address literals as such (…
…CVE-2019-14553) Using the inet_pton() function that we imported in the previous patches, recognize if "HostName" is an IP address literal, and then parse it into binary representation. Passing the latter to OpenSSL for server certificate validation is important, per RFC-2818 <https://tools.ietf.org/html/rfc2818#section-3.1>: > In some cases, the URI is specified as an IP address rather than a > hostname. In this case, the iPAddress subjectAltName must be present in > the certificate and must exactly match the IP in the URI. Note: we cannot use X509_VERIFY_PARAM_set1_ip_asc() because in the OpenSSL version that is currently consumed by edk2, said function depends on sscanf() for parsing IPv4 literals. In "CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c", we only provide an empty -- always failing -- stub for sscanf(), however. Cc: David Woodhouse <[email protected]> Cc: Jian J Wang <[email protected]> Cc: Jiaxin Wu <[email protected]> Cc: Sivaraman Nainar <[email protected]> Cc: Xiaoyu Lu <[email protected]> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=960 CVE: CVE-2019-14553 Suggested-by: David Woodhouse <[email protected]> Signed-off-by: Laszlo Ersek <[email protected]> Acked-by: Jian J Wang <[email protected]> Reviewed-by: Jiaxin Wu <[email protected]>
- Loading branch information