Imported OpenSSL 1.1.1b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
* Copyright 2005 Nokia. All rights reserved.
|
||||
*
|
||||
@@ -2107,7 +2107,7 @@ int SSL_key_update(SSL *s, int updatetype)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SSL_get_key_update_type(SSL *s)
|
||||
int SSL_get_key_update_type(const SSL *s)
|
||||
{
|
||||
return s->key_update;
|
||||
}
|
||||
@@ -2148,7 +2148,7 @@ int SSL_renegotiate_abbreviated(SSL *s)
|
||||
return s->method->ssl_renegotiate(s);
|
||||
}
|
||||
|
||||
int SSL_renegotiate_pending(SSL *s)
|
||||
int SSL_renegotiate_pending(const SSL *s)
|
||||
{
|
||||
/*
|
||||
* becomes true when negotiation is requested; false again once a
|
||||
@@ -2508,6 +2508,26 @@ STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Distinguish between ciphers controlled by set_ciphersuite() and
|
||||
* set_cipher_list() when counting.
|
||||
*/
|
||||
static int cipher_list_tls12_num(STACK_OF(SSL_CIPHER) *sk)
|
||||
{
|
||||
int i, num = 0;
|
||||
const SSL_CIPHER *c;
|
||||
|
||||
if (sk == NULL)
|
||||
return 0;
|
||||
for (i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
|
||||
c = sk_SSL_CIPHER_value(sk, i);
|
||||
if (c->min_tls >= TLS1_3_VERSION)
|
||||
continue;
|
||||
num++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/** specify the ciphers to be used by default by the SSL_CTX */
|
||||
int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
|
||||
{
|
||||
@@ -2525,7 +2545,7 @@ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
|
||||
*/
|
||||
if (sk == NULL)
|
||||
return 0;
|
||||
else if (sk_SSL_CIPHER_num(sk) == 0) {
|
||||
else if (cipher_list_tls12_num(sk) == 0) {
|
||||
SSLerr(SSL_F_SSL_CTX_SET_CIPHER_LIST, SSL_R_NO_CIPHER_MATCH);
|
||||
return 0;
|
||||
}
|
||||
@@ -2543,7 +2563,7 @@ int SSL_set_cipher_list(SSL *s, const char *str)
|
||||
/* see comment in SSL_CTX_set_cipher_list */
|
||||
if (sk == NULL)
|
||||
return 0;
|
||||
else if (sk_SSL_CIPHER_num(sk) == 0) {
|
||||
else if (cipher_list_tls12_num(sk) == 0) {
|
||||
SSLerr(SSL_F_SSL_SET_CIPHER_LIST, SSL_R_NO_CIPHER_MATCH);
|
||||
return 0;
|
||||
}
|
||||
@@ -3428,12 +3448,12 @@ void ssl_update_cache(SSL *s, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx)
|
||||
const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->method;
|
||||
}
|
||||
|
||||
const SSL_METHOD *SSL_get_ssl_method(SSL *s)
|
||||
const SSL_METHOD *SSL_get_ssl_method(const SSL *s)
|
||||
{
|
||||
return s->method;
|
||||
}
|
||||
@@ -3871,7 +3891,7 @@ const SSL_CIPHER *SSL_get_pending_cipher(const SSL *s)
|
||||
return s->s3->tmp.new_cipher;
|
||||
}
|
||||
|
||||
const COMP_METHOD *SSL_get_current_compression(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_compression(const SSL *s)
|
||||
{
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
return s->compress ? COMP_CTX_get_method(s->compress) : NULL;
|
||||
@@ -3880,7 +3900,7 @@ const COMP_METHOD *SSL_get_current_compression(SSL *s)
|
||||
#endif
|
||||
}
|
||||
|
||||
const COMP_METHOD *SSL_get_current_expansion(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_expansion(const SSL *s)
|
||||
{
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
return s->expand ? COMP_CTX_get_method(s->expand) : NULL;
|
||||
@@ -4328,7 +4348,7 @@ void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg)
|
||||
ctx->record_padding_arg = arg;
|
||||
}
|
||||
|
||||
void *SSL_CTX_get_record_padding_callback_arg(SSL_CTX *ctx)
|
||||
void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->record_padding_arg;
|
||||
}
|
||||
@@ -4357,7 +4377,7 @@ void SSL_set_record_padding_callback_arg(SSL *ssl, void *arg)
|
||||
ssl->record_padding_arg = arg;
|
||||
}
|
||||
|
||||
void *SSL_get_record_padding_callback_arg(SSL *ssl)
|
||||
void *SSL_get_record_padding_callback_arg(const SSL *ssl)
|
||||
{
|
||||
return ssl->record_padding_arg;
|
||||
}
|
||||
@@ -4381,7 +4401,7 @@ int SSL_set_num_tickets(SSL *s, size_t num_tickets)
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t SSL_get_num_tickets(SSL *s)
|
||||
size_t SSL_get_num_tickets(const SSL *s)
|
||||
{
|
||||
return s->num_tickets;
|
||||
}
|
||||
@@ -4393,7 +4413,7 @@ int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets)
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t SSL_CTX_get_num_tickets(SSL_CTX *ctx)
|
||||
size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->num_tickets;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user