diff --git a/tests/quic/helpers/client.nim b/tests/quic/helpers/client.nim index 3038c31..257540f 100644 --- a/tests/quic/helpers/client.nim +++ b/tests/quic/helpers/client.nim @@ -39,6 +39,24 @@ proc receiveCryptoData(connection: ptr ngtcp2_conn, level: ngtcp2_crypto_level, params.original_dcid = randomId assert 0 == ngtcp2_conn_set_remote_transport_params(connection, addr params) + var rxHandshakeKey: Key + assert 0 == ngtcp2_conn_install_rx_handshake_key( + connection, + addr rxHandshakeKey.aeadContext, + addr rxHandshakeKey.iv[0], + sizeof(rxHandshakeKey.iv).uint, + addr rxHandshakeKey.hpContext + ) + + var txHandshakeKey: Key + assert 0 == ngtcp2_conn_install_tx_handshake_key( + connection, + addr txHandshakeKey.aeadContext, + addr txHandshakeKey.iv[0], + sizeof(txHandshakeKey.iv).uint, + addr txHandshakeKey.hpContext + ) + var rxKey: Key assert 0 == ngtcp2_conn_install_rx_key( connection, @@ -109,25 +127,6 @@ proc setupClient*(path: ptr ngtcp2_path, sourceId: ptr ngtcp2_cid, destinationId nil ) - var rxHandshakeKey: Key - assert 0 == ngtcp2_conn_install_rx_handshake_key( - result, - addr rxHandshakeKey.aeadContext, - addr rxHandshakeKey.iv[0], - sizeof(rxHandshakeKey.iv).uint, - addr rxHandshakeKey.hpContext - ) - - var txHandshakeKey: Key - assert 0 == ngtcp2_conn_install_tx_handshake_key( - result, - addr txHandshakeKey.aeadContext, - addr txHandshakeKey.iv[0], - sizeof(txHandshakeKey.iv).uint, - addr txHandshakeKey.hpContext - ) - - var retryAead: RetryAead ngtcp2_conn_set_retry_aead(result, addr retryAead.aead, addr retryAead.aeadContext)