__owur SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags);
__owur SSL *ossl_quic_new_domain(SSL_CTX *ctx, uint64_t flags);
+typedef void* QTOK;
SSL_TOKEN_STORE_HANDLE *ossl_quic_new_token_store(void);
void ossl_quic_free_token_store(SSL_TOKEN_STORE_HANDLE *hdl);
SSL_TOKEN_STORE_HANDLE *ossl_quic_get_token_store(SSL_CTX *ctx);
const uint8_t *token, size_t token_len);
int ossl_quic_get_peer_token(SSL_CTX *ctx, BIO_ADDR *peer,
uint8_t **token, size_t *token_len,
- void **token_free_ptr);
+ QTOK **token_free_ptr);
+void ossl_quic_free_peer_token(QTOK *token);
__owur int ossl_quic_init(SSL *s);
void ossl_quic_deinit(SSL *s);
{
uint8_t *token;
size_t token_len;
- void *token_ptr;
+ QTOK *token_ptr;
if (ch->is_server)
/*
&token, &token_len,
&token_ptr)) {
if (!ossl_quic_tx_packetiser_set_initial_token(ch->txp, token,
- token_len, free_token,
+ token_len,
+ free_peer_token,
token_ptr))
- free_token(NULL, 0, token_ptr);
+ free_peer_token(NULL, 0, token_ptr);
}
/* Plug in secrets for the Initial EL. */
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,
int ossl_quic_get_peer_token(SSL_CTX *ctx, BIO_ADDR *peer,
uint8_t **token, size_t *token_len,
- void **token_free_ptr)
+ QTOK **token_free_ptr)
{
SSL_TOKEN_STORE *c = ctx->tokencache;
QUIC_TOKEN *key = NULL;
if (tok != NULL) {
*token = tok->token;
*token_len = tok->token_len;
- *token_free_ptr = tok;
+ *token_free_ptr = (QTOK *)tok;
lh_QUIC_TOKEN_delete(c->cache, key);
rc = 1;
}
return rc;
}
+void ossl_quic_free_peer_token(QTOK *token)
+{
+ OPENSSL_free(token);
+}
+
/*
* SSL_get_accept_connection_queue_len
* -----------------------------------