mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-04 13:39:38 +00:00
Fix no-tls1_3
The hostname_cb in sslapitest.c was originally only defined if TLSv1.3 was enabled. A recently added test now uses this unconditionally, so we move the function implementation earlier in the file, and always compile it in. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11014)
This commit is contained in:
parent
5ce87e11de
commit
104a733df6
@ -110,6 +110,17 @@ static unsigned char serverinfov2[] = {
|
|||||||
0xff /* Dummy extension data */
|
0xff /* Dummy extension data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int hostname_cb(SSL *s, int *al, void *arg)
|
||||||
|
{
|
||||||
|
const char *hostname = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
|
||||||
|
|
||||||
|
if (hostname != NULL && (strcmp(hostname, "goodhost") == 0
|
||||||
|
|| strcmp(hostname, "altgoodhost") == 0))
|
||||||
|
return SSL_TLSEXT_ERR_OK;
|
||||||
|
|
||||||
|
return SSL_TLSEXT_ERR_NOACK;
|
||||||
|
}
|
||||||
|
|
||||||
static void client_keylog_callback(const SSL *ssl, const char *line)
|
static void client_keylog_callback(const SSL *ssl, const char *line)
|
||||||
{
|
{
|
||||||
int line_length = strlen(line);
|
int line_length = strlen(line);
|
||||||
@ -3196,17 +3207,6 @@ static int test_early_data_not_sent(int idx)
|
|||||||
return testresult;
|
return testresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hostname_cb(SSL *s, int *al, void *arg)
|
|
||||||
{
|
|
||||||
const char *hostname = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
|
|
||||||
|
|
||||||
if (hostname != NULL && (strcmp(hostname, "goodhost") == 0
|
|
||||||
|| strcmp(hostname, "altgoodhost") == 0))
|
|
||||||
return SSL_TLSEXT_ERR_OK;
|
|
||||||
|
|
||||||
return SSL_TLSEXT_ERR_NOACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *servalpn;
|
static const char *servalpn;
|
||||||
|
|
||||||
static int alpn_select_cb(SSL *ssl, const unsigned char **out,
|
static int alpn_select_cb(SSL *ssl, const unsigned char **out,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user