mirror of
https://github.com/curl/curl.git
synced 2026-08-05 05:06:13 +03:00
gtls: fix some typos
Also make gtls_get_ietf_proto() static Found by Copilot Closes #21498
This commit is contained in:
parent
cb9cfee9b0
commit
1ff399c3f7
2 changed files with 20 additions and 22 deletions
|
|
@ -692,6 +692,24 @@ CURLcode Curl_gtls_client_trust_setup(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
#ifdef CURL_GNUTLS_EARLY_DATA
|
||||
static int gtls_get_ietf_proto(gnutls_session_t session)
|
||||
{
|
||||
switch(gnutls_protocol_get_version(session)) {
|
||||
case GNUTLS_SSL3:
|
||||
return CURL_IETF_PROTO_SSL3;
|
||||
case GNUTLS_TLS1_0:
|
||||
return CURL_IETF_PROTO_TLS1;
|
||||
case GNUTLS_TLS1_1:
|
||||
return CURL_IETF_PROTO_TLS1_1;
|
||||
case GNUTLS_TLS1_2:
|
||||
return CURL_IETF_PROTO_TLS1_2;
|
||||
case GNUTLS_TLS1_3:
|
||||
return CURL_IETF_PROTO_TLS1_3;
|
||||
default:
|
||||
return CURL_IETF_PROTO_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
const char *ssl_peer_key,
|
||||
|
|
@ -740,7 +758,7 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf,
|
|||
}
|
||||
|
||||
result = Curl_ssl_session_create2(sdata, sdata_len,
|
||||
Curl_glts_get_ietf_proto(session),
|
||||
gtls_get_ietf_proto(session),
|
||||
alpn, valid_until, earlydata_max,
|
||||
qtp_clone, quic_tp_len,
|
||||
&sc_session);
|
||||
|
|
@ -753,24 +771,6 @@ CURLcode Curl_gtls_cache_session(struct Curl_cfilter *cf,
|
|||
}
|
||||
#endif
|
||||
|
||||
int Curl_glts_get_ietf_proto(gnutls_session_t session)
|
||||
{
|
||||
switch(gnutls_protocol_get_version(session)) {
|
||||
case GNUTLS_SSL3:
|
||||
return CURL_IETF_PROTO_SSL3;
|
||||
case GNUTLS_TLS1_0:
|
||||
return CURL_IETF_PROTO_TLS1;
|
||||
case GNUTLS_TLS1_1:
|
||||
return CURL_IETF_PROTO_TLS1_1;
|
||||
case GNUTLS_TLS1_2:
|
||||
return CURL_IETF_PROTO_TLS1_2;
|
||||
case GNUTLS_TLS1_3:
|
||||
return CURL_IETF_PROTO_TLS1_3;
|
||||
default:
|
||||
return CURL_IETF_PROTO_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CURL_GNUTLS_EARLY_DATA
|
||||
static CURLcode cf_gtls_update_session_id(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
|
|
@ -839,7 +839,7 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf,
|
|||
if((conn_config->cipher_list[0] == '+') ||
|
||||
(conn_config->cipher_list[0] == '-') ||
|
||||
(conn_config->cipher_list[0] == '!')) {
|
||||
/* add it to out own */
|
||||
/* add it to our own */
|
||||
if(!curlx_dyn_len(&buf)) { /* not added yet */
|
||||
result = curlx_dyn_add(&buf, priority);
|
||||
if(result)
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ struct ssl_peer;
|
|||
struct ssl_connect_data;
|
||||
struct Curl_ssl_session;
|
||||
|
||||
int Curl_glts_get_ietf_proto(gnutls_session_t session);
|
||||
|
||||
struct gtls_shared_creds {
|
||||
gnutls_certificate_credentials_t creds;
|
||||
char *CAfile; /* CAfile path used to generate X509 store */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue