openssl/ssl
Gustaf Neumann beec4e146a Add SSL_get_peer_addr() function to query peer address for QUIC
This change introduces a new public API symbol: SSL_get_peer_addr().
The change is QUIC-only, there are no changes for TLS connections

- API: add peer address query for QUIC connections
  * Internal: declare/implement ossl_quic_get_peer_addr(SSL*, BIO_ADDR*)
  * Public: declare/implement SSL_get_peer_addr(SSL*, BIO_ADDR*)

Rationale:
- Allow applications to retrieve the remote UDP tuple for QUIC sessions
  (e.g., logging, access control, diagnostics)

Provided documentation and test cases for SSL_get_peer_addr().

Set peer via channel API on new-conn.

- In ch_on_new_conn_common(), BIO_ADDR_copy(&ch->cur_peer_addr, peer)
  was replaced with ossl_quic_channel_set_peer_addr(ch, peer) so
  addressed_mode is enabled at connection bring-up.

Dropped redundant peer detection in create_qc_from_incoming_conn()

The peer address is now propagated in ch_on_new_conn_common() via
ossl_quic_channel_set_peer_addr(), so the channel is already in
"addressed" mode. This also avoids querying the (unconnected) server
UDP BIO, reduces duplication, and simplifies the accept path. All
regression tests pass.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28690)
2025-10-04 10:21:38 +02:00
..
quic Add SSL_get_peer_addr() function to query peer address for QUIC 2025-10-04 10:21:38 +02:00
record tls_common.c: Handle inner content type properly on Big Endian 2025-09-23 16:37:35 +02:00
rio Add util/codespell-check.sh and run it 2025-09-26 07:58:44 -04:00
statem Add util/codespell-check.sh and run it 2025-09-26 07:58:44 -04:00
bio_ssl.c libssl: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
build.info Move ssl_err.c into libcrypto 2025-03-01 14:46:03 -05:00
d1_lib.c Fix: Check for wrong object. The converted sc should be checked instead of the original s 2025-08-22 11:06:25 -04:00
d1_msg.c Copyright year updates 2025-03-12 13:35:59 +00:00
d1_srtp.c Copyright year updates 2025-03-12 13:35:59 +00:00
methods.c Update some inclusions of <openssl/macros.h> 2019-11-07 11:37:25 +01:00
pqueue.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
priority_queue.c Copyright year updates 2025-09-02 13:05:45 +00:00
s3_enc.c Copyright year updates 2025-03-12 13:35:59 +00:00
s3_lib.c Add support for TLS 1.3 OCSP multi-stapling for server certs 2025-07-25 17:24:37 +02:00
s3_msg.c Copyright year updates 2025-03-12 13:35:59 +00:00
ssl_asn1.c RFC7250 (RPK) support 2023-03-28 13:49:54 -04:00
ssl_cert.c ssl: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ssl_cert_comp.c libssl: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ssl_cert_table.h Make ssl_cert_info read-only 2023-11-27 07:51:33 +00:00
ssl_ciph.c ssl: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ssl_conf.c Introduce SSL_OP_SERVER_PREFERENCE to replace SSL_OP_CIPHER_SERVER_PREFERENCE misnomer 2025-07-09 12:10:57 +02:00
ssl_err_legacy.c Copyright year updates 2025-03-12 13:35:59 +00:00
ssl_init.c Copyright year updates 2025-03-12 13:35:59 +00:00
ssl_lib.c Add SSL_get_peer_addr() function to query peer address for QUIC 2025-10-04 10:21:38 +02:00
ssl_local.h Add support for TLS 1.3 OCSP multi-stapling for server certs 2025-07-25 17:24:37 +02:00
ssl_mcnf.c Copyright year updates 2024-09-05 09:35:49 +02:00
ssl_rsa.c Fix the abnormal branch memory leak in ssl_set_cert_and_key function 2025-09-23 16:36:23 +02:00
ssl_rsa_legacy.c Copyright year updates 2025-03-12 13:35:59 +00:00
ssl_sess.c libssl: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ssl_stat.c Copyright year updates 2025-03-12 13:35:59 +00:00
ssl_txt.c Copyright year updates 2024-09-05 09:35:49 +02:00
ssl_utst.c Remove the old buffer management code 2022-10-20 14:39:33 +01:00
t1_enc.c Add util/codespell-check.sh and run it 2025-09-26 07:58:44 -04:00
t1_lib.c Add util/codespell-check.sh and run it 2025-09-26 07:58:44 -04:00
t1_trce.c Add util/codespell-check.sh and run it 2025-09-26 07:58:44 -04:00
tls13_enc.c support passing prop querys to composite algs 2025-09-17 10:21:46 +10:00
tls_depr.c libssl: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
tls_srp.c Copyright year updates 2025-03-12 13:35:59 +00:00