Latest update
This commit is contained in:
@@ -11,5 +11,4 @@
|
||||
|
||||
int async_init(void);
|
||||
void async_deinit(void);
|
||||
void async_delete_thread_state(void);
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include <openssl/core.h>
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
/* This file is not scanned by mkdef.pl, whereas cryptlib.h is */
|
||||
|
||||
struct thread_local_inits_st {
|
||||
int async;
|
||||
int err_state;
|
||||
int rand;
|
||||
};
|
||||
|
||||
int ossl_init_thread_start(uint64_t opts);
|
||||
int ossl_init_thread_start(const void *index, void *arg,
|
||||
OSSL_thread_stop_handler_fn handfn);
|
||||
int ossl_init_thread_deregister(void *index);
|
||||
int ossl_init_thread(void);
|
||||
void ossl_cleanup_thread(void);
|
||||
void ossl_ctx_thread_stop(void *arg);
|
||||
|
||||
/*
|
||||
* OPENSSL_INIT flags. The primary list of these is in crypto.h. Flags below
|
||||
@@ -27,11 +27,6 @@ int ossl_init_thread_start(uint64_t opts);
|
||||
# define OPENSSL_INIT_ZLIB 0x00010000L
|
||||
# define OPENSSL_INIT_BASE_ONLY 0x00040000L
|
||||
|
||||
/* OPENSSL_INIT_THREAD flags */
|
||||
# define OPENSSL_INIT_THREAD_ASYNC 0x01
|
||||
# define OPENSSL_INIT_THREAD_ERR_STATE 0x02
|
||||
# define OPENSSL_INIT_THREAD_RAND 0x04
|
||||
|
||||
int ossl_trace_init(void);
|
||||
void ossl_trace_cleanup(void);
|
||||
void ossl_malloc_setup_failures(void);
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
int err_load_crypto_strings_int(void);
|
||||
void err_cleanup(void);
|
||||
void err_delete_thread_state(void);
|
||||
int err_shelve_state(void **);
|
||||
void err_unshelve_state(void *);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ typedef struct evp_mac_impl_st EVP_MAC_IMPL;
|
||||
struct evp_mac_st {
|
||||
int type;
|
||||
EVP_MAC_IMPL *(*new) (void);
|
||||
int (*copy) (EVP_MAC_IMPL *macdst, EVP_MAC_IMPL *macsrc);
|
||||
EVP_MAC_IMPL *(*dup) (const EVP_MAC_IMPL *macsrc);
|
||||
void (*free) (EVP_MAC_IMPL *macctx);
|
||||
size_t (*size) (EVP_MAC_IMPL *macctx);
|
||||
int (*init) (EVP_MAC_IMPL *macctx);
|
||||
@@ -173,6 +173,7 @@ extern const EVP_KDF hkdf_kdf_meth;
|
||||
extern const EVP_KDF sshkdf_kdf_meth;
|
||||
extern const EVP_KDF ss_kdf_meth;
|
||||
extern const EVP_KDF x963_kdf_meth;
|
||||
extern const EVP_KDF x942_kdf_meth;
|
||||
|
||||
struct evp_md_st {
|
||||
/* nid */
|
||||
@@ -207,6 +208,8 @@ struct evp_md_st {
|
||||
OSSL_OP_digest_dupctx_fn *dupctx;
|
||||
OSSL_OP_digest_size_fn *size;
|
||||
OSSL_OP_digest_block_size_fn *dblock_size;
|
||||
OSSL_OP_digest_set_params_fn *set_params;
|
||||
OSSL_OP_digest_get_params_fn *get_params;
|
||||
|
||||
} /* EVP_MD */ ;
|
||||
|
||||
@@ -254,9 +257,6 @@ struct evp_cipher_st {
|
||||
OSSL_OP_cipher_cipher_fn *ccipher;
|
||||
OSSL_OP_cipher_freectx_fn *freectx;
|
||||
OSSL_OP_cipher_dupctx_fn *dupctx;
|
||||
OSSL_OP_cipher_key_length_fn *key_length;
|
||||
OSSL_OP_cipher_iv_length_fn *iv_length;
|
||||
OSSL_OP_cipher_block_size_fn *blocksize;
|
||||
OSSL_OP_cipher_get_params_fn *get_params;
|
||||
OSSL_OP_cipher_ctx_get_params_fn *ctx_get_params;
|
||||
OSSL_OP_cipher_ctx_set_params_fn *ctx_set_params;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 OPENSSL_NO_SIV
|
||||
|
||||
typedef struct siv128_context SIV128_CONTEXT;
|
||||
|
||||
SIV128_CONTEXT *CRYPTO_siv128_new(const unsigned char *key, int klen,
|
||||
EVP_CIPHER* cbc, EVP_CIPHER* ctr);
|
||||
int CRYPTO_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
|
||||
const EVP_CIPHER* cbc, const EVP_CIPHER* ctr);
|
||||
int CRYPTO_siv128_copy_ctx(SIV128_CONTEXT *dest, SIV128_CONTEXT *src);
|
||||
int CRYPTO_siv128_aad(SIV128_CONTEXT *ctx, const unsigned char *aad,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_encrypt(SIV128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_decrypt(SIV128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_finish(SIV128_CONTEXT *ctx);
|
||||
int CRYPTO_siv128_set_tag(SIV128_CONTEXT *ctx, const unsigned char *tag,
|
||||
size_t len);
|
||||
int CRYPTO_siv128_get_tag(SIV128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
||||
int CRYPTO_siv128_cleanup(SIV128_CONTEXT *ctx);
|
||||
int CRYPTO_siv128_speed(SIV128_CONTEXT *ctx, int arg);
|
||||
|
||||
#endif /* OPENSSL_NO_SIV */
|
||||
@@ -24,8 +24,6 @@
|
||||
typedef struct rand_pool_st RAND_POOL;
|
||||
|
||||
void rand_cleanup_int(void);
|
||||
void rand_drbg_cleanup_int(void);
|
||||
void drbg_delete_thread_state(void);
|
||||
void rand_fork(void);
|
||||
|
||||
/* Hardware-based seeding functions. */
|
||||
@@ -139,4 +137,10 @@ void rand_pool_cleanup(void);
|
||||
*/
|
||||
void rand_pool_keep_random_devices_open(int keep);
|
||||
|
||||
/* Equivalent of RAND_priv_bytes() but additionally taking an OPENSSL_CTX */
|
||||
int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
|
||||
|
||||
/* Equivalent of RAND_bytes() but additionally taking an OPENSSL_CTX */
|
||||
int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
|
||||
|
||||
#endif
|
||||
@@ -15,5 +15,6 @@
|
||||
|
||||
int sha512_224_init(SHA512_CTX *);
|
||||
int sha512_256_init(SHA512_CTX *);
|
||||
int sha1_ctrl(SHA_CTX *ctx, int cmd, int mslen, void *ms);
|
||||
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2017 Ribose Inc. 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 HEADER_SM3_H
|
||||
# define HEADER_SM3_H
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifdef OPENSSL_NO_SM3
|
||||
# error SM3 is disabled.
|
||||
# endif
|
||||
|
||||
# define SM3_DIGEST_LENGTH 32
|
||||
# define SM3_WORD unsigned int
|
||||
|
||||
# define SM3_CBLOCK 64
|
||||
# define SM3_LBLOCK (SM3_CBLOCK/4)
|
||||
|
||||
typedef struct SM3state_st {
|
||||
SM3_WORD A, B, C, D, E, F, G, H;
|
||||
SM3_WORD Nl, Nh;
|
||||
SM3_WORD data[SM3_LBLOCK];
|
||||
unsigned int num;
|
||||
} SM3_CTX;
|
||||
|
||||
int sm3_init(SM3_CTX *c);
|
||||
int sm3_update(SM3_CTX *c, const void *data, size_t len);
|
||||
int sm3_final(unsigned char *md, SM3_CTX *c);
|
||||
|
||||
void sm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
|
||||
|
||||
#endif
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
|
||||
# define SPARSE_ARRAY_OF(type) struct sparse_array_st_ ## type
|
||||
|
||||
# define DEFINE_SPARSE_ARRAY_OF(type) \
|
||||
# define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
|
||||
SPARSE_ARRAY_OF(type); \
|
||||
static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
|
||||
ossl_sa_##type##_new(void) \
|
||||
@@ -53,18 +53,23 @@ extern "C" {
|
||||
void *))leaf, \
|
||||
arg); \
|
||||
} \
|
||||
static ossl_unused ossl_inline type *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n) \
|
||||
{ \
|
||||
return (type *)OPENSSL_SA_get((OPENSSL_SA *)sa, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n, type *val) \
|
||||
ossl_uintmax_t n, ctype *val) \
|
||||
{ \
|
||||
return OPENSSL_SA_set((OPENSSL_SA *)sa, n, (void *)val); \
|
||||
} \
|
||||
SPARSE_ARRAY_OF(type)
|
||||
|
||||
# define DEFINE_SPARSE_ARRAY_OF(type) \
|
||||
DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, type)
|
||||
# define DEFINE_SPARSE_ARRAY_OF_CONST(type) \
|
||||
DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, const type)
|
||||
|
||||
typedef struct sparse_array_st OPENSSL_SA;
|
||||
OPENSSL_SA *OPENSSL_SA_new(void);
|
||||
void OPENSSL_SA_free(OPENSSL_SA *sa);
|
||||
|
||||
@@ -71,6 +71,9 @@ struct X509_req_st {
|
||||
ASN1_BIT_STRING *signature; /* signature */
|
||||
CRYPTO_REF_COUNT references;
|
||||
CRYPTO_RWLOCK *lock;
|
||||
# ifndef OPENSSL_NO_SM2
|
||||
ASN1_OCTET_STRING *sm2_id;
|
||||
# endif
|
||||
};
|
||||
|
||||
struct X509_crl_info_st {
|
||||
|
||||
Reference in New Issue
Block a user