BIO *ossl_quic_port_get_net_wbio(QUIC_PORT *port);
int ossl_quic_port_set_net_rbio(QUIC_PORT *port, BIO *net_rbio);
int ossl_quic_port_set_net_wbio(QUIC_PORT *port, BIO *net_wbio);
+SSL_CTX *ossl_quic_port_get_channel_ctx(QUIC_PORT *port);
/*
* Re-poll the network BIOs already set to determine if their support for
SSL_TOKEN_STORE_HANDLE *ossl_quic_get_token_store(SSL_CTX *ctx);
int ossl_quic_set_token_store(SSL_CTX *ctx, SSL_TOKEN_STORE_HANDLE *hdl);
int ossl_quic_update_peer_token(SSL_CTX *ctx, BIO_ADDR *peer,
- uint8_t *token, size_t token_len);
+ 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);
}
int ossl_quic_update_peer_token(SSL_CTX *ctx, BIO_ADDR *peer,
- uint8_t *token, size_t token_len)
+ const uint8_t *token, size_t token_len)
{
SSL_TOKEN_STORE *c = ctx->tokencache;
QUIC_TOKEN *tok, *old = NULL;
if (ctx->tokencache == NULL)
return 0;
- tok = ossl_quic_build_new_token(peer, token, token_len);
+ tok = ossl_quic_build_new_token(peer, (uint8_t *)token, token_len);
if (tok == NULL)
return 0;
return 1;
}
+SSL_CTX *ossl_quic_port_get_channel_ctx(QUIC_PORT *port)
+{
+ return port->channel_ctx;
+}
+
/*
* QUIC Port: Channel Lifecycle
* ============================
return 0;
}
- /* TODO(QUIC FUTURE): ADD CODE to send |token| to the session manager */
+ /* store the new token in our token cache */
+ ossl_quic_update_peer_token(ossl_quic_port_get_channel_ctx(ch->port),
+ &ch->cur_peer_addr, token, token_len);
return 1;
}