mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
AppleM1: Update openssl to v1.1.1l
This commit is contained in:
parent
1fe12b8e8c
commit
b787656eea
990 changed files with 13406 additions and 18710 deletions
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_INTERNAL_CONF_H
|
||||
# define HEADER_INTERNAL_CONF_H
|
||||
#ifndef OSSL_INTERNAL_CONF_H
|
||||
# define OSSL_INTERNAL_CONF_H
|
||||
|
||||
#include <openssl/conf.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2014-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CONSTANT_TIME_LOCL_H
|
||||
# define HEADER_CONSTANT_TIME_LOCL_H
|
||||
#ifndef OSSL_INTERNAL_CONSTANT_TIME_H
|
||||
# define OSSL_INTERNAL_CONSTANT_TIME_H
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
@ -213,18 +213,72 @@ static ossl_inline unsigned char constant_time_eq_int_8(int a, int b)
|
|||
return constant_time_eq_8((unsigned)(a), (unsigned)(b));
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the value unmodified, but avoids optimizations.
|
||||
* The barriers prevent the compiler from narrowing down the
|
||||
* possible value range of the mask and ~mask in the select
|
||||
* statements, which avoids the recognition of the select
|
||||
* and turning it into a conditional load or branch.
|
||||
*/
|
||||
static ossl_inline unsigned int value_barrier(unsigned int a)
|
||||
{
|
||||
#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
|
||||
unsigned int r;
|
||||
__asm__("" : "=r"(r) : "0"(a));
|
||||
#else
|
||||
volatile unsigned int r = a;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Convenience method for uint32_t. */
|
||||
static ossl_inline uint32_t value_barrier_32(uint32_t a)
|
||||
{
|
||||
#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
|
||||
uint32_t r;
|
||||
__asm__("" : "=r"(r) : "0"(a));
|
||||
#else
|
||||
volatile uint32_t r = a;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Convenience method for uint64_t. */
|
||||
static ossl_inline uint64_t value_barrier_64(uint64_t a)
|
||||
{
|
||||
#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
|
||||
uint64_t r;
|
||||
__asm__("" : "=r"(r) : "0"(a));
|
||||
#else
|
||||
volatile uint64_t r = a;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Convenience method for size_t. */
|
||||
static ossl_inline size_t value_barrier_s(size_t a)
|
||||
{
|
||||
#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
|
||||
size_t r;
|
||||
__asm__("" : "=r"(r) : "0"(a));
|
||||
#else
|
||||
volatile size_t r = a;
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
|
||||
static ossl_inline unsigned int constant_time_select(unsigned int mask,
|
||||
unsigned int a,
|
||||
unsigned int b)
|
||||
{
|
||||
return (mask & a) | (~mask & b);
|
||||
return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
|
||||
}
|
||||
|
||||
static ossl_inline size_t constant_time_select_s(size_t mask,
|
||||
size_t a,
|
||||
size_t b)
|
||||
{
|
||||
return (mask & a) | (~mask & b);
|
||||
return (value_barrier_s(mask) & a) | (value_barrier_s(~mask) & b);
|
||||
}
|
||||
|
||||
static ossl_inline unsigned char constant_time_select_8(unsigned char mask,
|
||||
|
@ -249,13 +303,13 @@ static ossl_inline int constant_time_select_int_s(size_t mask, int a, int b)
|
|||
static ossl_inline uint32_t constant_time_select_32(uint32_t mask, uint32_t a,
|
||||
uint32_t b)
|
||||
{
|
||||
return (mask & a) | (~mask & b);
|
||||
return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
|
||||
}
|
||||
|
||||
static ossl_inline uint64_t constant_time_select_64(uint64_t mask, uint64_t a,
|
||||
uint64_t b)
|
||||
{
|
||||
return (mask & a) | (~mask & b);
|
||||
return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -330,4 +384,4 @@ static ossl_inline void constant_time_lookup(void *out,
|
|||
*/
|
||||
void err_clear_last_constant_time(int clear);
|
||||
|
||||
#endif /* HEADER_CONSTANT_TIME_LOCL_H */
|
||||
#endif /* OSSL_INTERNAL_CONSTANT_TIME_H */
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CRYPTLIB_H
|
||||
# define HEADER_CRYPTLIB_H
|
||||
#ifndef OSSL_INTERNAL_CRYPTLIB_H
|
||||
# define OSSL_INTERNAL_CRYPTLIB_H
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
@ -80,6 +80,7 @@ extern unsigned int OPENSSL_ia32cap_P[];
|
|||
void OPENSSL_showfatal(const char *fmta, ...);
|
||||
void crypto_cleanup_all_ex_data_int(void);
|
||||
int openssl_init_fork_handlers(void);
|
||||
int openssl_get_fork_id(void);
|
||||
|
||||
char *ossl_safe_getenv(const char *name);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_INTERNAL_DANE_H
|
||||
#define HEADER_INTERNAL_DANE_H
|
||||
#ifndef OSSL_INTERNAL_DANE_H
|
||||
#define OSSL_INTERNAL_DANE_H
|
||||
|
||||
#include <openssl/safestack.h>
|
||||
|
||||
|
@ -100,4 +100,4 @@ struct ssl_dane_st {
|
|||
#define DANETLS_HAS_DANE_TA(dane) ((dane)&&((dane)->umask & DANETLS_DANE_TA_MASK))
|
||||
#define DANETLS_HAS_DANE_EE(dane) ((dane)&&((dane)->umask & DANETLS_DANE_EE_MASK))
|
||||
|
||||
#endif /* HEADER_INTERNAL_DANE_H */
|
||||
#endif /* OSSL_INTERNAL_DANE_H */
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DSO_H
|
||||
# define HEADER_DSO_H
|
||||
#ifndef OSSL_INTERNAL_DSO_H
|
||||
# define OSSL_INTERNAL_DSO_H
|
||||
|
||||
# include <openssl/crypto.h>
|
||||
# include "internal/dsoerr.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -8,16 +8,16 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DSOERR_H
|
||||
# define HEADER_DSOERR_H
|
||||
#ifndef OSSL_INTERNAL_DSOERR_H
|
||||
# define OSSL_INTERNAL_DSOERR_H
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DSO
|
||||
|
||||
# ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
# endif
|
||||
int ERR_load_DSO_strings(void);
|
||||
|
||||
/*
|
||||
|
@ -79,5 +79,4 @@ int ERR_load_DSO_strings(void);
|
|||
# define DSO_R_UNLOAD_FAILED 107
|
||||
# define DSO_R_UNSUPPORTED 108
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef INTERNAL_ERR_H
|
||||
# define INTERNAL_ERR_H
|
||||
#ifndef OSSL_INTERNAL_ERR_H
|
||||
# define OSSL_INTERNAL_ERR_H
|
||||
|
||||
void err_free_strings_int(void);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_NELEM_H
|
||||
# define HEADER_NELEM_H
|
||||
#ifndef OSSL_INTERNAL_NELEM_H
|
||||
# define OSSL_INTERNAL_NELEM_H
|
||||
|
||||
# define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))
|
||||
#endif
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_NUMBERS_H
|
||||
# define HEADER_NUMBERS_H
|
||||
#ifndef OSSL_INTERNAL_NUMBERS_H
|
||||
# define OSSL_INTERNAL_NUMBERS_H
|
||||
|
||||
# include <limits.h>
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef O_DIR_H
|
||||
# define O_DIR_H
|
||||
#ifndef OSSL_INTERNAL_O_DIR_H
|
||||
# define OSSL_INTERNAL_O_DIR_H
|
||||
|
||||
typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_O_STR_H
|
||||
# define HEADER_O_STR_H
|
||||
#ifndef OSSL_INTERNAL_O_STR_H
|
||||
# define OSSL_INTERNAL_O_STR_H
|
||||
|
||||
# include <stddef.h> /* to get size_t */
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
#ifndef HEADER_INTERNAL_REFCOUNT_H
|
||||
# define HEADER_INTERNAL_REFCOUNT_H
|
||||
#ifndef OSSL_INTERNAL_REFCOUNT_H
|
||||
# define OSSL_INTERNAL_REFCOUNT_H
|
||||
|
||||
/* Used to checking reference counts, most while doing perl5 stuff :-) */
|
||||
# if defined(OPENSSL_NO_STDIO)
|
||||
|
@ -79,7 +79,7 @@ static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret, void *lock)
|
|||
|
||||
typedef volatile int CRYPTO_REF_COUNT;
|
||||
|
||||
# if (defined(_M_ARM) && _M_ARM>=7) || defined(_M_ARM64)
|
||||
# if (defined(_M_ARM) && _M_ARM>=7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
|
@ -99,7 +99,17 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
|||
return 1;
|
||||
}
|
||||
# else
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# if !defined(_WIN32_WCE)
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# else
|
||||
# if _WIN32_WCE >= 0x600
|
||||
extern long __cdecl _InterlockedExchangeAdd(long volatile*, long);
|
||||
# else
|
||||
/* under Windows CE we still have old-style Interlocked* functions */
|
||||
extern long __cdecl InterlockedExchangeAdd(long volatile*, long);
|
||||
# define _InterlockedExchangeAdd InterlockedExchangeAdd
|
||||
# endif
|
||||
# endif
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
{
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef HEADER_INTERNAL_SOCKETS
|
||||
# define HEADER_INTERNAL_SOCKETS
|
||||
#ifndef OSSL_INTERNAL_SOCKETS_H
|
||||
# define OSSL_INTERNAL_SOCKETS_H
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
|
||||
# define NO_SYS_PARAM_H
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_SSLCONF_H
|
||||
# define HEADER_SSLCONF_H
|
||||
#ifndef OSSL_INTERNAL_SSLCONF_H
|
||||
# define OSSL_INTERNAL_SSLCONF_H
|
||||
|
||||
typedef struct ssl_conf_cmd_st SSL_CONF_CMD;
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
* function defined via DEFINE_ONCE_STATIC where both functions use the same
|
||||
* CRYPTO_ONCE object to synchronise. Where an alternative initialiser function
|
||||
* is used only one of the primary or the alternative initialiser function will
|
||||
* ever be called - and that function will be called exactly once. Definitition
|
||||
* ever be called - and that function will be called exactly once. Definition
|
||||
* of an alternative initialiser function MUST occur AFTER the definition of the
|
||||
* primary initialiser function.
|
||||
*
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* if (var == NOT_YET_INITIALIZED)
|
||||
* var = function_returning_same_value();
|
||||
*
|
||||
* This does work provided that loads and stores are single-instuction
|
||||
* This does work provided that loads and stores are single-instruction
|
||||
* operations (and integer ones are on *all* supported platforms), but
|
||||
* it upsets Thread Sanitizer. Suggested solution is
|
||||
*
|
||||
|
@ -77,7 +77,7 @@
|
|||
|
||||
#elif defined(_MSC_VER) && _MSC_VER>=1200 \
|
||||
&& (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
|
||||
defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7))
|
||||
defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7 && !defined(_WIN32_WCE)))
|
||||
/*
|
||||
* There is subtle dependency on /volatile:<iso|ms> command-line option.
|
||||
* "ms" implies same semantic as memory_order_acquire for loads and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue