Skip to content

Commit

Permalink
fixup! QUIC: add v1 quic_transport_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tmshort committed Dec 18, 2020
1 parent 8f4f7f2 commit a33c406
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions include/openssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2476,12 +2476,14 @@ __owur int SSL_is_quic(SSL *ssl);
/* BoringSSL API */
__owur void SSL_set_quic_use_legacy_codepoint(SSL *ssl, int use_legacy);

/* Set an explicit value that you want to use */
/* If set to 0 (default) the server will use the versions the client used */
/* If set to 0 (default) the client will send both extensions */
/*
* Set an explicit value that you want to use
* If 0 (default) the server will use the highest extenstion the client sent
* If 0 (default) the client will send both extensions
*/
void SSL_set_quic_transport_version(SSL *ssl, int version);
__owur int SSL_get_quic_transport_version(const SSL *ssl);
/* Get the version the peer sent, -1 if neither, 0 if both */
/* Returns the negotiated version, or -1 on error */
__owur int SSL_get_peer_quic_transport_version(const SSL *ssl);

int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *c);
Expand Down
3 changes: 2 additions & 1 deletion ssl/ssl_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,8 @@ struct ssl_st {
OSSL_ENCRYPTION_LEVEL quic_read_level;
OSSL_ENCRYPTION_LEVEL quic_write_level;
OSSL_ENCRYPTION_LEVEL quic_latest_level_received;
/* defaults to 0, but can be set to:
/*
* defaults to 0, but can be set to:
* - TLSEXT_TYPE_quic_transport_parameters_draft
* - TLSEXT_TYPE_quic_transport_parameters
* Client: if 0, send both
Expand Down
2 changes: 1 addition & 1 deletion ssl/ssl_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void SSL_get_peer_quic_transport_params(const SSL *ssl,
}
}

/* returns 0 if both are set, -1 if neither, otherwise version */
/* Returns the negotiated version, or -1 on error */
int SSL_get_peer_quic_transport_version(const SSL *ssl)
{
if (ssl->ext.peer_quic_transport_params_len != 0
Expand Down
2 changes: 1 addition & 1 deletion test/sslapitest.c
Original file line number Diff line number Diff line change
Expand Up @@ -6827,7 +6827,7 @@ static int test_quic_api(int tst)

/* Failure cases:
* test 6/[5] clnt = parameters, srvr = draft
* test 8/[7] clnt = draft, srvr = paramrters
* test 8/[7] clnt = draft, srvr = parameters
*/

/* Clean up logging space */
Expand Down

0 comments on commit a33c406

Please sign in to comment.