mirror of
https://github.com/curl/curl.git
synced 2024-12-03 06:20:31 +08:00
parent
a72b6b9606
commit
82e4d029c5
@ -199,11 +199,12 @@ static int quic_add_handshake_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL ossl_level,
|
|||||||
ngtcp2_crypto_level level = quic_from_ossl_level(ossl_level);
|
ngtcp2_crypto_level level = quic_from_ossl_level(ossl_level);
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
crypto_data = &qs->client_crypto_data[level];
|
crypto_data = &qs->crypto_data[level];
|
||||||
if(crypto_data->buf == NULL) {
|
if(crypto_data->buf == NULL) {
|
||||||
crypto_data->buf = malloc(4096);
|
crypto_data->buf = malloc(4096);
|
||||||
|
if(!crypto_data->buf)
|
||||||
|
return 0;
|
||||||
crypto_data->alloclen = 4096;
|
crypto_data->alloclen = 4096;
|
||||||
/* TODO Explode if malloc failed */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Just pretend that handshake does not grow more than 4KiB for
|
/* TODO Just pretend that handshake does not grow more than 4KiB for
|
||||||
@ -696,8 +697,17 @@ static int ng_perform_getsock(const struct connectdata *conn,
|
|||||||
static CURLcode ng_disconnect(struct connectdata *conn,
|
static CURLcode ng_disconnect(struct connectdata *conn,
|
||||||
bool dead_connection)
|
bool dead_connection)
|
||||||
{
|
{
|
||||||
(void)conn;
|
int i;
|
||||||
|
struct quicsocket *qs = &conn->hequic[0];
|
||||||
(void)dead_connection;
|
(void)dead_connection;
|
||||||
|
free(qs->rx_secret);
|
||||||
|
if(qs->ssl)
|
||||||
|
SSL_free(qs->ssl);
|
||||||
|
for(i = 0; i < 3; i++)
|
||||||
|
free(qs->crypto_data[i].buf);
|
||||||
|
nghttp3_conn_del(qs->h3conn);
|
||||||
|
ngtcp2_conn_del(qs->qconn);
|
||||||
|
SSL_CTX_free(qs->sslctx);
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ struct quicsocket {
|
|||||||
uint8_t *rx_secret; /* malloced */
|
uint8_t *rx_secret; /* malloced */
|
||||||
uint8_t *tx_secret; /* points into the above buffer */
|
uint8_t *tx_secret; /* points into the above buffer */
|
||||||
size_t rx_secretlen;
|
size_t rx_secretlen;
|
||||||
struct quic_handshake client_crypto_data[3];
|
struct quic_handshake crypto_data[3];
|
||||||
/* the last TLS alert description generated by the local endpoint */
|
/* the last TLS alert description generated by the local endpoint */
|
||||||
uint8_t tls_alert;
|
uint8_t tls_alert;
|
||||||
struct sockaddr_storage local_addr;
|
struct sockaddr_storage local_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user