#include <openssl/core_dispatch.h>
#include "internal/thread_once.h"
#include "internal/refcount.h"
#include <openssl/dsa.h>
#include <openssl/engine.h>
#include <openssl/evp.h>
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include <openssl/store.h>
#include "internal/passphrase.h"
struct ossl_store_info_st {
int type;
union {
void *data;
struct {
char *name;
char *desc;
} name;
EVP_PKEY *params;
EVP_PKEY *pubkey;
EVP_PKEY *pkey;
X509 *x509;
X509_CRL *crl;
} _;
};
DEFINE_STACK_OF(OSSL_STORE_INFO)
struct ossl_store_search_st {
int search_type;
X509_NAME *name;
const ASN1_INTEGER *serial;
const EVP_MD *digest;
const unsigned char *string;
size_t stringlength;
};
int ossl_store_register_loader_int(OSSL_STORE_LOADER *loader);
OSSL_STORE_LOADER *ossl_store_unregister_loader_int(const char *scheme);
struct ossl_store_loader_st {
#ifndef OPENSSL_NO_DEPRECATED_3_0
const char *scheme;
ENGINE *engine;
OSSL_STORE_open_fn open;
OSSL_STORE_attach_fn attach;
OSSL_STORE_ctrl_fn ctrl;
OSSL_STORE_expect_fn expect;
OSSL_STORE_find_fn find;
OSSL_STORE_load_fn load;
OSSL_STORE_eof_fn eof;
OSSL_STORE_error_fn error;
OSSL_STORE_close_fn closefn;
OSSL_STORE_open_ex_fn open_ex;
#endif
OSSL_PROVIDER *prov;
int scheme_id;
const char *propdef;
const char *description;
CRYPTO_REF_COUNT refcnt;
OSSL_FUNC_store_open_fn *p_open;
OSSL_FUNC_store_attach_fn *p_attach;
OSSL_FUNC_store_settable_ctx_params_fn *p_settable_ctx_params;
OSSL_FUNC_store_set_ctx_params_fn *p_set_ctx_params;
OSSL_FUNC_store_load_fn *p_load;
OSSL_FUNC_store_eof_fn *p_eof;
OSSL_FUNC_store_close_fn *p_close;
OSSL_FUNC_store_export_object_fn *p_export_object;
OSSL_FUNC_store_delete_fn *p_delete;
OSSL_FUNC_store_open_ex_fn *p_open_ex;
};
DEFINE_LHASH_OF_EX(OSSL_STORE_LOADER);
const OSSL_STORE_LOADER *ossl_store_get0_loader_int(const char *scheme);
void ossl_store_destroy_loaders_int(void);
#ifdef OPENSSL_NO_DEPRECATED_3_0
typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX;
#endif
struct ossl_store_ctx_st {
const OSSL_STORE_LOADER *loader;
OSSL_STORE_LOADER *fetched_loader;
OSSL_STORE_LOADER_CTX *loader_ctx;
OSSL_STORE_post_process_info_fn post_process;
void *post_process_data;
int expected_type;
char *properties;
int loading;
int error_flag;
STACK_OF(OSSL_STORE_INFO) *cached_info;
struct ossl_passphrase_data_st pwdata;
};
OSSL_STORE_LOADER_CTX *ossl_store_file_attach_pem_bio_int(BIO *bp);
int ossl_store_file_detach_pem_bio_int(OSSL_STORE_LOADER_CTX *ctx);
OSSL_STORE_LOADER *ossl_store_loader_fetch(OSSL_LIB_CTX *libctx,
const char *scheme,
const char *properties);
struct ossl_load_result_data_st {
OSSL_STORE_INFO *v;
OSSL_STORE_CTX *ctx;
};
OSSL_CALLBACK ossl_store_handle_load_result;