mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
ssl_session_dup() missing ext.alpn_session
Properly copy ext.alpn_session in ssl_session_dup() Use OPENSSL_strndup() as that's used in ssl_asn1.c Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3770)
This commit is contained in:
parent
3668721d3a
commit
eed3ec9047
@ -122,6 +122,7 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
|
||||
dest->ext.supportedgroups = NULL;
|
||||
#endif
|
||||
dest->ext.tick = NULL;
|
||||
dest->ext.alpn_selected = NULL;
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
dest->srp_username = NULL;
|
||||
#endif
|
||||
@ -212,6 +213,15 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
|
||||
dest->ext.ticklen = 0;
|
||||
}
|
||||
|
||||
if (src->ext.alpn_selected) {
|
||||
dest->ext.alpn_selected =
|
||||
(unsigned char*)OPENSSL_strndup((char*)src->ext.alpn_selected,
|
||||
src->ext.alpn_selected_len);
|
||||
if (dest->ext.alpn_selected == NULL) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (src->srp_username) {
|
||||
dest->srp_username = OPENSSL_strdup(src->srp_username);
|
||||
|
Loading…
Reference in New Issue
Block a user