Fix crash and latest update.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (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 OSSL_INTERNAL_CORE_H
|
||||
# define OSSL_INTERNAL_CORE_H
|
||||
|
||||
/*
|
||||
* namespaces:
|
||||
*
|
||||
* ossl_method_ Core Method API
|
||||
*/
|
||||
|
||||
/*
|
||||
* construct an arbitrary method from a dispatch table found by looking
|
||||
* up a match for the < operation_id, name, property > combination.
|
||||
* constructor and destructor are the constructor and destructor for that
|
||||
* arbitrary object.
|
||||
*
|
||||
* These objects are normally cached, unless the provider says not to cache.
|
||||
* However, force_cache can be used to force caching whatever the provider
|
||||
* says (for example, because the application knows better).
|
||||
*/
|
||||
typedef struct ossl_method_construct_method_st {
|
||||
/* Create store */
|
||||
void *(*alloc_tmp_store)(void);
|
||||
/* Remove a store */
|
||||
void (*dealloc_tmp_store)(void *store);
|
||||
/* Get an already existing method from a store */
|
||||
void *(*get)(OPENSSL_CTX *libctx, void *store, const char *propquery,
|
||||
void *data);
|
||||
/* Store a method in a store */
|
||||
int (*put)(OPENSSL_CTX *libctx, void *store, const char *propdef,
|
||||
void *method, void *data);
|
||||
/* Construct a new method */
|
||||
void *(*construct)(const OSSL_DISPATCH *fns, OSSL_PROVIDER *prov,
|
||||
void *data);
|
||||
/* Destruct a method */
|
||||
void (*destruct)(void *method);
|
||||
} OSSL_METHOD_CONSTRUCT_METHOD;
|
||||
|
||||
void *ossl_method_construct(OPENSSL_CTX *ctx, int operation_id,
|
||||
const char *name, const char *properties,
|
||||
int force_cache,
|
||||
OSSL_METHOD_CONSTRUCT_METHOD *mcm, void *mcm_data);
|
||||
|
||||
#endif
|
||||
@@ -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 Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -11,6 +11,10 @@
|
||||
#ifndef HEADER_DSOERR_H
|
||||
# define HEADER_DSOERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DSO
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#ifndef HEADER_PROPERR_H
|
||||
# define HEADER_PROPERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (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 OSSL_INTERNAL_PROVIDER_H
|
||||
# define OSSL_INTERNAL_PROVIDER_H
|
||||
|
||||
# include <openssl/core.h>
|
||||
# include "internal/dso.h"
|
||||
# include "internal/symhacks.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*
|
||||
* namespaces:
|
||||
*
|
||||
* ossl_provider_ Provider Object internal API
|
||||
* OSSL_PROVIDER Provider Object
|
||||
*/
|
||||
|
||||
/* Provider Object finder, constructor and destructor */
|
||||
OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name);
|
||||
OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
|
||||
OSSL_provider_init_fn *init_function);
|
||||
int ossl_provider_upref(OSSL_PROVIDER *prov);
|
||||
void ossl_provider_free(OSSL_PROVIDER *prov);
|
||||
|
||||
/* Setters */
|
||||
int ossl_provider_add_module_location(OSSL_PROVIDER *prov, const char *loc);
|
||||
|
||||
/*
|
||||
* Activate the Provider
|
||||
* If the Provider is a module, the module will be loaded
|
||||
* Inactivation is done by freeing the Provider
|
||||
*/
|
||||
int ossl_provider_activate(OSSL_PROVIDER *prov);
|
||||
|
||||
/* Iterate over all loaded providers */
|
||||
int ossl_provider_forall_loaded(OPENSSL_CTX *,
|
||||
int (*cb)(OSSL_PROVIDER *provider,
|
||||
void *cbdata),
|
||||
void *cbdata);
|
||||
|
||||
/* Getters for other library functions */
|
||||
const char *ossl_provider_name(OSSL_PROVIDER *prov);
|
||||
const DSO *ossl_provider_dso(OSSL_PROVIDER *prov);
|
||||
const char *ossl_provider_module_name(OSSL_PROVIDER *prov);
|
||||
const char *ossl_provider_module_path(OSSL_PROVIDER *prov);
|
||||
|
||||
/* Thin wrappers around calls to the provider */
|
||||
void ossl_provider_teardown(const OSSL_PROVIDER *prov);
|
||||
const OSSL_ITEM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
|
||||
int ossl_provider_get_params(const OSSL_PROVIDER *prov,
|
||||
const OSSL_PARAM params[]);
|
||||
const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov,
|
||||
int operation_id,
|
||||
int *no_cache);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
+30
-21
@@ -16,16 +16,17 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
|
||||
&& !defined(__STDC_NO_ATOMICS__)
|
||||
# include <stdatomic.h>
|
||||
# define HAVE_C11_ATOMICS
|
||||
# endif
|
||||
# ifndef OPENSSL_DEV_NO_ATOMICS
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
|
||||
&& !defined(__STDC_NO_ATOMICS__)
|
||||
# include <stdatomic.h>
|
||||
# define HAVE_C11_ATOMICS
|
||||
# endif
|
||||
|
||||
# if defined(HAVE_C11_ATOMICS) && defined(ATOMIC_INT_LOCK_FREE) \
|
||||
&& ATOMIC_INT_LOCK_FREE > 0
|
||||
# if defined(HAVE_C11_ATOMICS) && defined(ATOMIC_INT_LOCK_FREE) \
|
||||
&& ATOMIC_INT_LOCK_FREE > 0
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef _Atomic int CRYPTO_REF_COUNT;
|
||||
|
||||
@@ -53,9 +54,9 @@ static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)
|
||||
return 1;
|
||||
}
|
||||
|
||||
# elif defined(__GNUC__) && defined(__ATOMIC_RELAXED) && __GCC_ATOMIC_INT_LOCK_FREE > 0
|
||||
# elif defined(__GNUC__) && defined(__ATOMIC_RELAXED) && __GCC_ATOMIC_INT_LOCK_FREE > 0
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef int CRYPTO_REF_COUNT;
|
||||
|
||||
@@ -73,17 +74,17 @@ static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret, void *lock)
|
||||
return 1;
|
||||
}
|
||||
|
||||
# elif defined(_MSC_VER) && _MSC_VER>=1200
|
||||
# elif defined(_MSC_VER) && _MSC_VER>=1200
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef volatile int CRYPTO_REF_COUNT;
|
||||
|
||||
# if (defined(_M_ARM) && _M_ARM>=7) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
# endif
|
||||
# if (defined(_M_ARM) && _M_ARM>=7) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
# endif
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
{
|
||||
@@ -98,8 +99,8 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
||||
__dmb(_ARM_BARRIER_ISH);
|
||||
return 1;
|
||||
}
|
||||
# else
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# else
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
{
|
||||
@@ -112,9 +113,17 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
||||
*ret = _InterlockedExchangeAdd(val, -1) - 1;
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# else
|
||||
# endif
|
||||
# endif /* !OPENSSL_DEV_NO_ATOMICS */
|
||||
|
||||
/*
|
||||
* All the refcounting implementations above define HAVE_ATOMICS, so if it's
|
||||
* still undefined here (such as when OPENSSL_DEV_NO_ATMOICS is defined), it
|
||||
* means we need to implement a fallback. This fallback uses locks.
|
||||
*/
|
||||
# ifndef HAVE_ATOMICS
|
||||
|
||||
typedef int CRYPTO_REF_COUNT;
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (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 OSSL_INTERNAL_SYMHACKS_H
|
||||
# define OSSL_INTERNAL_SYMHACKS_H
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# if defined(OPENSSL_SYS_VMS)
|
||||
|
||||
/* ossl_provider_get_param_types vs OSSL_PROVIDER_get_param_types */
|
||||
# undef ossl_provider_get_param_types
|
||||
# define ossl_provider_get_param_types ossl_int_prov_get_param_types
|
||||
/* ossl_provider_get_params vs OSSL_PROVIDER_get_params */
|
||||
# undef ossl_provider_get_params
|
||||
# define ossl_provider_get_params ossl_int_prov_get_params
|
||||
|
||||
# endif
|
||||
|
||||
#endif /* ! defined HEADER_VMS_IDHACKS_H */
|
||||
Reference in New Issue
Block a user