mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-24 05:00:45 -04:00
Create error code for mbedtls_ssl_set_hostname not called
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
434016e2eb
commit
59a5117072
@ -169,6 +169,39 @@
|
||||
#define MBEDTLS_ERR_SSL_VERSION_MISMATCH -0x5F00
|
||||
/** Invalid value in SSL config */
|
||||
#define MBEDTLS_ERR_SSL_BAD_CONFIG -0x5E80
|
||||
/* Error space gap */
|
||||
/** Attempt to verify a certificate without an expected hostname.
|
||||
* This is usually insecure.
|
||||
*
|
||||
* In TLS clients, when a client authenticates a server through its
|
||||
* certificate, the client normally checks three things:
|
||||
* - the certificate chain must be valid;
|
||||
* - the chain must start from a trusted CA;
|
||||
* - the certificate must cover the server name that is expected by the client.
|
||||
*
|
||||
* Omitting any of these checks is generally insecure, and can allow a
|
||||
* malicious server to impersonate a legitimate server.
|
||||
*
|
||||
* The third check may be safely skipped in some unusual scenarios,
|
||||
* such as networks where eavesdropping is a risk but not active attacks,
|
||||
* or a private PKI where the client equally trusts all servers that are
|
||||
* accredited by the root CA.
|
||||
*
|
||||
* You should call mbedtls_ssl_set_hostname() with the expected server name
|
||||
* before starting a TLS handshake on a client (unless the client is
|
||||
* set up to only use PSK-based authentication, which does not rely on the
|
||||
* host name). If you have determined that server name verification is not
|
||||
* required for security in your scenario, call mbedtls_ssl_set_hostname()
|
||||
* with \p NULL as the server name.
|
||||
*
|
||||
* This error is raised if all of the following conditions are met:
|
||||
*
|
||||
* - A TLS client is configured with the authentication mode
|
||||
* #MBEDTLS_SSL_VERIFY_REQUIRED (default).
|
||||
* - Certificate authentication is enabled.
|
||||
* - The client does not call mbedtls_ssl_set_hostname().
|
||||
*/
|
||||
#define MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME -0x5D80
|
||||
|
||||
/*
|
||||
* Constants from RFC 8446 for TLS 1.3 PSK modes
|
||||
|
Loading…
x
Reference in New Issue
Block a user