You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
openssl: Sync with upstream 1.0.2l
(cherry picked from commit 67305d1b0a)
This commit is contained in:
31
thirdparty/openssl/ssl/ssl_lib.c
vendored
31
thirdparty/openssl/ssl/ssl_lib.c
vendored
@@ -1828,7 +1828,7 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
|
||||
const unsigned char *p, size_t plen,
|
||||
int use_context)
|
||||
{
|
||||
if (s->version < TLS1_VERSION)
|
||||
if (s->version < TLS1_VERSION && s->version != DTLS1_BAD_VER)
|
||||
return -1;
|
||||
|
||||
return s->method->ssl3_enc->export_keying_material(s, out, olen, label,
|
||||
@@ -1838,13 +1838,21 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
|
||||
|
||||
static unsigned long ssl_session_hash(const SSL_SESSION *a)
|
||||
{
|
||||
const unsigned char *session_id = a->session_id;
|
||||
unsigned long l;
|
||||
unsigned char tmp_storage[4];
|
||||
|
||||
if (a->session_id_length < sizeof(tmp_storage)) {
|
||||
memset(tmp_storage, 0, sizeof(tmp_storage));
|
||||
memcpy(tmp_storage, a->session_id, a->session_id_length);
|
||||
session_id = tmp_storage;
|
||||
}
|
||||
|
||||
l = (unsigned long)
|
||||
((unsigned int)a->session_id[0]) |
|
||||
((unsigned int)a->session_id[1] << 8L) |
|
||||
((unsigned long)a->session_id[2] << 16L) |
|
||||
((unsigned long)a->session_id[3] << 24L);
|
||||
((unsigned long)session_id[0]) |
|
||||
((unsigned long)session_id[1] << 8L) |
|
||||
((unsigned long)session_id[2] << 16L) |
|
||||
((unsigned long)session_id[3] << 24L);
|
||||
return (l);
|
||||
}
|
||||
|
||||
@@ -2000,7 +2008,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
|
||||
ret->tlsext_servername_callback = 0;
|
||||
ret->tlsext_servername_arg = NULL;
|
||||
/* Setup RFC4507 ticket keys */
|
||||
if ((RAND_pseudo_bytes(ret->tlsext_tick_key_name, 16) <= 0)
|
||||
if ((RAND_bytes(ret->tlsext_tick_key_name, 16) <= 0)
|
||||
|| (RAND_bytes(ret->tlsext_tick_hmac_key, 16) <= 0)
|
||||
|| (RAND_bytes(ret->tlsext_tick_aes_key, 16) <= 0))
|
||||
ret->options |= SSL_OP_NO_TICKET;
|
||||
@@ -2030,10 +2038,8 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
|
||||
ret->rbuf_freelist->len = 0;
|
||||
ret->rbuf_freelist->head = NULL;
|
||||
ret->wbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST));
|
||||
if (!ret->wbuf_freelist) {
|
||||
OPENSSL_free(ret->rbuf_freelist);
|
||||
if (!ret->wbuf_freelist)
|
||||
goto err;
|
||||
}
|
||||
ret->wbuf_freelist->chunklen = 0;
|
||||
ret->wbuf_freelist->len = 0;
|
||||
ret->wbuf_freelist->head = NULL;
|
||||
@@ -3050,12 +3056,12 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s)
|
||||
}
|
||||
|
||||
#ifdef OPENSSL_NO_COMP
|
||||
const void *SSL_get_current_compression(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_compression(SSL *s)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const void *SSL_get_current_expansion(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_expansion(SSL *s)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -3188,6 +3194,9 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
|
||||
ssl->cert->alpn_proposed_len = ocert->alpn_proposed_len;
|
||||
ocert->alpn_proposed = NULL;
|
||||
ssl->cert->alpn_sent = ocert->alpn_sent;
|
||||
|
||||
if (!custom_exts_copy_flags(&ssl->cert->srv_ext, &ocert->srv_ext))
|
||||
return NULL;
|
||||
#endif
|
||||
ssl_cert_free(ocert);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user