diff options
author | Matt Caswell <matt@openssl.org> | 2023-09-07 17:36:13 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-09-12 15:29:00 +0200 |
commit | 1e4fc0b2e57d08a90a6d8e30981fce2007d21109 (patch) | |
tree | 7d6b0033b4d7bf5cdd0715ce00bc31fd9b7d9444 /ssl | |
parent | 4ee8c1fb51687ea811fc2abf87e173c70d018bc2 (diff) |
Add a test for using a PSK with QUIC
Check that we can set and use a PSK when establishing a QUIC connection.
Fixes openssl/project#83
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22011)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_tserver.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c index 788d4780d8..92c17d10f3 100644 --- a/ssl/quic/quic_tserver.c +++ b/ssl/quic/quic_tserver.c @@ -99,10 +99,12 @@ QUIC_TSERVER *ossl_quic_tserver_new(const QUIC_TSERVER_ARGS *args, if (srv->ctx == NULL) goto err; - if (SSL_CTX_use_certificate_file(srv->ctx, certfile, SSL_FILETYPE_PEM) <= 0) + if (certfile != NULL + && SSL_CTX_use_certificate_file(srv->ctx, certfile, SSL_FILETYPE_PEM) <= 0) goto err; - if (SSL_CTX_use_PrivateKey_file(srv->ctx, keyfile, SSL_FILETYPE_PEM) <= 0) + if (keyfile != NULL + && SSL_CTX_use_PrivateKey_file(srv->ctx, keyfile, SSL_FILETYPE_PEM) <= 0) goto err; SSL_CTX_set_alpn_select_cb(srv->ctx, alpn_select_cb, srv); @@ -556,3 +558,9 @@ int ossl_quic_tserver_set_max_early_data(QUIC_TSERVER *srv, { return SSL_set_max_early_data(srv->tls, max_early_data); } + +void ossl_quic_tserver_set_psk_find_session_cb(QUIC_TSERVER *srv, + SSL_psk_find_session_cb_func cb) +{ + SSL_set_psk_find_session_callback(srv->tls, cb); +} |