Merge pull request 'updating security misc for vx6.9' (#6) from updating_security_misc into master
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/6 Reviewed-by: Siddhant Singh <siddhant.singh@neominds.in>
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright 2002-2020 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_AES_H
|
||||
# define OPENSSL_AES_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_AES_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define AES_BLOCK_SIZE 16
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
# define AES_ENCRYPT 1
|
||||
# define AES_DECRYPT 0
|
||||
|
||||
# define AES_MAXNR 14
|
||||
|
||||
|
||||
/* This should be a hidden type, but EVP requires that the size be known */
|
||||
struct aes_key_st {
|
||||
# ifdef AES_LONG
|
||||
unsigned long rd_key[4 * (AES_MAXNR + 1)];
|
||||
# else
|
||||
unsigned int rd_key[4 * (AES_MAXNR + 1)];
|
||||
# endif
|
||||
int rounds;
|
||||
};
|
||||
typedef struct aes_key_st AES_KEY;
|
||||
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
|
||||
/* NB: the IV is _two_ blocks long */
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
/* NB: the IV is _four_ blocks long */
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key, const AES_KEY *key2,
|
||||
const unsigned char *ivec, const int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in,
|
||||
unsigned int inlen);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in,
|
||||
unsigned int inlen);
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_ASN1ERR_H
|
||||
# define OPENSSL_ASN1ERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ASN1 reason codes.
|
||||
*/
|
||||
# define ASN1_R_ADDING_OBJECT 171
|
||||
# define ASN1_R_ASN1_PARSE_ERROR 203
|
||||
# define ASN1_R_ASN1_SIG_PARSE_ERROR 204
|
||||
# define ASN1_R_AUX_ERROR 100
|
||||
# define ASN1_R_BAD_OBJECT_HEADER 102
|
||||
# define ASN1_R_BAD_TEMPLATE 230
|
||||
# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
|
||||
# define ASN1_R_BN_LIB 105
|
||||
# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
|
||||
# define ASN1_R_BUFFER_TOO_SMALL 107
|
||||
# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
|
||||
# define ASN1_R_CONTEXT_NOT_INITIALISED 217
|
||||
# define ASN1_R_DATA_IS_WRONG 109
|
||||
# define ASN1_R_DECODE_ERROR 110
|
||||
# define ASN1_R_DEPTH_EXCEEDED 174
|
||||
# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
|
||||
# define ASN1_R_ENCODE_ERROR 112
|
||||
# define ASN1_R_ERROR_GETTING_TIME 173
|
||||
# define ASN1_R_ERROR_LOADING_SECTION 172
|
||||
# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
|
||||
# define ASN1_R_EXPECTING_AN_INTEGER 115
|
||||
# define ASN1_R_EXPECTING_AN_OBJECT 116
|
||||
# define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
|
||||
# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
|
||||
# define ASN1_R_FIELD_MISSING 121
|
||||
# define ASN1_R_FIRST_NUM_TOO_LARGE 122
|
||||
# define ASN1_R_HEADER_TOO_LONG 123
|
||||
# define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
|
||||
# define ASN1_R_ILLEGAL_BOOLEAN 176
|
||||
# define ASN1_R_ILLEGAL_CHARACTERS 124
|
||||
# define ASN1_R_ILLEGAL_FORMAT 177
|
||||
# define ASN1_R_ILLEGAL_HEX 178
|
||||
# define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
|
||||
# define ASN1_R_ILLEGAL_INTEGER 180
|
||||
# define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226
|
||||
# define ASN1_R_ILLEGAL_NESTED_TAGGING 181
|
||||
# define ASN1_R_ILLEGAL_NULL 125
|
||||
# define ASN1_R_ILLEGAL_NULL_VALUE 182
|
||||
# define ASN1_R_ILLEGAL_OBJECT 183
|
||||
# define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
|
||||
# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
|
||||
# define ASN1_R_ILLEGAL_PADDING 221
|
||||
# define ASN1_R_ILLEGAL_TAGGED_ANY 127
|
||||
# define ASN1_R_ILLEGAL_TIME_VALUE 184
|
||||
# define ASN1_R_ILLEGAL_ZERO_CONTENT 222
|
||||
# define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
|
||||
# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
|
||||
# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
|
||||
# define ASN1_R_INVALID_BMPSTRING_LENGTH 129
|
||||
# define ASN1_R_INVALID_DIGIT 130
|
||||
# define ASN1_R_INVALID_MIME_TYPE 205
|
||||
# define ASN1_R_INVALID_MODIFIER 186
|
||||
# define ASN1_R_INVALID_NUMBER 187
|
||||
# define ASN1_R_INVALID_OBJECT_ENCODING 216
|
||||
# define ASN1_R_INVALID_SCRYPT_PARAMETERS 227
|
||||
# define ASN1_R_INVALID_SEPARATOR 131
|
||||
# define ASN1_R_INVALID_STRING_TABLE_VALUE 218
|
||||
# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
|
||||
# define ASN1_R_INVALID_UTF8STRING 134
|
||||
# define ASN1_R_INVALID_VALUE 219
|
||||
# define ASN1_R_LENGTH_TOO_LONG 231
|
||||
# define ASN1_R_LIST_ERROR 188
|
||||
# define ASN1_R_MIME_NO_CONTENT_TYPE 206
|
||||
# define ASN1_R_MIME_PARSE_ERROR 207
|
||||
# define ASN1_R_MIME_SIG_PARSE_ERROR 208
|
||||
# define ASN1_R_MISSING_EOC 137
|
||||
# define ASN1_R_MISSING_SECOND_NUMBER 138
|
||||
# define ASN1_R_MISSING_VALUE 189
|
||||
# define ASN1_R_MSTRING_NOT_UNIVERSAL 139
|
||||
# define ASN1_R_MSTRING_WRONG_TAG 140
|
||||
# define ASN1_R_NESTED_ASN1_STRING 197
|
||||
# define ASN1_R_NESTED_TOO_DEEP 201
|
||||
# define ASN1_R_NON_HEX_CHARACTERS 141
|
||||
# define ASN1_R_NOT_ASCII_FORMAT 190
|
||||
# define ASN1_R_NOT_ENOUGH_DATA 142
|
||||
# define ASN1_R_NO_CONTENT_TYPE 209
|
||||
# define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
|
||||
# define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
|
||||
# define ASN1_R_NO_MULTIPART_BOUNDARY 211
|
||||
# define ASN1_R_NO_SIG_CONTENT_TYPE 212
|
||||
# define ASN1_R_NULL_IS_WRONG_LENGTH 144
|
||||
# define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
|
||||
# define ASN1_R_ODD_NUMBER_OF_CHARS 145
|
||||
# define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
|
||||
# define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
|
||||
# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
|
||||
# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
|
||||
# define ASN1_R_SHORT_LINE 150
|
||||
# define ASN1_R_SIG_INVALID_MIME_TYPE 213
|
||||
# define ASN1_R_STREAMING_NOT_SUPPORTED 202
|
||||
# define ASN1_R_STRING_TOO_LONG 151
|
||||
# define ASN1_R_STRING_TOO_SHORT 152
|
||||
# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
|
||||
# define ASN1_R_TIME_NOT_ASCII_FORMAT 193
|
||||
# define ASN1_R_TOO_LARGE 223
|
||||
# define ASN1_R_TOO_LONG 155
|
||||
# define ASN1_R_TOO_SMALL 224
|
||||
# define ASN1_R_TYPE_NOT_CONSTRUCTED 156
|
||||
# define ASN1_R_TYPE_NOT_PRIMITIVE 195
|
||||
# define ASN1_R_UNEXPECTED_EOC 159
|
||||
# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
|
||||
# define ASN1_R_UNKNOWN_DIGEST 229
|
||||
# define ASN1_R_UNKNOWN_FORMAT 160
|
||||
# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
|
||||
# define ASN1_R_UNKNOWN_OBJECT_TYPE 162
|
||||
# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
|
||||
# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
|
||||
# define ASN1_R_UNKNOWN_TAG 194
|
||||
# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
|
||||
# define ASN1_R_UNSUPPORTED_CIPHER 228
|
||||
# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
|
||||
# define ASN1_R_UNSUPPORTED_TYPE 196
|
||||
# define ASN1_R_WRONG_INTEGER_TYPE 225
|
||||
# define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
|
||||
# define ASN1_R_WRONG_TAG 168
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2015-2018 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
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef OPENSSL_ASYNC_H
|
||||
# define OPENSSL_ASYNC_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_ASYNC_H
|
||||
# endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# if defined(BASETYPES) || defined(_WINDEF_H)
|
||||
/* application has to include <windows.h> to use this */
|
||||
#define OSSL_ASYNC_FD HANDLE
|
||||
#define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE
|
||||
# endif
|
||||
#else
|
||||
#define OSSL_ASYNC_FD int
|
||||
#define OSSL_BAD_ASYNC_FD -1
|
||||
#endif
|
||||
# include <openssl/asyncerr.h>
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
typedef struct async_job_st ASYNC_JOB;
|
||||
typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
|
||||
typedef int (*ASYNC_callback_fn)(void *arg);
|
||||
|
||||
#define ASYNC_ERR 0
|
||||
#define ASYNC_NO_JOBS 1
|
||||
#define ASYNC_PAUSE 2
|
||||
#define ASYNC_FINISH 3
|
||||
|
||||
#define ASYNC_STATUS_UNSUPPORTED 0
|
||||
#define ASYNC_STATUS_ERR 1
|
||||
#define ASYNC_STATUS_OK 2
|
||||
#define ASYNC_STATUS_EAGAIN 3
|
||||
|
||||
int ASYNC_init_thread(size_t max_size, size_t init_size);
|
||||
void ASYNC_cleanup_thread(void);
|
||||
|
||||
#ifdef OSSL_ASYNC_FD
|
||||
ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void);
|
||||
void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx);
|
||||
int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD fd,
|
||||
void *custom_data,
|
||||
void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
|
||||
OSSL_ASYNC_FD, void *));
|
||||
int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD *fd, void **custom_data);
|
||||
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
|
||||
size_t *numfds);
|
||||
int ASYNC_WAIT_CTX_get_callback(ASYNC_WAIT_CTX *ctx,
|
||||
ASYNC_callback_fn *callback,
|
||||
void **callback_arg);
|
||||
int ASYNC_WAIT_CTX_set_callback(ASYNC_WAIT_CTX *ctx,
|
||||
ASYNC_callback_fn callback,
|
||||
void *callback_arg);
|
||||
int ASYNC_WAIT_CTX_set_status(ASYNC_WAIT_CTX *ctx, int status);
|
||||
int ASYNC_WAIT_CTX_get_status(ASYNC_WAIT_CTX *ctx);
|
||||
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
|
||||
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
|
||||
size_t *numdelfds);
|
||||
int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
|
||||
#endif
|
||||
|
||||
int ASYNC_is_capable(void);
|
||||
|
||||
int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret,
|
||||
int (*func)(void *), void *args, size_t size);
|
||||
int ASYNC_pause_job(void);
|
||||
|
||||
ASYNC_JOB *ASYNC_get_current_job(void);
|
||||
ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job);
|
||||
void ASYNC_block_pause(void);
|
||||
void ASYNC_unblock_pause(void);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_ASYNCERR_H
|
||||
# define OPENSSL_ASYNCERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ASYNC reason codes.
|
||||
*/
|
||||
# define ASYNC_R_FAILED_TO_SET_POOL 101
|
||||
# define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102
|
||||
# define ASYNC_R_INIT_FAILED 105
|
||||
# define ASYNC_R_INVALID_POOL_SIZE 103
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,887 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/bio.h.in
|
||||
*
|
||||
* Copyright 1995-2022 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_BIO_H
|
||||
# define OPENSSL_BIO_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_BIO_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
# include <stdarg.h>
|
||||
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/bioerr.h>
|
||||
# include <openssl/core.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* There are the classes of BIOs */
|
||||
# define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
|
||||
# define BIO_TYPE_FILTER 0x0200
|
||||
# define BIO_TYPE_SOURCE_SINK 0x0400
|
||||
|
||||
/* These are the 'types' of BIOs */
|
||||
# define BIO_TYPE_NONE 0
|
||||
# define BIO_TYPE_MEM ( 1|BIO_TYPE_SOURCE_SINK)
|
||||
# define BIO_TYPE_FILE ( 2|BIO_TYPE_SOURCE_SINK)
|
||||
|
||||
# define BIO_TYPE_FD ( 4|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
# define BIO_TYPE_SOCKET ( 5|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
# define BIO_TYPE_NULL ( 6|BIO_TYPE_SOURCE_SINK)
|
||||
# define BIO_TYPE_SSL ( 7|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_MD ( 8|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_BUFFER ( 9|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_CIPHER (10|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_BASE64 (11|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_CONNECT (12|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
# define BIO_TYPE_ACCEPT (13|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
|
||||
# define BIO_TYPE_NBIO_TEST (16|BIO_TYPE_FILTER)/* server proxy BIO */
|
||||
# define BIO_TYPE_NULL_FILTER (17|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_BIO (19|BIO_TYPE_SOURCE_SINK)/* half a BIO pair */
|
||||
# define BIO_TYPE_LINEBUFFER (20|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_DGRAM (21|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
# define BIO_TYPE_ASN1 (22|BIO_TYPE_FILTER)
|
||||
# define BIO_TYPE_COMP (23|BIO_TYPE_FILTER)
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# define BIO_TYPE_DGRAM_SCTP (24|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
||||
# endif
|
||||
# define BIO_TYPE_CORE_TO_PROV (25|BIO_TYPE_SOURCE_SINK)
|
||||
|
||||
#define BIO_TYPE_START 128
|
||||
|
||||
/*
|
||||
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
|
||||
* BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
*/
|
||||
# define BIO_NOCLOSE 0x00
|
||||
# define BIO_CLOSE 0x01
|
||||
|
||||
/*
|
||||
* These are used in the following macros and are passed to BIO_ctrl()
|
||||
*/
|
||||
# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */
|
||||
# define BIO_CTRL_EOF 2/* opt - are we at the eof */
|
||||
# define BIO_CTRL_INFO 3/* opt - extra tit-bits */
|
||||
# define BIO_CTRL_SET 4/* man - set the 'IO' type */
|
||||
# define BIO_CTRL_GET 5/* man - get the 'IO' type */
|
||||
# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */
|
||||
# define BIO_CTRL_POP 7/* opt - internal, used to signify change */
|
||||
# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */
|
||||
# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */
|
||||
# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */
|
||||
# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */
|
||||
# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */
|
||||
# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */
|
||||
# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */
|
||||
# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */
|
||||
|
||||
# define BIO_CTRL_PEEK 29/* BIO_f_buffer special */
|
||||
# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */
|
||||
|
||||
/* dgram BIO stuff */
|
||||
# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */
|
||||
# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
|
||||
* socket to be passed in */
|
||||
# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */
|
||||
# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation timed out */
|
||||
|
||||
/* #ifdef IP_MTU_DISCOVER */
|
||||
# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */
|
||||
/* #endif */
|
||||
|
||||
# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */
|
||||
# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
|
||||
# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */
|
||||
# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
|
||||
* want to use this if asking
|
||||
* the kernel fails */
|
||||
|
||||
# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
|
||||
* exceed in the previous write
|
||||
* operation */
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_PEER 46
|
||||
# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */
|
||||
|
||||
# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
|
||||
* to adjust socket timeouts */
|
||||
# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
|
||||
|
||||
/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP stuff */
|
||||
# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
|
||||
# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
|
||||
# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
|
||||
# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
|
||||
# endif
|
||||
|
||||
# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71
|
||||
|
||||
/*
|
||||
* internal BIO:
|
||||
* # define BIO_CTRL_SET_KTLS_SEND 72
|
||||
* # define BIO_CTRL_SET_KTLS_SEND_CTRL_MSG 74
|
||||
* # define BIO_CTRL_CLEAR_KTLS_CTRL_MSG 75
|
||||
*/
|
||||
|
||||
# define BIO_CTRL_GET_KTLS_SEND 73
|
||||
# define BIO_CTRL_GET_KTLS_RECV 76
|
||||
|
||||
# define BIO_CTRL_DGRAM_SCTP_WAIT_FOR_DRY 77
|
||||
# define BIO_CTRL_DGRAM_SCTP_MSG_WAITING 78
|
||||
|
||||
/* BIO_f_prefix controls */
|
||||
# define BIO_CTRL_SET_PREFIX 79
|
||||
# define BIO_CTRL_SET_INDENT 80
|
||||
# define BIO_CTRL_GET_INDENT 81
|
||||
|
||||
# ifndef OPENSSL_NO_KTLS
|
||||
# define BIO_get_ktls_send(b) \
|
||||
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) > 0)
|
||||
# define BIO_get_ktls_recv(b) \
|
||||
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0)
|
||||
# else
|
||||
# define BIO_get_ktls_send(b) (0)
|
||||
# define BIO_get_ktls_recv(b) (0)
|
||||
# endif
|
||||
|
||||
/* modifiers */
|
||||
# define BIO_FP_READ 0x02
|
||||
# define BIO_FP_WRITE 0x04
|
||||
# define BIO_FP_APPEND 0x08
|
||||
# define BIO_FP_TEXT 0x10
|
||||
|
||||
# define BIO_FLAGS_READ 0x01
|
||||
# define BIO_FLAGS_WRITE 0x02
|
||||
# define BIO_FLAGS_IO_SPECIAL 0x04
|
||||
# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
|
||||
# define BIO_FLAGS_SHOULD_RETRY 0x08
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* This #define was replaced by an internal constant and should not be used. */
|
||||
# define BIO_FLAGS_UPLINK 0
|
||||
# endif
|
||||
|
||||
# define BIO_FLAGS_BASE64_NO_NL 0x100
|
||||
|
||||
/*
|
||||
* This is used with memory BIOs:
|
||||
* BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way;
|
||||
* BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset.
|
||||
*/
|
||||
# define BIO_FLAGS_MEM_RDONLY 0x200
|
||||
# define BIO_FLAGS_NONCLEAR_RST 0x400
|
||||
# define BIO_FLAGS_IN_EOF 0x800
|
||||
|
||||
/* the BIO FLAGS values 0x1000 to 0x4000 are reserved for internal KTLS flags */
|
||||
|
||||
typedef union bio_addr_st BIO_ADDR;
|
||||
typedef struct bio_addrinfo_st BIO_ADDRINFO;
|
||||
|
||||
int BIO_get_new_index(void);
|
||||
void BIO_set_flags(BIO *b, int flags);
|
||||
int BIO_test_flags(const BIO *b, int flags);
|
||||
void BIO_clear_flags(BIO *b, int flags);
|
||||
|
||||
# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
|
||||
# define BIO_set_retry_special(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_set_retry_read(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_set_retry_write(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
|
||||
|
||||
/* These are normally used internally in BIOs */
|
||||
# define BIO_clear_retry_flags(b) \
|
||||
BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_get_retry_flags(b) \
|
||||
BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
|
||||
/* These should be used by the application to tell why we should retry */
|
||||
# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
|
||||
# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
|
||||
# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
|
||||
# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
|
||||
# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
|
||||
|
||||
/*
|
||||
* The next three are used in conjunction with the BIO_should_io_special()
|
||||
* condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int
|
||||
* *reason); will walk the BIO stack and return the 'reason' for the special
|
||||
* and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return
|
||||
* the code.
|
||||
*/
|
||||
/*
|
||||
* Returned from the SSL bio when the certificate retrieval code had an error
|
||||
*/
|
||||
# define BIO_RR_SSL_X509_LOOKUP 0x01
|
||||
/* Returned from the connect BIO when a connect would have blocked */
|
||||
# define BIO_RR_CONNECT 0x02
|
||||
/* Returned from the accept BIO when an accept would have blocked */
|
||||
# define BIO_RR_ACCEPT 0x03
|
||||
|
||||
/* These are passed by the BIO callback */
|
||||
# define BIO_CB_FREE 0x01
|
||||
# define BIO_CB_READ 0x02
|
||||
# define BIO_CB_WRITE 0x03
|
||||
# define BIO_CB_PUTS 0x04
|
||||
# define BIO_CB_GETS 0x05
|
||||
# define BIO_CB_CTRL 0x06
|
||||
|
||||
/*
|
||||
* The callback is called before and after the underling operation, The
|
||||
* BIO_CB_RETURN flag indicates if it is after the call
|
||||
*/
|
||||
# define BIO_CB_RETURN 0x80
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
||||
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
||||
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
OSSL_DEPRECATEDIN_3_0 BIO_callback_fn BIO_get_callback(const BIO *b);
|
||||
OSSL_DEPRECATEDIN_3_0 void BIO_set_callback(BIO *b, BIO_callback_fn callback);
|
||||
OSSL_DEPRECATEDIN_3_0 long BIO_debug_callback(BIO *bio, int cmd,
|
||||
const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
# endif
|
||||
|
||||
typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp,
|
||||
size_t len, int argi,
|
||||
long argl, int ret, size_t *processed);
|
||||
BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b);
|
||||
void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback);
|
||||
long BIO_debug_callback_ex(BIO *bio, int oper, const char *argp, size_t len,
|
||||
int argi, long argl, int ret, size_t *processed);
|
||||
|
||||
char *BIO_get_callback_arg(const BIO *b);
|
||||
void BIO_set_callback_arg(BIO *b, char *arg);
|
||||
|
||||
typedef struct bio_method_st BIO_METHOD;
|
||||
|
||||
const char *BIO_method_name(const BIO *b);
|
||||
int BIO_method_type(const BIO *b);
|
||||
|
||||
typedef int BIO_info_cb(BIO *, int, int);
|
||||
typedef BIO_info_cb bio_info_cb; /* backward compatibility */
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(BIO, BIO, BIO)
|
||||
#define sk_BIO_num(sk) OPENSSL_sk_num(ossl_check_const_BIO_sk_type(sk))
|
||||
#define sk_BIO_value(sk, idx) ((BIO *)OPENSSL_sk_value(ossl_check_const_BIO_sk_type(sk), (idx)))
|
||||
#define sk_BIO_new(cmp) ((STACK_OF(BIO) *)OPENSSL_sk_new(ossl_check_BIO_compfunc_type(cmp)))
|
||||
#define sk_BIO_new_null() ((STACK_OF(BIO) *)OPENSSL_sk_new_null())
|
||||
#define sk_BIO_new_reserve(cmp, n) ((STACK_OF(BIO) *)OPENSSL_sk_new_reserve(ossl_check_BIO_compfunc_type(cmp), (n)))
|
||||
#define sk_BIO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_BIO_sk_type(sk), (n))
|
||||
#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_zero(sk) OPENSSL_sk_zero(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_delete(sk, i) ((BIO *)OPENSSL_sk_delete(ossl_check_BIO_sk_type(sk), (i)))
|
||||
#define sk_BIO_delete_ptr(sk, ptr) ((BIO *)OPENSSL_sk_delete_ptr(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)))
|
||||
#define sk_BIO_push(sk, ptr) OPENSSL_sk_push(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk)))
|
||||
#define sk_BIO_shift(sk) ((BIO *)OPENSSL_sk_shift(ossl_check_BIO_sk_type(sk)))
|
||||
#define sk_BIO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_BIO_sk_type(sk),ossl_check_BIO_freefunc_type(freefunc))
|
||||
#define sk_BIO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), (idx))
|
||||
#define sk_BIO_set(sk, idx, ptr) ((BIO *)OPENSSL_sk_set(ossl_check_BIO_sk_type(sk), (idx), ossl_check_BIO_type(ptr)))
|
||||
#define sk_BIO_find(sk, ptr) OPENSSL_sk_find(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), pnum)
|
||||
#define sk_BIO_sort(sk) OPENSSL_sk_sort(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_BIO_sk_type(sk))
|
||||
#define sk_BIO_dup(sk) ((STACK_OF(BIO) *)OPENSSL_sk_dup(ossl_check_const_BIO_sk_type(sk)))
|
||||
#define sk_BIO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(BIO) *)OPENSSL_sk_deep_copy(ossl_check_const_BIO_sk_type(sk), ossl_check_BIO_copyfunc_type(copyfunc), ossl_check_BIO_freefunc_type(freefunc)))
|
||||
#define sk_BIO_set_cmp_func(sk, cmp) ((sk_BIO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_BIO_sk_type(sk), ossl_check_BIO_compfunc_type(cmp)))
|
||||
|
||||
|
||||
|
||||
/* Prefix and suffix callback in ASN1 BIO */
|
||||
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
|
||||
void *parg);
|
||||
|
||||
typedef void (*BIO_dgram_sctp_notification_handler_fn) (BIO *b,
|
||||
void *context,
|
||||
void *buf);
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP parameter structs */
|
||||
struct bio_dgram_sctp_sndinfo {
|
||||
uint16_t snd_sid;
|
||||
uint16_t snd_flags;
|
||||
uint32_t snd_ppid;
|
||||
uint32_t snd_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_rcvinfo {
|
||||
uint16_t rcv_sid;
|
||||
uint16_t rcv_ssn;
|
||||
uint16_t rcv_flags;
|
||||
uint32_t rcv_ppid;
|
||||
uint32_t rcv_tsn;
|
||||
uint32_t rcv_cumtsn;
|
||||
uint32_t rcv_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_prinfo {
|
||||
uint16_t pr_policy;
|
||||
uint32_t pr_value;
|
||||
};
|
||||
# endif
|
||||
|
||||
/*
|
||||
* #define BIO_CONN_get_param_hostname BIO_ctrl
|
||||
*/
|
||||
|
||||
# define BIO_C_SET_CONNECT 100
|
||||
# define BIO_C_DO_STATE_MACHINE 101
|
||||
# define BIO_C_SET_NBIO 102
|
||||
/* # define BIO_C_SET_PROXY_PARAM 103 */
|
||||
# define BIO_C_SET_FD 104
|
||||
# define BIO_C_GET_FD 105
|
||||
# define BIO_C_SET_FILE_PTR 106
|
||||
# define BIO_C_GET_FILE_PTR 107
|
||||
# define BIO_C_SET_FILENAME 108
|
||||
# define BIO_C_SET_SSL 109
|
||||
# define BIO_C_GET_SSL 110
|
||||
# define BIO_C_SET_MD 111
|
||||
# define BIO_C_GET_MD 112
|
||||
# define BIO_C_GET_CIPHER_STATUS 113
|
||||
# define BIO_C_SET_BUF_MEM 114
|
||||
# define BIO_C_GET_BUF_MEM_PTR 115
|
||||
# define BIO_C_GET_BUFF_NUM_LINES 116
|
||||
# define BIO_C_SET_BUFF_SIZE 117
|
||||
# define BIO_C_SET_ACCEPT 118
|
||||
# define BIO_C_SSL_MODE 119
|
||||
# define BIO_C_GET_MD_CTX 120
|
||||
/* # define BIO_C_GET_PROXY_PARAM 121 */
|
||||
# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
|
||||
# define BIO_C_GET_CONNECT 123
|
||||
# define BIO_C_GET_ACCEPT 124
|
||||
# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
|
||||
# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
|
||||
# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
|
||||
# define BIO_C_FILE_SEEK 128
|
||||
# define BIO_C_GET_CIPHER_CTX 129
|
||||
# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
|
||||
* value */
|
||||
# define BIO_C_SET_BIND_MODE 131
|
||||
# define BIO_C_GET_BIND_MODE 132
|
||||
# define BIO_C_FILE_TELL 133
|
||||
# define BIO_C_GET_SOCKS 134
|
||||
# define BIO_C_SET_SOCKS 135
|
||||
|
||||
# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
|
||||
# define BIO_C_GET_WRITE_BUF_SIZE 137
|
||||
# define BIO_C_MAKE_BIO_PAIR 138
|
||||
# define BIO_C_DESTROY_BIO_PAIR 139
|
||||
# define BIO_C_GET_WRITE_GUARANTEE 140
|
||||
# define BIO_C_GET_READ_REQUEST 141
|
||||
# define BIO_C_SHUTDOWN_WR 142
|
||||
# define BIO_C_NREAD0 143
|
||||
# define BIO_C_NREAD 144
|
||||
# define BIO_C_NWRITE0 145
|
||||
# define BIO_C_NWRITE 146
|
||||
# define BIO_C_RESET_READ_REQUEST 147
|
||||
# define BIO_C_SET_MD_CTX 148
|
||||
|
||||
# define BIO_C_SET_PREFIX 149
|
||||
# define BIO_C_GET_PREFIX 150
|
||||
# define BIO_C_SET_SUFFIX 151
|
||||
# define BIO_C_GET_SUFFIX 152
|
||||
|
||||
# define BIO_C_SET_EX_ARG 153
|
||||
# define BIO_C_GET_EX_ARG 154
|
||||
|
||||
# define BIO_C_SET_CONNECT_MODE 155
|
||||
|
||||
# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
|
||||
# define BIO_get_app_data(s) BIO_get_ex_data(s,0)
|
||||
|
||||
# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
|
||||
|
||||
# ifndef OPENSSL_NO_SOCK
|
||||
/* IP families we support, for BIO_s_connect() and BIO_s_accept() */
|
||||
/* Note: the underlying operating system may not support some of them */
|
||||
# define BIO_FAMILY_IPV4 4
|
||||
# define BIO_FAMILY_IPV6 6
|
||||
# define BIO_FAMILY_IPANY 256
|
||||
|
||||
/* BIO_s_connect() */
|
||||
# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0, \
|
||||
(char *)(name))
|
||||
# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1, \
|
||||
(char *)(port))
|
||||
# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2, \
|
||||
(char *)(addr))
|
||||
# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)
|
||||
# define BIO_get_conn_hostname(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))
|
||||
# define BIO_get_conn_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))
|
||||
# define BIO_get_conn_address(b) ((const BIO_ADDR *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))
|
||||
# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
|
||||
# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)
|
||||
|
||||
/* BIO_s_accept() */
|
||||
# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0, \
|
||||
(char *)(name))
|
||||
# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1, \
|
||||
(char *)(port))
|
||||
# define BIO_get_accept_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))
|
||||
# define BIO_get_accept_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))
|
||||
# define BIO_get_peer_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))
|
||||
# define BIO_get_peer_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))
|
||||
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
|
||||
# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(void *)"a":NULL)
|
||||
# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,3, \
|
||||
(char *)(bio))
|
||||
# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)
|
||||
# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)
|
||||
|
||||
/* Aliases kept for backward compatibility */
|
||||
# define BIO_BIND_NORMAL 0
|
||||
# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR
|
||||
# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR
|
||||
# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
|
||||
# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
|
||||
# endif /* OPENSSL_NO_SOCK */
|
||||
|
||||
# define BIO_do_connect(b) BIO_do_handshake(b)
|
||||
# define BIO_do_accept(b) BIO_do_handshake(b)
|
||||
|
||||
# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
|
||||
|
||||
/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */
|
||||
# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
|
||||
# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)(c))
|
||||
|
||||
/* BIO_s_file() */
|
||||
# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
|
||||
# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)(fpp))
|
||||
|
||||
/* BIO_s_fd() and BIO_s_file() */
|
||||
# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
|
||||
# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
|
||||
|
||||
/*
|
||||
* name is cast to lose const, but might be better to route through a
|
||||
* function so we can do it safely
|
||||
*/
|
||||
# ifdef CONST_STRICT
|
||||
/*
|
||||
* If you are wondering why this isn't defined, its because CONST_STRICT is
|
||||
* purely a compile-time kludge to allow const to be checked.
|
||||
*/
|
||||
int BIO_read_filename(BIO *b, const char *name);
|
||||
# else
|
||||
# define BIO_read_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_READ,(char *)(name))
|
||||
# endif
|
||||
# define BIO_write_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_WRITE,name)
|
||||
# define BIO_append_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_APPEND,name)
|
||||
# define BIO_rw_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
|
||||
|
||||
/*
|
||||
* WARNING WARNING, this ups the reference count on the read bio of the SSL
|
||||
* structure. This is because the ssl read BIO is now pointed to by the
|
||||
* next_bio field in the bio. So when you free the BIO, make sure you are
|
||||
* doing a BIO_free_all() to catch the underlying BIO.
|
||||
*/
|
||||
# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)(ssl))
|
||||
# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)(sslp))
|
||||
# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
|
||||
# define BIO_set_ssl_renegotiate_bytes(b,num) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
|
||||
# define BIO_get_num_renegotiates(b) \
|
||||
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
|
||||
# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
|
||||
|
||||
/* defined in evp.h */
|
||||
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)(md)) */
|
||||
|
||||
# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
|
||||
# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)(bm))
|
||||
# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
|
||||
(char *)(pp))
|
||||
# define BIO_set_mem_eof_return(b,v) \
|
||||
BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
|
||||
|
||||
/* For the BIO_f_buffer() type */
|
||||
# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
|
||||
# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
|
||||
# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
|
||||
# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
|
||||
# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
|
||||
|
||||
/* Don't use the next one unless you know what you are doing :-) */
|
||||
# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
|
||||
|
||||
# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
|
||||
# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
|
||||
# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
|
||||
# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
|
||||
# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
|
||||
# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
|
||||
/* ...pending macros have inappropriate return type */
|
||||
size_t BIO_ctrl_pending(BIO *b);
|
||||
size_t BIO_ctrl_wpending(BIO *b);
|
||||
# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
|
||||
# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
|
||||
cbp)
|
||||
# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
|
||||
|
||||
/* For the BIO_f_buffer() type */
|
||||
# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
|
||||
# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))
|
||||
|
||||
/* For BIO_s_bio() */
|
||||
# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
|
||||
# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
|
||||
# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
|
||||
# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
|
||||
# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
|
||||
/* macros with inappropriate type -- but ...pending macros use int too: */
|
||||
# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
|
||||
# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
|
||||
size_t BIO_ctrl_get_write_guarantee(BIO *b);
|
||||
size_t BIO_ctrl_get_read_request(BIO *b);
|
||||
int BIO_ctrl_reset_read_request(BIO *b);
|
||||
|
||||
/* ctrl macros for dgram */
|
||||
# define BIO_ctrl_dgram_connect(b,peer) \
|
||||
(int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)(peer))
|
||||
# define BIO_ctrl_set_connected(b,peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char *)(peer))
|
||||
# define BIO_dgram_recv_timedout(b) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
|
||||
# define BIO_dgram_send_timedout(b) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
|
||||
# define BIO_dgram_get_peer(b,peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)(peer))
|
||||
# define BIO_dgram_set_peer(b,peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)(peer))
|
||||
# define BIO_dgram_get_mtu_overhead(b) \
|
||||
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
|
||||
|
||||
/* ctrl macros for BIO_f_prefix */
|
||||
# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
|
||||
# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
|
||||
# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
|
||||
|
||||
#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef)
|
||||
int BIO_set_ex_data(BIO *bio, int idx, void *data);
|
||||
void *BIO_get_ex_data(const BIO *bio, int idx);
|
||||
uint64_t BIO_number_read(BIO *bio);
|
||||
uint64_t BIO_number_written(BIO *bio);
|
||||
|
||||
/* For BIO_f_asn1() */
|
||||
int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
|
||||
asn1_ps_func *prefix_free);
|
||||
int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
|
||||
asn1_ps_func **pprefix_free);
|
||||
int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
|
||||
asn1_ps_func *suffix_free);
|
||||
int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
|
||||
asn1_ps_func **psuffix_free);
|
||||
|
||||
const BIO_METHOD *BIO_s_file(void);
|
||||
BIO *BIO_new_file(const char *filename, const char *mode);
|
||||
BIO *BIO_new_from_core_bio(OSSL_LIB_CTX *libctx, OSSL_CORE_BIO *corebio);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
BIO *BIO_new_fp(FILE *stream, int close_flag);
|
||||
# endif
|
||||
BIO *BIO_new_ex(OSSL_LIB_CTX *libctx, const BIO_METHOD *method);
|
||||
BIO *BIO_new(const BIO_METHOD *type);
|
||||
int BIO_free(BIO *a);
|
||||
void BIO_set_data(BIO *a, void *ptr);
|
||||
void *BIO_get_data(BIO *a);
|
||||
void BIO_set_init(BIO *a, int init);
|
||||
int BIO_get_init(BIO *a);
|
||||
void BIO_set_shutdown(BIO *a, int shut);
|
||||
int BIO_get_shutdown(BIO *a);
|
||||
void BIO_vfree(BIO *a);
|
||||
int BIO_up_ref(BIO *a);
|
||||
int BIO_read(BIO *b, void *data, int dlen);
|
||||
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
|
||||
int BIO_gets(BIO *bp, char *buf, int size);
|
||||
int BIO_get_line(BIO *bio, char *buf, int size);
|
||||
int BIO_write(BIO *b, const void *data, int dlen);
|
||||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
|
||||
int BIO_puts(BIO *bp, const char *buf);
|
||||
int BIO_indent(BIO *b, int indent, int max);
|
||||
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
|
||||
long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
|
||||
void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
|
||||
long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
|
||||
BIO *BIO_push(BIO *b, BIO *append);
|
||||
BIO *BIO_pop(BIO *b);
|
||||
void BIO_free_all(BIO *a);
|
||||
BIO *BIO_find_type(BIO *b, int bio_type);
|
||||
BIO *BIO_next(BIO *b);
|
||||
void BIO_set_next(BIO *b, BIO *next);
|
||||
BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
|
||||
int BIO_get_retry_reason(BIO *bio);
|
||||
void BIO_set_retry_reason(BIO *bio, int reason);
|
||||
BIO *BIO_dup_chain(BIO *in);
|
||||
|
||||
int BIO_nread0(BIO *bio, char **buf);
|
||||
int BIO_nread(BIO *bio, char **buf, int num);
|
||||
int BIO_nwrite0(BIO *bio, char **buf);
|
||||
int BIO_nwrite(BIO *bio, char **buf, int num);
|
||||
|
||||
const BIO_METHOD *BIO_s_mem(void);
|
||||
const BIO_METHOD *BIO_s_secmem(void);
|
||||
BIO *BIO_new_mem_buf(const void *buf, int len);
|
||||
# ifndef OPENSSL_NO_SOCK
|
||||
const BIO_METHOD *BIO_s_socket(void);
|
||||
const BIO_METHOD *BIO_s_connect(void);
|
||||
const BIO_METHOD *BIO_s_accept(void);
|
||||
# endif
|
||||
const BIO_METHOD *BIO_s_fd(void);
|
||||
const BIO_METHOD *BIO_s_log(void);
|
||||
const BIO_METHOD *BIO_s_bio(void);
|
||||
const BIO_METHOD *BIO_s_null(void);
|
||||
const BIO_METHOD *BIO_f_null(void);
|
||||
const BIO_METHOD *BIO_f_buffer(void);
|
||||
const BIO_METHOD *BIO_f_readbuffer(void);
|
||||
const BIO_METHOD *BIO_f_linebuffer(void);
|
||||
const BIO_METHOD *BIO_f_nbio_test(void);
|
||||
const BIO_METHOD *BIO_f_prefix(void);
|
||||
const BIO_METHOD *BIO_s_core(void);
|
||||
# ifndef OPENSSL_NO_DGRAM
|
||||
const BIO_METHOD *BIO_s_datagram(void);
|
||||
int BIO_dgram_non_fatal_error(int error);
|
||||
BIO *BIO_new_dgram(int fd, int close_flag);
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
const BIO_METHOD *BIO_s_datagram_sctp(void);
|
||||
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
|
||||
int BIO_dgram_is_sctp(BIO *bio);
|
||||
int BIO_dgram_sctp_notification_cb(BIO *b,
|
||||
BIO_dgram_sctp_notification_handler_fn handle_notifications,
|
||||
void *context);
|
||||
int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
||||
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_SOCK
|
||||
int BIO_sock_should_retry(int i);
|
||||
int BIO_sock_non_fatal_error(int error);
|
||||
int BIO_socket_wait(int fd, int for_read, time_t max_time);
|
||||
# endif
|
||||
int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds);
|
||||
int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds);
|
||||
|
||||
int BIO_fd_should_retry(int i);
|
||||
int BIO_fd_non_fatal_error(int error);
|
||||
int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const void *s, int len);
|
||||
int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const void *s, int len, int indent);
|
||||
int BIO_dump(BIO *b, const void *bytes, int len);
|
||||
int BIO_dump_indent(BIO *b, const void *bytes, int len, int indent);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
int BIO_dump_fp(FILE *fp, const void *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const void *s, int len, int indent);
|
||||
# endif
|
||||
int BIO_hex_string(BIO *out, int indent, int width, const void *data,
|
||||
int datalen);
|
||||
|
||||
# ifndef OPENSSL_NO_SOCK
|
||||
BIO_ADDR *BIO_ADDR_new(void);
|
||||
int BIO_ADDR_rawmake(BIO_ADDR *ap, int family,
|
||||
const void *where, size_t wherelen, unsigned short port);
|
||||
void BIO_ADDR_free(BIO_ADDR *);
|
||||
void BIO_ADDR_clear(BIO_ADDR *ap);
|
||||
int BIO_ADDR_family(const BIO_ADDR *ap);
|
||||
int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l);
|
||||
unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap);
|
||||
char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric);
|
||||
char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric);
|
||||
char *BIO_ADDR_path_string(const BIO_ADDR *ap);
|
||||
|
||||
const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai);
|
||||
int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai);
|
||||
const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
|
||||
void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
|
||||
|
||||
enum BIO_hostserv_priorities {
|
||||
BIO_PARSE_PRIO_HOST, BIO_PARSE_PRIO_SERV
|
||||
};
|
||||
int BIO_parse_hostserv(const char *hostserv, char **host, char **service,
|
||||
enum BIO_hostserv_priorities hostserv_prio);
|
||||
enum BIO_lookup_type {
|
||||
BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
|
||||
};
|
||||
int BIO_lookup(const char *host, const char *service,
|
||||
enum BIO_lookup_type lookup_type,
|
||||
int family, int socktype, BIO_ADDRINFO **res);
|
||||
int BIO_lookup_ex(const char *host, const char *service,
|
||||
int lookup_type, int family, int socktype, int protocol,
|
||||
BIO_ADDRINFO **res);
|
||||
int BIO_sock_error(int sock);
|
||||
int BIO_socket_ioctl(int fd, long type, void *arg);
|
||||
int BIO_socket_nbio(int fd, int mode);
|
||||
int BIO_sock_init(void);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define BIO_sock_cleanup() while(0) continue
|
||||
# endif
|
||||
int BIO_set_tcp_ndelay(int sock, int turn_on);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 struct hostent *BIO_gethostbyname(const char *name);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_port(const char *str, unsigned short *port_ptr);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_host_ip(const char *str, unsigned char *ip);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_accept_socket(char *host_port, int mode);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_accept(int sock, char **ip_port);
|
||||
# endif
|
||||
|
||||
union BIO_sock_info_u {
|
||||
BIO_ADDR *addr;
|
||||
};
|
||||
enum BIO_sock_info_type {
|
||||
BIO_SOCK_INFO_ADDRESS
|
||||
};
|
||||
int BIO_sock_info(int sock,
|
||||
enum BIO_sock_info_type type, union BIO_sock_info_u *info);
|
||||
|
||||
# define BIO_SOCK_REUSEADDR 0x01
|
||||
# define BIO_SOCK_V6_ONLY 0x02
|
||||
# define BIO_SOCK_KEEPALIVE 0x04
|
||||
# define BIO_SOCK_NONBLOCK 0x08
|
||||
# define BIO_SOCK_NODELAY 0x10
|
||||
|
||||
int BIO_socket(int domain, int socktype, int protocol, int options);
|
||||
int BIO_connect(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_bind(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_listen(int sock, const BIO_ADDR *addr, int options);
|
||||
int BIO_accept_ex(int accept_sock, BIO_ADDR *addr, int options);
|
||||
int BIO_closesocket(int sock);
|
||||
|
||||
BIO *BIO_new_socket(int sock, int close_flag);
|
||||
BIO *BIO_new_connect(const char *host_port);
|
||||
BIO *BIO_new_accept(const char *host_port);
|
||||
# endif /* OPENSSL_NO_SOCK*/
|
||||
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
/*
|
||||
* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
|
||||
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
|
||||
* value.
|
||||
*/
|
||||
|
||||
void BIO_copy_next_retry(BIO *b);
|
||||
|
||||
/*
|
||||
* long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
|
||||
*/
|
||||
|
||||
# define ossl_bio__attr__(x)
|
||||
# if defined(__GNUC__) && defined(__STDC_VERSION__) \
|
||||
&& !defined(__MINGW32__) && !defined(__MINGW64__) \
|
||||
&& !defined(__APPLE__)
|
||||
/*
|
||||
* Because we support the 'z' modifier, which made its appearance in C99,
|
||||
* we can't use __attribute__ with pre C99 dialects.
|
||||
*/
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# undef ossl_bio__attr__
|
||||
# define ossl_bio__attr__ __attribute__
|
||||
# if __GNUC__*10 + __GNUC_MINOR__ >= 44
|
||||
# define ossl_bio__printf__ __gnu_printf__
|
||||
# else
|
||||
# define ossl_bio__printf__ __printf__
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
int BIO_printf(BIO *bio, const char *format, ...)
|
||||
ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 3)));
|
||||
int BIO_vprintf(BIO *bio, const char *format, va_list args)
|
||||
ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 0)));
|
||||
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
|
||||
ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 4)));
|
||||
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
|
||||
ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 0)));
|
||||
# undef ossl_bio__attr__
|
||||
# undef ossl_bio__printf__
|
||||
|
||||
|
||||
BIO_METHOD *BIO_meth_new(int type, const char *name);
|
||||
void BIO_meth_free(BIO_METHOD *biom);
|
||||
int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int);
|
||||
int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, size_t,
|
||||
size_t *);
|
||||
int BIO_meth_set_write(BIO_METHOD *biom,
|
||||
int (*write) (BIO *, const char *, int));
|
||||
int BIO_meth_set_write_ex(BIO_METHOD *biom,
|
||||
int (*bwrite) (BIO *, const char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *);
|
||||
int BIO_meth_set_read(BIO_METHOD *biom,
|
||||
int (*read) (BIO *, char *, int));
|
||||
int BIO_meth_set_read_ex(BIO_METHOD *biom,
|
||||
int (*bread) (BIO *, char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *);
|
||||
int BIO_meth_set_puts(BIO_METHOD *biom,
|
||||
int (*puts) (BIO *, const char *));
|
||||
int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int BIO_meth_set_gets(BIO_METHOD *biom,
|
||||
int (*ossl_gets) (BIO *, char *, int));
|
||||
long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *);
|
||||
int BIO_meth_set_ctrl(BIO_METHOD *biom,
|
||||
long (*ctrl) (BIO *, int, long, void *));
|
||||
int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *);
|
||||
int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *));
|
||||
int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *);
|
||||
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *));
|
||||
long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))
|
||||
(BIO *, int, BIO_info_cb *);
|
||||
int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
|
||||
long (*callback_ctrl) (BIO *, int,
|
||||
BIO_info_cb *));
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_BIOERR_H
|
||||
# define OPENSSL_BIOERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BIO reason codes.
|
||||
*/
|
||||
# define BIO_R_ACCEPT_ERROR 100
|
||||
# define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141
|
||||
# define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129
|
||||
# define BIO_R_BAD_FOPEN_MODE 101
|
||||
# define BIO_R_BROKEN_PIPE 124
|
||||
# define BIO_R_CONNECT_ERROR 103
|
||||
# define BIO_R_CONNECT_TIMEOUT 147
|
||||
# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
|
||||
# define BIO_R_GETSOCKNAME_ERROR 132
|
||||
# define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
|
||||
# define BIO_R_GETTING_SOCKTYPE 134
|
||||
# define BIO_R_INVALID_ARGUMENT 125
|
||||
# define BIO_R_INVALID_SOCKET 135
|
||||
# define BIO_R_IN_USE 123
|
||||
# define BIO_R_LENGTH_TOO_LONG 102
|
||||
# define BIO_R_LISTEN_V6_ONLY 136
|
||||
# define BIO_R_LOOKUP_RETURNED_NOTHING 142
|
||||
# define BIO_R_MALFORMED_HOST_OR_SERVICE 130
|
||||
# define BIO_R_NBIO_CONNECT_ERROR 110
|
||||
# define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
|
||||
# define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
|
||||
# define BIO_R_NO_PORT_DEFINED 113
|
||||
# define BIO_R_NO_SUCH_FILE 128
|
||||
# define BIO_R_NULL_PARAMETER 115 /* unused */
|
||||
# define BIO_R_TRANSFER_ERROR 104
|
||||
# define BIO_R_TRANSFER_TIMEOUT 105
|
||||
# define BIO_R_UNABLE_TO_BIND_SOCKET 117
|
||||
# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
|
||||
# define BIO_R_UNABLE_TO_KEEPALIVE 137
|
||||
# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
|
||||
# define BIO_R_UNABLE_TO_NODELAY 138
|
||||
# define BIO_R_UNABLE_TO_REUSEADDR 139
|
||||
# define BIO_R_UNAVAILABLE_IP_FAMILY 145
|
||||
# define BIO_R_UNINITIALIZED 120
|
||||
# define BIO_R_UNKNOWN_INFO_TYPE 140
|
||||
# define BIO_R_UNSUPPORTED_IP_FAMILY 146
|
||||
# define BIO_R_UNSUPPORTED_METHOD 121
|
||||
# define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
|
||||
# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
|
||||
# define BIO_R_WSASTARTUP 122
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_BLOWFISH_H
|
||||
# define OPENSSL_BLOWFISH_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_BLOWFISH_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_BF
|
||||
# include <openssl/e_os2.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define BF_BLOCK 8
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
# define BF_ENCRYPT 1
|
||||
# define BF_DECRYPT 0
|
||||
|
||||
/*-
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* ! BF_LONG has to be at least 32 bits wide. !
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
# define BF_LONG unsigned int
|
||||
|
||||
# define BF_ROUNDS 16
|
||||
|
||||
typedef struct bf_key_st {
|
||||
BF_LONG P[BF_ROUNDS + 2];
|
||||
BF_LONG S[4 * 256];
|
||||
} BF_KEY;
|
||||
|
||||
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len,
|
||||
const unsigned char *data);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in,
|
||||
unsigned char *out, const BF_KEY *key,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in,
|
||||
unsigned char *out, long length,
|
||||
const BF_KEY *schedule,
|
||||
unsigned char *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *BF_options(void);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,584 @@
|
||||
/*
|
||||
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. 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_BN_H
|
||||
# define OPENSSL_BN_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_BN_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/bnerr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 64-bit processor with LP64 ABI
|
||||
*/
|
||||
# ifdef SIXTY_FOUR_BIT_LONG
|
||||
# define BN_ULONG unsigned long
|
||||
# define BN_BYTES 8
|
||||
# endif
|
||||
|
||||
/*
|
||||
* 64-bit processor other than LP64 ABI
|
||||
*/
|
||||
# ifdef SIXTY_FOUR_BIT
|
||||
# define BN_ULONG unsigned long long
|
||||
# define BN_BYTES 8
|
||||
# endif
|
||||
|
||||
# ifdef THIRTY_TWO_BIT
|
||||
# define BN_ULONG unsigned int
|
||||
# define BN_BYTES 4
|
||||
# endif
|
||||
|
||||
# define BN_BITS2 (BN_BYTES * 8)
|
||||
# define BN_BITS (BN_BITS2 * 2)
|
||||
# define BN_TBIT ((BN_ULONG)1 << (BN_BITS2 - 1))
|
||||
|
||||
# define BN_FLG_MALLOCED 0x01
|
||||
# define BN_FLG_STATIC_DATA 0x02
|
||||
|
||||
/*
|
||||
* avoid leaking exponent information through timing,
|
||||
* BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
|
||||
* BN_div() will call BN_div_no_branch,
|
||||
* BN_mod_inverse() will call bn_mod_inverse_no_branch.
|
||||
*/
|
||||
# define BN_FLG_CONSTTIME 0x04
|
||||
# define BN_FLG_SECURE 0x08
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
/* deprecated name for the flag */
|
||||
# define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME
|
||||
# define BN_FLG_FREE 0x8000 /* used for debugging */
|
||||
# endif
|
||||
|
||||
void BN_set_flags(BIGNUM *b, int n);
|
||||
int BN_get_flags(const BIGNUM *b, int n);
|
||||
|
||||
/* Values for |top| in BN_rand() */
|
||||
#define BN_RAND_TOP_ANY -1
|
||||
#define BN_RAND_TOP_ONE 0
|
||||
#define BN_RAND_TOP_TWO 1
|
||||
|
||||
/* Values for |bottom| in BN_rand() */
|
||||
#define BN_RAND_BOTTOM_ANY 0
|
||||
#define BN_RAND_BOTTOM_ODD 1
|
||||
|
||||
/*
|
||||
* get a clone of a BIGNUM with changed flags, for *temporary* use only (the
|
||||
* two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The
|
||||
* value |dest| should be a newly allocated BIGNUM obtained via BN_new() that
|
||||
* has not been otherwise initialised or used.
|
||||
*/
|
||||
void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);
|
||||
|
||||
/* Wrapper function to make using BN_GENCB easier */
|
||||
int BN_GENCB_call(BN_GENCB *cb, int a, int b);
|
||||
|
||||
BN_GENCB *BN_GENCB_new(void);
|
||||
void BN_GENCB_free(BN_GENCB *cb);
|
||||
|
||||
/* Populate a BN_GENCB structure with an "old"-style callback */
|
||||
void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback) (int, int, void *),
|
||||
void *cb_arg);
|
||||
|
||||
/* Populate a BN_GENCB structure with a "new"-style callback */
|
||||
void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *),
|
||||
void *cb_arg);
|
||||
|
||||
void *BN_GENCB_get_arg(BN_GENCB *cb);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define BN_prime_checks 0 /* default: select number of iterations based
|
||||
* on the size of the number */
|
||||
|
||||
/*
|
||||
* BN_prime_checks_for_size() returns the number of Miller-Rabin iterations
|
||||
* that will be done for checking that a random number is probably prime. The
|
||||
* error rate for accepting a composite number as prime depends on the size of
|
||||
* the prime |b|. The error rates used are for calculating an RSA key with 2 primes,
|
||||
* and so the level is what you would expect for a key of double the size of the
|
||||
* prime.
|
||||
*
|
||||
* This table is generated using the algorithm of FIPS PUB 186-4
|
||||
* Digital Signature Standard (DSS), section F.1, page 117.
|
||||
* (https://dx.doi.org/10.6028/NIST.FIPS.186-4)
|
||||
*
|
||||
* The following magma script was used to generate the output:
|
||||
* securitybits:=125;
|
||||
* k:=1024;
|
||||
* for t:=1 to 65 do
|
||||
* for M:=3 to Floor(2*Sqrt(k-1)-1) do
|
||||
* S:=0;
|
||||
* // Sum over m
|
||||
* for m:=3 to M do
|
||||
* s:=0;
|
||||
* // Sum over j
|
||||
* for j:=2 to m do
|
||||
* s+:=(RealField(32)!2)^-(j+(k-1)/j);
|
||||
* end for;
|
||||
* S+:=2^(m-(m-1)*t)*s;
|
||||
* end for;
|
||||
* A:=2^(k-2-M*t);
|
||||
* B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S;
|
||||
* pkt:=2.00743*Log(2)*k*2^-k*(A+B);
|
||||
* seclevel:=Floor(-Log(2,pkt));
|
||||
* if seclevel ge securitybits then
|
||||
* printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M;
|
||||
* break;
|
||||
* end if;
|
||||
* end for;
|
||||
* if seclevel ge securitybits then break; end if;
|
||||
* end for;
|
||||
*
|
||||
* It can be run online at:
|
||||
* http://magma.maths.usyd.edu.au/calc
|
||||
*
|
||||
* And will output:
|
||||
* k: 1024, security: 129 bits (t: 6, M: 23)
|
||||
*
|
||||
* k is the number of bits of the prime, securitybits is the level we want to
|
||||
* reach.
|
||||
*
|
||||
* prime length | RSA key size | # MR tests | security level
|
||||
* -------------+--------------|------------+---------------
|
||||
* (b) >= 6394 | >= 12788 | 3 | 256 bit
|
||||
* (b) >= 3747 | >= 7494 | 3 | 192 bit
|
||||
* (b) >= 1345 | >= 2690 | 4 | 128 bit
|
||||
* (b) >= 1080 | >= 2160 | 5 | 128 bit
|
||||
* (b) >= 852 | >= 1704 | 5 | 112 bit
|
||||
* (b) >= 476 | >= 952 | 5 | 80 bit
|
||||
* (b) >= 400 | >= 800 | 6 | 80 bit
|
||||
* (b) >= 347 | >= 694 | 7 | 80 bit
|
||||
* (b) >= 308 | >= 616 | 8 | 80 bit
|
||||
* (b) >= 55 | >= 110 | 27 | 64 bit
|
||||
* (b) >= 6 | >= 12 | 34 | 64 bit
|
||||
*/
|
||||
|
||||
# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \
|
||||
(b) >= 1345 ? 4 : \
|
||||
(b) >= 476 ? 5 : \
|
||||
(b) >= 400 ? 6 : \
|
||||
(b) >= 347 ? 7 : \
|
||||
(b) >= 308 ? 8 : \
|
||||
(b) >= 55 ? 27 : \
|
||||
/* b >= 6 */ 34)
|
||||
# endif
|
||||
|
||||
# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
|
||||
|
||||
int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
|
||||
int BN_is_zero(const BIGNUM *a);
|
||||
int BN_is_one(const BIGNUM *a);
|
||||
int BN_is_word(const BIGNUM *a, const BN_ULONG w);
|
||||
int BN_is_odd(const BIGNUM *a);
|
||||
|
||||
# define BN_one(a) (BN_set_word((a),1))
|
||||
|
||||
void BN_zero_ex(BIGNUM *a);
|
||||
|
||||
# if OPENSSL_API_LEVEL > 908
|
||||
# define BN_zero(a) BN_zero_ex(a)
|
||||
# else
|
||||
# define BN_zero(a) (BN_set_word((a),0))
|
||||
# endif
|
||||
|
||||
const BIGNUM *BN_value_one(void);
|
||||
char *BN_options(void);
|
||||
BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx);
|
||||
BN_CTX *BN_CTX_new(void);
|
||||
BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx);
|
||||
BN_CTX *BN_CTX_secure_new(void);
|
||||
void BN_CTX_free(BN_CTX *c);
|
||||
void BN_CTX_start(BN_CTX *ctx);
|
||||
BIGNUM *BN_CTX_get(BN_CTX *ctx);
|
||||
void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand_ex(BIGNUM *rnd, int bits, int top, int bottom,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_priv_rand_ex(BIGNUM *rnd, int bits, int top, int bottom,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_rand_range_ex(BIGNUM *r, const BIGNUM *range, unsigned int strength,
|
||||
BN_CTX *ctx);
|
||||
int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_priv_rand_range_ex(BIGNUM *r, const BIGNUM *range,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
# endif
|
||||
int BN_num_bits(const BIGNUM *a);
|
||||
int BN_num_bits_word(BN_ULONG l);
|
||||
int BN_security_bits(int L, int N);
|
||||
BIGNUM *BN_new(void);
|
||||
BIGNUM *BN_secure_new(void);
|
||||
void BN_clear_free(BIGNUM *a);
|
||||
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
|
||||
void BN_swap(BIGNUM *a, BIGNUM *b);
|
||||
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
|
||||
int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_native2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2nativepad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
|
||||
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
|
||||
/** BN_set_negative sets sign of a BIGNUM
|
||||
* \param b pointer to the BIGNUM object
|
||||
* \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
|
||||
*/
|
||||
void BN_set_negative(BIGNUM *b, int n);
|
||||
/** BN_is_negative returns 1 if the BIGNUM is negative
|
||||
* \param b pointer to the BIGNUM object
|
||||
* \return 1 if a < 0 and 0 otherwise
|
||||
*/
|
||||
int BN_is_negative(const BIGNUM *b);
|
||||
|
||||
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
BN_CTX *ctx);
|
||||
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
|
||||
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
|
||||
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *m);
|
||||
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *m);
|
||||
int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
|
||||
int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
|
||||
|
||||
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
|
||||
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
|
||||
int BN_mul_word(BIGNUM *a, BN_ULONG w);
|
||||
int BN_add_word(BIGNUM *a, BN_ULONG w);
|
||||
int BN_sub_word(BIGNUM *a, BN_ULONG w);
|
||||
int BN_set_word(BIGNUM *a, BN_ULONG w);
|
||||
BN_ULONG BN_get_word(const BIGNUM *a);
|
||||
|
||||
int BN_cmp(const BIGNUM *a, const BIGNUM *b);
|
||||
void BN_free(BIGNUM *a);
|
||||
int BN_is_bit_set(const BIGNUM *a, int n);
|
||||
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
|
||||
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
|
||||
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
|
||||
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx,
|
||||
BN_MONT_CTX *in_mont);
|
||||
int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
|
||||
const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
|
||||
BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_exp_mont_consttime_x2(BIGNUM *rr1, const BIGNUM *a1, const BIGNUM *p1,
|
||||
const BIGNUM *m1, BN_MONT_CTX *in_mont1,
|
||||
BIGNUM *rr2, const BIGNUM *a2, const BIGNUM *p2,
|
||||
const BIGNUM *m2, BN_MONT_CTX *in_mont2,
|
||||
BN_CTX *ctx);
|
||||
|
||||
int BN_mask_bits(BIGNUM *a, int n);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
int BN_print_fp(FILE *fp, const BIGNUM *a);
|
||||
# endif
|
||||
int BN_print(BIO *bio, const BIGNUM *a);
|
||||
int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
|
||||
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
|
||||
int BN_rshift1(BIGNUM *r, const BIGNUM *a);
|
||||
void BN_clear(BIGNUM *a);
|
||||
BIGNUM *BN_dup(const BIGNUM *a);
|
||||
int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
|
||||
int BN_set_bit(BIGNUM *a, int n);
|
||||
int BN_clear_bit(BIGNUM *a, int n);
|
||||
char *BN_bn2hex(const BIGNUM *a);
|
||||
char *BN_bn2dec(const BIGNUM *a);
|
||||
int BN_hex2bn(BIGNUM **a, const char *str);
|
||||
int BN_dec2bn(BIGNUM **a, const char *str);
|
||||
int BN_asc2bn(BIGNUM **a, const char *str);
|
||||
int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns
|
||||
* -2 for
|
||||
* error */
|
||||
int BN_are_coprime(BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_inverse(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
|
||||
|
||||
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
|
||||
|
||||
/* Deprecated versions */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
|
||||
const BIGNUM *add, const BIGNUM *rem,
|
||||
void (*callback) (int, int, void *),
|
||||
void *cb_arg);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_is_prime(const BIGNUM *p, int nchecks,
|
||||
void (*callback) (int, int, void *),
|
||||
BN_CTX *ctx, void *cb_arg);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
|
||||
void (*callback) (int, int, void *),
|
||||
BN_CTX *ctx, void *cb_arg,
|
||||
int do_trial_division);
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
|
||||
int do_trial_division, BN_GENCB *cb);
|
||||
# endif
|
||||
/* Newer versions */
|
||||
int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe,
|
||||
const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb,
|
||||
BN_CTX *ctx);
|
||||
int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
|
||||
const BIGNUM *rem, BN_GENCB *cb);
|
||||
int BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1,
|
||||
const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
|
||||
BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
|
||||
BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
|
||||
BN_CTX *ctx, BN_GENCB *cb);
|
||||
# endif
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
BN_MONT_CTX *mont, BN_CTX *ctx);
|
||||
int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
||||
BN_CTX *ctx);
|
||||
int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
||||
BN_CTX *ctx);
|
||||
void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
||||
int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
|
||||
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);
|
||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
|
||||
const BIGNUM *mod, BN_CTX *ctx);
|
||||
|
||||
/* BN_BLINDING flags */
|
||||
# define BN_BLINDING_NO_UPDATE 0x00000001
|
||||
# define BN_BLINDING_NO_RECREATE 0x00000002
|
||||
|
||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
|
||||
void BN_BLINDING_free(BN_BLINDING *b);
|
||||
int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
|
||||
int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
|
||||
int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
|
||||
BN_CTX *);
|
||||
|
||||
int BN_BLINDING_is_current_thread(BN_BLINDING *b);
|
||||
void BN_BLINDING_set_current_thread(BN_BLINDING *b);
|
||||
int BN_BLINDING_lock(BN_BLINDING *b);
|
||||
int BN_BLINDING_unlock(BN_BLINDING *b);
|
||||
|
||||
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
|
||||
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
|
||||
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
|
||||
const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
|
||||
int (*bn_mod_exp) (BIGNUM *r,
|
||||
const BIGNUM *a,
|
||||
const BIGNUM *p,
|
||||
const BIGNUM *m,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx),
|
||||
BN_MONT_CTX *m_ctx);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
void BN_set_params(int mul, int high, int low, int mont);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
|
||||
# endif
|
||||
|
||||
BN_RECP_CTX *BN_RECP_CTX_new(void);
|
||||
void BN_RECP_CTX_free(BN_RECP_CTX *recp);
|
||||
int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
|
||||
int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
|
||||
BN_RECP_CTX *recp, BN_CTX *ctx);
|
||||
int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
|
||||
BN_RECP_CTX *recp, BN_CTX *ctx);
|
||||
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
|
||||
/*
|
||||
* Functions for arithmetic over binary polynomials represented by BIGNUMs.
|
||||
* The BIGNUM::neg property of BIGNUMs representing binary polynomials is
|
||||
* ignored. Note that input arguments are not const so that their bit arrays
|
||||
* can be expanded to the appropriate size if needed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* r = a + b
|
||||
*/
|
||||
int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
# define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)
|
||||
/*
|
||||
* r=a mod p
|
||||
*/
|
||||
int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);
|
||||
/* r = (a * b) mod p */
|
||||
int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
/* r = (a * a) mod p */
|
||||
int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
/* r = (1 / b) mod p */
|
||||
int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
|
||||
/* r = (a / b) mod p */
|
||||
int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
/* r = (a ^ b) mod p */
|
||||
int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const BIGNUM *p, BN_CTX *ctx);
|
||||
/* r = sqrt(a) mod p */
|
||||
int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BN_CTX *ctx);
|
||||
/* r^2 + r = a mod p */
|
||||
int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
BN_CTX *ctx);
|
||||
# define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
|
||||
/*-
|
||||
* Some functions allow for representation of the irreducible polynomials
|
||||
* as an unsigned int[], say p. The irreducible f(t) is then of the form:
|
||||
* t^p[0] + t^p[1] + ... + t^p[k]
|
||||
* where m = p[0] > p[1] > ... > p[k] = 0.
|
||||
*/
|
||||
/* r = a mod p */
|
||||
int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);
|
||||
/* r = (a * b) mod p */
|
||||
int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
/* r = (a * a) mod p */
|
||||
int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
|
||||
BN_CTX *ctx);
|
||||
/* r = (1 / b) mod p */
|
||||
int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],
|
||||
BN_CTX *ctx);
|
||||
/* r = (a / b) mod p */
|
||||
int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
/* r = (a ^ b) mod p */
|
||||
int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
const int p[], BN_CTX *ctx);
|
||||
/* r = sqrt(a) mod p */
|
||||
int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
|
||||
const int p[], BN_CTX *ctx);
|
||||
/* r^2 + r = a mod p */
|
||||
int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
|
||||
const int p[], BN_CTX *ctx);
|
||||
int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
|
||||
int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
|
||||
|
||||
# endif
|
||||
|
||||
/*
|
||||
* faster mod functions for the 'NIST primes' 0 <= a < p^2
|
||||
*/
|
||||
int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
|
||||
const BIGNUM *BN_get0_nist_prime_192(void);
|
||||
const BIGNUM *BN_get0_nist_prime_224(void);
|
||||
const BIGNUM *BN_get0_nist_prime_256(void);
|
||||
const BIGNUM *BN_get0_nist_prime_384(void);
|
||||
const BIGNUM *BN_get0_nist_prime_521(void);
|
||||
|
||||
int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a,
|
||||
const BIGNUM *field, BN_CTX *ctx);
|
||||
|
||||
int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
|
||||
const BIGNUM *priv, const unsigned char *message,
|
||||
size_t message_len, BN_CTX *ctx);
|
||||
|
||||
/* Primes from RFC 2409 */
|
||||
BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn);
|
||||
|
||||
/* Primes from RFC 3526 */
|
||||
BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define get_rfc2409_prime_768 BN_get_rfc2409_prime_768
|
||||
# define get_rfc2409_prime_1024 BN_get_rfc2409_prime_1024
|
||||
# define get_rfc3526_prime_1536 BN_get_rfc3526_prime_1536
|
||||
# define get_rfc3526_prime_2048 BN_get_rfc3526_prime_2048
|
||||
# define get_rfc3526_prime_3072 BN_get_rfc3526_prime_3072
|
||||
# define get_rfc3526_prime_4096 BN_get_rfc3526_prime_4096
|
||||
# define get_rfc3526_prime_6144 BN_get_rfc3526_prime_6144
|
||||
# define get_rfc3526_prime_8192 BN_get_rfc3526_prime_8192
|
||||
# endif
|
||||
|
||||
int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2022 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_BNERR_H
|
||||
# define OPENSSL_BNERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BN reason codes.
|
||||
*/
|
||||
# define BN_R_ARG2_LT_ARG3 100
|
||||
# define BN_R_BAD_RECIPROCAL 101
|
||||
# define BN_R_BIGNUM_TOO_LONG 114
|
||||
# define BN_R_BITS_TOO_SMALL 118
|
||||
# define BN_R_CALLED_WITH_EVEN_MODULUS 102
|
||||
# define BN_R_DIV_BY_ZERO 103
|
||||
# define BN_R_ENCODING_ERROR 104
|
||||
# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
|
||||
# define BN_R_INPUT_NOT_REDUCED 110
|
||||
# define BN_R_INVALID_LENGTH 106
|
||||
# define BN_R_INVALID_RANGE 115
|
||||
# define BN_R_INVALID_SHIFT 119
|
||||
# define BN_R_NOT_A_SQUARE 111
|
||||
# define BN_R_NOT_INITIALIZED 107
|
||||
# define BN_R_NO_INVERSE 108
|
||||
# define BN_R_NO_PRIME_CANDIDATE 121
|
||||
# define BN_R_NO_SOLUTION 116
|
||||
# define BN_R_NO_SUITABLE_DIGEST 120
|
||||
# define BN_R_PRIVATE_KEY_TOO_LARGE 117
|
||||
# define BN_R_P_IS_NOT_PRIME 112
|
||||
# define BN_R_TOO_MANY_ITERATIONS 113
|
||||
# define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 1995-2018 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_BUFFER_H
|
||||
# define OPENSSL_BUFFER_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_BUFFER_H
|
||||
# endif
|
||||
|
||||
# include <openssl/types.h>
|
||||
# ifndef OPENSSL_CRYPTO_H
|
||||
# include <openssl/crypto.h>
|
||||
# endif
|
||||
# include <openssl/buffererr.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# include <stddef.h>
|
||||
# include <sys/types.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define BUF_strdup(s) OPENSSL_strdup(s)
|
||||
# define BUF_strndup(s, size) OPENSSL_strndup(s, size)
|
||||
# define BUF_memdup(data, size) OPENSSL_memdup(data, size)
|
||||
# define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
|
||||
# define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
|
||||
# define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
|
||||
# endif
|
||||
|
||||
struct buf_mem_st {
|
||||
size_t length; /* current number of bytes */
|
||||
char *data;
|
||||
size_t max; /* size of buffer */
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
# define BUF_MEM_FLAG_SECURE 0x01
|
||||
|
||||
BUF_MEM *BUF_MEM_new(void);
|
||||
BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
|
||||
void BUF_MEM_free(BUF_MEM *a);
|
||||
size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
|
||||
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
||||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_BUFFERERR_H
|
||||
# define OPENSSL_BUFFERERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BUF reason codes.
|
||||
*/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_CAST_H
|
||||
# define OPENSSL_CAST_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_CAST_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_CAST
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define CAST_BLOCK 8
|
||||
# define CAST_KEY_LENGTH 16
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
# define CAST_ENCRYPT 1
|
||||
# define CAST_DECRYPT 0
|
||||
|
||||
# define CAST_LONG unsigned int
|
||||
|
||||
typedef struct cast_key_st {
|
||||
CAST_LONG data[32];
|
||||
int short_key; /* Use reduced rounds for short key */
|
||||
} CAST_KEY;
|
||||
|
||||
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const CAST_KEY *key, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *ks, unsigned char *iv,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *schedule,
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2015-2018 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_COMP_H
|
||||
# define OPENSSL_COMP_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_COMP_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_COMP
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/comperr.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
|
||||
const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
|
||||
int COMP_CTX_get_type(const COMP_CTX* comp);
|
||||
int COMP_get_type(const COMP_METHOD *meth);
|
||||
const char *COMP_get_name(const COMP_METHOD *meth);
|
||||
void COMP_CTX_free(COMP_CTX *ctx);
|
||||
|
||||
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
||||
unsigned char *in, int ilen);
|
||||
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
||||
unsigned char *in, int ilen);
|
||||
|
||||
COMP_METHOD *COMP_zlib(void);
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define COMP_zlib_cleanup() while(0) continue
|
||||
#endif
|
||||
|
||||
# ifdef OPENSSL_BIO_H
|
||||
# ifdef ZLIB
|
||||
const BIO_METHOD *BIO_f_zlib(void);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/conf.h.in
|
||||
*
|
||||
* Copyright 1995-2022 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_CONF_H
|
||||
# define OPENSSL_CONF_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_CONF_H
|
||||
# endif
|
||||
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/lhash.h>
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/conferr.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *section;
|
||||
char *name;
|
||||
char *value;
|
||||
} CONF_VALUE;
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE)
|
||||
#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
|
||||
#define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
||||
#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
|
||||
#define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n)))
|
||||
#define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n))
|
||||
#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i)))
|
||||
#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
|
||||
#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc))
|
||||
#define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx))
|
||||
#define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr)))
|
||||
#define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum)
|
||||
#define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc)))
|
||||
#define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
||||
DEFINE_LHASH_OF_INTERNAL(CONF_VALUE);
|
||||
#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)))
|
||||
#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
|
||||
#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
|
||||
|
||||
|
||||
struct conf_st;
|
||||
struct conf_method_st;
|
||||
typedef struct conf_method_st CONF_METHOD;
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# include <openssl/conftypes.h>
|
||||
# endif
|
||||
|
||||
/* Module definitions */
|
||||
typedef struct conf_imodule_st CONF_IMODULE;
|
||||
typedef struct conf_module_st CONF_MODULE;
|
||||
|
||||
STACK_OF(CONF_MODULE);
|
||||
STACK_OF(CONF_IMODULE);
|
||||
|
||||
/* DSO module function typedefs */
|
||||
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
|
||||
typedef void conf_finish_func (CONF_IMODULE *md);
|
||||
|
||||
# define CONF_MFLAGS_IGNORE_ERRORS 0x1
|
||||
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
|
||||
# define CONF_MFLAGS_SILENT 0x4
|
||||
# define CONF_MFLAGS_NO_DSO 0x8
|
||||
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
|
||||
# define CONF_MFLAGS_DEFAULT_SECTION 0x20
|
||||
|
||||
int CONF_set_default_method(CONF_METHOD *meth);
|
||||
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
|
||||
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
|
||||
long *eline);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
|
||||
long *eline);
|
||||
# endif
|
||||
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
|
||||
long *eline);
|
||||
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
|
||||
const char *section);
|
||||
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
||||
const char *name);
|
||||
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
||||
const char *name);
|
||||
void CONF_free(LHASH_OF(CONF_VALUE) *conf);
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
|
||||
#endif
|
||||
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define OPENSSL_no_config() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* New conf code. The semantics are different from the functions above. If
|
||||
* that wasn't the case, the above functions would have been replaced
|
||||
*/
|
||||
|
||||
CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
|
||||
OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
|
||||
CONF *NCONF_new(CONF_METHOD *meth);
|
||||
CONF_METHOD *NCONF_default(void);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
|
||||
#endif
|
||||
void NCONF_free(CONF *conf);
|
||||
void NCONF_free_data(CONF *conf);
|
||||
|
||||
int NCONF_load(CONF *conf, const char *file, long *eline);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
|
||||
# endif
|
||||
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
|
||||
STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
|
||||
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
|
||||
const char *section);
|
||||
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
|
||||
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
|
||||
long *result);
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
int NCONF_dump_fp(const CONF *conf, FILE *out);
|
||||
#endif
|
||||
int NCONF_dump_bio(const CONF *conf, BIO *out);
|
||||
|
||||
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
|
||||
|
||||
/* Module functions */
|
||||
|
||||
int CONF_modules_load(const CONF *cnf, const char *appname,
|
||||
unsigned long flags);
|
||||
int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
||||
const char *appname, unsigned long flags);
|
||||
int CONF_modules_load_file(const char *filename, const char *appname,
|
||||
unsigned long flags);
|
||||
void CONF_modules_unload(int all);
|
||||
void CONF_modules_finish(void);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define CONF_modules_free() while(0) continue
|
||||
#endif
|
||||
int CONF_module_add(const char *name, conf_init_func *ifunc,
|
||||
conf_finish_func *ffunc);
|
||||
|
||||
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
|
||||
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
|
||||
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
|
||||
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
|
||||
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
|
||||
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
|
||||
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
|
||||
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
|
||||
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
|
||||
|
||||
char *CONF_get1_default_config_file(void);
|
||||
|
||||
int CONF_parse_list(const char *list, int sep, int nospc,
|
||||
int (*list_cb) (const char *elem, int len, void *usr),
|
||||
void *arg);
|
||||
|
||||
void OPENSSL_load_builtin_modules(void);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_CONFERR_H
|
||||
# define OPENSSL_CONFERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* CONF reason codes.
|
||||
*/
|
||||
# define CONF_R_ERROR_LOADING_DSO 110
|
||||
# define CONF_R_INVALID_PRAGMA 122
|
||||
# define CONF_R_LIST_CANNOT_BE_NULL 115
|
||||
# define CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION 123
|
||||
# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
|
||||
# define CONF_R_MISSING_EQUAL_SIGN 101
|
||||
# define CONF_R_MISSING_INIT_FUNCTION 112
|
||||
# define CONF_R_MODULE_INITIALIZATION_ERROR 109
|
||||
# define CONF_R_NO_CLOSE_BRACE 102
|
||||
# define CONF_R_NO_CONF 105
|
||||
# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
|
||||
# define CONF_R_NO_SECTION 107
|
||||
# define CONF_R_NO_SUCH_FILE 114
|
||||
# define CONF_R_NO_VALUE 108
|
||||
# define CONF_R_NUMBER_TOO_LARGE 121
|
||||
# define CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION 124
|
||||
# define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111
|
||||
# define CONF_R_RECURSIVE_SECTION_REFERENCE 126
|
||||
# define CONF_R_RELATIVE_PATH 125
|
||||
# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117
|
||||
# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118
|
||||
# define CONF_R_SSL_SECTION_EMPTY 119
|
||||
# define CONF_R_SSL_SECTION_NOT_FOUND 120
|
||||
# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
|
||||
# define CONF_R_UNKNOWN_MODULE_NAME 113
|
||||
# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116
|
||||
# define CONF_R_VARIABLE_HAS_NO_VALUE 104
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,230 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by configdata.pm from Configurations/common0.tmpl, Configurations/unix-Makefile.tmpl
|
||||
* via Makefile.in
|
||||
*
|
||||
* Copyright 2016-2021 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_CONFIGURATION_H
|
||||
# define OPENSSL_CONFIGURATION_H
|
||||
# pragma once
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_ALGORITHM_DEFINES
|
||||
# error OPENSSL_ALGORITHM_DEFINES no longer supported
|
||||
# endif
|
||||
|
||||
/*
|
||||
* OpenSSL was configured with the following options:
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_SYS_VXWORKS
|
||||
# define OPENSSL_SYS_VXWORKS 1
|
||||
# endif
|
||||
# define OPENSSL_CONFIGURED_API 30100
|
||||
# ifndef OPENSSL_RAND_SEED_NONE
|
||||
# define OPENSSL_RAND_SEED_NONE
|
||||
# endif
|
||||
# ifndef OPENSSL_THREADS
|
||||
# define OPENSSL_THREADS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ACVP_TESTS
|
||||
# define OPENSSL_NO_ACVP_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_AFALGENG
|
||||
# define OPENSSL_NO_AFALGENG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ARIA
|
||||
# define OPENSSL_NO_ARIA
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ASAN
|
||||
# define OPENSSL_NO_ASAN
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ASM
|
||||
# define OPENSSL_NO_ASM
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_AUTOERRINIT
|
||||
# define OPENSSL_NO_AUTOERRINIT
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_BLAKE2
|
||||
# define OPENSSL_NO_BLAKE2
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAMELLIA
|
||||
# define OPENSSL_NO_CAMELLIA
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CHACHA
|
||||
# define OPENSSL_NO_CHACHA
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CMP
|
||||
# define OPENSSL_NO_CMP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CMS
|
||||
# define OPENSSL_NO_CMS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_COMP
|
||||
# define OPENSSL_NO_COMP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CRMF
|
||||
# define OPENSSL_NO_CRMF
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
# define OPENSSL_NO_CRYPTO_MDEBUG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
||||
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CT
|
||||
# define OPENSSL_NO_CT
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEVCRYPTOENG
|
||||
# define OPENSSL_NO_DEVCRYPTOENG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DSO
|
||||
# define OPENSSL_NO_DSO
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
# define OPENSSL_NO_EC2M
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
# define OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EGD
|
||||
# define OPENSSL_NO_EGD
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ERR
|
||||
# define OPENSSL_NO_ERR
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EXTERNAL_TESTS
|
||||
# define OPENSSL_NO_EXTERNAL_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FILENAMES
|
||||
# define OPENSSL_NO_FILENAMES
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FIPS_SECURITYCHECKS
|
||||
# define OPENSSL_NO_FIPS_SECURITYCHECKS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FUZZ_AFL
|
||||
# define OPENSSL_NO_FUZZ_AFL
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FUZZ_LIBFUZZER
|
||||
# define OPENSSL_NO_FUZZ_LIBFUZZER
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_KTLS
|
||||
# define OPENSSL_NO_KTLS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_LOADERENG
|
||||
# define OPENSSL_NO_LOADERENG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_MD2
|
||||
# define OPENSSL_NO_MD2
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_MSAN
|
||||
# define OPENSSL_NO_MSAN
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_MULTIBLOCK
|
||||
# define OPENSSL_NO_MULTIBLOCK
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_OCB
|
||||
# define OPENSSL_NO_OCB
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_PADLOCKENG
|
||||
# define OPENSSL_NO_PADLOCKENG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_POLY1305
|
||||
# define OPENSSL_NO_POLY1305
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_RC2
|
||||
# define OPENSSL_NO_RC2
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_RC5
|
||||
# define OPENSSL_NO_RC5
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_RDRAND
|
||||
# define OPENSSL_NO_RDRAND
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_RFC3779
|
||||
# define OPENSSL_NO_RFC3779
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SCRYPT
|
||||
# define OPENSSL_NO_SCRYPT
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# define OPENSSL_NO_SCTP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SEED
|
||||
# define OPENSSL_NO_SEED
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SIPHASH
|
||||
# define OPENSSL_NO_SIPHASH
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SM2
|
||||
# define OPENSSL_NO_SM2
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SM3
|
||||
# define OPENSSL_NO_SM3
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SM4
|
||||
# define OPENSSL_NO_SM4
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SRP
|
||||
# define OPENSSL_NO_SRP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SSL3
|
||||
# define OPENSSL_NO_SSL3
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SSL3_METHOD
|
||||
# define OPENSSL_NO_SSL3_METHOD
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TESTS
|
||||
# define OPENSSL_NO_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TRACE
|
||||
# define OPENSSL_NO_TRACE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_UBSAN
|
||||
# define OPENSSL_NO_UBSAN
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_UNIT_TEST
|
||||
# define OPENSSL_NO_UNIT_TEST
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_UPLINK
|
||||
# define OPENSSL_NO_UPLINK
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
|
||||
# define OPENSSL_NO_WEAK_SSL_CIPHERS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# define OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# endif
|
||||
|
||||
|
||||
/* Generate 80386 code? */
|
||||
# undef I386_ONLY
|
||||
|
||||
/*
|
||||
* The following are cipher-specific, but are part of the public API.
|
||||
*/
|
||||
# if !defined(OPENSSL_SYS_UEFI)
|
||||
# define BN_LLONG
|
||||
/* Only one for the following should be defined */
|
||||
# undef SIXTY_FOUR_BIT_LONG
|
||||
# undef SIXTY_FOUR_BIT
|
||||
# define THIRTY_TWO_BIT
|
||||
# endif
|
||||
|
||||
# define RC4_INT unsigned int
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* OPENSSL_CONFIGURATION_H */
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 1995-2021 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_CONFTYPES_H
|
||||
# define OPENSSL_CONFTYPES_H
|
||||
# pragma once
|
||||
|
||||
#ifndef OPENSSL_CONF_H
|
||||
# include <openssl/conf.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The contents of this file are deprecated and will be made opaque
|
||||
*/
|
||||
struct conf_method_st {
|
||||
const char *name;
|
||||
CONF *(*create) (CONF_METHOD *meth);
|
||||
int (*init) (CONF *conf);
|
||||
int (*destroy) (CONF *conf);
|
||||
int (*destroy_data) (CONF *conf);
|
||||
int (*load_bio) (CONF *conf, BIO *bp, long *eline);
|
||||
int (*dump) (const CONF *conf, BIO *bp);
|
||||
int (*is_number) (const CONF *conf, char c);
|
||||
int (*to_int) (const CONF *conf, char c);
|
||||
int (*load) (CONF *conf, const char *name, long *eline);
|
||||
};
|
||||
|
||||
struct conf_st {
|
||||
CONF_METHOD *meth;
|
||||
void *meth_data;
|
||||
LHASH_OF(CONF_VALUE) *data;
|
||||
int flag_dollarid;
|
||||
int flag_abspath;
|
||||
char *includedir;
|
||||
OSSL_LIB_CTX *libctx;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Copyright 2019-2021 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_CORE_H
|
||||
# define OPENSSL_CORE_H
|
||||
# pragma once
|
||||
|
||||
# include <stddef.h>
|
||||
# include <openssl/types.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* Base types
|
||||
* ----------
|
||||
*
|
||||
* These are the types that the OpenSSL core and providers have in common
|
||||
* to communicate data between them.
|
||||
*/
|
||||
|
||||
/* Opaque handles to be used with core upcall functions from providers */
|
||||
typedef struct ossl_core_handle_st OSSL_CORE_HANDLE;
|
||||
typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX;
|
||||
typedef struct ossl_core_bio_st OSSL_CORE_BIO;
|
||||
|
||||
/*
|
||||
* Dispatch table element. function_id numbers and the functions are defined
|
||||
* in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names.
|
||||
*
|
||||
* An array of these is always terminated by function_id == 0
|
||||
*/
|
||||
struct ossl_dispatch_st {
|
||||
int function_id;
|
||||
void (*function)(void);
|
||||
};
|
||||
|
||||
/*
|
||||
* Other items, essentially an int<->pointer map element.
|
||||
*
|
||||
* We make this type distinct from OSSL_DISPATCH to ensure that dispatch
|
||||
* tables remain tables with function pointers only.
|
||||
*
|
||||
* This is used whenever we need to pass things like a table of error reason
|
||||
* codes <-> reason string maps, ...
|
||||
*
|
||||
* Usage determines which field works as key if any, rather than field order.
|
||||
*
|
||||
* An array of these is always terminated by id == 0 && ptr == NULL
|
||||
*/
|
||||
struct ossl_item_st {
|
||||
unsigned int id;
|
||||
void *ptr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Type to tie together algorithm names, property definition string and
|
||||
* the algorithm implementation in the form of a dispatch table.
|
||||
*
|
||||
* An array of these is always terminated by algorithm_names == NULL
|
||||
*/
|
||||
struct ossl_algorithm_st {
|
||||
const char *algorithm_names; /* key */
|
||||
const char *property_definition; /* key */
|
||||
const OSSL_DISPATCH *implementation;
|
||||
const char *algorithm_description;
|
||||
};
|
||||
|
||||
/*
|
||||
* Type to pass object data in a uniform way, without exposing the object
|
||||
* structure.
|
||||
*
|
||||
* An array of these is always terminated by key == NULL
|
||||
*/
|
||||
struct ossl_param_st {
|
||||
const char *key; /* the name of the parameter */
|
||||
unsigned int data_type; /* declare what kind of content is in buffer */
|
||||
void *data; /* value being passed in or out */
|
||||
size_t data_size; /* data size */
|
||||
size_t return_size; /* returned content size */
|
||||
};
|
||||
|
||||
/* Currently supported OSSL_PARAM data types */
|
||||
/*
|
||||
* OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER
|
||||
* are arbitrary length and therefore require an arbitrarily sized buffer,
|
||||
* since they may be used to pass numbers larger than what is natively
|
||||
* available.
|
||||
*
|
||||
* The number must be buffered in native form, i.e. MSB first on B_ENDIAN
|
||||
* systems and LSB first on L_ENDIAN systems. This means that arbitrary
|
||||
* native integers can be stored in the buffer, just make sure that the
|
||||
* buffer size is correct and the buffer itself is properly aligned (for
|
||||
* example by having the buffer field point at a C integer).
|
||||
*/
|
||||
# define OSSL_PARAM_INTEGER 1
|
||||
# define OSSL_PARAM_UNSIGNED_INTEGER 2
|
||||
/*-
|
||||
* OSSL_PARAM_REAL
|
||||
* is a C binary floating point values in native form and alignment.
|
||||
*/
|
||||
# define OSSL_PARAM_REAL 3
|
||||
/*-
|
||||
* OSSL_PARAM_UTF8_STRING
|
||||
* is a printable string. It is expected to be printed as it is.
|
||||
*/
|
||||
# define OSSL_PARAM_UTF8_STRING 4
|
||||
/*-
|
||||
* OSSL_PARAM_OCTET_STRING
|
||||
* is a string of bytes with no further specification. It is expected to be
|
||||
* printed as a hexdump.
|
||||
*/
|
||||
# define OSSL_PARAM_OCTET_STRING 5
|
||||
/*-
|
||||
* OSSL_PARAM_UTF8_PTR
|
||||
* is a pointer to a printable string. It is expected to be printed as it is.
|
||||
*
|
||||
* The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers
|
||||
* are manipulated for this type.
|
||||
*
|
||||
* This is more relevant for parameter requests, where the responding
|
||||
* function doesn't need to copy the data to the provided buffer, but
|
||||
* sets the provided buffer to point at the actual data instead.
|
||||
*
|
||||
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
||||
* data and its location are constant.
|
||||
*
|
||||
* EXTRA WARNING! If you are not completely sure you most likely want
|
||||
* to use the OSSL_PARAM_UTF8_STRING type.
|
||||
*/
|
||||
# define OSSL_PARAM_UTF8_PTR 6
|
||||
/*-
|
||||
* OSSL_PARAM_OCTET_PTR
|
||||
* is a pointer to a string of bytes with no further specification. It is
|
||||
* expected to be printed as a hexdump.
|
||||
*
|
||||
* The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers
|
||||
* are manipulated for this type.
|
||||
*
|
||||
* This is more relevant for parameter requests, where the responding
|
||||
* function doesn't need to copy the data to the provided buffer, but
|
||||
* sets the provided buffer to point at the actual data instead.
|
||||
*
|
||||
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
||||
* data and its location are constant.
|
||||
*
|
||||
* EXTRA WARNING! If you are not completely sure you most likely want
|
||||
* to use the OSSL_PARAM_OCTET_STRING type.
|
||||
*/
|
||||
# define OSSL_PARAM_OCTET_PTR 7
|
||||
|
||||
/*
|
||||
* Typedef for the thread stop handling callback. Used both internally and by
|
||||
* providers.
|
||||
*
|
||||
* Providers may register for notifications about threads stopping by
|
||||
* registering a callback to hear about such events. Providers register the
|
||||
* callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch
|
||||
* table passed to OSSL_provider_init(). The arg passed back to a provider will
|
||||
* be the provider side context object.
|
||||
*/
|
||||
typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
|
||||
|
||||
|
||||
/*-
|
||||
* Provider entry point
|
||||
* --------------------
|
||||
*
|
||||
* This function is expected to be present in any dynamically loadable
|
||||
* provider module. By definition, if this function doesn't exist in a
|
||||
* module, that module is not an OpenSSL provider module.
|
||||
*/
|
||||
/*-
|
||||
* |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used
|
||||
* together with some functions passed via |in| to query data.
|
||||
* |in| is the array of functions that the Core passes to the provider.
|
||||
* |out| will be the array of base functions that the provider passes
|
||||
* back to the Core.
|
||||
* |provctx| a provider side context object, optionally created if the
|
||||
* provider needs it. This value is passed to other provider
|
||||
* functions, notably other context constructors.
|
||||
*/
|
||||
typedef int (OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in,
|
||||
const OSSL_DISPATCH **out,
|
||||
void **provctx);
|
||||
# ifdef __VMS
|
||||
# pragma names save
|
||||
# pragma names uppercase,truncated
|
||||
# endif
|
||||
OPENSSL_EXPORT OSSL_provider_init_fn OSSL_provider_init;
|
||||
# ifdef __VMS
|
||||
# pragma names restore
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Generic callback function signature.
|
||||
*
|
||||
* The expectation is that any provider function that wants to offer
|
||||
* a callback / hook can do so by taking an argument with this type,
|
||||
* as well as a pointer to caller-specific data. When calling the
|
||||
* callback, the provider function can populate an OSSL_PARAM array
|
||||
* with data of its choice and pass that in the callback call, along
|
||||
* with the caller data argument.
|
||||
*
|
||||
* libcrypto may use the OSSL_PARAM array to create arguments for an
|
||||
* application callback it knows about.
|
||||
*/
|
||||
typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
|
||||
typedef int (OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[],
|
||||
OSSL_PARAM out_params[], void *arg);
|
||||
/*
|
||||
* Passphrase callback function signature
|
||||
*
|
||||
* This is similar to the generic callback function above, but adds a
|
||||
* result parameter.
|
||||
*/
|
||||
typedef int (OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
|
||||
size_t *pass_len,
|
||||
const OSSL_PARAM params[], void *arg);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,960 @@
|
||||
/*
|
||||
* Copyright 2019-2023 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_CORE_NUMBERS_H
|
||||
# define OPENSSL_CORE_NUMBERS_H
|
||||
# pragma once
|
||||
|
||||
# include <stdarg.h>
|
||||
# include <openssl/core.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* Identities
|
||||
* ----------
|
||||
*
|
||||
* All series start with 1, to allow 0 to be an array terminator.
|
||||
* For any FUNC identity, we also provide a function signature typedef
|
||||
* and a static inline function to extract a function pointer from a
|
||||
* OSSL_DISPATCH element in a type safe manner.
|
||||
*
|
||||
* Names:
|
||||
* for any function base name 'foo' (uppercase form 'FOO'), we will have
|
||||
* the following:
|
||||
* - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
|
||||
* thereof (to be specified further down)
|
||||
* - a function signature typedef with the name OSSL_FUNC_'foo'_fn
|
||||
* - a function pointer extractor function with the name OSSL_FUNC_'foo'
|
||||
*/
|
||||
|
||||
/*
|
||||
* Helper macro to create the function signature typedef and the extractor
|
||||
* |type| is the return-type of the function, |name| is the name of the
|
||||
* function to fetch, and |args| is a parenthesized list of parameters
|
||||
* for the function (that is, it is |name|'s function signature).
|
||||
* Note: This is considered a "reserved" internal macro. Applications should
|
||||
* not use this or assume its existence.
|
||||
*/
|
||||
#define OSSL_CORE_MAKE_FUNC(type,name,args) \
|
||||
typedef type (OSSL_FUNC_##name##_fn)args; \
|
||||
static ossl_unused ossl_inline \
|
||||
OSSL_FUNC_##name##_fn *OSSL_FUNC_##name(const OSSL_DISPATCH *opf) \
|
||||
{ \
|
||||
return (OSSL_FUNC_##name##_fn *)opf->function; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Core function identities, for the two OSSL_DISPATCH tables being passed
|
||||
* in the OSSL_provider_init call.
|
||||
*
|
||||
* 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
|
||||
* therefore NEVER be used as a function identity.
|
||||
*/
|
||||
/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
|
||||
# define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
||||
core_gettable_params,(const OSSL_CORE_HANDLE *prov))
|
||||
# define OSSL_FUNC_CORE_GET_PARAMS 2
|
||||
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
|
||||
OSSL_PARAM params[]))
|
||||
# define OSSL_FUNC_CORE_THREAD_START 3
|
||||
OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
|
||||
OSSL_thread_stop_handler_fn handfn,
|
||||
void *arg))
|
||||
# define OSSL_FUNC_CORE_GET_LIBCTX 4
|
||||
OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_libctx,
|
||||
(const OSSL_CORE_HANDLE *prov))
|
||||
# define OSSL_FUNC_CORE_NEW_ERROR 5
|
||||
OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
|
||||
# define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
|
||||
OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
|
||||
(const OSSL_CORE_HANDLE *prov,
|
||||
const char *file, int line, const char *func))
|
||||
# define OSSL_FUNC_CORE_VSET_ERROR 7
|
||||
OSSL_CORE_MAKE_FUNC(void,core_vset_error,
|
||||
(const OSSL_CORE_HANDLE *prov,
|
||||
uint32_t reason, const char *fmt, va_list args))
|
||||
# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
|
||||
OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
|
||||
# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
|
||||
OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
|
||||
(const OSSL_CORE_HANDLE *prov))
|
||||
# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
|
||||
OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
|
||||
|
||||
|
||||
/* Functions to access the OBJ database */
|
||||
|
||||
#define OSSL_FUNC_CORE_OBJ_ADD_SIGID 11
|
||||
#define OSSL_FUNC_CORE_OBJ_CREATE 12
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, core_obj_add_sigid,
|
||||
(const OSSL_CORE_HANDLE *prov, const char *sign_name,
|
||||
const char *digest_name, const char *pkey_name))
|
||||
OSSL_CORE_MAKE_FUNC(int, core_obj_create,
|
||||
(const OSSL_CORE_HANDLE *prov, const char *oid,
|
||||
const char *sn, const char *ln))
|
||||
|
||||
/* Memory allocation, freeing, clearing. */
|
||||
#define OSSL_FUNC_CRYPTO_MALLOC 20
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_malloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_ZALLOC 21
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_zalloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_FREE 22
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_free, (void *ptr, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_REALLOC 24
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
|
||||
const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_secure_malloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
|
||||
OSSL_CORE_MAKE_FUNC(void *,
|
||||
CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_FREE 28
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_secure_free, (void *ptr, const char *file, int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
|
||||
int line))
|
||||
#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
|
||||
OSSL_CORE_MAKE_FUNC(int,
|
||||
CRYPTO_secure_allocated, (const void *ptr))
|
||||
#define OSSL_FUNC_OPENSSL_CLEANSE 31
|
||||
OSSL_CORE_MAKE_FUNC(void,
|
||||
OPENSSL_cleanse, (void *ptr, size_t len))
|
||||
|
||||
/* Bio functions provided by the core */
|
||||
#define OSSL_FUNC_BIO_NEW_FILE 40
|
||||
#define OSSL_FUNC_BIO_NEW_MEMBUF 41
|
||||
#define OSSL_FUNC_BIO_READ_EX 42
|
||||
#define OSSL_FUNC_BIO_WRITE_EX 43
|
||||
#define OSSL_FUNC_BIO_UP_REF 44
|
||||
#define OSSL_FUNC_BIO_FREE 45
|
||||
#define OSSL_FUNC_BIO_VPRINTF 46
|
||||
#define OSSL_FUNC_BIO_VSNPRINTF 47
|
||||
#define OSSL_FUNC_BIO_PUTS 48
|
||||
#define OSSL_FUNC_BIO_GETS 49
|
||||
#define OSSL_FUNC_BIO_CTRL 50
|
||||
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
|
||||
const char *mode))
|
||||
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
|
||||
size_t data_len, size_t *bytes_read))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
|
||||
size_t data_len, size_t *written))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO *bio, char *buf, int size))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO *bio, const char *str))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO *bio))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
|
||||
va_list args))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
|
||||
(char *buf, size_t n, const char *fmt, va_list args))
|
||||
OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio,
|
||||
int cmd, long num, void *ptr))
|
||||
|
||||
/* New seeding functions prototypes with the 101-104 series */
|
||||
#define OSSL_FUNC_CLEANUP_USER_ENTROPY 96
|
||||
#define OSSL_FUNC_CLEANUP_USER_NONCE 97
|
||||
#define OSSL_FUNC_GET_USER_ENTROPY 98
|
||||
#define OSSL_FUNC_GET_USER_NONCE 99
|
||||
|
||||
#define OSSL_FUNC_SELF_TEST_CB 100
|
||||
OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
|
||||
void **cbarg))
|
||||
|
||||
/* Functions to get seed material from the operating system */
|
||||
#define OSSL_FUNC_GET_ENTROPY 101
|
||||
#define OSSL_FUNC_CLEANUP_ENTROPY 102
|
||||
#define OSSL_FUNC_GET_NONCE 103
|
||||
#define OSSL_FUNC_CLEANUP_NONCE 104
|
||||
OSSL_CORE_MAKE_FUNC(size_t, get_entropy, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char **pout, int entropy,
|
||||
size_t min_len, size_t max_len))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, get_user_entropy, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char **pout, int entropy,
|
||||
size_t min_len, size_t max_len))
|
||||
OSSL_CORE_MAKE_FUNC(void, cleanup_entropy, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char *buf, size_t len))
|
||||
OSSL_CORE_MAKE_FUNC(void, cleanup_user_entropy, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char *buf, size_t len))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, get_nonce, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char **pout, size_t min_len,
|
||||
size_t max_len, const void *salt,
|
||||
size_t salt_len))
|
||||
OSSL_CORE_MAKE_FUNC(size_t, get_user_nonce, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char **pout, size_t min_len,
|
||||
size_t max_len, const void *salt,
|
||||
size_t salt_len))
|
||||
OSSL_CORE_MAKE_FUNC(void, cleanup_nonce, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char *buf, size_t len))
|
||||
OSSL_CORE_MAKE_FUNC(void, cleanup_user_nonce, (const OSSL_CORE_HANDLE *handle,
|
||||
unsigned char *buf, size_t len))
|
||||
|
||||
/* Functions to access the core's providers */
|
||||
#define OSSL_FUNC_PROVIDER_REGISTER_CHILD_CB 105
|
||||
#define OSSL_FUNC_PROVIDER_DEREGISTER_CHILD_CB 106
|
||||
#define OSSL_FUNC_PROVIDER_NAME 107
|
||||
#define OSSL_FUNC_PROVIDER_GET0_PROVIDER_CTX 108
|
||||
#define OSSL_FUNC_PROVIDER_GET0_DISPATCH 109
|
||||
#define OSSL_FUNC_PROVIDER_UP_REF 110
|
||||
#define OSSL_FUNC_PROVIDER_FREE 111
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, provider_register_child_cb,
|
||||
(const OSSL_CORE_HANDLE *handle,
|
||||
int (*create_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
|
||||
int (*remove_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
|
||||
int (*global_props_cb)(const char *props, void *cbdata),
|
||||
void *cbdata))
|
||||
OSSL_CORE_MAKE_FUNC(void, provider_deregister_child_cb,
|
||||
(const OSSL_CORE_HANDLE *handle))
|
||||
OSSL_CORE_MAKE_FUNC(const char *, provider_name,
|
||||
(const OSSL_CORE_HANDLE *prov))
|
||||
OSSL_CORE_MAKE_FUNC(void *, provider_get0_provider_ctx,
|
||||
(const OSSL_CORE_HANDLE *prov))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, provider_get0_dispatch,
|
||||
(const OSSL_CORE_HANDLE *prov))
|
||||
OSSL_CORE_MAKE_FUNC(int, provider_up_ref,
|
||||
(const OSSL_CORE_HANDLE *prov, int activate))
|
||||
OSSL_CORE_MAKE_FUNC(int, provider_free,
|
||||
(const OSSL_CORE_HANDLE *prov, int deactivate))
|
||||
|
||||
/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
|
||||
# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
|
||||
OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
|
||||
# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
||||
provider_gettable_params,(void *provctx))
|
||||
# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
|
||||
OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
|
||||
OSSL_PARAM params[]))
|
||||
# define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
|
||||
(void *provctx, int operation_id, int *no_store))
|
||||
# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028
|
||||
OSSL_CORE_MAKE_FUNC(void, provider_unquery_operation,
|
||||
(void *provctx, int operation_id, const OSSL_ALGORITHM *))
|
||||
# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
|
||||
(void *provctx))
|
||||
# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030
|
||||
OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx,
|
||||
const char *capability, OSSL_CALLBACK *cb, void *arg))
|
||||
# define OSSL_FUNC_PROVIDER_SELF_TEST 1031
|
||||
OSSL_CORE_MAKE_FUNC(int, provider_self_test, (void *provctx))
|
||||
|
||||
/* Operations */
|
||||
|
||||
# define OSSL_OP_DIGEST 1
|
||||
# define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
|
||||
# define OSSL_OP_MAC 3
|
||||
# define OSSL_OP_KDF 4
|
||||
# define OSSL_OP_RAND 5
|
||||
# define OSSL_OP_KEYMGMT 10
|
||||
# define OSSL_OP_KEYEXCH 11
|
||||
# define OSSL_OP_SIGNATURE 12
|
||||
# define OSSL_OP_ASYM_CIPHER 13
|
||||
# define OSSL_OP_KEM 14
|
||||
/* New section for non-EVP operations */
|
||||
# define OSSL_OP_ENCODER 20
|
||||
# define OSSL_OP_DECODER 21
|
||||
# define OSSL_OP_STORE 22
|
||||
/* Highest known operation number */
|
||||
# define OSSL_OP__HIGHEST 22
|
||||
|
||||
/* Digests */
|
||||
|
||||
# define OSSL_FUNC_DIGEST_NEWCTX 1
|
||||
# define OSSL_FUNC_DIGEST_INIT 2
|
||||
# define OSSL_FUNC_DIGEST_UPDATE 3
|
||||
# define OSSL_FUNC_DIGEST_FINAL 4
|
||||
# define OSSL_FUNC_DIGEST_DIGEST 5
|
||||
# define OSSL_FUNC_DIGEST_FREECTX 6
|
||||
# define OSSL_FUNC_DIGEST_DUPCTX 7
|
||||
# define OSSL_FUNC_DIGEST_GET_PARAMS 8
|
||||
# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
|
||||
# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
|
||||
# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
|
||||
# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
|
||||
# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_update,
|
||||
(void *dctx, const unsigned char *in, size_t inl))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_final,
|
||||
(void *dctx,
|
||||
unsigned char *out, size_t *outl, size_t outsz))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_digest,
|
||||
(void *provctx, const unsigned char *in, size_t inl,
|
||||
unsigned char *out, size_t *outl, size_t outsz))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void, digest_freectx, (void *dctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, digest_dupctx, (void *dctx))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_set_ctx_params,
|
||||
(void *vctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, digest_get_ctx_params,
|
||||
(void *vctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_params,
|
||||
(void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params,
|
||||
(void *dctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params,
|
||||
(void *dctx, void *provctx))
|
||||
|
||||
/* Symmetric Ciphers */
|
||||
|
||||
# define OSSL_FUNC_CIPHER_NEWCTX 1
|
||||
# define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
|
||||
# define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
|
||||
# define OSSL_FUNC_CIPHER_UPDATE 4
|
||||
# define OSSL_FUNC_CIPHER_FINAL 5
|
||||
# define OSSL_FUNC_CIPHER_CIPHER 6
|
||||
# define OSSL_FUNC_CIPHER_FREECTX 7
|
||||
# define OSSL_FUNC_CIPHER_DUPCTX 8
|
||||
# define OSSL_FUNC_CIPHER_GET_PARAMS 9
|
||||
# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
|
||||
# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
|
||||
# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
|
||||
# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
|
||||
# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, cipher_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_init, (void *cctx,
|
||||
const unsigned char *key,
|
||||
size_t keylen,
|
||||
const unsigned char *iv,
|
||||
size_t ivlen,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_init, (void *cctx,
|
||||
const unsigned char *key,
|
||||
size_t keylen,
|
||||
const unsigned char *iv,
|
||||
size_t ivlen,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_update,
|
||||
(void *cctx,
|
||||
unsigned char *out, size_t *outl, size_t outsize,
|
||||
const unsigned char *in, size_t inl))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_final,
|
||||
(void *cctx,
|
||||
unsigned char *out, size_t *outl, size_t outsize))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_cipher,
|
||||
(void *cctx,
|
||||
unsigned char *out, size_t *outl, size_t outsize,
|
||||
const unsigned char *in, size_t inl))
|
||||
OSSL_CORE_MAKE_FUNC(void, cipher_freectx, (void *cctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, cipher_dupctx, (void *cctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_get_ctx_params, (void *cctx,
|
||||
OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, cipher_set_ctx_params, (void *cctx,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_params,
|
||||
(void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_settable_ctx_params,
|
||||
(void *cctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params,
|
||||
(void *cctx, void *provctx))
|
||||
|
||||
/* MACs */
|
||||
|
||||
# define OSSL_FUNC_MAC_NEWCTX 1
|
||||
# define OSSL_FUNC_MAC_DUPCTX 2
|
||||
# define OSSL_FUNC_MAC_FREECTX 3
|
||||
# define OSSL_FUNC_MAC_INIT 4
|
||||
# define OSSL_FUNC_MAC_UPDATE 5
|
||||
# define OSSL_FUNC_MAC_FINAL 6
|
||||
# define OSSL_FUNC_MAC_GET_PARAMS 7
|
||||
# define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
|
||||
# define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
|
||||
# define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
|
||||
# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
|
||||
# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src))
|
||||
OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx, const unsigned char *key,
|
||||
size_t keylen, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_update,
|
||||
(void *mctx, const unsigned char *in, size_t inl))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_final,
|
||||
(void *mctx,
|
||||
unsigned char *out, size_t *outl, size_t outsize))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_params, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_ctx_params,
|
||||
(void *mctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_settable_ctx_params,
|
||||
(void *mctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_get_ctx_params,
|
||||
(void *mctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params,
|
||||
(void *mctx, const OSSL_PARAM params[]))
|
||||
|
||||
/* KDFs and PRFs */
|
||||
|
||||
# define OSSL_FUNC_KDF_NEWCTX 1
|
||||
# define OSSL_FUNC_KDF_DUPCTX 2
|
||||
# define OSSL_FUNC_KDF_FREECTX 3
|
||||
# define OSSL_FUNC_KDF_RESET 4
|
||||
# define OSSL_FUNC_KDF_DERIVE 5
|
||||
# define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
|
||||
# define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
|
||||
# define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
|
||||
# define OSSL_FUNC_KDF_GET_PARAMS 9
|
||||
# define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
|
||||
# define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src))
|
||||
OSSL_CORE_MAKE_FUNC(void, kdf_freectx, (void *kctx))
|
||||
OSSL_CORE_MAKE_FUNC(void, kdf_reset, (void *kctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, kdf_derive, (void *kctx, unsigned char *key,
|
||||
size_t keylen, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_params, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_ctx_params,
|
||||
(void *kctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_settable_ctx_params,
|
||||
(void *kctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, kdf_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params,
|
||||
(void *kctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params,
|
||||
(void *kctx, const OSSL_PARAM params[]))
|
||||
|
||||
/* RAND */
|
||||
|
||||
# define OSSL_FUNC_RAND_NEWCTX 1
|
||||
# define OSSL_FUNC_RAND_FREECTX 2
|
||||
# define OSSL_FUNC_RAND_INSTANTIATE 3
|
||||
# define OSSL_FUNC_RAND_UNINSTANTIATE 4
|
||||
# define OSSL_FUNC_RAND_GENERATE 5
|
||||
# define OSSL_FUNC_RAND_RESEED 6
|
||||
# define OSSL_FUNC_RAND_NONCE 7
|
||||
# define OSSL_FUNC_RAND_ENABLE_LOCKING 8
|
||||
# define OSSL_FUNC_RAND_LOCK 9
|
||||
# define OSSL_FUNC_RAND_UNLOCK 10
|
||||
# define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
|
||||
# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
|
||||
# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
|
||||
# define OSSL_FUNC_RAND_GET_PARAMS 14
|
||||
# define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
|
||||
# define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
|
||||
# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17
|
||||
# define OSSL_FUNC_RAND_GET_SEED 18
|
||||
# define OSSL_FUNC_RAND_CLEAR_SEED 19
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *,rand_newctx,
|
||||
(void *provctx, void *parent,
|
||||
const OSSL_DISPATCH *parent_calls))
|
||||
OSSL_CORE_MAKE_FUNC(void,rand_freectx, (void *vctx))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_instantiate,
|
||||
(void *vdrbg, unsigned int strength,
|
||||
int prediction_resistance,
|
||||
const unsigned char *pstr, size_t pstr_len,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_uninstantiate, (void *vdrbg))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_generate,
|
||||
(void *vctx, unsigned char *out, size_t outlen,
|
||||
unsigned int strength, int prediction_resistance,
|
||||
const unsigned char *addin, size_t addin_len))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_reseed,
|
||||
(void *vctx, int prediction_resistance,
|
||||
const unsigned char *ent, size_t ent_len,
|
||||
const unsigned char *addin, size_t addin_len))
|
||||
OSSL_CORE_MAKE_FUNC(size_t,rand_nonce,
|
||||
(void *vctx, unsigned char *out, unsigned int strength,
|
||||
size_t min_noncelen, size_t max_noncelen))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_enable_locking, (void *vctx))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_lock, (void *vctx))
|
||||
OSSL_CORE_MAKE_FUNC(void,rand_unlock, (void *vctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_params, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_ctx_params,
|
||||
(void *vctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_settable_ctx_params,
|
||||
(void *vctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_get_ctx_params,
|
||||
(void *vctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_set_ctx_params,
|
||||
(void *vctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(void,rand_set_callbacks,
|
||||
(void *vctx, OSSL_INOUT_CALLBACK *get_entropy,
|
||||
OSSL_CALLBACK *cleanup_entropy,
|
||||
OSSL_INOUT_CALLBACK *get_nonce,
|
||||
OSSL_CALLBACK *cleanup_nonce, void *arg))
|
||||
OSSL_CORE_MAKE_FUNC(int,rand_verify_zeroization,
|
||||
(void *vctx))
|
||||
OSSL_CORE_MAKE_FUNC(size_t,rand_get_seed,
|
||||
(void *vctx, unsigned char **buffer,
|
||||
int entropy, size_t min_len, size_t max_len,
|
||||
int prediction_resistance,
|
||||
const unsigned char *adin, size_t adin_len))
|
||||
OSSL_CORE_MAKE_FUNC(void,rand_clear_seed,
|
||||
(void *vctx, unsigned char *buffer, size_t b_len))
|
||||
|
||||
/*-
|
||||
* Key management
|
||||
*
|
||||
* The Key Management takes care of provider side key objects, and includes
|
||||
* all current functionality to create them, destroy them, set parameters
|
||||
* and key material, etc, essentially everything that manipulates the keys
|
||||
* themselves and their parameters.
|
||||
*
|
||||
* The key objects are commonly referred to as |keydata|, and it MUST be able
|
||||
* to contain parameters if the key has any, the public key and the private
|
||||
* key. All parts are optional, but their presence determines what can be
|
||||
* done with the key object in terms of encryption, signature, and so on.
|
||||
* The assumption from libcrypto is that the key object contains any of the
|
||||
* following data combinations:
|
||||
*
|
||||
* - parameters only
|
||||
* - public key only
|
||||
* - public key + private key
|
||||
* - parameters + public key
|
||||
* - parameters + public key + private key
|
||||
*
|
||||
* What "parameters", "public key" and "private key" means in detail is left
|
||||
* to the implementation. In the case of DH and DSA, they would typically
|
||||
* include domain parameters, while for certain variants of RSA, they would
|
||||
* typically include PSS or OAEP parameters.
|
||||
*
|
||||
* Key objects are created with OSSL_FUNC_keymgmt_new() and destroyed with
|
||||
* OSSL_FUNC_keymgmt_free(). Key objects can have data filled in with
|
||||
* OSSL_FUNC_keymgmt_import().
|
||||
*
|
||||
* Three functions are made available to check what selection of data is
|
||||
* present in a key object: OSSL_FUNC_keymgmt_has_parameters(),
|
||||
* OSSL_FUNC_keymgmt_has_public_key(), and OSSL_FUNC_keymgmt_has_private_key(),
|
||||
*/
|
||||
|
||||
/* Key data subset selection - individual bits */
|
||||
# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
|
||||
# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
|
||||
# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
|
||||
# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
|
||||
|
||||
/* Key data subset selection - combinations */
|
||||
# define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
|
||||
( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
|
||||
| OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
|
||||
# define OSSL_KEYMGMT_SELECT_KEYPAIR \
|
||||
( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
|
||||
# define OSSL_KEYMGMT_SELECT_ALL \
|
||||
( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
|
||||
|
||||
# define OSSL_KEYMGMT_VALIDATE_FULL_CHECK 0
|
||||
# define OSSL_KEYMGMT_VALIDATE_QUICK_CHECK 1
|
||||
|
||||
/* Basic key object creation */
|
||||
# define OSSL_FUNC_KEYMGMT_NEW 1
|
||||
OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx))
|
||||
|
||||
/* Generation, a more complex constructor */
|
||||
# define OSSL_FUNC_KEYMGMT_GEN_INIT 2
|
||||
# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
|
||||
# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
|
||||
# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
|
||||
# define OSSL_FUNC_KEYMGMT_GEN 6
|
||||
# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
|
||||
OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen_init,
|
||||
(void *provctx, int selection, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_template,
|
||||
(void *genctx, void *templ))
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_params,
|
||||
(void *genctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
||||
keymgmt_gen_settable_params,
|
||||
(void *genctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen,
|
||||
(void *genctx, OSSL_CALLBACK *cb, void *cbarg))
|
||||
OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx))
|
||||
|
||||
/* Key loading by object reference */
|
||||
# define OSSL_FUNC_KEYMGMT_LOAD 8
|
||||
OSSL_CORE_MAKE_FUNC(void *, keymgmt_load,
|
||||
(const void *reference, size_t reference_sz))
|
||||
|
||||
/* Basic key object destruction */
|
||||
# define OSSL_FUNC_KEYMGMT_FREE 10
|
||||
OSSL_CORE_MAKE_FUNC(void, keymgmt_free, (void *keydata))
|
||||
|
||||
/* Key object information, with discovery */
|
||||
#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
|
||||
#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_get_params,
|
||||
(void *keydata, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gettable_params,
|
||||
(void *provctx))
|
||||
|
||||
#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
|
||||
#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_set_params,
|
||||
(void *keydata, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_settable_params,
|
||||
(void *provctx))
|
||||
|
||||
/* Key checks - discovery of supported operations */
|
||||
# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
|
||||
OSSL_CORE_MAKE_FUNC(const char *, keymgmt_query_operation_name,
|
||||
(int operation_id))
|
||||
|
||||
/* Key checks - key data content checks */
|
||||
# define OSSL_FUNC_KEYMGMT_HAS 21
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_has, (const void *keydata, int selection))
|
||||
|
||||
/* Key checks - validation */
|
||||
# define OSSL_FUNC_KEYMGMT_VALIDATE 22
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_validate, (const void *keydata, int selection,
|
||||
int checktype))
|
||||
|
||||
/* Key checks - matching */
|
||||
# define OSSL_FUNC_KEYMGMT_MATCH 23
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_match,
|
||||
(const void *keydata1, const void *keydata2,
|
||||
int selection))
|
||||
|
||||
/* Import and export functions, with discovery */
|
||||
# define OSSL_FUNC_KEYMGMT_IMPORT 40
|
||||
# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
|
||||
# define OSSL_FUNC_KEYMGMT_EXPORT 42
|
||||
# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_import,
|
||||
(void *keydata, int selection, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types,
|
||||
(int selection))
|
||||
OSSL_CORE_MAKE_FUNC(int, keymgmt_export,
|
||||
(void *keydata, int selection,
|
||||
OSSL_CALLBACK *param_cb, void *cbarg))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types,
|
||||
(int selection))
|
||||
|
||||
/* Dup function, constructor */
|
||||
# define OSSL_FUNC_KEYMGMT_DUP 44
|
||||
OSSL_CORE_MAKE_FUNC(void *, keymgmt_dup,
|
||||
(const void *keydata_from, int selection))
|
||||
|
||||
/* Key Exchange */
|
||||
|
||||
# define OSSL_FUNC_KEYEXCH_NEWCTX 1
|
||||
# define OSSL_FUNC_KEYEXCH_INIT 2
|
||||
# define OSSL_FUNC_KEYEXCH_DERIVE 3
|
||||
# define OSSL_FUNC_KEYEXCH_SET_PEER 4
|
||||
# define OSSL_FUNC_KEYEXCH_FREECTX 5
|
||||
# define OSSL_FUNC_KEYEXCH_DUPCTX 6
|
||||
# define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
|
||||
# define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
|
||||
# define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
|
||||
# define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, keyexch_derive, (void *ctx, unsigned char *secret,
|
||||
size_t *secretlen, size_t outlen))
|
||||
OSSL_CORE_MAKE_FUNC(int, keyexch_set_peer, (void *ctx, void *provkey))
|
||||
OSSL_CORE_MAKE_FUNC(void, keyexch_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, keyexch_dupctx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, keyexch_set_ctx_params, (void *ctx,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx,
|
||||
OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
|
||||
/* Signature */
|
||||
|
||||
# define OSSL_FUNC_SIGNATURE_NEWCTX 1
|
||||
# define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
|
||||
# define OSSL_FUNC_SIGNATURE_SIGN 3
|
||||
# define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
|
||||
# define OSSL_FUNC_SIGNATURE_VERIFY 5
|
||||
# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
|
||||
# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
|
||||
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
|
||||
# define OSSL_FUNC_SIGNATURE_FREECTX 16
|
||||
# define OSSL_FUNC_SIGNATURE_DUPCTX 17
|
||||
# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
|
||||
# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
|
||||
# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
|
||||
# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
|
||||
# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
|
||||
# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
|
||||
# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
|
||||
# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, signature_newctx, (void *provctx,
|
||||
const char *propq))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_sign_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_sign, (void *ctx, unsigned char *sig,
|
||||
size_t *siglen, size_t sigsize,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_verify_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_verify, (void *ctx,
|
||||
const unsigned char *sig,
|
||||
size_t siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_verify_recover_init,
|
||||
(void *ctx, void *provkey, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_verify_recover,
|
||||
(void *ctx, unsigned char *rout, size_t *routlen,
|
||||
size_t routsize, const unsigned char *sig, size_t siglen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_init,
|
||||
(void *ctx, const char *mdname, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_update,
|
||||
(void *ctx, const unsigned char *data, size_t datalen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_final,
|
||||
(void *ctx, unsigned char *sig, size_t *siglen,
|
||||
size_t sigsize))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign,
|
||||
(void *ctx, unsigned char *sigret, size_t *siglen,
|
||||
size_t sigsize, const unsigned char *tbs, size_t tbslen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_init,
|
||||
(void *ctx, const char *mdname, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_update,
|
||||
(void *ctx, const unsigned char *data, size_t datalen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_final,
|
||||
(void *ctx, const unsigned char *sig, size_t siglen))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify,
|
||||
(void *ctx, const unsigned char *sig, size_t siglen,
|
||||
const unsigned char *tbs, size_t tbslen))
|
||||
OSSL_CORE_MAKE_FUNC(void, signature_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, signature_dupctx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_params,
|
||||
(void *ctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_md_params,
|
||||
(void *ctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_md_params,
|
||||
(void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_md_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params,
|
||||
(void *ctx))
|
||||
|
||||
|
||||
/* Asymmetric Ciphers */
|
||||
|
||||
# define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
|
||||
# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
|
||||
# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
|
||||
# define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
|
||||
# define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
|
||||
# define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
|
||||
# define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
|
||||
# define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
|
||||
# define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
|
||||
# define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
|
||||
# define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, asym_cipher_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt, (void *ctx, unsigned char *out,
|
||||
size_t *outlen,
|
||||
size_t outsize,
|
||||
const unsigned char *in,
|
||||
size_t inlen))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt, (void *ctx, unsigned char *out,
|
||||
size_t *outlen,
|
||||
size_t outsize,
|
||||
const unsigned char *in,
|
||||
size_t inlen))
|
||||
OSSL_CORE_MAKE_FUNC(void, asym_cipher_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, asym_cipher_dupctx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_get_ctx_params,
|
||||
(void *ctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_gettable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, asym_cipher_set_ctx_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_settable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
|
||||
/* Asymmetric Key encapsulation */
|
||||
# define OSSL_FUNC_KEM_NEWCTX 1
|
||||
# define OSSL_FUNC_KEM_ENCAPSULATE_INIT 2
|
||||
# define OSSL_FUNC_KEM_ENCAPSULATE 3
|
||||
# define OSSL_FUNC_KEM_DECAPSULATE_INIT 4
|
||||
# define OSSL_FUNC_KEM_DECAPSULATE 5
|
||||
# define OSSL_FUNC_KEM_FREECTX 6
|
||||
# define OSSL_FUNC_KEM_DUPCTX 7
|
||||
# define OSSL_FUNC_KEM_GET_CTX_PARAMS 8
|
||||
# define OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS 9
|
||||
# define OSSL_FUNC_KEM_SET_CTX_PARAMS 10
|
||||
# define OSSL_FUNC_KEM_SETTABLE_CTX_PARAMS 11
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, kem_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_encapsulate_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_encapsulate, (void *ctx,
|
||||
unsigned char *out, size_t *outlen,
|
||||
unsigned char *secret,
|
||||
size_t *secretlen))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_decapsulate_init, (void *ctx, void *provkey,
|
||||
const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_decapsulate, (void *ctx,
|
||||
unsigned char *out, size_t *outlen,
|
||||
const unsigned char *in, size_t inlen))
|
||||
OSSL_CORE_MAKE_FUNC(void, kem_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(void *, kem_dupctx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_get_ctx_params, (void *ctx, OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_gettable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, kem_set_ctx_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_settable_ctx_params,
|
||||
(void *ctx, void *provctx))
|
||||
|
||||
/* Encoders and decoders */
|
||||
# define OSSL_FUNC_ENCODER_NEWCTX 1
|
||||
# define OSSL_FUNC_ENCODER_FREECTX 2
|
||||
# define OSSL_FUNC_ENCODER_GET_PARAMS 3
|
||||
# define OSSL_FUNC_ENCODER_GETTABLE_PARAMS 4
|
||||
# define OSSL_FUNC_ENCODER_SET_CTX_PARAMS 5
|
||||
# define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS 6
|
||||
# define OSSL_FUNC_ENCODER_DOES_SELECTION 10
|
||||
# define OSSL_FUNC_ENCODER_ENCODE 11
|
||||
# define OSSL_FUNC_ENCODER_IMPORT_OBJECT 20
|
||||
# define OSSL_FUNC_ENCODER_FREE_OBJECT 21
|
||||
OSSL_CORE_MAKE_FUNC(void *, encoder_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(void, encoder_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, encoder_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_gettable_params,
|
||||
(void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, encoder_set_ctx_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_settable_ctx_params,
|
||||
(void *provctx))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, encoder_does_selection,
|
||||
(void *provctx, int selection))
|
||||
OSSL_CORE_MAKE_FUNC(int, encoder_encode,
|
||||
(void *ctx, OSSL_CORE_BIO *out,
|
||||
const void *obj_raw, const OSSL_PARAM obj_abstract[],
|
||||
int selection,
|
||||
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(void *, encoder_import_object,
|
||||
(void *ctx, int selection, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(void, encoder_free_object, (void *obj))
|
||||
|
||||
# define OSSL_FUNC_DECODER_NEWCTX 1
|
||||
# define OSSL_FUNC_DECODER_FREECTX 2
|
||||
# define OSSL_FUNC_DECODER_GET_PARAMS 3
|
||||
# define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4
|
||||
# define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5
|
||||
# define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6
|
||||
# define OSSL_FUNC_DECODER_DOES_SELECTION 10
|
||||
# define OSSL_FUNC_DECODER_DECODE 11
|
||||
# define OSSL_FUNC_DECODER_EXPORT_OBJECT 20
|
||||
OSSL_CORE_MAKE_FUNC(void *, decoder_newctx, (void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(void, decoder_freectx, (void *ctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, decoder_get_params, (OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_gettable_params,
|
||||
(void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, decoder_set_ctx_params,
|
||||
(void *ctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_settable_ctx_params,
|
||||
(void *provctx))
|
||||
|
||||
OSSL_CORE_MAKE_FUNC(int, decoder_does_selection,
|
||||
(void *provctx, int selection))
|
||||
OSSL_CORE_MAKE_FUNC(int, decoder_decode,
|
||||
(void *ctx, OSSL_CORE_BIO *in, int selection,
|
||||
OSSL_CALLBACK *data_cb, void *data_cbarg,
|
||||
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
|
||||
OSSL_CORE_MAKE_FUNC(int, decoder_export_object,
|
||||
(void *ctx, const void *objref, size_t objref_sz,
|
||||
OSSL_CALLBACK *export_cb, void *export_cbarg))
|
||||
|
||||
/*-
|
||||
* Store
|
||||
*
|
||||
* Objects are scanned by using the 'open', 'load', 'eof' and 'close'
|
||||
* functions, which implement an OSSL_STORE loader.
|
||||
*
|
||||
* store_load() works in a way that's very similar to the decoders, in
|
||||
* that they pass an abstract object through a callback, either as a DER
|
||||
* octet string or as an object reference, which libcrypto will have to
|
||||
* deal with.
|
||||
*/
|
||||
|
||||
#define OSSL_FUNC_STORE_OPEN 1
|
||||
#define OSSL_FUNC_STORE_ATTACH 2
|
||||
#define OSSL_FUNC_STORE_SETTABLE_CTX_PARAMS 3
|
||||
#define OSSL_FUNC_STORE_SET_CTX_PARAMS 4
|
||||
#define OSSL_FUNC_STORE_LOAD 5
|
||||
#define OSSL_FUNC_STORE_EOF 6
|
||||
#define OSSL_FUNC_STORE_CLOSE 7
|
||||
#define OSSL_FUNC_STORE_EXPORT_OBJECT 8
|
||||
OSSL_CORE_MAKE_FUNC(void *, store_open, (void *provctx, const char *uri))
|
||||
OSSL_CORE_MAKE_FUNC(void *, store_attach, (void *provctx, OSSL_CORE_BIO *in))
|
||||
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, store_settable_ctx_params,
|
||||
(void *provctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, store_set_ctx_params,
|
||||
(void *loaderctx, const OSSL_PARAM params[]))
|
||||
OSSL_CORE_MAKE_FUNC(int, store_load,
|
||||
(void *loaderctx,
|
||||
OSSL_CALLBACK *object_cb, void *object_cbarg,
|
||||
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
|
||||
OSSL_CORE_MAKE_FUNC(int, store_eof, (void *loaderctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, store_close, (void *loaderctx))
|
||||
OSSL_CORE_MAKE_FUNC(int, store_export_object,
|
||||
(void *loaderctx, const void *objref, size_t objref_sz,
|
||||
OSSL_CALLBACK *export_cb, void *export_cbarg))
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,581 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/crypto.h.in
|
||||
*
|
||||
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. 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_CRYPTO_H
|
||||
# define OPENSSL_CRYPTO_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_CRYPTO_H
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <time.h>
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/opensslv.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/cryptoerr.h>
|
||||
# include <openssl/core.h>
|
||||
|
||||
# ifdef CHARSET_EBCDIC
|
||||
# include <openssl/ebcdic.h>
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Resolve problems on some operating systems with symbol names that clash
|
||||
* one way or another
|
||||
*/
|
||||
# include <openssl/symhacks.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/opensslv.h>
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS) && defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
|
||||
#include <taskLib.h>
|
||||
/* threads.h cannot be included from C++ files, so define these types */
|
||||
typedef int once_flag;
|
||||
typedef unsigned int tss_t;
|
||||
# ifndef __cplusplus
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define SSLeay OpenSSL_version_num
|
||||
# define SSLeay_version OpenSSL_version
|
||||
# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
|
||||
# define SSLEAY_VERSION OPENSSL_VERSION
|
||||
# define SSLEAY_CFLAGS OPENSSL_CFLAGS
|
||||
# define SSLEAY_BUILT_ON OPENSSL_BUILT_ON
|
||||
# define SSLEAY_PLATFORM OPENSSL_PLATFORM
|
||||
# define SSLEAY_DIR OPENSSL_DIR
|
||||
|
||||
/*
|
||||
* Old type for allocating dynamic locks. No longer used. Use the new thread
|
||||
* API instead.
|
||||
*/
|
||||
typedef struct {
|
||||
int dummy;
|
||||
} CRYPTO_dynlock;
|
||||
|
||||
# endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
||||
|
||||
typedef void CRYPTO_RWLOCK;
|
||||
|
||||
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
|
||||
__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
|
||||
__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock);
|
||||
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock);
|
||||
|
||||
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
|
||||
CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock);
|
||||
|
||||
/* No longer needed, so this is a no-op */
|
||||
#define OPENSSL_malloc_init() while(0) continue
|
||||
|
||||
# define OPENSSL_malloc(num) \
|
||||
CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_zalloc(num) \
|
||||
CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_realloc(addr, num) \
|
||||
CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_clear_realloc(addr, old_num, num) \
|
||||
CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_clear_free(addr, num) \
|
||||
CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_free(addr) \
|
||||
CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_memdup(str, s) \
|
||||
CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_strdup(str) \
|
||||
CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_strndup(str, n) \
|
||||
CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_malloc(num) \
|
||||
CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_zalloc(num) \
|
||||
CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_free(addr) \
|
||||
CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_clear_free(addr, num) \
|
||||
CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_actual_size(ptr) \
|
||||
CRYPTO_secure_actual_size(ptr)
|
||||
|
||||
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strnlen(const char *str, size_t maxlen);
|
||||
int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlength,
|
||||
const unsigned char *buf, size_t buflen,
|
||||
const char sep);
|
||||
char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen);
|
||||
int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen,
|
||||
const char *str, const char sep);
|
||||
unsigned char *OPENSSL_hexstr2buf(const char *str, long *buflen);
|
||||
int OPENSSL_hexchar2int(unsigned char c);
|
||||
int OPENSSL_strcasecmp(const char *s1, const char *s2);
|
||||
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
# define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
|
||||
|
||||
/*
|
||||
* These functions return the values of OPENSSL_VERSION_MAJOR,
|
||||
* OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH, OPENSSL_VERSION_PRE_RELEASE
|
||||
* and OPENSSL_VERSION_BUILD_METADATA, respectively.
|
||||
*/
|
||||
unsigned int OPENSSL_version_major(void);
|
||||
unsigned int OPENSSL_version_minor(void);
|
||||
unsigned int OPENSSL_version_patch(void);
|
||||
const char *OPENSSL_version_pre_release(void);
|
||||
const char *OPENSSL_version_build_metadata(void);
|
||||
|
||||
unsigned long OpenSSL_version_num(void);
|
||||
const char *OpenSSL_version(int type);
|
||||
# define OPENSSL_VERSION 0
|
||||
# define OPENSSL_CFLAGS 1
|
||||
# define OPENSSL_BUILT_ON 2
|
||||
# define OPENSSL_PLATFORM 3
|
||||
# define OPENSSL_DIR 4
|
||||
# define OPENSSL_ENGINES_DIR 5
|
||||
# define OPENSSL_VERSION_STRING 6
|
||||
# define OPENSSL_FULL_VERSION_STRING 7
|
||||
# define OPENSSL_MODULES_DIR 8
|
||||
# define OPENSSL_CPU_INFO 9
|
||||
|
||||
const char *OPENSSL_info(int type);
|
||||
/*
|
||||
* The series starts at 1001 to avoid confusion with the OpenSSL_version
|
||||
* types.
|
||||
*/
|
||||
# define OPENSSL_INFO_CONFIG_DIR 1001
|
||||
# define OPENSSL_INFO_ENGINES_DIR 1002
|
||||
# define OPENSSL_INFO_MODULES_DIR 1003
|
||||
# define OPENSSL_INFO_DSO_EXTENSION 1004
|
||||
# define OPENSSL_INFO_DIR_FILENAME_SEPARATOR 1005
|
||||
# define OPENSSL_INFO_LIST_SEPARATOR 1006
|
||||
# define OPENSSL_INFO_SEED_SOURCE 1007
|
||||
# define OPENSSL_INFO_CPU_SETTINGS 1008
|
||||
|
||||
int OPENSSL_issetugid(void);
|
||||
|
||||
struct crypto_ex_data_st {
|
||||
OSSL_LIB_CTX *ctx;
|
||||
STACK_OF(void) *sk;
|
||||
};
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(void, void, void)
|
||||
#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
|
||||
#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx)))
|
||||
#define sk_void_new(cmp) ((STACK_OF(void) *)OPENSSL_sk_new(ossl_check_void_compfunc_type(cmp)))
|
||||
#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null())
|
||||
#define sk_void_new_reserve(cmp, n) ((STACK_OF(void) *)OPENSSL_sk_new_reserve(ossl_check_void_compfunc_type(cmp), (n)))
|
||||
#define sk_void_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_void_sk_type(sk), (n))
|
||||
#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_zero(sk) OPENSSL_sk_zero(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_void_sk_type(sk), (i)))
|
||||
#define sk_void_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)))
|
||||
#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_void_sk_type(sk)))
|
||||
#define sk_void_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_void_sk_type(sk)))
|
||||
#define sk_void_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_void_sk_type(sk),ossl_check_void_freefunc_type(freefunc))
|
||||
#define sk_void_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), (idx))
|
||||
#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr)))
|
||||
#define sk_void_find(sk, ptr) OPENSSL_sk_find(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), pnum)
|
||||
#define sk_void_sort(sk) OPENSSL_sk_sort(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_void_sk_type(sk))
|
||||
#define sk_void_dup(sk) ((STACK_OF(void) *)OPENSSL_sk_dup(ossl_check_const_void_sk_type(sk)))
|
||||
#define sk_void_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(void) *)OPENSSL_sk_deep_copy(ossl_check_const_void_sk_type(sk), ossl_check_void_copyfunc_type(copyfunc), ossl_check_void_freefunc_type(freefunc)))
|
||||
#define sk_void_set_cmp_func(sk, cmp) ((sk_void_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_void_sk_type(sk), ossl_check_void_compfunc_type(cmp)))
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Per class, we have a STACK of function pointers.
|
||||
*/
|
||||
# define CRYPTO_EX_INDEX_SSL 0
|
||||
# define CRYPTO_EX_INDEX_SSL_CTX 1
|
||||
# define CRYPTO_EX_INDEX_SSL_SESSION 2
|
||||
# define CRYPTO_EX_INDEX_X509 3
|
||||
# define CRYPTO_EX_INDEX_X509_STORE 4
|
||||
# define CRYPTO_EX_INDEX_X509_STORE_CTX 5
|
||||
# define CRYPTO_EX_INDEX_DH 6
|
||||
# define CRYPTO_EX_INDEX_DSA 7
|
||||
# define CRYPTO_EX_INDEX_EC_KEY 8
|
||||
# define CRYPTO_EX_INDEX_RSA 9
|
||||
# define CRYPTO_EX_INDEX_ENGINE 10
|
||||
# define CRYPTO_EX_INDEX_UI 11
|
||||
# define CRYPTO_EX_INDEX_BIO 12
|
||||
# define CRYPTO_EX_INDEX_APP 13
|
||||
# define CRYPTO_EX_INDEX_UI_METHOD 14
|
||||
# define CRYPTO_EX_INDEX_RAND_DRBG 15
|
||||
# define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG
|
||||
# define CRYPTO_EX_INDEX_OSSL_LIB_CTX 16
|
||||
# define CRYPTO_EX_INDEX_EVP_PKEY 17
|
||||
# define CRYPTO_EX_INDEX__COUNT 18
|
||||
|
||||
typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
||||
void **from_d, int idx, long argl, void *argp);
|
||||
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
||||
CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func,
|
||||
CRYPTO_EX_free *free_func);
|
||||
/* No longer use an index. */
|
||||
int CRYPTO_free_ex_index(int class_index, int idx);
|
||||
|
||||
/*
|
||||
* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a
|
||||
* given class (invokes whatever per-class callbacks are applicable)
|
||||
*/
|
||||
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
||||
const CRYPTO_EX_DATA *from);
|
||||
|
||||
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
|
||||
/* Allocate a single item in the CRYPTO_EX_DATA variable */
|
||||
int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad,
|
||||
int idx);
|
||||
|
||||
/*
|
||||
* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
|
||||
* index (relative to the class type involved)
|
||||
*/
|
||||
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
|
||||
void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
/*
|
||||
* This function cleans up all "ex_data" state. It mustn't be called under
|
||||
* potential race-conditions.
|
||||
*/
|
||||
# define CRYPTO_cleanup_all_ex_data() while(0) continue
|
||||
|
||||
/*
|
||||
* The old locking functions have been removed completely without compatibility
|
||||
* macros. This is because the old functions either could not properly report
|
||||
* errors, or the returned error values were not clearly documented.
|
||||
* Replacing the locking functions with no-ops would cause race condition
|
||||
* issues in the affected applications. It is far better for them to fail at
|
||||
* compile time.
|
||||
* On the other hand, the locking callbacks are no longer used. Consequently,
|
||||
* the callback management functions can be safely replaced with no-op macros.
|
||||
*/
|
||||
# define CRYPTO_num_locks() (1)
|
||||
# define CRYPTO_set_locking_callback(func)
|
||||
# define CRYPTO_get_locking_callback() (NULL)
|
||||
# define CRYPTO_set_add_lock_callback(func)
|
||||
# define CRYPTO_get_add_lock_callback() (NULL)
|
||||
|
||||
/*
|
||||
* These defines where used in combination with the old locking callbacks,
|
||||
* they are not called anymore, but old code that's not called might still
|
||||
* use them.
|
||||
*/
|
||||
# define CRYPTO_LOCK 1
|
||||
# define CRYPTO_UNLOCK 2
|
||||
# define CRYPTO_READ 4
|
||||
# define CRYPTO_WRITE 8
|
||||
|
||||
/* This structure is no longer used */
|
||||
typedef struct crypto_threadid_st {
|
||||
int dummy;
|
||||
} CRYPTO_THREADID;
|
||||
/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
|
||||
# define CRYPTO_THREADID_set_numeric(id, val)
|
||||
# define CRYPTO_THREADID_set_pointer(id, ptr)
|
||||
# define CRYPTO_THREADID_set_callback(threadid_func) (0)
|
||||
# define CRYPTO_THREADID_get_callback() (NULL)
|
||||
# define CRYPTO_THREADID_current(id)
|
||||
# define CRYPTO_THREADID_cmp(a, b) (-1)
|
||||
# define CRYPTO_THREADID_cpy(dest, src)
|
||||
# define CRYPTO_THREADID_hash(id) (0UL)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
||||
# define CRYPTO_set_id_callback(func)
|
||||
# define CRYPTO_get_id_callback() (NULL)
|
||||
# define CRYPTO_thread_id() (0UL)
|
||||
# endif /* OPENSSL_NO_DEPRECATED_1_0_0 */
|
||||
|
||||
# define CRYPTO_set_dynlock_create_callback(dyn_create_function)
|
||||
# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function)
|
||||
# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function)
|
||||
# define CRYPTO_get_dynlock_create_callback() (NULL)
|
||||
# define CRYPTO_get_dynlock_lock_callback() (NULL)
|
||||
# define CRYPTO_get_dynlock_destroy_callback() (NULL)
|
||||
# endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
||||
|
||||
typedef void *(*CRYPTO_malloc_fn)(size_t num, const char *file, int line);
|
||||
typedef void *(*CRYPTO_realloc_fn)(void *addr, size_t num, const char *file,
|
||||
int line);
|
||||
typedef void (*CRYPTO_free_fn)(void *addr, const char *file, int line);
|
||||
int CRYPTO_set_mem_functions(CRYPTO_malloc_fn malloc_fn,
|
||||
CRYPTO_realloc_fn realloc_fn,
|
||||
CRYPTO_free_fn free_fn);
|
||||
void CRYPTO_get_mem_functions(CRYPTO_malloc_fn *malloc_fn,
|
||||
CRYPTO_realloc_fn *realloc_fn,
|
||||
CRYPTO_free_fn *free_fn);
|
||||
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_zalloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC char *CRYPTO_strdup(const char *str, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
|
||||
void CRYPTO_free(void *ptr, const char *file, int line);
|
||||
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
|
||||
const char *file, int line);
|
||||
|
||||
int CRYPTO_secure_malloc_init(size_t sz, size_t minsize);
|
||||
int CRYPTO_secure_malloc_done(void);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
|
||||
void CRYPTO_secure_free(void *ptr, const char *file, int line);
|
||||
void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
||||
const char *file, int line);
|
||||
int CRYPTO_secure_allocated(const void *ptr);
|
||||
int CRYPTO_secure_malloc_initialized(void);
|
||||
size_t CRYPTO_secure_actual_size(void *ptr);
|
||||
size_t CRYPTO_secure_used(void);
|
||||
|
||||
void OPENSSL_cleanse(void *ptr, size_t len);
|
||||
|
||||
# ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
/*
|
||||
* The following can be used to detect memory leaks in the library. If
|
||||
* used, it turns on malloc checking
|
||||
*/
|
||||
# define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
|
||||
# define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
|
||||
# define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
|
||||
# define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
|
||||
|
||||
void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define OPENSSL_mem_debug_push(info) \
|
||||
CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_mem_debug_pop() \
|
||||
CRYPTO_mem_debug_pop()
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_set_mem_debug(int flag);
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_ctrl(int mode);
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_push(const char *info,
|
||||
const char *file, int line);
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_pop(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_malloc(void *addr, size_t num,
|
||||
int flag,
|
||||
const char *file, int line);
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_realloc(void *addr1, void *addr2,
|
||||
size_t num, int flag,
|
||||
const char *file, int line);
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_free(void *addr, int flag,
|
||||
const char *file, int line);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u),
|
||||
void *u);
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks_fp(FILE *);
|
||||
# endif
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks(BIO *bio);
|
||||
# endif
|
||||
# endif /* OPENSSL_NO_CRYPTO_MDEBUG */
|
||||
|
||||
/* die if we have to */
|
||||
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define OpenSSLDie(f,l,a) OPENSSL_die((a),(f),(l))
|
||||
# endif
|
||||
# define OPENSSL_assert(e) \
|
||||
(void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
|
||||
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
void OPENSSL_init(void);
|
||||
# ifdef OPENSSL_SYS_UNIX
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_prepare(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_parent(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_child(void);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
|
||||
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec);
|
||||
int OPENSSL_gmtime_diff(int *pday, int *psec,
|
||||
const struct tm *from, const struct tm *to);
|
||||
|
||||
/*
|
||||
* CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.
|
||||
* It takes an amount of time dependent on |len|, but independent of the
|
||||
* contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements
|
||||
* into a defined order as the return value when a != b is undefined, other
|
||||
* than to be non-zero.
|
||||
*/
|
||||
int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
|
||||
|
||||
/* Standard initialisation options */
|
||||
# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
|
||||
# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
|
||||
# define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
|
||||
# define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
|
||||
# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L
|
||||
# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L
|
||||
# define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
|
||||
# define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
|
||||
# define OPENSSL_INIT_ASYNC 0x00000100L
|
||||
# define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
|
||||
# define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
|
||||
# define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
|
||||
# define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
|
||||
# define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
|
||||
# define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
|
||||
# define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
|
||||
/* FREE: 0x00010000L */
|
||||
# define OPENSSL_INIT_ATFORK 0x00020000L
|
||||
/* OPENSSL_INIT_BASE_ONLY 0x00040000L */
|
||||
# define OPENSSL_INIT_NO_ATEXIT 0x00080000L
|
||||
/* OPENSSL_INIT flag range 0x03f00000 reserved for OPENSSL_init_ssl() */
|
||||
/* FREE: 0x04000000L */
|
||||
/* FREE: 0x08000000L */
|
||||
/* FREE: 0x10000000L */
|
||||
/* FREE: 0x20000000L */
|
||||
/* FREE: 0x40000000L */
|
||||
/* FREE: 0x80000000L */
|
||||
/* Max OPENSSL_INIT flag value is 0x80000000 */
|
||||
|
||||
/* openssl and dasync not counted as builtin */
|
||||
# define OPENSSL_INIT_ENGINE_ALL_BUILTIN \
|
||||
(OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
|
||||
| OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
|
||||
OPENSSL_INIT_ENGINE_PADLOCK)
|
||||
|
||||
/* Library initialisation functions */
|
||||
void OPENSSL_cleanup(void);
|
||||
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||
int OPENSSL_atexit(void (*handler)(void));
|
||||
void OPENSSL_thread_stop(void);
|
||||
void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);
|
||||
|
||||
/* Low-level control of initialization */
|
||||
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
|
||||
const char *config_filename);
|
||||
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings,
|
||||
unsigned long flags);
|
||||
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings,
|
||||
const char *config_appname);
|
||||
# endif
|
||||
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings);
|
||||
|
||||
# if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
|
||||
# if defined(_WIN32)
|
||||
# if defined(BASETYPES) || defined(_WINDEF_H)
|
||||
/* application has to include <windows.h> in order to use this */
|
||||
typedef DWORD CRYPTO_THREAD_LOCAL;
|
||||
typedef DWORD CRYPTO_THREAD_ID;
|
||||
|
||||
typedef LONG CRYPTO_ONCE;
|
||||
# define CRYPTO_ONCE_STATIC_INIT 0
|
||||
# endif
|
||||
# elif defined(OPENSSL_SYS_VXWORKS)
|
||||
typedef once_flag CRYPTO_ONCE;
|
||||
typedef tss_t CRYPTO_THREAD_LOCAL;
|
||||
typedef TASK_ID CRYPTO_THREAD_ID;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int initialized;
|
||||
SEM_ID sem;
|
||||
}CRYPTO_ONCE_STATIC_INIT;
|
||||
|
||||
# define ONCE_FLAG_INIT {0, NULL}
|
||||
|
||||
# define CRYPTO_ONCE_STATIC_INIT ONCE_FLAG_INIT
|
||||
# else
|
||||
# if defined(__TANDEM) && defined(_SPT_MODEL_)
|
||||
# define SPT_THREAD_SIGNAL 1
|
||||
# define SPT_THREAD_AWARE 1
|
||||
# include <spthread.h>
|
||||
# else
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
typedef pthread_once_t CRYPTO_ONCE;
|
||||
typedef pthread_key_t CRYPTO_THREAD_LOCAL;
|
||||
typedef pthread_t CRYPTO_THREAD_ID;
|
||||
|
||||
# define CRYPTO_ONCE_STATIC_INIT PTHREAD_ONCE_INIT
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !defined(CRYPTO_ONCE_STATIC_INIT)
|
||||
typedef unsigned int CRYPTO_ONCE;
|
||||
typedef unsigned int CRYPTO_THREAD_LOCAL;
|
||||
typedef unsigned int CRYPTO_THREAD_ID;
|
||||
# define CRYPTO_ONCE_STATIC_INIT 0
|
||||
# endif
|
||||
|
||||
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void));
|
||||
|
||||
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *));
|
||||
void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key);
|
||||
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val);
|
||||
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
|
||||
|
||||
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
|
||||
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
|
||||
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new_from_dispatch(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new_child(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in);
|
||||
int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
|
||||
void OSSL_LIB_CTX_free(OSSL_LIB_CTX *);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2022 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_CRYPTOERR_H
|
||||
# define OPENSSL_CRYPTOERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* CRYPTO reason codes.
|
||||
*/
|
||||
# define CRYPTO_R_BAD_ALGORITHM_NAME 117
|
||||
# define CRYPTO_R_CONFLICTING_NAMES 118
|
||||
# define CRYPTO_R_HEX_STRING_TOO_SHORT 121
|
||||
# define CRYPTO_R_ILLEGAL_HEX_DIGIT 102
|
||||
# define CRYPTO_R_INSUFFICIENT_DATA_SPACE 106
|
||||
# define CRYPTO_R_INSUFFICIENT_PARAM_SIZE 107
|
||||
# define CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE 108
|
||||
# define CRYPTO_R_INTEGER_OVERFLOW 127
|
||||
# define CRYPTO_R_INVALID_NEGATIVE_VALUE 122
|
||||
# define CRYPTO_R_INVALID_NULL_ARGUMENT 109
|
||||
# define CRYPTO_R_INVALID_OSSL_PARAM_TYPE 110
|
||||
# define CRYPTO_R_NO_PARAMS_TO_MERGE 131
|
||||
# define CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL 128
|
||||
# define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103
|
||||
# define CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY 123
|
||||
# define CRYPTO_R_PARAM_NOT_INTEGER_TYPE 124
|
||||
# define CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE 129
|
||||
# define CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED 125
|
||||
# define CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT 130
|
||||
# define CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION 126
|
||||
# define CRYPTO_R_PROVIDER_ALREADY_EXISTS 104
|
||||
# define CRYPTO_R_PROVIDER_SECTION_ERROR 105
|
||||
# define CRYPTO_R_RANDOM_SECTION_ERROR 119
|
||||
# define CRYPTO_R_SECURE_MALLOC_FAILURE 111
|
||||
# define CRYPTO_R_STRING_TOO_LONG 112
|
||||
# define CRYPTO_R_TOO_MANY_BYTES 113
|
||||
# define CRYPTO_R_TOO_MANY_RECORDS 114
|
||||
# define CRYPTO_R_TOO_SMALL_BUFFER 116
|
||||
# define CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION 120
|
||||
# define CRYPTO_R_ZERO_LENGTH_NUMBER 115
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,573 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/ct.h.in
|
||||
*
|
||||
* Copyright 2016-2020 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_CT_H
|
||||
# define OPENSSL_CT_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_CT_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_CT
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/cterr.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
|
||||
/* Minimum RSA key size, from RFC6962 */
|
||||
# define SCT_MIN_RSA_BITS 2048
|
||||
|
||||
/* All hashes are SHA256 in v1 of Certificate Transparency */
|
||||
# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(SCT, SCT, SCT)
|
||||
#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
|
||||
#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
|
||||
#define sk_SCT_new(cmp) ((STACK_OF(SCT) *)OPENSSL_sk_new(ossl_check_SCT_compfunc_type(cmp)))
|
||||
#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_new_null())
|
||||
#define sk_SCT_new_reserve(cmp, n) ((STACK_OF(SCT) *)OPENSSL_sk_new_reserve(ossl_check_SCT_compfunc_type(cmp), (n)))
|
||||
#define sk_SCT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SCT_sk_type(sk), (n))
|
||||
#define sk_SCT_free(sk) OPENSSL_sk_free(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_zero(sk) OPENSSL_sk_zero(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_delete(sk, i) ((SCT *)OPENSSL_sk_delete(ossl_check_SCT_sk_type(sk), (i)))
|
||||
#define sk_SCT_delete_ptr(sk, ptr) ((SCT *)OPENSSL_sk_delete_ptr(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)))
|
||||
#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk)))
|
||||
#define sk_SCT_shift(sk) ((SCT *)OPENSSL_sk_shift(ossl_check_SCT_sk_type(sk)))
|
||||
#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk),ossl_check_SCT_freefunc_type(freefunc))
|
||||
#define sk_SCT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), (idx))
|
||||
#define sk_SCT_set(sk, idx, ptr) ((SCT *)OPENSSL_sk_set(ossl_check_SCT_sk_type(sk), (idx), ossl_check_SCT_type(ptr)))
|
||||
#define sk_SCT_find(sk, ptr) OPENSSL_sk_find(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), pnum)
|
||||
#define sk_SCT_sort(sk) OPENSSL_sk_sort(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SCT_sk_type(sk))
|
||||
#define sk_SCT_dup(sk) ((STACK_OF(SCT) *)OPENSSL_sk_dup(ossl_check_const_SCT_sk_type(sk)))
|
||||
#define sk_SCT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SCT) *)OPENSSL_sk_deep_copy(ossl_check_const_SCT_sk_type(sk), ossl_check_SCT_copyfunc_type(copyfunc), ossl_check_SCT_freefunc_type(freefunc)))
|
||||
#define sk_SCT_set_cmp_func(sk, cmp) ((sk_SCT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SCT_sk_type(sk), ossl_check_SCT_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CTLOG, CTLOG, CTLOG)
|
||||
#define sk_CTLOG_num(sk) OPENSSL_sk_num(ossl_check_const_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_value(sk, idx) ((CTLOG *)OPENSSL_sk_value(ossl_check_const_CTLOG_sk_type(sk), (idx)))
|
||||
#define sk_CTLOG_new(cmp) ((STACK_OF(CTLOG) *)OPENSSL_sk_new(ossl_check_CTLOG_compfunc_type(cmp)))
|
||||
#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null())
|
||||
#define sk_CTLOG_new_reserve(cmp, n) ((STACK_OF(CTLOG) *)OPENSSL_sk_new_reserve(ossl_check_CTLOG_compfunc_type(cmp), (n)))
|
||||
#define sk_CTLOG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CTLOG_sk_type(sk), (n))
|
||||
#define sk_CTLOG_free(sk) OPENSSL_sk_free(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_zero(sk) OPENSSL_sk_zero(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_delete(sk, i) ((CTLOG *)OPENSSL_sk_delete(ossl_check_CTLOG_sk_type(sk), (i)))
|
||||
#define sk_CTLOG_delete_ptr(sk, ptr) ((CTLOG *)OPENSSL_sk_delete_ptr(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)))
|
||||
#define sk_CTLOG_push(sk, ptr) OPENSSL_sk_push(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_pop(sk) ((CTLOG *)OPENSSL_sk_pop(ossl_check_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_shift(sk) ((CTLOG *)OPENSSL_sk_shift(ossl_check_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk),ossl_check_CTLOG_freefunc_type(freefunc))
|
||||
#define sk_CTLOG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), (idx))
|
||||
#define sk_CTLOG_set(sk, idx, ptr) ((CTLOG *)OPENSSL_sk_set(ossl_check_CTLOG_sk_type(sk), (idx), ossl_check_CTLOG_type(ptr)))
|
||||
#define sk_CTLOG_find(sk, ptr) OPENSSL_sk_find(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), pnum)
|
||||
#define sk_CTLOG_sort(sk) OPENSSL_sk_sort(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_dup(sk) ((STACK_OF(CTLOG) *)OPENSSL_sk_dup(ossl_check_const_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CTLOG) *)OPENSSL_sk_deep_copy(ossl_check_const_CTLOG_sk_type(sk), ossl_check_CTLOG_copyfunc_type(copyfunc), ossl_check_CTLOG_freefunc_type(freefunc)))
|
||||
#define sk_CTLOG_set_cmp_func(sk, cmp) ((sk_CTLOG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_compfunc_type(cmp)))
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
|
||||
CT_LOG_ENTRY_TYPE_X509 = 0,
|
||||
CT_LOG_ENTRY_TYPE_PRECERT = 1
|
||||
} ct_log_entry_type_t;
|
||||
|
||||
typedef enum {
|
||||
SCT_VERSION_NOT_SET = -1,
|
||||
SCT_VERSION_V1 = 0
|
||||
} sct_version_t;
|
||||
|
||||
typedef enum {
|
||||
SCT_SOURCE_UNKNOWN,
|
||||
SCT_SOURCE_TLS_EXTENSION,
|
||||
SCT_SOURCE_X509V3_EXTENSION,
|
||||
SCT_SOURCE_OCSP_STAPLED_RESPONSE
|
||||
} sct_source_t;
|
||||
|
||||
typedef enum {
|
||||
SCT_VALIDATION_STATUS_NOT_SET,
|
||||
SCT_VALIDATION_STATUS_UNKNOWN_LOG,
|
||||
SCT_VALIDATION_STATUS_VALID,
|
||||
SCT_VALIDATION_STATUS_INVALID,
|
||||
SCT_VALIDATION_STATUS_UNVERIFIED,
|
||||
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
|
||||
} sct_validation_status_t;
|
||||
|
||||
/******************************************
|
||||
* CT policy evaluation context functions *
|
||||
******************************************/
|
||||
|
||||
/*
|
||||
* Creates a new, empty policy evaluation context associated with the given
|
||||
* library context and property query string.
|
||||
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
|
||||
* with the CT_POLICY_EVAL_CTX.
|
||||
*/
|
||||
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CT_POLICY_EVAL_CTX_new_ex() but the default library
|
||||
* context and property query string is used.
|
||||
*/
|
||||
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
|
||||
|
||||
/* Deletes a policy evaluation context and anything it owns. */
|
||||
void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/* Gets the peer certificate that the SCTs are for */
|
||||
X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/*
|
||||
* Sets the certificate associated with the received SCTs.
|
||||
* Increments the reference count of cert.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
|
||||
|
||||
/* Gets the issuer of the aforementioned certificate */
|
||||
X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/*
|
||||
* Sets the issuer of the certificate associated with the received SCTs.
|
||||
* Increments the reference count of issuer.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
|
||||
|
||||
/* Gets the CT logs that are trusted sources of SCTs */
|
||||
const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */
|
||||
void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
|
||||
CTLOG_STORE *log_store);
|
||||
|
||||
/*
|
||||
* Gets the time, in milliseconds since the Unix epoch, that will be used as the
|
||||
* current time when checking whether an SCT was issued in the future.
|
||||
* Such SCTs will fail validation, as required by RFC6962.
|
||||
*/
|
||||
uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/*
|
||||
* Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch.
|
||||
* If an SCT's timestamp is after this time, it will be interpreted as having
|
||||
* been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs
|
||||
* whose timestamp is in the future", so an SCT will not validate in this case.
|
||||
*/
|
||||
void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
|
||||
|
||||
/*****************
|
||||
* SCT functions *
|
||||
*****************/
|
||||
|
||||
/*
|
||||
* Creates a new, blank SCT.
|
||||
* The caller is responsible for calling SCT_free when finished with the SCT.
|
||||
*/
|
||||
SCT *SCT_new(void);
|
||||
|
||||
/*
|
||||
* Creates a new SCT from some base64-encoded strings.
|
||||
* The caller is responsible for calling SCT_free when finished with the SCT.
|
||||
*/
|
||||
SCT *SCT_new_from_base64(unsigned char version,
|
||||
const char *logid_base64,
|
||||
ct_log_entry_type_t entry_type,
|
||||
uint64_t timestamp,
|
||||
const char *extensions_base64,
|
||||
const char *signature_base64);
|
||||
|
||||
/*
|
||||
* Frees the SCT and the underlying data structures.
|
||||
*/
|
||||
void SCT_free(SCT *sct);
|
||||
|
||||
/*
|
||||
* Free a stack of SCTs, and the underlying SCTs themselves.
|
||||
* Intended to be compatible with X509V3_EXT_FREE.
|
||||
*/
|
||||
void SCT_LIST_free(STACK_OF(SCT) *a);
|
||||
|
||||
/*
|
||||
* Returns the version of the SCT.
|
||||
*/
|
||||
sct_version_t SCT_get_version(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Set the version of an SCT.
|
||||
* Returns 1 on success, 0 if the version is unrecognized.
|
||||
*/
|
||||
__owur int SCT_set_version(SCT *sct, sct_version_t version);
|
||||
|
||||
/*
|
||||
* Returns the log entry type of the SCT.
|
||||
*/
|
||||
ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Set the log entry type of an SCT.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type);
|
||||
|
||||
/*
|
||||
* Gets the ID of the log that an SCT came from.
|
||||
* Ownership of the log ID remains with the SCT.
|
||||
* Returns the length of the log ID.
|
||||
*/
|
||||
size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id);
|
||||
|
||||
/*
|
||||
* Set the log ID of an SCT to point directly to the *log_id specified.
|
||||
* The SCT takes ownership of the specified pointer.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len);
|
||||
|
||||
/*
|
||||
* Set the log ID of an SCT.
|
||||
* This makes a copy of the log_id.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id,
|
||||
size_t log_id_len);
|
||||
|
||||
/*
|
||||
* Returns the timestamp for the SCT (epoch time in milliseconds).
|
||||
*/
|
||||
uint64_t SCT_get_timestamp(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Set the timestamp of an SCT (epoch time in milliseconds).
|
||||
*/
|
||||
void SCT_set_timestamp(SCT *sct, uint64_t timestamp);
|
||||
|
||||
/*
|
||||
* Return the NID for the signature used by the SCT.
|
||||
* For CT v1, this will be either NID_sha256WithRSAEncryption or
|
||||
* NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset).
|
||||
*/
|
||||
int SCT_get_signature_nid(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Set the signature type of an SCT
|
||||
* For CT v1, this should be either NID_sha256WithRSAEncryption or
|
||||
* NID_ecdsa_with_SHA256.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set_signature_nid(SCT *sct, int nid);
|
||||
|
||||
/*
|
||||
* Set *ext to point to the extension data for the SCT. ext must not be NULL.
|
||||
* The SCT retains ownership of this pointer.
|
||||
* Returns length of the data pointed to.
|
||||
*/
|
||||
size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext);
|
||||
|
||||
/*
|
||||
* Set the extensions of an SCT to point directly to the *ext specified.
|
||||
* The SCT takes ownership of the specified pointer.
|
||||
*/
|
||||
void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len);
|
||||
|
||||
/*
|
||||
* Set the extensions of an SCT.
|
||||
* This takes a copy of the ext.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext,
|
||||
size_t ext_len);
|
||||
|
||||
/*
|
||||
* Set *sig to point to the signature for the SCT. sig must not be NULL.
|
||||
* The SCT retains ownership of this pointer.
|
||||
* Returns length of the data pointed to.
|
||||
*/
|
||||
size_t SCT_get0_signature(const SCT *sct, unsigned char **sig);
|
||||
|
||||
/*
|
||||
* Set the signature of an SCT to point directly to the *sig specified.
|
||||
* The SCT takes ownership of the specified pointer.
|
||||
*/
|
||||
void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len);
|
||||
|
||||
/*
|
||||
* Set the signature of an SCT to be a copy of the *sig specified.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig,
|
||||
size_t sig_len);
|
||||
|
||||
/*
|
||||
* The origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
||||
*/
|
||||
sct_source_t SCT_get_source(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Set the origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
||||
* Returns 1 on success, 0 otherwise.
|
||||
*/
|
||||
__owur int SCT_set_source(SCT *sct, sct_source_t source);
|
||||
|
||||
/*
|
||||
* Returns a text string describing the validation status of |sct|.
|
||||
*/
|
||||
const char *SCT_validation_status_string(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Pretty-prints an |sct| to |out|.
|
||||
* It will be indented by the number of spaces specified by |indent|.
|
||||
* If |logs| is not NULL, it will be used to lookup the CT log that the SCT came
|
||||
* from, so that the log name can be printed.
|
||||
*/
|
||||
void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs);
|
||||
|
||||
/*
|
||||
* Pretty-prints an |sct_list| to |out|.
|
||||
* It will be indented by the number of spaces specified by |indent|.
|
||||
* SCTs will be delimited by |separator|.
|
||||
* If |logs| is not NULL, it will be used to lookup the CT log that each SCT
|
||||
* came from, so that the log names can be printed.
|
||||
*/
|
||||
void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent,
|
||||
const char *separator, const CTLOG_STORE *logs);
|
||||
|
||||
/*
|
||||
* Gets the last result of validating this SCT.
|
||||
* If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET.
|
||||
*/
|
||||
sct_validation_status_t SCT_get_validation_status(const SCT *sct);
|
||||
|
||||
/*
|
||||
* Validates the given SCT with the provided context.
|
||||
* Sets the "validation_status" field of the SCT.
|
||||
* Returns 1 if the SCT is valid and the signature verifies.
|
||||
* Returns 0 if the SCT is invalid or could not be verified.
|
||||
* Returns -1 if an error occurs.
|
||||
*/
|
||||
__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
/*
|
||||
* Validates the given list of SCTs with the provided context.
|
||||
* Sets the "validation_status" field of each SCT.
|
||||
* Returns 1 if there are no invalid SCTs and all signatures verify.
|
||||
* Returns 0 if at least one SCT is invalid or could not be verified.
|
||||
* Returns a negative integer if an error occurs.
|
||||
*/
|
||||
__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts,
|
||||
CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
|
||||
/*********************************
|
||||
* SCT parsing and serialization *
|
||||
*********************************/
|
||||
|
||||
/*
|
||||
* Serialize (to TLS format) a stack of SCTs and return the length.
|
||||
* "a" must not be NULL.
|
||||
* If "pp" is NULL, just return the length of what would have been serialized.
|
||||
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
||||
* for data that caller is responsible for freeing (only if function returns
|
||||
* successfully).
|
||||
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
||||
* that "*pp" is large enough to accept all of the serialized data.
|
||||
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
||||
* on success.
|
||||
*/
|
||||
__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
||||
|
||||
/*
|
||||
* Convert TLS format SCT list to a stack of SCTs.
|
||||
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
||||
* responsible for freeing (by calling SCT_LIST_free).
|
||||
* "**pp" and "*pp" must not be NULL.
|
||||
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
||||
* will be returned.
|
||||
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
||||
* not defined.
|
||||
*/
|
||||
STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
||||
size_t len);
|
||||
|
||||
/*
|
||||
* Serialize (to DER format) a stack of SCTs and return the length.
|
||||
* "a" must not be NULL.
|
||||
* If "pp" is NULL, just returns the length of what would have been serialized.
|
||||
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
||||
* for data that caller is responsible for freeing (only if function returns
|
||||
* successfully).
|
||||
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
||||
* that "*pp" is large enough to accept all of the serialized data.
|
||||
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
||||
* on success.
|
||||
*/
|
||||
__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
||||
|
||||
/*
|
||||
* Parses an SCT list in DER format and returns it.
|
||||
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
||||
* responsible for freeing (by calling SCT_LIST_free).
|
||||
* "**pp" and "*pp" must not be NULL.
|
||||
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
||||
* will be returned.
|
||||
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
||||
* not defined.
|
||||
*/
|
||||
STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
||||
long len);
|
||||
|
||||
/*
|
||||
* Serialize (to TLS format) an |sct| and write it to |out|.
|
||||
* If |out| is null, no SCT will be output but the length will still be returned.
|
||||
* If |out| points to a null pointer, a string will be allocated to hold the
|
||||
* TLS-format SCT. It is the responsibility of the caller to free it.
|
||||
* If |out| points to an allocated string, the TLS-format SCT will be written
|
||||
* to it.
|
||||
* The length of the SCT in TLS format will be returned.
|
||||
*/
|
||||
__owur int i2o_SCT(const SCT *sct, unsigned char **out);
|
||||
|
||||
/*
|
||||
* Parses an SCT in TLS format and returns it.
|
||||
* If |psct| is not null, it will end up pointing to the parsed SCT. If it
|
||||
* already points to a non-null pointer, the pointer will be free'd.
|
||||
* |in| should be a pointer to a string containing the TLS-format SCT.
|
||||
* |in| will be advanced to the end of the SCT if parsing succeeds.
|
||||
* |len| should be the length of the SCT in |in|.
|
||||
* Returns NULL if an error occurs.
|
||||
* If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len'
|
||||
* fields will be populated (with |in| and |len| respectively).
|
||||
*/
|
||||
SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len);
|
||||
|
||||
/********************
|
||||
* CT log functions *
|
||||
********************/
|
||||
|
||||
/*
|
||||
* Creates a new CT log instance with the given |public_key| and |name| and
|
||||
* associates it with the give library context |libctx| and property query
|
||||
* string |propq|.
|
||||
* Takes ownership of |public_key| but copies |name|.
|
||||
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
|
||||
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
||||
*/
|
||||
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CTLOG_new_ex except that the default library context and
|
||||
* property query string are used.
|
||||
*/
|
||||
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
|
||||
|
||||
/*
|
||||
* Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
|
||||
* in |pkey_base64| and associated with the given library context |libctx| and
|
||||
* property query string |propq|. The |name| is a string to help users identify
|
||||
* this log.
|
||||
* Returns 1 on success, 0 on failure.
|
||||
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
||||
*/
|
||||
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
|
||||
const char *name, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CTLOG_new_from_base64_ex() except that the default
|
||||
* library context and property query string are used.
|
||||
* Returns 1 on success, 0 on failure.
|
||||
*/
|
||||
int CTLOG_new_from_base64(CTLOG ** ct_log,
|
||||
const char *pkey_base64, const char *name);
|
||||
|
||||
/*
|
||||
* Deletes a CT log instance and its fields.
|
||||
*/
|
||||
void CTLOG_free(CTLOG *log);
|
||||
|
||||
/* Gets the name of the CT log */
|
||||
const char *CTLOG_get0_name(const CTLOG *log);
|
||||
/* Gets the ID of the CT log */
|
||||
void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
|
||||
size_t *log_id_len);
|
||||
/* Gets the public key of the CT log */
|
||||
EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
|
||||
|
||||
/**************************
|
||||
* CT log store functions *
|
||||
**************************/
|
||||
|
||||
/*
|
||||
* Creates a new CT log store and associates it with the given libctx and
|
||||
* property query string.
|
||||
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
||||
*/
|
||||
CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
/*
|
||||
* Same as CTLOG_STORE_new_ex except that the default libctx and
|
||||
* property query string are used.
|
||||
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
||||
*/
|
||||
CTLOG_STORE *CTLOG_STORE_new(void);
|
||||
|
||||
/*
|
||||
* Deletes a CT log store and all of the CT log instances held within.
|
||||
*/
|
||||
void CTLOG_STORE_free(CTLOG_STORE *store);
|
||||
|
||||
/*
|
||||
* Finds a CT log in the store based on its log ID.
|
||||
* Returns the CT log, or NULL if no match is found.
|
||||
*/
|
||||
const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store,
|
||||
const uint8_t *log_id,
|
||||
size_t log_id_len);
|
||||
|
||||
/*
|
||||
* Loads a CT log list into a |store| from a |file|.
|
||||
* Returns 1 if loading is successful, or 0 otherwise.
|
||||
*/
|
||||
__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
|
||||
|
||||
/*
|
||||
* Loads the default CT log list into a |store|.
|
||||
* Returns 1 if loading is successful, or 0 otherwise.
|
||||
*/
|
||||
__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_DES_H
|
||||
# define OPENSSL_DES_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_DES_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DES
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef unsigned int DES_LONG;
|
||||
|
||||
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
# undef OPENSSL_EXTERN
|
||||
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
||||
# endif
|
||||
|
||||
typedef unsigned char DES_cblock[8];
|
||||
typedef /* const */ unsigned char const_DES_cblock[8];
|
||||
/*
|
||||
* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and
|
||||
* const_DES_cblock * are incompatible pointer types.
|
||||
*/
|
||||
|
||||
typedef struct DES_ks {
|
||||
union {
|
||||
DES_cblock cblock;
|
||||
/*
|
||||
* make sure things are correct size on machines with 8 byte longs
|
||||
*/
|
||||
DES_LONG deslong[2];
|
||||
} ks[16];
|
||||
} DES_key_schedule;
|
||||
|
||||
# define DES_KEY_SZ (sizeof(DES_cblock))
|
||||
# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
|
||||
|
||||
# define DES_ENCRYPT 1
|
||||
# define DES_DECRYPT 0
|
||||
|
||||
# define DES_CBC_MODE 0
|
||||
# define DES_PCBC_MODE 1
|
||||
|
||||
# define DES_ecb2_encrypt(i,o,k1,k2,e) \
|
||||
DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
||||
|
||||
# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
||||
DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
||||
|
||||
# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
||||
DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
||||
|
||||
# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
||||
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
||||
|
||||
# define DES_fixup_key_parity DES_set_odd_parity
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *DES_options(void);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
|
||||
DES_key_schedule *ks1, DES_key_schedule *ks2,
|
||||
DES_key_schedule *ks3, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
|
||||
long length, DES_key_schedule *schedule,
|
||||
const_DES_cblock *ivec);
|
||||
# endif
|
||||
/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec,
|
||||
const_DES_cblock *inw, const_DES_cblock *outw, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
|
||||
DES_key_schedule *ks, int enc);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This is the DES encryption function that gets called by just about every
|
||||
* other DES routine in the library. You should not use this function except
|
||||
* to implement 'modes' of DES. I say this because the functions that call
|
||||
* this routine do the conversion from 'char *' to long, and this needs to be
|
||||
* done to make sure 'non-aligned' memory access do not occur. The
|
||||
* characters are loaded 'little endian'. Data is a pointer to 2 unsigned
|
||||
* long's and ks is the DES_key_schedule to use. enc, is non zero specifies
|
||||
* encryption, zero if decryption.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This functions is the same as DES_encrypt1() except that the DES initial
|
||||
* permutation (IP) and final permutation (FP) have been left out. As for
|
||||
* DES_encrypt1(), you should not use this function. It is used by the
|
||||
* routines in the library that implement triple DES. IP() DES_encrypt2()
|
||||
* DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
|
||||
* DES_encrypt1() DES_encrypt1() except faster :-).
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2,
|
||||
DES_key_schedule *ks3);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2,
|
||||
DES_key_schedule *ks3);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
long length, DES_key_schedule *ks1,
|
||||
DES_key_schedule *ks2, DES_key_schedule *ks3,
|
||||
DES_cblock *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, DES_key_schedule *ks1,
|
||||
DES_key_schedule *ks2, DES_key_schedule *ks3,
|
||||
DES_cblock *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
int numbits, long length, DES_key_schedule *ks1,
|
||||
DES_key_schedule *ks2, DES_key_schedule *ks3,
|
||||
DES_cblock *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, DES_key_schedule *ks1,
|
||||
DES_key_schedule *ks2, DES_key_schedule *ks3,
|
||||
DES_cblock *ivec, int *num);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
char *DES_fcrypt(const char *buf, const char *salt, char *ret);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
char *DES_crypt(const char *buf, const char *salt);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
||||
long length, DES_key_schedule *schedule, DES_cblock *ivec);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
|
||||
long length, DES_key_schedule *schedule,
|
||||
DES_cblock *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
|
||||
long length, int out_count, DES_cblock *seed);
|
||||
OSSL_DEPRECATEDIN_3_0 int DES_random_key(DES_cblock *ret);
|
||||
OSSL_DEPRECATEDIN_3_0 void DES_set_odd_parity(DES_cblock *key);
|
||||
OSSL_DEPRECATEDIN_3_0 int DES_check_key_parity(const_DES_cblock *key);
|
||||
OSSL_DEPRECATEDIN_3_0 int DES_is_weak_key(const_DES_cblock *key);
|
||||
# endif
|
||||
/*
|
||||
* DES_set_key (= set_key = DES_key_sched = key_sched) calls
|
||||
* DES_set_key_checked
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
|
||||
OSSL_DEPRECATEDIN_3_0 void DES_string_to_key(const char *str, DES_cblock *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, DES_key_schedule *schedule,
|
||||
DES_cblock *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, DES_key_schedule *schedule,
|
||||
DES_cblock *ivec, int *num);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,335 @@
|
||||
/*
|
||||
* Copyright 1995-2023 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_DH_H
|
||||
# define OPENSSL_DH_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_DH_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/types.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* DH parameter generation types used by EVP_PKEY_CTX_set_dh_paramgen_type() */
|
||||
# define DH_PARAMGEN_TYPE_GENERATOR 0 /* Use a safe prime generator */
|
||||
# define DH_PARAMGEN_TYPE_FIPS_186_2 1 /* Use FIPS186-2 standard */
|
||||
# define DH_PARAMGEN_TYPE_FIPS_186_4 2 /* Use FIPS186-4 standard */
|
||||
# define DH_PARAMGEN_TYPE_GROUP 3 /* Use a named safe prime group */
|
||||
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_type(EVP_PKEY_CTX *ctx, int typ);
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_gindex(EVP_PKEY_CTX *ctx, int gindex);
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_seed(EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *seed,
|
||||
size_t seedlen);
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_prime_len(EVP_PKEY_CTX *ctx, int pbits);
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_subprime_len(EVP_PKEY_CTX *ctx, int qlen);
|
||||
int EVP_PKEY_CTX_set_dh_paramgen_generator(EVP_PKEY_CTX *ctx, int gen);
|
||||
int EVP_PKEY_CTX_set_dh_nid(EVP_PKEY_CTX *ctx, int nid);
|
||||
int EVP_PKEY_CTX_set_dh_rfc5114(EVP_PKEY_CTX *ctx, int gen);
|
||||
int EVP_PKEY_CTX_set_dhx_rfc5114(EVP_PKEY_CTX *ctx, int gen);
|
||||
int EVP_PKEY_CTX_set_dh_pad(EVP_PKEY_CTX *ctx, int pad);
|
||||
|
||||
int EVP_PKEY_CTX_set_dh_kdf_type(EVP_PKEY_CTX *ctx, int kdf);
|
||||
int EVP_PKEY_CTX_get_dh_kdf_type(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_CTX_set0_dh_kdf_oid(EVP_PKEY_CTX *ctx, ASN1_OBJECT *oid);
|
||||
int EVP_PKEY_CTX_get0_dh_kdf_oid(EVP_PKEY_CTX *ctx, ASN1_OBJECT **oid);
|
||||
int EVP_PKEY_CTX_set_dh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_get_dh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
||||
int EVP_PKEY_CTX_set_dh_kdf_outlen(EVP_PKEY_CTX *ctx, int len);
|
||||
int EVP_PKEY_CTX_get_dh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len);
|
||||
int EVP_PKEY_CTX_set0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm, int len);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int EVP_PKEY_CTX_get0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
|
||||
#endif
|
||||
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
|
||||
# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
|
||||
# define EVP_PKEY_CTRL_DH_NID (EVP_PKEY_ALG_CTRL + 15)
|
||||
# define EVP_PKEY_CTRL_DH_PAD (EVP_PKEY_ALG_CTRL + 16)
|
||||
|
||||
/* KDF types */
|
||||
# define EVP_PKEY_DH_KDF_NONE 1
|
||||
# define EVP_PKEY_DH_KDF_X9_42 2
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DH
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/asn1.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/bn.h>
|
||||
# endif
|
||||
# include <openssl/dherr.h>
|
||||
|
||||
# ifndef OPENSSL_DH_MAX_MODULUS_BITS
|
||||
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS
|
||||
# define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768
|
||||
# endif
|
||||
|
||||
# define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
|
||||
|
||||
# define DH_FLAG_CACHE_MONT_P 0x01
|
||||
|
||||
# define DH_FLAG_TYPE_MASK 0xF000
|
||||
# define DH_FLAG_TYPE_DH 0x0000
|
||||
# define DH_FLAG_TYPE_DHX 0x1000
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
/*
|
||||
* Does nothing. Previously this switched off constant time behaviour.
|
||||
*/
|
||||
# define DH_FLAG_NO_EXP_CONSTTIME 0x00
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/*
|
||||
* If this flag is set the DH method is FIPS compliant and can be used in
|
||||
* FIPS mode. This is set in the validated module method. If an application
|
||||
* sets this flag in its own methods it is its responsibility to ensure the
|
||||
* result is compliant.
|
||||
*/
|
||||
|
||||
# define DH_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/*
|
||||
* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
# define DH_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
# endif
|
||||
|
||||
/* Already defined in ossl_typ.h */
|
||||
/* typedef struct dh_st DH; */
|
||||
/* typedef struct dh_method DH_METHOD; */
|
||||
|
||||
DECLARE_ASN1_ITEM(DHparams)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DH_GENERATOR_2 2
|
||||
# define DH_GENERATOR_3 3
|
||||
# define DH_GENERATOR_5 5
|
||||
|
||||
/* DH_check error codes, some of them shared with DH_check_pub_key */
|
||||
/*
|
||||
* NB: These values must align with the equivalently named macros in
|
||||
* internal/ffc.h.
|
||||
*/
|
||||
# define DH_CHECK_P_NOT_PRIME 0x01
|
||||
# define DH_CHECK_P_NOT_SAFE_PRIME 0x02
|
||||
# define DH_UNABLE_TO_CHECK_GENERATOR 0x04
|
||||
# define DH_NOT_SUITABLE_GENERATOR 0x08
|
||||
# define DH_CHECK_Q_NOT_PRIME 0x10
|
||||
# define DH_CHECK_INVALID_Q_VALUE 0x20 /* +DH_check_pub_key */
|
||||
# define DH_CHECK_INVALID_J_VALUE 0x40
|
||||
# define DH_MODULUS_TOO_SMALL 0x80
|
||||
# define DH_MODULUS_TOO_LARGE 0x100 /* +DH_check_pub_key */
|
||||
|
||||
/* DH_check_pub_key error codes */
|
||||
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
|
||||
# define DH_CHECK_PUBKEY_TOO_LARGE 0x02
|
||||
# define DH_CHECK_PUBKEY_INVALID 0x04
|
||||
|
||||
/*
|
||||
* primes p where (p-1)/2 is prime too are called "safe"; we define this for
|
||||
* backward compatibility:
|
||||
*/
|
||||
# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
|
||||
|
||||
# define d2i_DHparams_fp(fp, x) \
|
||||
(DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
||||
(char *(*)())d2i_DHparams, \
|
||||
(fp), \
|
||||
(unsigned char **)(x))
|
||||
# define i2d_DHparams_fp(fp, x) \
|
||||
ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))
|
||||
# define d2i_DHparams_bio(bp, x) \
|
||||
ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)
|
||||
# define i2d_DHparams_bio(bp, x) \
|
||||
ASN1_i2d_bio_of(DH, i2d_DHparams, bp, x)
|
||||
|
||||
# define d2i_DHxparams_fp(fp,x) \
|
||||
(DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
||||
(char *(*)())d2i_DHxparams, \
|
||||
(fp), \
|
||||
(unsigned char **)(x))
|
||||
# define i2d_DHxparams_fp(fp, x) \
|
||||
ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))
|
||||
# define d2i_DHxparams_bio(bp, x) \
|
||||
ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)
|
||||
# define i2d_DHxparams_bio(bp, x) \
|
||||
ASN1_i2d_bio_of(DH, i2d_DHxparams, bp, x)
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_OpenSSL(void);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_set_default_method(const DH_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_get_default_method(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_set_method(DH *dh, const DH_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_up_ref(DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_bits(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_size(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_security_bits(const DH *dh);
|
||||
|
||||
# define DH_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, l, p, newf, dupf, freef)
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_set_ex_data(DH *d, int idx, void *arg);
|
||||
OSSL_DEPRECATEDIN_3_0 void *DH_get_ex_data(const DH *d, int idx);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_generate_parameters_ex(DH *dh, int prime_len,
|
||||
int generator,
|
||||
BN_GENCB *cb);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check_params_ex(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check_ex(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check_params(const DH *dh, int *ret);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check(const DH *dh, int *codes);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key,
|
||||
int *codes);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_generate_key(DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_compute_key(unsigned char *key,
|
||||
const BIGNUM *pub_key, DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_compute_key_padded(unsigned char *key,
|
||||
const BIGNUM *pub_key, DH *dh);
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHxparams)
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
OSSL_DEPRECATEDIN_3_0 int DHparams_print_fp(FILE *fp, const DH *x);
|
||||
# endif
|
||||
OSSL_DEPRECATEDIN_3_0 int DHparams_print(BIO *bp, const DH *x);
|
||||
|
||||
/* RFC 5114 parameters */
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_get_1024_160(void);
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_get_2048_224(void);
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_get_2048_256(void);
|
||||
|
||||
/* Named parameters, currently RFC7919 and RFC3526 */
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DH_new_by_nid(int nid);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_get_nid(const DH *dh);
|
||||
|
||||
/* RFC2631 KDF */
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_KDF_X9_42(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
ASN1_OBJECT *key_oid,
|
||||
const unsigned char *ukm,
|
||||
size_t ukmlen, const EVP_MD *md);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p,
|
||||
const BIGNUM **q, const BIGNUM **g);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key,
|
||||
const BIGNUM **priv_key);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_p(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_q(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_g(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_priv_key(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_pub_key(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_clear_flags(DH *dh, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_test_flags(const DH *dh, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_set_flags(DH *dh, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *DH_get0_engine(DH *d);
|
||||
OSSL_DEPRECATEDIN_3_0 long DH_get_length(const DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_set_length(DH *dh, long length);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 DH_METHOD *DH_meth_new(const char *name, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void DH_meth_free(DH_METHOD *dhm);
|
||||
OSSL_DEPRECATEDIN_3_0 DH_METHOD *DH_meth_dup(const DH_METHOD *dhm);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *DH_meth_get0_name(const DH_METHOD *dhm);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set1_name(DH_METHOD *dhm, const char *name);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_get_flags(const DH_METHOD *dhm);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_flags(DH_METHOD *dhm, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void *DH_meth_get0_app_data(const DH_METHOD *dhm);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data);
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_generate_key(const DH_METHOD *dhm)) (DH *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_generate_key(DH_METHOD *dhm,
|
||||
int (*generate_key) (DH *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_compute_key(const DH_METHOD *dhm))
|
||||
(unsigned char *key,
|
||||
const BIGNUM *pub_key,
|
||||
DH *dh);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_compute_key(DH_METHOD *dhm,
|
||||
int (*compute_key)
|
||||
(unsigned char *key,
|
||||
const BIGNUM *pub_key,
|
||||
DH *dh));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm))
|
||||
(const DH *, BIGNUM *,
|
||||
const BIGNUM *,
|
||||
const BIGNUM *,
|
||||
const BIGNUM *, BN_CTX *,
|
||||
BN_MONT_CTX *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_bn_mod_exp(DH_METHOD *dhm,
|
||||
int (*bn_mod_exp)
|
||||
(const DH *, BIGNUM *,
|
||||
const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, BN_CTX *,
|
||||
BN_MONT_CTX *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_finish(const DH_METHOD *dhm)) (DH *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_finish(DH_METHOD *dhm, int (*finish) (DH *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_generate_params(const DH_METHOD *dhm))
|
||||
(DH *, int, int,
|
||||
BN_GENCB *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DH_meth_set_generate_params(DH_METHOD *dhm,
|
||||
int (*generate_params)
|
||||
(DH *, int, int,
|
||||
BN_GENCB *));
|
||||
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8 DH *DH_generate_parameters(int prime_len, int generator,
|
||||
void (*callback) (int, int,
|
||||
void *),
|
||||
void *cb_arg);
|
||||
# endif
|
||||
|
||||
# endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_DHERR_H
|
||||
# define OPENSSL_DHERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
# ifndef OPENSSL_NO_DH
|
||||
|
||||
|
||||
/*
|
||||
* DH reason codes.
|
||||
*/
|
||||
# define DH_R_BAD_FFC_PARAMETERS 127
|
||||
# define DH_R_BAD_GENERATOR 101
|
||||
# define DH_R_BN_DECODE_ERROR 109
|
||||
# define DH_R_BN_ERROR 106
|
||||
# define DH_R_CHECK_INVALID_J_VALUE 115
|
||||
# define DH_R_CHECK_INVALID_Q_VALUE 116
|
||||
# define DH_R_CHECK_PUBKEY_INVALID 122
|
||||
# define DH_R_CHECK_PUBKEY_TOO_LARGE 123
|
||||
# define DH_R_CHECK_PUBKEY_TOO_SMALL 124
|
||||
# define DH_R_CHECK_P_NOT_PRIME 117
|
||||
# define DH_R_CHECK_P_NOT_SAFE_PRIME 118
|
||||
# define DH_R_CHECK_Q_NOT_PRIME 119
|
||||
# define DH_R_DECODE_ERROR 104
|
||||
# define DH_R_INVALID_PARAMETER_NAME 110
|
||||
# define DH_R_INVALID_PARAMETER_NID 114
|
||||
# define DH_R_INVALID_PUBKEY 102
|
||||
# define DH_R_INVALID_SECRET 128
|
||||
# define DH_R_KDF_PARAMETER_ERROR 112
|
||||
# define DH_R_KEYS_NOT_SET 108
|
||||
# define DH_R_MISSING_PUBKEY 125
|
||||
# define DH_R_MODULUS_TOO_LARGE 103
|
||||
# define DH_R_MODULUS_TOO_SMALL 126
|
||||
# define DH_R_NOT_SUITABLE_GENERATOR 120
|
||||
# define DH_R_NO_PARAMETERS_SET 107
|
||||
# define DH_R_NO_PRIVATE_VALUE 100
|
||||
# define DH_R_PARAMETER_ENCODING_ERROR 105
|
||||
# define DH_R_PEER_KEY_ERROR 111
|
||||
# define DH_R_Q_TOO_LARGE 130
|
||||
# define DH_R_SHARED_INFO_ERROR 113
|
||||
# define DH_R_UNABLE_TO_CHECK_GENERATOR 121
|
||||
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_DSA_H
|
||||
# define OPENSSL_DSA_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_DSA_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/types.h>
|
||||
|
||||
# include <stdlib.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/asn1.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/bn.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/dh.h>
|
||||
# endif
|
||||
# include <openssl/dsaerr.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_bits(EVP_PKEY_CTX *ctx, int nbits);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_q_bits(EVP_PKEY_CTX *ctx, int qbits);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_md_props(EVP_PKEY_CTX *ctx,
|
||||
const char *md_name,
|
||||
const char *md_properties);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_gindex(EVP_PKEY_CTX *ctx, int gindex);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_type(EVP_PKEY_CTX *ctx, const char *name);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_seed(EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *seed,
|
||||
size_t seedlen);
|
||||
int EVP_PKEY_CTX_set_dsa_paramgen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
|
||||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1)
|
||||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2)
|
||||
# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3)
|
||||
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
# ifndef OPENSSL_DSA_MAX_MODULUS_BITS
|
||||
# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
|
||||
# endif
|
||||
|
||||
# define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024
|
||||
|
||||
typedef struct DSA_SIG_st DSA_SIG;
|
||||
DSA_SIG *DSA_SIG_new(void);
|
||||
void DSA_SIG_free(DSA_SIG *a);
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only(DSA_SIG, DSA_SIG)
|
||||
void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
|
||||
int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
|
||||
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
/*
|
||||
* Does nothing. Previously this switched off constant time behaviour.
|
||||
*/
|
||||
# define DSA_FLAG_NO_EXP_CONSTTIME 0x00
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DSA_FLAG_CACHE_MONT_P 0x01
|
||||
|
||||
/*
|
||||
* If this flag is set the DSA method is FIPS compliant and can be used in
|
||||
* FIPS mode. This is set in the validated module method. If an application
|
||||
* sets this flag in its own methods it is its responsibility to ensure the
|
||||
* result is compliant.
|
||||
*/
|
||||
|
||||
# define DSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/*
|
||||
* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
# define DSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
# define DSA_FLAG_FIPS_CHECKED 0x0800
|
||||
|
||||
/* Already defined in ossl_typ.h */
|
||||
/* typedef struct dsa_st DSA; */
|
||||
/* typedef struct dsa_method DSA_METHOD; */
|
||||
|
||||
# define d2i_DSAparams_fp(fp, x) \
|
||||
(DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
|
||||
(char *(*)())d2i_DSAparams, (fp), \
|
||||
(unsigned char **)(x))
|
||||
# define i2d_DSAparams_fp(fp, x) \
|
||||
ASN1_i2d_fp(i2d_DSAparams, (fp), (unsigned char *)(x))
|
||||
# define d2i_DSAparams_bio(bp, x) \
|
||||
ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSAparams, bp, x)
|
||||
# define i2d_DSAparams_bio(bp, x) \
|
||||
ASN1_i2d_bio_of(DSA, i2d_DSAparams, bp, x)
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DSA, DSAparams)
|
||||
OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen,
|
||||
DSA *dsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
|
||||
DSA_SIG *sig, DSA *dsa);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_OpenSSL(void);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_set_default_method(const DSA_METHOD *);
|
||||
OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_default_method(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_set_method(DSA *dsa, const DSA_METHOD *);
|
||||
OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_method(DSA *d);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 DSA *DSA_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine);
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_free(DSA *r);
|
||||
/* "up" the DSA object's reference count */
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_up_ref(DSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_size(const DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_bits(const DSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_security_bits(const DSA *d);
|
||||
/* next 4 return -1 on error */
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||
BIGNUM **kinvp, BIGNUM **rp);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_sign(int type, const unsigned char *dgst,
|
||||
int dlen, unsigned char *sig,
|
||||
unsigned int *siglen, DSA *dsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_verify(int type, const unsigned char *dgst,
|
||||
int dgst_len, const unsigned char *sigbuf,
|
||||
int siglen, DSA *dsa);
|
||||
|
||||
# define DSA_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef)
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_set_ex_data(DSA *d, int idx, void *arg);
|
||||
OSSL_DEPRECATEDIN_3_0 void *DSA_get_ex_data(const DSA *d, int idx);
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
|
||||
DSA, DSAPublicKey)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
|
||||
DSA, DSAPrivateKey)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
|
||||
DSA, DSAparams)
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
/* Deprecated version */
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
DSA *DSA_generate_parameters(int bits, unsigned char *seed, int seed_len,
|
||||
int *counter_ret, unsigned long *h_ret,
|
||||
void (*callback) (int, int, void *),
|
||||
void *cb_arg);
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* New version */
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_generate_parameters_ex(DSA *dsa, int bits,
|
||||
const unsigned char *seed,
|
||||
int seed_len,
|
||||
int *counter_ret,
|
||||
unsigned long *h_ret,
|
||||
BN_GENCB *cb);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_generate_key(DSA *a);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int DSAparams_print(BIO *bp, const DSA *x);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_print(BIO *bp, const DSA *x, int off);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
OSSL_DEPRECATEDIN_3_0 int DSAparams_print_fp(FILE *fp, const DSA *x);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_print_fp(FILE *bp, const DSA *x, int off);
|
||||
# endif
|
||||
|
||||
# define DSS_prime_checks 64
|
||||
/*
|
||||
* Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only
|
||||
* have one value here we set the number of checks to 64 which is the 128 bit
|
||||
* security level that is the highest level and valid for creating a 3072 bit
|
||||
* DSA key.
|
||||
*/
|
||||
# define DSA_is_prime(n, callback, cb_arg) \
|
||||
BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
|
||||
|
||||
# ifndef OPENSSL_NO_DH
|
||||
/*
|
||||
* Convert DSA structure (key or just parameters) into DH structure (be
|
||||
* careful to avoid small subgroup attacks when using this!)
|
||||
*/
|
||||
OSSL_DEPRECATEDIN_3_0 DH *DSA_dup_DH(const DSA *r);
|
||||
# endif
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_get0_pqg(const DSA *d, const BIGNUM **p,
|
||||
const BIGNUM **q, const BIGNUM **g);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_get0_key(const DSA *d, const BIGNUM **pub_key,
|
||||
const BIGNUM **priv_key);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_set0_key(DSA *d, BIGNUM *pub_key,
|
||||
BIGNUM *priv_key);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_p(const DSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_q(const DSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_g(const DSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_pub_key(const DSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_priv_key(const DSA *d);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_setnull_priv_key(DSA *d);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_clear_flags(DSA *d, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_test_flags(const DSA *d, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_set_flags(DSA *d, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *DSA_get0_engine(DSA *d);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 DSA_METHOD *DSA_meth_new(const char *name, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void DSA_meth_free(DSA_METHOD *dsam);
|
||||
OSSL_DEPRECATEDIN_3_0 DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *DSA_meth_get0_name(const DSA_METHOD *dsam);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set1_name(DSA_METHOD *dsam,
|
||||
const char *name);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_get_flags(const DSA_METHOD *dsam);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_flags(DSA_METHOD *dsam, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void *DSA_meth_get0_app_data(const DSA_METHOD *dsam);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set0_app_data(DSA_METHOD *dsam,
|
||||
void *app_data);
|
||||
OSSL_DEPRECATEDIN_3_0 DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))
|
||||
(const unsigned char *, int, DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_sign(DSA_METHOD *dsam,
|
||||
DSA_SIG *(*sign) (const unsigned char *, int, DSA *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))
|
||||
(DSA *, BN_CTX *, BIGNUM **, BIGNUM **);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_sign_setup(DSA_METHOD *dsam,
|
||||
int (*sign_setup) (DSA *, BN_CTX *, BIGNUM **, BIGNUM **));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_verify(const DSA_METHOD *dsam))
|
||||
(const unsigned char *, int, DSA_SIG *, DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_verify(DSA_METHOD *dsam,
|
||||
int (*verify) (const unsigned char *, int, DSA_SIG *, DSA *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))
|
||||
(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, const BIGNUM *, BN_CTX *, BN_MONT_CTX *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_mod_exp(DSA_METHOD *dsam,
|
||||
int (*mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *,
|
||||
BN_MONT_CTX *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))
|
||||
(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
BN_CTX *, BN_MONT_CTX *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam,
|
||||
int (*bn_mod_exp) (DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
||||
const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_init(DSA_METHOD *dsam,
|
||||
int (*init)(DSA *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_finish(const DSA_METHOD *dsam))(DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_finish(DSA_METHOD *dsam,
|
||||
int (*finish)(DSA *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))
|
||||
(DSA *, int, const unsigned char *, int, int *, unsigned long *,
|
||||
BN_GENCB *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_paramgen(DSA_METHOD *dsam,
|
||||
int (*paramgen) (DSA *, int, const unsigned char *, int, int *,
|
||||
unsigned long *, BN_GENCB *));
|
||||
OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_keygen(const DSA_METHOD *dsam))(DSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_keygen(DSA_METHOD *dsam,
|
||||
int (*keygen) (DSA *));
|
||||
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_DSAERR_H
|
||||
# define OPENSSL_DSAERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
|
||||
|
||||
/*
|
||||
* DSA reason codes.
|
||||
*/
|
||||
# define DSA_R_BAD_FFC_PARAMETERS 114
|
||||
# define DSA_R_BAD_Q_VALUE 102
|
||||
# define DSA_R_BN_DECODE_ERROR 108
|
||||
# define DSA_R_BN_ERROR 109
|
||||
# define DSA_R_DECODE_ERROR 104
|
||||
# define DSA_R_INVALID_DIGEST_TYPE 106
|
||||
# define DSA_R_INVALID_PARAMETERS 112
|
||||
# define DSA_R_MISSING_PARAMETERS 101
|
||||
# define DSA_R_MISSING_PRIVATE_KEY 111
|
||||
# define DSA_R_MODULUS_TOO_LARGE 103
|
||||
# define DSA_R_NO_PARAMETERS_SET 107
|
||||
# define DSA_R_PARAMETER_ENCODING_ERROR 105
|
||||
# define DSA_R_P_NOT_PRIME 115
|
||||
# define DSA_R_Q_NOT_PRIME 113
|
||||
# define DSA_R_SEED_LEN_SMALL 110
|
||||
# define DSA_R_TOO_MANY_RETRIES 116
|
||||
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2005-2021 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_DTLS1_H
|
||||
# define OPENSSL_DTLS1_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_DTLS1_H
|
||||
# endif
|
||||
|
||||
# include <openssl/prov_ssl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
/* DTLS*_VERSION constants are defined in prov_ssl.h */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DTLS_MIN_VERSION DTLS1_VERSION
|
||||
# define DTLS_MAX_VERSION DTLS1_2_VERSION
|
||||
# endif
|
||||
# define DTLS1_VERSION_MAJOR 0xFE
|
||||
|
||||
/* Special value for method supporting multiple versions */
|
||||
# define DTLS_ANY_VERSION 0x1FFFF
|
||||
|
||||
/* lengths of messages */
|
||||
|
||||
# define DTLS1_COOKIE_LENGTH 255
|
||||
|
||||
# define DTLS1_RT_HEADER_LENGTH 13
|
||||
|
||||
# define DTLS1_HM_HEADER_LENGTH 12
|
||||
|
||||
# define DTLS1_HM_BAD_FRAGMENT -2
|
||||
# define DTLS1_HM_FRAGMENT_RETRY -3
|
||||
|
||||
# define DTLS1_CCS_HEADER_LENGTH 1
|
||||
|
||||
# define DTLS1_AL_HEADER_LENGTH 2
|
||||
|
||||
# define DTLS1_TMO_ALERT_COUNT 12
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_E_OS2_H
|
||||
# define OPENSSL_E_OS2_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_E_OS2_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Detect operating systems. This probably needs completing.
|
||||
* The result is that at least one OPENSSL_SYS_os macro should be defined.
|
||||
* However, if none is defined, Unix is assumed.
|
||||
**/
|
||||
|
||||
# define OPENSSL_SYS_UNIX
|
||||
|
||||
/* --------------------- Microsoft operating systems ---------------------- */
|
||||
|
||||
/*
|
||||
* Note that MSDOS actually denotes 32-bit environments running on top of
|
||||
* MS-DOS, such as DJGPP one.
|
||||
*/
|
||||
# if defined(OPENSSL_SYS_MSDOS)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# endif
|
||||
|
||||
/*
|
||||
* For 32 bit environment, there seems to be the CygWin environment and then
|
||||
* all the others that try to do the same thing Microsoft does...
|
||||
*/
|
||||
/*
|
||||
* UEFI lives here because it might be built with a Microsoft toolchain and
|
||||
* we need to avoid the false positive match on Windows.
|
||||
*/
|
||||
# if defined(OPENSSL_SYS_UEFI)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# elif defined(OPENSSL_SYS_UWIN)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# define OPENSSL_SYS_WIN32_UWIN
|
||||
# else
|
||||
# if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN)
|
||||
# define OPENSSL_SYS_WIN32_CYGWIN
|
||||
# else
|
||||
# if defined(_WIN32) || defined(OPENSSL_SYS_WIN32)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# if !defined(OPENSSL_SYS_WIN32)
|
||||
# define OPENSSL_SYS_WIN32
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_WIN64) || defined(OPENSSL_SYS_WIN64)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# if !defined(OPENSSL_SYS_WIN64)
|
||||
# define OPENSSL_SYS_WIN64
|
||||
# endif
|
||||
# endif
|
||||
# if defined(OPENSSL_SYS_WINNT)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# endif
|
||||
# if defined(OPENSSL_SYS_WINCE)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Anything that tries to look like Microsoft is "Windows" */
|
||||
# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# define OPENSSL_SYS_WINDOWS
|
||||
# ifndef OPENSSL_SYS_MSDOS
|
||||
# define OPENSSL_SYS_MSDOS
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* DLL settings. This part is a bit tough, because it's up to the
|
||||
* application implementor how he or she will link the application, so it
|
||||
* requires some macro to be used.
|
||||
*/
|
||||
# ifdef OPENSSL_SYS_WINDOWS
|
||||
# ifndef OPENSSL_OPT_WINDLL
|
||||
# if defined(_WINDLL) /* This is used when building OpenSSL to
|
||||
* indicate that DLL linkage should be used */
|
||||
# define OPENSSL_OPT_WINDLL
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* ------------------------------- OpenVMS -------------------------------- */
|
||||
# if defined(__VMS) || defined(VMS)
|
||||
# if !defined(OPENSSL_SYS_VMS)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# define OPENSSL_SYS_VMS
|
||||
# endif
|
||||
# if defined(__DECC)
|
||||
# define OPENSSL_SYS_VMS_DECC
|
||||
# elif defined(__DECCXX)
|
||||
# define OPENSSL_SYS_VMS_DECC
|
||||
# define OPENSSL_SYS_VMS_DECCXX
|
||||
# else
|
||||
# define OPENSSL_SYS_VMS_NODECC
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* -------------------------------- Unix ---------------------------------- */
|
||||
# ifdef OPENSSL_SYS_UNIX
|
||||
# if defined(linux) || defined(__linux__) && !defined(OPENSSL_SYS_LINUX)
|
||||
# define OPENSSL_SYS_LINUX
|
||||
# endif
|
||||
# if defined(_AIX) && !defined(OPENSSL_SYS_AIX)
|
||||
# define OPENSSL_SYS_AIX
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* -------------------------------- VOS ----------------------------------- */
|
||||
# if defined(__VOS__) && !defined(OPENSSL_SYS_VOS)
|
||||
# define OPENSSL_SYS_VOS
|
||||
# ifdef __HPPA__
|
||||
# define OPENSSL_SYS_VOS_HPPA
|
||||
# endif
|
||||
# ifdef __IA32__
|
||||
# define OPENSSL_SYS_VOS_IA32
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* ---------------------------- HP NonStop -------------------------------- */
|
||||
# ifdef __TANDEM
|
||||
# ifdef _STRING
|
||||
# include <strings.h>
|
||||
# endif
|
||||
# define OPENSSL_USE_BUILD_DATE
|
||||
# if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_)
|
||||
# define SPT_THREAD_SIGNAL 1
|
||||
# define SPT_THREAD_AWARE 1
|
||||
# include <spthread.h>
|
||||
# elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_)
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* -------------------------------- VxWorks ----------------------------------- */
|
||||
# if defined(OPENSSL_SYS_VXWORKS)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# undef ENGINESDIR
|
||||
# endif
|
||||
|
||||
/**
|
||||
* That's it for OS-specific stuff
|
||||
*****************************************************************************/
|
||||
|
||||
/*-
|
||||
* OPENSSL_EXTERN is normally used to declare a symbol with possible extra
|
||||
* attributes to handle its presence in a shared library.
|
||||
* OPENSSL_EXPORT is used to define a symbol with extra possible attributes
|
||||
* to make it visible in a shared library.
|
||||
* Care needs to be taken when a header file is used both to declare and
|
||||
* define symbols. Basically, for any library that exports some global
|
||||
* variables, the following code must be present in the header file that
|
||||
* declares them, before OPENSSL_EXTERN is used:
|
||||
*
|
||||
* #ifdef SOME_BUILD_FLAG_MACRO
|
||||
* # undef OPENSSL_EXTERN
|
||||
* # define OPENSSL_EXTERN OPENSSL_EXPORT
|
||||
* #endif
|
||||
*
|
||||
* The default is to have OPENSSL_EXPORT and OPENSSL_EXTERN
|
||||
* have some generally sensible values.
|
||||
*/
|
||||
|
||||
# if defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
|
||||
# define OPENSSL_EXPORT extern __declspec(dllexport)
|
||||
# define OPENSSL_EXTERN extern __declspec(dllimport)
|
||||
# else
|
||||
# define OPENSSL_EXPORT extern
|
||||
# define OPENSSL_EXTERN extern
|
||||
# endif
|
||||
|
||||
# ifdef _WIN32
|
||||
# ifdef _WIN64
|
||||
# define ossl_ssize_t __int64
|
||||
# define OSSL_SSIZE_MAX _I64_MAX
|
||||
# else
|
||||
# define ossl_ssize_t int
|
||||
# define OSSL_SSIZE_MAX INT_MAX
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t)
|
||||
# define ossl_ssize_t INTN
|
||||
# define OSSL_SSIZE_MAX MAX_INTN
|
||||
# endif
|
||||
|
||||
# ifndef ossl_ssize_t
|
||||
# define ossl_ssize_t ssize_t
|
||||
# if defined(SSIZE_MAX)
|
||||
# define OSSL_SSIZE_MAX SSIZE_MAX
|
||||
# elif defined(_POSIX_SSIZE_MAX)
|
||||
# define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
|
||||
# else
|
||||
# define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX>>1))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(UNUSEDRESULT_DEBUG)
|
||||
# define __owur __attribute__((__warn_unused_result__))
|
||||
# else
|
||||
# define __owur
|
||||
# endif
|
||||
|
||||
/* Standard integer types */
|
||||
# define OPENSSL_NO_INTTYPES_H
|
||||
# define OPENSSL_NO_STDINT_H
|
||||
# if defined(OPENSSL_SYS_UEFI)
|
||||
typedef INT8 int8_t;
|
||||
typedef UINT8 uint8_t;
|
||||
typedef INT16 int16_t;
|
||||
typedef UINT16 uint16_t;
|
||||
typedef INT32 int32_t;
|
||||
typedef UINT32 uint32_t;
|
||||
typedef INT64 int64_t;
|
||||
typedef UINT64 uint64_t;
|
||||
# elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
defined(__osf__) || defined(__sgi) || defined(__hpux) || \
|
||||
defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__)
|
||||
# include <inttypes.h>
|
||||
# undef OPENSSL_NO_INTTYPES_H
|
||||
/* Because the specs say that inttypes.h includes stdint.h if present */
|
||||
# undef OPENSSL_NO_STDINT_H
|
||||
# elif defined(_MSC_VER) && _MSC_VER<1600
|
||||
/*
|
||||
* minimally required typdefs for systems not supporting inttypes.h or
|
||||
* stdint.h: currently just older VC++
|
||||
*/
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# elif defined(OPENSSL_SYS_TANDEM)
|
||||
# include <stdint.h>
|
||||
# include <sys/types.h>
|
||||
# else
|
||||
# include <stdint.h>
|
||||
# undef OPENSSL_NO_STDINT_H
|
||||
# endif
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
|
||||
defined(INTMAX_MAX) && defined(UINTMAX_MAX)
|
||||
typedef intmax_t ossl_intmax_t;
|
||||
typedef uintmax_t ossl_uintmax_t;
|
||||
# else
|
||||
/* Fall back to the largest we know we require and can handle */
|
||||
typedef int64_t ossl_intmax_t;
|
||||
typedef uint64_t ossl_uintmax_t;
|
||||
# endif
|
||||
|
||||
/* ossl_inline: portable inline definition usable in public headers */
|
||||
# if !defined(inline) && !defined(__cplusplus)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
|
||||
/* just use inline */
|
||||
# define ossl_inline inline
|
||||
# elif defined(__GNUC__) && __GNUC__>=2
|
||||
# define ossl_inline __inline__
|
||||
# elif defined(_MSC_VER)
|
||||
/*
|
||||
* Visual Studio: inline is available in C++ only, however
|
||||
* __inline is available for C, see
|
||||
* http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx
|
||||
*/
|
||||
# define ossl_inline __inline
|
||||
# else
|
||||
# define ossl_inline
|
||||
# endif
|
||||
# else
|
||||
# define ossl_inline inline
|
||||
# endif
|
||||
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && \
|
||||
!defined(__cplusplus)
|
||||
# define ossl_noreturn _Noreturn
|
||||
# elif defined(__GNUC__) && __GNUC__ >= 2
|
||||
# define ossl_noreturn __attribute__((noreturn))
|
||||
# else
|
||||
# define ossl_noreturn
|
||||
# endif
|
||||
|
||||
/* ossl_unused: portable unused attribute for use in public headers */
|
||||
# if defined(__GNUC__)
|
||||
# define ossl_unused __attribute__((unused))
|
||||
# else
|
||||
# define ossl_unused
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_ECERR_H
|
||||
# define OPENSSL_ECERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
# ifndef OPENSSL_NO_EC
|
||||
|
||||
|
||||
/*
|
||||
* EC reason codes.
|
||||
*/
|
||||
# define EC_R_ASN1_ERROR 115
|
||||
# define EC_R_BAD_SIGNATURE 156
|
||||
# define EC_R_BIGNUM_OUT_OF_RANGE 144
|
||||
# define EC_R_BUFFER_TOO_SMALL 100
|
||||
# define EC_R_CANNOT_INVERT 165
|
||||
# define EC_R_COORDINATES_OUT_OF_RANGE 146
|
||||
# define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160
|
||||
# define EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA 170
|
||||
# define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159
|
||||
# define EC_R_DECODE_ERROR 142
|
||||
# define EC_R_DISCRIMINANT_IS_ZERO 118
|
||||
# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
|
||||
# define EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED 127
|
||||
# define EC_R_FAILED_MAKING_PUBLIC_KEY 166
|
||||
# define EC_R_FIELD_TOO_LARGE 143
|
||||
# define EC_R_GF2M_NOT_SUPPORTED 147
|
||||
# define EC_R_GROUP2PKPARAMETERS_FAILURE 120
|
||||
# define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
|
||||
# define EC_R_INCOMPATIBLE_OBJECTS 101
|
||||
# define EC_R_INVALID_A 168
|
||||
# define EC_R_INVALID_ARGUMENT 112
|
||||
# define EC_R_INVALID_B 169
|
||||
# define EC_R_INVALID_COFACTOR 171
|
||||
# define EC_R_INVALID_COMPRESSED_POINT 110
|
||||
# define EC_R_INVALID_COMPRESSION_BIT 109
|
||||
# define EC_R_INVALID_CURVE 141
|
||||
# define EC_R_INVALID_DIGEST 151
|
||||
# define EC_R_INVALID_DIGEST_TYPE 138
|
||||
# define EC_R_INVALID_ENCODING 102
|
||||
# define EC_R_INVALID_FIELD 103
|
||||
# define EC_R_INVALID_FORM 104
|
||||
# define EC_R_INVALID_GENERATOR 173
|
||||
# define EC_R_INVALID_GROUP_ORDER 122
|
||||
# define EC_R_INVALID_KEY 116
|
||||
# define EC_R_INVALID_LENGTH 117
|
||||
# define EC_R_INVALID_NAMED_GROUP_CONVERSION 174
|
||||
# define EC_R_INVALID_OUTPUT_LENGTH 161
|
||||
# define EC_R_INVALID_P 172
|
||||
# define EC_R_INVALID_PEER_KEY 133
|
||||
# define EC_R_INVALID_PENTANOMIAL_BASIS 132
|
||||
# define EC_R_INVALID_PRIVATE_KEY 123
|
||||
# define EC_R_INVALID_SEED 175
|
||||
# define EC_R_INVALID_TRINOMIAL_BASIS 137
|
||||
# define EC_R_KDF_PARAMETER_ERROR 148
|
||||
# define EC_R_KEYS_NOT_SET 140
|
||||
# define EC_R_LADDER_POST_FAILURE 136
|
||||
# define EC_R_LADDER_PRE_FAILURE 153
|
||||
# define EC_R_LADDER_STEP_FAILURE 162
|
||||
# define EC_R_MISSING_OID 167
|
||||
# define EC_R_MISSING_PARAMETERS 124
|
||||
# define EC_R_MISSING_PRIVATE_KEY 125
|
||||
# define EC_R_NEED_NEW_SETUP_VALUES 157
|
||||
# define EC_R_NOT_A_NIST_PRIME 135
|
||||
# define EC_R_NOT_IMPLEMENTED 126
|
||||
# define EC_R_NOT_INITIALIZED 111
|
||||
# define EC_R_NO_PARAMETERS_SET 139
|
||||
# define EC_R_NO_PRIVATE_VALUE 154
|
||||
# define EC_R_OPERATION_NOT_SUPPORTED 152
|
||||
# define EC_R_PASSED_NULL_PARAMETER 134
|
||||
# define EC_R_PEER_KEY_ERROR 149
|
||||
# define EC_R_POINT_ARITHMETIC_FAILURE 155
|
||||
# define EC_R_POINT_AT_INFINITY 106
|
||||
# define EC_R_POINT_COORDINATES_BLIND_FAILURE 163
|
||||
# define EC_R_POINT_IS_NOT_ON_CURVE 107
|
||||
# define EC_R_RANDOM_NUMBER_GENERATION_FAILED 158
|
||||
# define EC_R_SHARED_INFO_ERROR 150
|
||||
# define EC_R_SLOT_FULL 108
|
||||
# define EC_R_TOO_MANY_RETRIES 176
|
||||
# define EC_R_UNDEFINED_GENERATOR 113
|
||||
# define EC_R_UNDEFINED_ORDER 128
|
||||
# define EC_R_UNKNOWN_COFACTOR 164
|
||||
# define EC_R_UNKNOWN_GROUP 129
|
||||
# define EC_R_UNKNOWN_ORDER 114
|
||||
# define EC_R_UNSUPPORTED_FIELD 131
|
||||
# define EC_R_WRONG_CURVE_PARAMETERS 145
|
||||
# define EC_R_WRONG_ORDER 130
|
||||
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,833 @@
|
||||
/*
|
||||
* Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. 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_ENGINE_H
|
||||
# define OPENSSL_ENGINE_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_ENGINE_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/bn.h>
|
||||
# include <openssl/rsa.h>
|
||||
# include <openssl/dsa.h>
|
||||
# include <openssl/dh.h>
|
||||
# include <openssl/ec.h>
|
||||
# include <openssl/rand.h>
|
||||
# include <openssl/ui.h>
|
||||
# include <openssl/err.h>
|
||||
# endif
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/engineerr.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*
|
||||
* These flags are used to control combinations of algorithm (methods) by
|
||||
* bitwise "OR"ing.
|
||||
*/
|
||||
# define ENGINE_METHOD_RSA (unsigned int)0x0001
|
||||
# define ENGINE_METHOD_DSA (unsigned int)0x0002
|
||||
# define ENGINE_METHOD_DH (unsigned int)0x0004
|
||||
# define ENGINE_METHOD_RAND (unsigned int)0x0008
|
||||
# define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
|
||||
# define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
|
||||
# define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
|
||||
# define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
|
||||
# define ENGINE_METHOD_EC (unsigned int)0x0800
|
||||
/* Obvious all-or-nothing cases. */
|
||||
# define ENGINE_METHOD_ALL (unsigned int)0xFFFF
|
||||
# define ENGINE_METHOD_NONE (unsigned int)0x0000
|
||||
|
||||
/*
|
||||
* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
|
||||
* internally to control registration of ENGINE implementations, and can be
|
||||
* set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
|
||||
* initialise registered ENGINEs if they are not already initialised.
|
||||
*/
|
||||
# define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
|
||||
|
||||
/* ENGINE flags that can be set by ENGINE_set_flags(). */
|
||||
/* Not used */
|
||||
/* #define ENGINE_FLAGS_MALLOCED 0x0001 */
|
||||
|
||||
/*
|
||||
* This flag is for ENGINEs that wish to handle the various 'CMD'-related
|
||||
* control commands on their own. Without this flag, ENGINE_ctrl() handles
|
||||
* these control commands on behalf of the ENGINE using their "cmd_defns"
|
||||
* data.
|
||||
*/
|
||||
# define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
|
||||
|
||||
/*
|
||||
* This flag is for ENGINEs who return new duplicate structures when found
|
||||
* via "ENGINE_by_id()". When an ENGINE must store state (eg. if
|
||||
* ENGINE_ctrl() commands are called in sequence as part of some stateful
|
||||
* process like key-generation setup and execution), it can set this flag -
|
||||
* then each attempt to obtain the ENGINE will result in it being copied into
|
||||
* a new structure. Normally, ENGINEs don't declare this flag so
|
||||
* ENGINE_by_id() just increments the existing ENGINE's structural reference
|
||||
* count.
|
||||
*/
|
||||
# define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
|
||||
|
||||
/*
|
||||
* This flag if for an ENGINE that does not want its methods registered as
|
||||
* part of ENGINE_register_all_complete() for example if the methods are not
|
||||
* usable as default methods.
|
||||
*/
|
||||
|
||||
# define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
|
||||
|
||||
/*
|
||||
* ENGINEs can support their own command types, and these flags are used in
|
||||
* ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input
|
||||
* each command expects. Currently only numeric and string input is
|
||||
* supported. If a control command supports none of the _NUMERIC, _STRING, or
|
||||
* _NO_INPUT options, then it is regarded as an "internal" control command -
|
||||
* and not for use in config setting situations. As such, they're not
|
||||
* available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()
|
||||
* access. Changes to this list of 'command types' should be reflected
|
||||
* carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().
|
||||
*/
|
||||
|
||||
/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
|
||||
# define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
|
||||
/*
|
||||
* accepts string input (cast from 'void*' to 'const char *', 4th parameter
|
||||
* to ENGINE_ctrl)
|
||||
*/
|
||||
# define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
|
||||
/*
|
||||
* Indicates that the control command takes *no* input. Ie. the control
|
||||
* command is unparameterised.
|
||||
*/
|
||||
# define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
|
||||
/*
|
||||
* Indicates that the control command is internal. This control command won't
|
||||
* be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
|
||||
* function.
|
||||
*/
|
||||
# define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
|
||||
|
||||
/*
|
||||
* NB: These 3 control commands are deprecated and should not be used.
|
||||
* ENGINEs relying on these commands should compile conditional support for
|
||||
* compatibility (eg. if these symbols are defined) but should also migrate
|
||||
* the same functionality to their own ENGINE-specific control functions that
|
||||
* can be "discovered" by calling applications. The fact these control
|
||||
* commands wouldn't be "executable" (ie. usable by text-based config)
|
||||
* doesn't change the fact that application code can find and use them
|
||||
* without requiring per-ENGINE hacking.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These flags are used to tell the ctrl function what should be done. All
|
||||
* command numbers are shared between all engines, even if some don't make
|
||||
* sense to some engines. In such a case, they do nothing but return the
|
||||
* error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.
|
||||
*/
|
||||
# define ENGINE_CTRL_SET_LOGSTREAM 1
|
||||
# define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
|
||||
# define ENGINE_CTRL_HUP 3/* Close and reinitialise
|
||||
* any handles/connections
|
||||
* etc. */
|
||||
# define ENGINE_CTRL_SET_USER_INTERFACE 4/* Alternative to callback */
|
||||
# define ENGINE_CTRL_SET_CALLBACK_DATA 5/* User-specific data, used
|
||||
* when calling the password
|
||||
* callback and the user
|
||||
* interface */
|
||||
# define ENGINE_CTRL_LOAD_CONFIGURATION 6/* Load a configuration,
|
||||
* given a string that
|
||||
* represents a file name
|
||||
* or so */
|
||||
# define ENGINE_CTRL_LOAD_SECTION 7/* Load data from a given
|
||||
* section in the already
|
||||
* loaded configuration */
|
||||
|
||||
/*
|
||||
* These control commands allow an application to deal with an arbitrary
|
||||
* engine in a dynamic way. Warn: Negative return values indicate errors FOR
|
||||
* THESE COMMANDS because zero is used to indicate 'end-of-list'. Other
|
||||
* commands, including ENGINE-specific command types, return zero for an
|
||||
* error. An ENGINE can choose to implement these ctrl functions, and can
|
||||
* internally manage things however it chooses - it does so by setting the
|
||||
* ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise
|
||||
* the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
|
||||
* cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
|
||||
* ctrl() handler need only implement its own commands - the above "meta"
|
||||
* commands will be taken care of.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
|
||||
* then all the remaining control commands will return failure, so it is
|
||||
* worth checking this first if the caller is trying to "discover" the
|
||||
* engine's capabilities and doesn't want errors generated unnecessarily.
|
||||
*/
|
||||
# define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
|
||||
/*
|
||||
* Returns a positive command number for the first command supported by the
|
||||
* engine. Returns zero if no ctrl commands are supported.
|
||||
*/
|
||||
# define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
|
||||
/*
|
||||
* The 'long' argument specifies a command implemented by the engine, and the
|
||||
* return value is the next command supported, or zero if there are no more.
|
||||
*/
|
||||
# define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
|
||||
/*
|
||||
* The 'void*' argument is a command name (cast from 'const char *'), and the
|
||||
* return value is the command that corresponds to it.
|
||||
*/
|
||||
# define ENGINE_CTRL_GET_CMD_FROM_NAME 13
|
||||
/*
|
||||
* The next two allow a command to be converted into its corresponding string
|
||||
* form. In each case, the 'long' argument supplies the command. In the
|
||||
* NAME_LEN case, the return value is the length of the command name (not
|
||||
* counting a trailing EOL). In the NAME case, the 'void*' argument must be a
|
||||
* string buffer large enough, and it will be populated with the name of the
|
||||
* command (WITH a trailing EOL).
|
||||
*/
|
||||
# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
|
||||
# define ENGINE_CTRL_GET_NAME_FROM_CMD 15
|
||||
/* The next two are similar but give a "short description" of a command. */
|
||||
# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
|
||||
# define ENGINE_CTRL_GET_DESC_FROM_CMD 17
|
||||
/*
|
||||
* With this command, the return value is the OR'd combination of
|
||||
* ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
|
||||
* engine-specific ctrl command expects.
|
||||
*/
|
||||
# define ENGINE_CTRL_GET_CMD_FLAGS 18
|
||||
|
||||
/*
|
||||
* ENGINE implementations should start the numbering of their own control
|
||||
* commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).
|
||||
*/
|
||||
# define ENGINE_CMD_BASE 200
|
||||
|
||||
/*
|
||||
* NB: These 2 nCipher "chil" control commands are deprecated, and their
|
||||
* functionality is now available through ENGINE-specific control commands
|
||||
* (exposed through the above-mentioned 'CMD'-handling). Code using these 2
|
||||
* commands should be migrated to the more general command handling before
|
||||
* these are removed.
|
||||
*/
|
||||
|
||||
/* Flags specific to the nCipher "chil" engine */
|
||||
# define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
|
||||
/*
|
||||
* Depending on the value of the (long)i argument, this sets or
|
||||
* unsets the SimpleForkCheck flag in the CHIL API to enable or
|
||||
* disable checking and workarounds for applications that fork().
|
||||
*/
|
||||
# define ENGINE_CTRL_CHIL_NO_LOCKING 101
|
||||
/*
|
||||
* This prevents the initialisation function from providing mutex
|
||||
* callbacks to the nCipher library.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If an ENGINE supports its own specific control commands and wishes the
|
||||
* framework to handle the above 'ENGINE_CMD_***'-manipulation commands on
|
||||
* its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN
|
||||
* entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()
|
||||
* handler that supports the stated commands (ie. the "cmd_num" entries as
|
||||
* described by the array). NB: The array must be ordered in increasing order
|
||||
* of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element
|
||||
* has cmd_num set to zero and/or cmd_name set to NULL.
|
||||
*/
|
||||
typedef struct ENGINE_CMD_DEFN_st {
|
||||
unsigned int cmd_num; /* The command number */
|
||||
const char *cmd_name; /* The command name itself */
|
||||
const char *cmd_desc; /* A short description of the command */
|
||||
unsigned int cmd_flags; /* The input the command expects */
|
||||
} ENGINE_CMD_DEFN;
|
||||
|
||||
/* Generic function pointer */
|
||||
typedef int (*ENGINE_GEN_FUNC_PTR) (void);
|
||||
/* Generic function pointer taking no arguments */
|
||||
typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
|
||||
/* Specific control function pointer */
|
||||
typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
|
||||
void (*f) (void));
|
||||
/* Generic load_key function pointer */
|
||||
typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
|
||||
UI_METHOD *ui_method,
|
||||
void *callback_data);
|
||||
typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
|
||||
STACK_OF(X509_NAME) *ca_dn,
|
||||
X509 **pcert, EVP_PKEY **pkey,
|
||||
STACK_OF(X509) **pother,
|
||||
UI_METHOD *ui_method,
|
||||
void *callback_data);
|
||||
/*-
|
||||
* These callback types are for an ENGINE's handler for cipher and digest logic.
|
||||
* These handlers have these prototypes;
|
||||
* int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
|
||||
* int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
|
||||
* Looking at how to implement these handlers in the case of cipher support, if
|
||||
* the framework wants the EVP_CIPHER for 'nid', it will call;
|
||||
* foo(e, &p_evp_cipher, NULL, nid); (return zero for failure)
|
||||
* If the framework wants a list of supported 'nid's, it will call;
|
||||
* foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
|
||||
*/
|
||||
/*
|
||||
* Returns to a pointer to the array of supported cipher 'nid's. If the
|
||||
* second parameter is non-NULL it is set to the size of the returned array.
|
||||
*/
|
||||
typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
|
||||
const int **, int);
|
||||
typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
|
||||
int);
|
||||
typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
|
||||
const int **, int);
|
||||
typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
|
||||
const int **, int);
|
||||
/*
|
||||
* STRUCTURE functions ... all of these functions deal with pointers to
|
||||
* ENGINE structures where the pointers have a "structural reference". This
|
||||
* means that their reference is to allowed access to the structure but it
|
||||
* does not imply that the structure is functional. To simply increment or
|
||||
* decrement the structural reference count, use ENGINE_by_id and
|
||||
* ENGINE_free. NB: This is not required when iterating using ENGINE_get_next
|
||||
* as it will automatically decrement the structural reference count of the
|
||||
* "current" ENGINE and increment the structural reference count of the
|
||||
* ENGINE it returns (unless it is NULL).
|
||||
*/
|
||||
|
||||
/* Get the first/last "ENGINE" type available. */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void);
|
||||
# endif
|
||||
/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e);
|
||||
# endif
|
||||
/* Add another "ENGINE" type into the array. */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e);
|
||||
# endif
|
||||
/* Remove an existing "ENGINE" type from the array. */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e);
|
||||
# endif
|
||||
/* Retrieve an engine from the list by its unique "id" value. */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define ENGINE_load_openssl() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
|
||||
# define ENGINE_load_dynamic() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
|
||||
# ifndef OPENSSL_NO_STATIC_ENGINE
|
||||
# define ENGINE_load_padlock() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
|
||||
# define ENGINE_load_capi() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
|
||||
# define ENGINE_load_afalg() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
|
||||
# endif
|
||||
# define ENGINE_load_cryptodev() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
|
||||
# define ENGINE_load_rdrand() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
|
||||
* "registry" handling.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
|
||||
# endif
|
||||
|
||||
/*- Manage registration of ENGINEs per "table". For each type, there are 3
|
||||
* functions;
|
||||
* ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)
|
||||
* ENGINE_unregister_***(e) - unregister the implementation from 'e'
|
||||
* ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
|
||||
* Cleanup is automatically registered from each table when required.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* These functions register all support from the above categories. Note, use
|
||||
* of these functions can result in static linkage of code your application
|
||||
* may not need. If you only need a subset of functionality, consider using
|
||||
* more selective initialisation.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Send parameterised control commands to the engine. The possibilities to
|
||||
* send down an integer, a pointer to data or a function pointer are
|
||||
* provided. Any of the parameters may or may not be NULL, depending on the
|
||||
* command number. In actuality, this function only requires a structural
|
||||
* (rather than functional) reference to an engine, but many control commands
|
||||
* may require the engine be functional. The caller should be aware of trying
|
||||
* commands that require an operational ENGINE, and only use functional
|
||||
* references in such situations.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
|
||||
void (*f) (void));
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This function tests if an ENGINE-specific command is usable as a
|
||||
* "setting". Eg. in an application's config file that gets processed through
|
||||
* ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
|
||||
* ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This function works like ENGINE_ctrl() with the exception of taking a
|
||||
* command name instead of a command number, and can handle optional
|
||||
* commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
|
||||
* on how to use the cmd_name and cmd_optional.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
|
||||
long i, void *p, void (*f) (void),
|
||||
int cmd_optional);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This function passes a command-name and argument to an ENGINE. The
|
||||
* cmd_name is converted to a command number and the control command is
|
||||
* called using 'arg' as an argument (unless the ENGINE doesn't support such
|
||||
* a command, in which case no control command is called). The command is
|
||||
* checked for input flags, and if necessary the argument will be converted
|
||||
* to a numeric value. If cmd_optional is non-zero, then if the ENGINE
|
||||
* doesn't support the given cmd_name the return value will be success
|
||||
* anyway. This function is intended for applications to use so that users
|
||||
* (or config files) can supply engine-specific config data to the ENGINE at
|
||||
* run-time to control behaviour of specific engines. As such, it shouldn't
|
||||
* be used for calling ENGINE_ctrl() functions that return data, deal with
|
||||
* binary data, or that are otherwise supposed to be used directly through
|
||||
* ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl()
|
||||
* operation in this function will be lost - the return value is interpreted
|
||||
* as failure if the return value is zero, success otherwise, and this
|
||||
* function returns a boolean value as a result. In other words, vendors of
|
||||
* 'ENGINE'-enabled devices should write ENGINE implementations with
|
||||
* parameterisations that work in this scheme, so that compliant ENGINE-based
|
||||
* applications can work consistently with the same configuration for the
|
||||
* same ENGINE-enabled devices, across applications.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
|
||||
int cmd_optional);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* These functions are useful for manufacturing new ENGINE structures. They
|
||||
* don't address reference counting at all - one uses them to populate an
|
||||
* ENGINE structure with personalised implementations of things prior to
|
||||
* using it directly or adding it to the builtin ENGINE list in OpenSSL.
|
||||
* These are also here so that the ENGINE structure doesn't have to be
|
||||
* exposed and break binary compatibility!
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_destroy_function(ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
|
||||
ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,
|
||||
const ENGINE_CMD_DEFN *defns);
|
||||
# endif
|
||||
/* These functions allow control over any per-structure ENGINE data. */
|
||||
# define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
|
||||
OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
/*
|
||||
* This function previously cleaned up anything that needs it. Auto-deinit will
|
||||
* now take care of it so it is no longer required to call this function.
|
||||
*/
|
||||
# define ENGINE_cleanup() while(0) continue
|
||||
# endif
|
||||
|
||||
/*
|
||||
* These return values from within the ENGINE structure. These can be useful
|
||||
* with functional references as well as structural references - it depends
|
||||
* which you obtained. Using the result for functional purposes if you only
|
||||
* obtained a structural reference may be problematic!
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
|
||||
const char *str,
|
||||
int len);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
|
||||
const char *str, int len);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* FUNCTIONAL functions. These functions deal with ENGINE structures that
|
||||
* have (or will) be initialised for use. Broadly speaking, the structural
|
||||
* functions are useful for iterating the list of available engine types,
|
||||
* creating new engine types, and other "list" operations. These functions
|
||||
* actually deal with ENGINEs that are to be used. As such these functions
|
||||
* can fail (if applicable) when particular engines are unavailable - eg. if
|
||||
* a hardware accelerator is not attached or not functioning correctly. Each
|
||||
* ENGINE has 2 reference counts; structural and functional. Every time a
|
||||
* functional reference is obtained or released, a corresponding structural
|
||||
* reference is automatically obtained or released too.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialise an engine type for use (or up its reference count if it's
|
||||
* already in use). This will fail if the engine is not currently operational
|
||||
* and cannot initialise.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
|
||||
# endif
|
||||
/*
|
||||
* Free a functional reference to an engine type. This does not require a
|
||||
* corresponding call to ENGINE_free as it also releases a structural
|
||||
* reference.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* The following functions handle keys that are stored in some secondary
|
||||
* location, handled by the engine. The storage may be on a card or
|
||||
* whatever.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
|
||||
X509 **pcert, EVP_PKEY **ppkey,
|
||||
STACK_OF(X509) **pother,
|
||||
UI_METHOD *ui_method, void *callback_data);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This returns a pointer for the current ENGINE structure that is (by
|
||||
* default) performing any RSA operations. The value returned is an
|
||||
* incremented reference, so it should be free'd (ENGINE_finish) before it is
|
||||
* discarded.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void);
|
||||
# endif
|
||||
/* Same for the other "methods" */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void);
|
||||
# endif
|
||||
/*
|
||||
* These functions can be used to get a functional reference to perform
|
||||
* ciphering or digesting corresponding to "nid".
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This sets a new default ENGINE structure for performing RSA operations. If
|
||||
* the result is non-zero (success) then the ENGINE structure will have had
|
||||
* its reference count up'd so the caller should still free their own
|
||||
* reference 'e'.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
|
||||
const char *def_list);
|
||||
# endif
|
||||
/* Same for the other "methods" */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e);
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* The combination "set" - the flags are bitwise "OR"d from the
|
||||
* ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
|
||||
* function, this function can result in unnecessary static linkage. If your
|
||||
* application requires only specific functionality, consider using more
|
||||
* selective functions.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void);
|
||||
# endif
|
||||
|
||||
/* Deprecated functions ... */
|
||||
/* int ENGINE_clear_defaults(void); */
|
||||
|
||||
/**************************/
|
||||
/* DYNAMIC ENGINE SUPPORT */
|
||||
/**************************/
|
||||
|
||||
/* Binary/behaviour compatibility levels */
|
||||
# define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000
|
||||
/*
|
||||
* Binary versions older than this are too old for us (whether we're a loader
|
||||
* or a loadee)
|
||||
*/
|
||||
# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000
|
||||
|
||||
/*
|
||||
* When compiling an ENGINE entirely as an external shared library, loadable
|
||||
* by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
|
||||
* structure type provides the calling application's (or library's) error
|
||||
* functionality and memory management function pointers to the loaded
|
||||
* library. These should be used/set in the loaded library code so that the
|
||||
* loading application's 'state' will be used/changed in all operations. The
|
||||
* 'static_state' pointer allows the loaded library to know if it shares the
|
||||
* same static data as the calling application (or library), and thus whether
|
||||
* these callbacks need to be set or not.
|
||||
*/
|
||||
typedef void *(*dyn_MEM_malloc_fn) (size_t, const char *, int);
|
||||
typedef void *(*dyn_MEM_realloc_fn) (void *, size_t, const char *, int);
|
||||
typedef void (*dyn_MEM_free_fn) (void *, const char *, int);
|
||||
typedef struct st_dynamic_MEM_fns {
|
||||
dyn_MEM_malloc_fn malloc_fn;
|
||||
dyn_MEM_realloc_fn realloc_fn;
|
||||
dyn_MEM_free_fn free_fn;
|
||||
} dynamic_MEM_fns;
|
||||
/*
|
||||
* FIXME: Perhaps the memory and locking code (crypto.h) should declare and
|
||||
* use these types so we (and any other dependent code) can simplify a bit??
|
||||
*/
|
||||
/* The top-level structure */
|
||||
typedef struct st_dynamic_fns {
|
||||
void *static_state;
|
||||
dynamic_MEM_fns mem_fns;
|
||||
} dynamic_fns;
|
||||
|
||||
/*
|
||||
* The version checking function should be of this prototype. NB: The
|
||||
* ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
|
||||
* code. If this function returns zero, it indicates a (potential) version
|
||||
* incompatibility and the loaded library doesn't believe it can proceed.
|
||||
* Otherwise, the returned value is the (latest) version supported by the
|
||||
* loading library. The loader may still decide that the loaded code's
|
||||
* version is unsatisfactory and could veto the load. The function is
|
||||
* expected to be implemented with the symbol name "v_check", and a default
|
||||
* implementation can be fully instantiated with
|
||||
* IMPLEMENT_DYNAMIC_CHECK_FN().
|
||||
*/
|
||||
typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
|
||||
# define IMPLEMENT_DYNAMIC_CHECK_FN() \
|
||||
OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
|
||||
OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
|
||||
if (v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
|
||||
return 0; }
|
||||
|
||||
/*
|
||||
* This function is passed the ENGINE structure to initialise with its own
|
||||
* function and command settings. It should not adjust the structural or
|
||||
* functional reference counts. If this function returns zero, (a) the load
|
||||
* will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
|
||||
* the structure, and (c) the shared library will be unloaded. So
|
||||
* implementations should do their own internal cleanup in failure
|
||||
* circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
|
||||
* represents the ENGINE id that the loader is looking for. If this is NULL,
|
||||
* the shared library can choose to return failure or to initialise a
|
||||
* 'default' ENGINE. If non-NULL, the shared library must initialise only an
|
||||
* ENGINE matching the passed 'id'. The function is expected to be
|
||||
* implemented with the symbol name "bind_engine". A standard implementation
|
||||
* can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
|
||||
* 'fn' is a callback function that populates the ENGINE structure and
|
||||
* returns an int value (zero for failure). 'fn' should have prototype;
|
||||
* [static] int fn(ENGINE *e, const char *id);
|
||||
*/
|
||||
typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
|
||||
const dynamic_fns *fns);
|
||||
# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
|
||||
OPENSSL_EXPORT \
|
||||
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
|
||||
OPENSSL_EXPORT \
|
||||
int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
|
||||
if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
|
||||
CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \
|
||||
fns->mem_fns.realloc_fn, \
|
||||
fns->mem_fns.free_fn); \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL); \
|
||||
skip_cbs: \
|
||||
if (!fn(e, id)) return 0; \
|
||||
return 1; }
|
||||
|
||||
/*
|
||||
* If the loading application (or library) and the loaded ENGINE library
|
||||
* share the same static data (eg. they're both dynamically linked to the
|
||||
* same libcrypto.so) we need a way to avoid trying to set system callbacks -
|
||||
* this would fail, and for the same reason that it's unnecessary to try. If
|
||||
* the loaded ENGINE has (or gets from through the loader) its own copy of
|
||||
* the libcrypto static data, we will need to set the callbacks. The easiest
|
||||
* way to detect this is to have a function that returns a pointer to some
|
||||
* static data and let the loading application and loaded ENGINE compare
|
||||
* their respective values.
|
||||
*/
|
||||
void *ENGINE_get_static_state(void);
|
||||
|
||||
# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif /* OPENSSL_NO_ENGINE */
|
||||
#endif /* OPENSSL_ENGINE_H */
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_ENGINEERR_H
|
||||
# define OPENSSL_ENGINEERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
|
||||
|
||||
/*
|
||||
* ENGINE reason codes.
|
||||
*/
|
||||
# define ENGINE_R_ALREADY_LOADED 100
|
||||
# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
|
||||
# define ENGINE_R_CMD_NOT_EXECUTABLE 134
|
||||
# define ENGINE_R_COMMAND_TAKES_INPUT 135
|
||||
# define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
|
||||
# define ENGINE_R_CONFLICTING_ENGINE_ID 103
|
||||
# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
|
||||
# define ENGINE_R_DSO_FAILURE 104
|
||||
# define ENGINE_R_DSO_NOT_FOUND 132
|
||||
# define ENGINE_R_ENGINES_SECTION_ERROR 148
|
||||
# define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
|
||||
# define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
|
||||
# define ENGINE_R_ENGINE_SECTION_ERROR 149
|
||||
# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
|
||||
# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
|
||||
# define ENGINE_R_FINISH_FAILED 106
|
||||
# define ENGINE_R_ID_OR_NAME_MISSING 108
|
||||
# define ENGINE_R_INIT_FAILED 109
|
||||
# define ENGINE_R_INTERNAL_LIST_ERROR 110
|
||||
# define ENGINE_R_INVALID_ARGUMENT 143
|
||||
# define ENGINE_R_INVALID_CMD_NAME 137
|
||||
# define ENGINE_R_INVALID_CMD_NUMBER 138
|
||||
# define ENGINE_R_INVALID_INIT_VALUE 151
|
||||
# define ENGINE_R_INVALID_STRING 150
|
||||
# define ENGINE_R_NOT_INITIALISED 117
|
||||
# define ENGINE_R_NOT_LOADED 112
|
||||
# define ENGINE_R_NO_CONTROL_FUNCTION 120
|
||||
# define ENGINE_R_NO_INDEX 144
|
||||
# define ENGINE_R_NO_LOAD_FUNCTION 125
|
||||
# define ENGINE_R_NO_REFERENCE 130
|
||||
# define ENGINE_R_NO_SUCH_ENGINE 116
|
||||
# define ENGINE_R_UNIMPLEMENTED_CIPHER 146
|
||||
# define ENGINE_R_UNIMPLEMENTED_DIGEST 147
|
||||
# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
|
||||
# define ENGINE_R_VERSION_INCOMPATIBILITY 145
|
||||
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,504 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_ERR_H
|
||||
# define OPENSSL_ERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_ERR_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/lhash.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# ifndef OPENSSL_NO_FILENAMES
|
||||
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,fn,ln)
|
||||
# else
|
||||
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,NULL,0)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include <limits.h>
|
||||
# include <errno.h>
|
||||
|
||||
# define ERR_TXT_MALLOCED 0x01
|
||||
# define ERR_TXT_STRING 0x02
|
||||
|
||||
# if !defined(OPENSSL_NO_DEPRECATED_3_0) || defined(OSSL_FORCE_ERR_STATE)
|
||||
# define ERR_FLAG_MARK 0x01
|
||||
# define ERR_FLAG_CLEAR 0x02
|
||||
|
||||
# define ERR_NUM_ERRORS 16
|
||||
struct err_state_st {
|
||||
int err_flags[ERR_NUM_ERRORS];
|
||||
int err_marks[ERR_NUM_ERRORS];
|
||||
unsigned long err_buffer[ERR_NUM_ERRORS];
|
||||
char *err_data[ERR_NUM_ERRORS];
|
||||
size_t err_data_size[ERR_NUM_ERRORS];
|
||||
int err_data_flags[ERR_NUM_ERRORS];
|
||||
char *err_file[ERR_NUM_ERRORS];
|
||||
int err_line[ERR_NUM_ERRORS];
|
||||
char *err_func[ERR_NUM_ERRORS];
|
||||
int top, bottom;
|
||||
};
|
||||
# endif
|
||||
|
||||
/* library */
|
||||
# define ERR_LIB_NONE 1
|
||||
# define ERR_LIB_SYS 2
|
||||
# define ERR_LIB_BN 3
|
||||
# define ERR_LIB_RSA 4
|
||||
# define ERR_LIB_DH 5
|
||||
# define ERR_LIB_EVP 6
|
||||
# define ERR_LIB_BUF 7
|
||||
# define ERR_LIB_OBJ 8
|
||||
# define ERR_LIB_PEM 9
|
||||
# define ERR_LIB_DSA 10
|
||||
# define ERR_LIB_X509 11
|
||||
/* #define ERR_LIB_METH 12 */
|
||||
# define ERR_LIB_ASN1 13
|
||||
# define ERR_LIB_CONF 14
|
||||
# define ERR_LIB_CRYPTO 15
|
||||
# define ERR_LIB_EC 16
|
||||
# define ERR_LIB_SSL 20
|
||||
/* #define ERR_LIB_SSL23 21 */
|
||||
/* #define ERR_LIB_SSL2 22 */
|
||||
/* #define ERR_LIB_SSL3 23 */
|
||||
/* #define ERR_LIB_RSAREF 30 */
|
||||
/* #define ERR_LIB_PROXY 31 */
|
||||
# define ERR_LIB_BIO 32
|
||||
# define ERR_LIB_PKCS7 33
|
||||
# define ERR_LIB_X509V3 34
|
||||
# define ERR_LIB_PKCS12 35
|
||||
# define ERR_LIB_RAND 36
|
||||
# define ERR_LIB_DSO 37
|
||||
# define ERR_LIB_ENGINE 38
|
||||
# define ERR_LIB_OCSP 39
|
||||
# define ERR_LIB_UI 40
|
||||
# define ERR_LIB_COMP 41
|
||||
# define ERR_LIB_ECDSA 42
|
||||
# define ERR_LIB_ECDH 43
|
||||
# define ERR_LIB_OSSL_STORE 44
|
||||
# define ERR_LIB_FIPS 45
|
||||
# define ERR_LIB_CMS 46
|
||||
# define ERR_LIB_TS 47
|
||||
# define ERR_LIB_HMAC 48
|
||||
/* # define ERR_LIB_JPAKE 49 */
|
||||
# define ERR_LIB_CT 50
|
||||
# define ERR_LIB_ASYNC 51
|
||||
# define ERR_LIB_KDF 52
|
||||
# define ERR_LIB_SM2 53
|
||||
# define ERR_LIB_ESS 54
|
||||
# define ERR_LIB_PROP 55
|
||||
# define ERR_LIB_CRMF 56
|
||||
# define ERR_LIB_PROV 57
|
||||
# define ERR_LIB_CMP 58
|
||||
# define ERR_LIB_OSSL_ENCODER 59
|
||||
# define ERR_LIB_OSSL_DECODER 60
|
||||
# define ERR_LIB_HTTP 61
|
||||
|
||||
# define ERR_LIB_USER 128
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define ASN1err(f, r) ERR_raise_data(ERR_LIB_ASN1, (r), NULL)
|
||||
# define ASYNCerr(f, r) ERR_raise_data(ERR_LIB_ASYNC, (r), NULL)
|
||||
# define BIOerr(f, r) ERR_raise_data(ERR_LIB_BIO, (r), NULL)
|
||||
# define BNerr(f, r) ERR_raise_data(ERR_LIB_BN, (r), NULL)
|
||||
# define BUFerr(f, r) ERR_raise_data(ERR_LIB_BUF, (r), NULL)
|
||||
# define CMPerr(f, r) ERR_raise_data(ERR_LIB_CMP, (r), NULL)
|
||||
# define CMSerr(f, r) ERR_raise_data(ERR_LIB_CMS, (r), NULL)
|
||||
# define COMPerr(f, r) ERR_raise_data(ERR_LIB_COMP, (r), NULL)
|
||||
# define CONFerr(f, r) ERR_raise_data(ERR_LIB_CONF, (r), NULL)
|
||||
# define CRMFerr(f, r) ERR_raise_data(ERR_LIB_CRMF, (r), NULL)
|
||||
# define CRYPTOerr(f, r) ERR_raise_data(ERR_LIB_CRYPTO, (r), NULL)
|
||||
# define CTerr(f, r) ERR_raise_data(ERR_LIB_CT, (r), NULL)
|
||||
# define DHerr(f, r) ERR_raise_data(ERR_LIB_DH, (r), NULL)
|
||||
# define DSAerr(f, r) ERR_raise_data(ERR_LIB_DSA, (r), NULL)
|
||||
# define DSOerr(f, r) ERR_raise_data(ERR_LIB_DSO, (r), NULL)
|
||||
# define ECDHerr(f, r) ERR_raise_data(ERR_LIB_ECDH, (r), NULL)
|
||||
# define ECDSAerr(f, r) ERR_raise_data(ERR_LIB_ECDSA, (r), NULL)
|
||||
# define ECerr(f, r) ERR_raise_data(ERR_LIB_EC, (r), NULL)
|
||||
# define ENGINEerr(f, r) ERR_raise_data(ERR_LIB_ENGINE, (r), NULL)
|
||||
# define ESSerr(f, r) ERR_raise_data(ERR_LIB_ESS, (r), NULL)
|
||||
# define EVPerr(f, r) ERR_raise_data(ERR_LIB_EVP, (r), NULL)
|
||||
# define FIPSerr(f, r) ERR_raise_data(ERR_LIB_FIPS, (r), NULL)
|
||||
# define HMACerr(f, r) ERR_raise_data(ERR_LIB_HMAC, (r), NULL)
|
||||
# define HTTPerr(f, r) ERR_raise_data(ERR_LIB_HTTP, (r), NULL)
|
||||
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
||||
# define OBJerr(f, r) ERR_raise_data(ERR_LIB_OBJ, (r), NULL)
|
||||
# define OCSPerr(f, r) ERR_raise_data(ERR_LIB_OCSP, (r), NULL)
|
||||
# define OSSL_STOREerr(f, r) ERR_raise_data(ERR_LIB_OSSL_STORE, (r), NULL)
|
||||
# define PEMerr(f, r) ERR_raise_data(ERR_LIB_PEM, (r), NULL)
|
||||
# define PKCS12err(f, r) ERR_raise_data(ERR_LIB_PKCS12, (r), NULL)
|
||||
# define PKCS7err(f, r) ERR_raise_data(ERR_LIB_PKCS7, (r), NULL)
|
||||
# define PROPerr(f, r) ERR_raise_data(ERR_LIB_PROP, (r), NULL)
|
||||
# define PROVerr(f, r) ERR_raise_data(ERR_LIB_PROV, (r), NULL)
|
||||
# define RANDerr(f, r) ERR_raise_data(ERR_LIB_RAND, (r), NULL)
|
||||
# define RSAerr(f, r) ERR_raise_data(ERR_LIB_RSA, (r), NULL)
|
||||
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
||||
# define SM2err(f, r) ERR_raise_data(ERR_LIB_SM2, (r), NULL)
|
||||
# define SSLerr(f, r) ERR_raise_data(ERR_LIB_SSL, (r), NULL)
|
||||
# define SYSerr(f, r) ERR_raise_data(ERR_LIB_SYS, (r), NULL)
|
||||
# define TSerr(f, r) ERR_raise_data(ERR_LIB_TS, (r), NULL)
|
||||
# define UIerr(f, r) ERR_raise_data(ERR_LIB_UI, (r), NULL)
|
||||
# define X509V3err(f, r) ERR_raise_data(ERR_LIB_X509V3, (r), NULL)
|
||||
# define X509err(f, r) ERR_raise_data(ERR_LIB_X509, (r), NULL)
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* The error code packs differently depending on if it records a system
|
||||
* error or an OpenSSL error.
|
||||
*
|
||||
* A system error packs like this (we follow POSIX and only allow positive
|
||||
* numbers that fit in an |int|):
|
||||
*
|
||||
* +-+-------------------------------------------------------------+
|
||||
* |1| system error number |
|
||||
* +-+-------------------------------------------------------------+
|
||||
*
|
||||
* An OpenSSL error packs like this:
|
||||
*
|
||||
* <---------------------------- 32 bits -------------------------->
|
||||
* <--- 8 bits ---><------------------ 23 bits ----------------->
|
||||
* +-+---------------+---------------------------------------------+
|
||||
* |0| library | reason |
|
||||
* +-+---------------+---------------------------------------------+
|
||||
*
|
||||
* A few of the reason bits are reserved as flags with special meaning:
|
||||
*
|
||||
* <5 bits-<>--------- 19 bits ----------------->
|
||||
* +-------+-+-----------------------------------+
|
||||
* | rflags| | reason |
|
||||
* +-------+-+-----------------------------------+
|
||||
* ^
|
||||
* |
|
||||
* ERR_RFLAG_FATAL = ERR_R_FATAL
|
||||
*
|
||||
* The reason flags are part of the overall reason code for practical
|
||||
* reasons, as they provide an easy way to place different types of
|
||||
* reason codes in different numeric ranges.
|
||||
*
|
||||
* The currently known reason flags are:
|
||||
*
|
||||
* ERR_RFLAG_FATAL Flags that the reason code is considered fatal.
|
||||
* For backward compatibility reasons, this flag
|
||||
* is also the code for ERR_R_FATAL (that reason
|
||||
* code served the dual purpose of flag and reason
|
||||
* code in one in pre-3.0 OpenSSL).
|
||||
* ERR_RFLAG_COMMON Flags that the reason code is common to all
|
||||
* libraries. All ERR_R_ macros must use this flag,
|
||||
* and no other _R_ macro is allowed to use it.
|
||||
*/
|
||||
|
||||
/* Macros to help decode recorded system errors */
|
||||
# define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
|
||||
# define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
|
||||
|
||||
/*
|
||||
* Macros to help decode recorded OpenSSL errors
|
||||
* As expressed above, RFLAGS and REASON overlap by one bit to allow
|
||||
* ERR_R_FATAL to use ERR_RFLAG_FATAL as its reason code.
|
||||
*/
|
||||
# define ERR_LIB_OFFSET 23L
|
||||
# define ERR_LIB_MASK 0xFF
|
||||
# define ERR_RFLAGS_OFFSET 18L
|
||||
# define ERR_RFLAGS_MASK 0x1F
|
||||
# define ERR_REASON_MASK 0X7FFFFF
|
||||
|
||||
/*
|
||||
* Reason flags are defined pre-shifted to easily combine with the reason
|
||||
* number.
|
||||
*/
|
||||
# define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
|
||||
# define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
|
||||
|
||||
# define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
|
||||
|
||||
static ossl_unused ossl_inline int ERR_GET_LIB(unsigned long errcode)
|
||||
{
|
||||
if (ERR_SYSTEM_ERROR(errcode))
|
||||
return ERR_LIB_SYS;
|
||||
return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
|
||||
}
|
||||
|
||||
static ossl_unused ossl_inline int ERR_GET_RFLAGS(unsigned long errcode)
|
||||
{
|
||||
if (ERR_SYSTEM_ERROR(errcode))
|
||||
return 0;
|
||||
return errcode & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET);
|
||||
}
|
||||
|
||||
static ossl_unused ossl_inline int ERR_GET_REASON(unsigned long errcode)
|
||||
{
|
||||
if (ERR_SYSTEM_ERROR(errcode))
|
||||
return errcode & ERR_SYSTEM_MASK;
|
||||
return errcode & ERR_REASON_MASK;
|
||||
}
|
||||
|
||||
static ossl_unused ossl_inline int ERR_FATAL_ERROR(unsigned long errcode)
|
||||
{
|
||||
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_FATAL) != 0;
|
||||
}
|
||||
|
||||
static ossl_unused ossl_inline int ERR_COMMON_ERROR(unsigned long errcode)
|
||||
{
|
||||
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_COMMON) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ERR_PACK is a helper macro to properly pack OpenSSL error codes and may
|
||||
* only be used for that purpose. System errors are packed internally.
|
||||
* ERR_PACK takes reason flags and reason code combined in |reason|.
|
||||
* ERR_PACK ignores |func|, that parameter is just legacy from pre-3.0 OpenSSL.
|
||||
*/
|
||||
# define ERR_PACK(lib,func,reason) \
|
||||
( (((unsigned long)(lib) & ERR_LIB_MASK ) << ERR_LIB_OFFSET) | \
|
||||
(((unsigned long)(reason) & ERR_REASON_MASK)) )
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define SYS_F_FOPEN 0
|
||||
# define SYS_F_CONNECT 0
|
||||
# define SYS_F_GETSERVBYNAME 0
|
||||
# define SYS_F_SOCKET 0
|
||||
# define SYS_F_IOCTLSOCKET 0
|
||||
# define SYS_F_BIND 0
|
||||
# define SYS_F_LISTEN 0
|
||||
# define SYS_F_ACCEPT 0
|
||||
# define SYS_F_WSASTARTUP 0
|
||||
# define SYS_F_OPENDIR 0
|
||||
# define SYS_F_FREAD 0
|
||||
# define SYS_F_GETADDRINFO 0
|
||||
# define SYS_F_GETNAMEINFO 0
|
||||
# define SYS_F_SETSOCKOPT 0
|
||||
# define SYS_F_GETSOCKOPT 0
|
||||
# define SYS_F_GETSOCKNAME 0
|
||||
# define SYS_F_GETHOSTBYNAME 0
|
||||
# define SYS_F_FFLUSH 0
|
||||
# define SYS_F_OPEN 0
|
||||
# define SYS_F_CLOSE 0
|
||||
# define SYS_F_IOCTL 0
|
||||
# define SYS_F_STAT 0
|
||||
# define SYS_F_FCNTL 0
|
||||
# define SYS_F_FSTAT 0
|
||||
# define SYS_F_SENDFILE 0
|
||||
# endif
|
||||
|
||||
/*
|
||||
* All ERR_R_ codes must be combined with ERR_RFLAG_COMMON.
|
||||
*/
|
||||
|
||||
/* "we came from here" global reason codes, range 1..255 */
|
||||
# define ERR_R_SYS_LIB (ERR_LIB_SYS/* 2 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_BN_LIB (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_RSA_LIB (ERR_LIB_RSA/* 4 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_DH_LIB (ERR_LIB_DH/* 5 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_EVP_LIB (ERR_LIB_EVP/* 6 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_BUF_LIB (ERR_LIB_BUF/* 7 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_OBJ_LIB (ERR_LIB_OBJ/* 8 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_PEM_LIB (ERR_LIB_PEM/* 9 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_DSA_LIB (ERR_LIB_DSA/* 10 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_X509_LIB (ERR_LIB_X509/* 11 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_ASN1_LIB (ERR_LIB_ASN1/* 13 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_CONF_LIB (ERR_LIB_CONF/* 14 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_EC_LIB (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_SSL_LIB (ERR_LIB_SSL/* 20 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_BIO_LIB (ERR_LIB_BIO/* 32 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_PKCS7_LIB (ERR_LIB_PKCS7/* 33 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_X509V3_LIB (ERR_LIB_X509V3/* 34 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_PKCS12_LIB (ERR_LIB_PKCS12/* 35 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_RAND_LIB (ERR_LIB_RAND/* 36 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_DSO_LIB (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_ENGINE_LIB (ERR_LIB_ENGINE/* 38 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_UI_LIB (ERR_LIB_UI/* 40 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_ECDSA_LIB (ERR_LIB_ECDSA/* 42 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_OSSL_STORE_LIB (ERR_LIB_OSSL_STORE/* 44 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_CMS_LIB (ERR_LIB_CMS/* 46 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_TS_LIB (ERR_LIB_TS/* 47 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_CT_LIB (ERR_LIB_CT/* 50 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_PROV_LIB (ERR_LIB_PROV/* 57 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_ESS_LIB (ERR_LIB_ESS/* 54 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_CMP_LIB (ERR_LIB_CMP/* 58 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_OSSL_ENCODER_LIB (ERR_LIB_OSSL_ENCODER/* 59 */ | ERR_RFLAG_COMMON)
|
||||
# define ERR_R_OSSL_DECODER_LIB (ERR_LIB_OSSL_DECODER/* 60 */ | ERR_RFLAG_COMMON)
|
||||
|
||||
/* Other common error codes, range 256..2^ERR_RFLAGS_OFFSET-1 */
|
||||
# define ERR_R_FATAL (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_MALLOC_FAILURE (256|ERR_R_FATAL)
|
||||
# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (257|ERR_R_FATAL)
|
||||
# define ERR_R_PASSED_NULL_PARAMETER (258|ERR_R_FATAL)
|
||||
# define ERR_R_INTERNAL_ERROR (259|ERR_R_FATAL)
|
||||
# define ERR_R_DISABLED (260|ERR_R_FATAL)
|
||||
# define ERR_R_INIT_FAIL (261|ERR_R_FATAL)
|
||||
# define ERR_R_PASSED_INVALID_ARGUMENT (262|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_OPERATION_FAIL (263|ERR_R_FATAL)
|
||||
# define ERR_R_INVALID_PROVIDER_FUNCTIONS (264|ERR_R_FATAL)
|
||||
# define ERR_R_INTERRUPTED_OR_CANCELLED (265|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_NESTED_ASN1_ERROR (266|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_MISSING_ASN1_EOS (267|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_UNSUPPORTED (268|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_FETCH_FAILED (269|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_INVALID_PROPERTY_DEFINITION (270|ERR_RFLAG_COMMON)
|
||||
# define ERR_R_UNABLE_TO_GET_READ_LOCK (271|ERR_R_FATAL)
|
||||
# define ERR_R_UNABLE_TO_GET_WRITE_LOCK (272|ERR_R_FATAL)
|
||||
|
||||
typedef struct ERR_string_data_st {
|
||||
unsigned long error;
|
||||
const char *string;
|
||||
} ERR_STRING_DATA;
|
||||
|
||||
DEFINE_LHASH_OF_INTERNAL(ERR_STRING_DATA);
|
||||
#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)))
|
||||
#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
||||
#define lh_ERR_STRING_DATA_flush(lh) OPENSSL_LH_flush(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
||||
#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
|
||||
#define lh_ERR_STRING_DATA_delete(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_delete(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
||||
#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
||||
#define lh_ERR_STRING_DATA_error(lh) OPENSSL_LH_error(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
||||
#define lh_ERR_STRING_DATA_num_items(lh) OPENSSL_LH_num_items(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
||||
#define lh_ERR_STRING_DATA_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
||||
#define lh_ERR_STRING_DATA_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
||||
#define lh_ERR_STRING_DATA_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
||||
#define lh_ERR_STRING_DATA_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
||||
#define lh_ERR_STRING_DATA_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh), dl)
|
||||
#define lh_ERR_STRING_DATA_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_doallfunc_type(dfn))
|
||||
|
||||
|
||||
/* 12 lines and some on an 80 column terminal */
|
||||
#define ERR_MAX_DATA_SIZE 1024
|
||||
|
||||
/* Building blocks */
|
||||
void ERR_new(void);
|
||||
void ERR_set_debug(const char *file, int line, const char *func);
|
||||
void ERR_set_error(int lib, int reason, const char *fmt, ...);
|
||||
void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
|
||||
|
||||
/* Main error raising functions */
|
||||
# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
|
||||
# define ERR_raise_data \
|
||||
(ERR_new(), \
|
||||
ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC), \
|
||||
ERR_set_error)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* Backward compatibility */
|
||||
# define ERR_put_error(lib, func, reason, file, line) \
|
||||
(ERR_new(), \
|
||||
ERR_set_debug((file), (line), OPENSSL_FUNC), \
|
||||
ERR_set_error((lib), (reason), NULL))
|
||||
# endif
|
||||
|
||||
void ERR_set_error_data(char *data, int flags);
|
||||
|
||||
unsigned long ERR_get_error(void);
|
||||
unsigned long ERR_get_error_all(const char **file, int *line,
|
||||
const char **func,
|
||||
const char **data, int *flags);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
unsigned long ERR_get_error_line(const char **file, int *line);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
unsigned long ERR_get_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
#endif
|
||||
unsigned long ERR_peek_error(void);
|
||||
unsigned long ERR_peek_error_line(const char **file, int *line);
|
||||
unsigned long ERR_peek_error_func(const char **func);
|
||||
unsigned long ERR_peek_error_data(const char **data, int *flags);
|
||||
unsigned long ERR_peek_error_all(const char **file, int *line,
|
||||
const char **func,
|
||||
const char **data, int *flags);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
unsigned long ERR_peek_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
# endif
|
||||
unsigned long ERR_peek_last_error(void);
|
||||
unsigned long ERR_peek_last_error_line(const char **file, int *line);
|
||||
unsigned long ERR_peek_last_error_func(const char **func);
|
||||
unsigned long ERR_peek_last_error_data(const char **data, int *flags);
|
||||
unsigned long ERR_peek_last_error_all(const char **file, int *line,
|
||||
const char **func,
|
||||
const char **data, int *flags);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
|
||||
const char **data, int *flags);
|
||||
# endif
|
||||
|
||||
void ERR_clear_error(void);
|
||||
|
||||
char *ERR_error_string(unsigned long e, char *buf);
|
||||
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
|
||||
const char *ERR_lib_error_string(unsigned long e);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *ERR_func_error_string(unsigned long e);
|
||||
# endif
|
||||
const char *ERR_reason_error_string(unsigned long e);
|
||||
|
||||
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
|
||||
void *u);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
void ERR_print_errors_fp(FILE *fp);
|
||||
# endif
|
||||
void ERR_print_errors(BIO *bp);
|
||||
|
||||
void ERR_add_error_data(int num, ...);
|
||||
void ERR_add_error_vdata(int num, va_list args);
|
||||
void ERR_add_error_txt(const char *sepr, const char *txt);
|
||||
void ERR_add_error_mem_bio(const char *sep, BIO *bio);
|
||||
|
||||
int ERR_load_strings(int lib, ERR_STRING_DATA *str);
|
||||
int ERR_load_strings_const(const ERR_STRING_DATA *str);
|
||||
int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define ERR_load_crypto_strings() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
|
||||
# define ERR_free_strings() while(0) continue
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
||||
OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void);
|
||||
#endif
|
||||
|
||||
int ERR_get_next_error_library(void);
|
||||
|
||||
int ERR_set_mark(void);
|
||||
int ERR_pop_to_mark(void);
|
||||
int ERR_clear_last_mark(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_EVPERR_H
|
||||
# define OPENSSL_EVPERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* EVP reason codes.
|
||||
*/
|
||||
# define EVP_R_AES_KEY_SETUP_FAILED 143
|
||||
# define EVP_R_ARIA_KEY_SETUP_FAILED 176
|
||||
# define EVP_R_BAD_ALGORITHM_NAME 200
|
||||
# define EVP_R_BAD_DECRYPT 100
|
||||
# define EVP_R_BAD_KEY_LENGTH 195
|
||||
# define EVP_R_BUFFER_TOO_SMALL 155
|
||||
# define EVP_R_CACHE_CONSTANTS_FAILED 225
|
||||
# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
|
||||
# define EVP_R_CANNOT_GET_PARAMETERS 197
|
||||
# define EVP_R_CANNOT_SET_PARAMETERS 198
|
||||
# define EVP_R_CIPHER_NOT_GCM_MODE 184
|
||||
# define EVP_R_CIPHER_PARAMETER_ERROR 122
|
||||
# define EVP_R_COMMAND_NOT_SUPPORTED 147
|
||||
# define EVP_R_CONFLICTING_ALGORITHM_NAME 201
|
||||
# define EVP_R_COPY_ERROR 173
|
||||
# define EVP_R_CTRL_NOT_IMPLEMENTED 132
|
||||
# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
|
||||
# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
|
||||
# define EVP_R_DECODE_ERROR 114
|
||||
# define EVP_R_DEFAULT_QUERY_PARSE_ERROR 210
|
||||
# define EVP_R_DIFFERENT_KEY_TYPES 101
|
||||
# define EVP_R_DIFFERENT_PARAMETERS 153
|
||||
# define EVP_R_ERROR_LOADING_SECTION 165
|
||||
# define EVP_R_EXPECTING_AN_HMAC_KEY 174
|
||||
# define EVP_R_EXPECTING_AN_RSA_KEY 127
|
||||
# define EVP_R_EXPECTING_A_DH_KEY 128
|
||||
# define EVP_R_EXPECTING_A_DSA_KEY 129
|
||||
# define EVP_R_EXPECTING_A_ECX_KEY 219
|
||||
# define EVP_R_EXPECTING_A_EC_KEY 142
|
||||
# define EVP_R_EXPECTING_A_POLY1305_KEY 164
|
||||
# define EVP_R_EXPECTING_A_SIPHASH_KEY 175
|
||||
# define EVP_R_FINAL_ERROR 188
|
||||
# define EVP_R_GENERATE_ERROR 214
|
||||
# define EVP_R_GET_RAW_KEY_FAILED 182
|
||||
# define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171
|
||||
# define EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS 204
|
||||
# define EVP_R_INACCESSIBLE_KEY 203
|
||||
# define EVP_R_INITIALIZATION_ERROR 134
|
||||
# define EVP_R_INPUT_NOT_INITIALIZED 111
|
||||
# define EVP_R_INVALID_CUSTOM_LENGTH 185
|
||||
# define EVP_R_INVALID_DIGEST 152
|
||||
# define EVP_R_INVALID_IV_LENGTH 194
|
||||
# define EVP_R_INVALID_KEY 163
|
||||
# define EVP_R_INVALID_KEY_LENGTH 130
|
||||
# define EVP_R_INVALID_LENGTH 221
|
||||
# define EVP_R_INVALID_NULL_ALGORITHM 218
|
||||
# define EVP_R_INVALID_OPERATION 148
|
||||
# define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
|
||||
# define EVP_R_INVALID_SALT_LENGTH 186
|
||||
# define EVP_R_INVALID_SECRET_LENGTH 223
|
||||
# define EVP_R_INVALID_SEED_LENGTH 220
|
||||
# define EVP_R_INVALID_VALUE 222
|
||||
# define EVP_R_KEYMGMT_EXPORT_FAILURE 205
|
||||
# define EVP_R_KEY_SETUP_FAILED 180
|
||||
# define EVP_R_LOCKING_NOT_SUPPORTED 213
|
||||
# define EVP_R_MEMORY_LIMIT_EXCEEDED 172
|
||||
# define EVP_R_MESSAGE_DIGEST_IS_NULL 159
|
||||
# define EVP_R_METHOD_NOT_SUPPORTED 144
|
||||
# define EVP_R_MISSING_PARAMETERS 103
|
||||
# define EVP_R_NOT_ABLE_TO_COPY_CTX 190
|
||||
# define EVP_R_NOT_XOF_OR_INVALID_LENGTH 178
|
||||
# define EVP_R_NO_CIPHER_SET 131
|
||||
# define EVP_R_NO_DEFAULT_DIGEST 158
|
||||
# define EVP_R_NO_DIGEST_SET 139
|
||||
# define EVP_R_NO_IMPORT_FUNCTION 206
|
||||
# define EVP_R_NO_KEYMGMT_AVAILABLE 199
|
||||
# define EVP_R_NO_KEYMGMT_PRESENT 196
|
||||
# define EVP_R_NO_KEY_SET 154
|
||||
# define EVP_R_NO_OPERATION_SET 149
|
||||
# define EVP_R_NULL_MAC_PKEY_CTX 208
|
||||
# define EVP_R_ONLY_ONESHOT_SUPPORTED 177
|
||||
# define EVP_R_OPERATION_NOT_INITIALIZED 151
|
||||
# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
|
||||
# define EVP_R_OUTPUT_WOULD_OVERFLOW 202
|
||||
# define EVP_R_PARAMETER_TOO_LARGE 187
|
||||
# define EVP_R_PARTIALLY_OVERLAPPING 162
|
||||
# define EVP_R_PBKDF2_ERROR 181
|
||||
# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179
|
||||
# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
|
||||
# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
|
||||
# define EVP_R_PUBLIC_KEY_NOT_RSA 106
|
||||
# define EVP_R_SETTING_XOF_FAILED 227
|
||||
# define EVP_R_SET_DEFAULT_PROPERTY_FAILURE 209
|
||||
# define EVP_R_TOO_MANY_RECORDS 183
|
||||
# define EVP_R_UNABLE_TO_ENABLE_LOCKING 212
|
||||
# define EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE 215
|
||||
# define EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH 216
|
||||
# define EVP_R_UNABLE_TO_LOCK_CONTEXT 211
|
||||
# define EVP_R_UNABLE_TO_SET_CALLBACKS 217
|
||||
# define EVP_R_UNKNOWN_CIPHER 160
|
||||
# define EVP_R_UNKNOWN_DIGEST 161
|
||||
# define EVP_R_UNKNOWN_KEY_TYPE 207
|
||||
# define EVP_R_UNKNOWN_OPTION 169
|
||||
# define EVP_R_UNKNOWN_PBE_ALGORITHM 121
|
||||
# define EVP_R_UNSUPPORTED_ALGORITHM 156
|
||||
# define EVP_R_UNSUPPORTED_CIPHER 107
|
||||
# define EVP_R_UNSUPPORTED_KEYLENGTH 123
|
||||
# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
|
||||
# define EVP_R_UNSUPPORTED_KEY_SIZE 108
|
||||
# define EVP_R_UNSUPPORTED_KEY_TYPE 224
|
||||
# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135
|
||||
# define EVP_R_UNSUPPORTED_PRF 125
|
||||
# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
|
||||
# define EVP_R_UNSUPPORTED_SALT_TYPE 126
|
||||
# define EVP_R_UPDATE_ERROR 189
|
||||
# define EVP_R_WRAP_MODE_NOT_ALLOWED 170
|
||||
# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
|
||||
# define EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE 191
|
||||
# define EVP_R_XTS_DUPLICATED_KEYS 192
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 1995-2021 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_HMAC_H
|
||||
# define OPENSSL_HMAC_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_HMAC_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# include <openssl/evp.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HMAC_MAX_MD_CBLOCK 200 /* Deprecated */
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 size_t HMAC_size(const HMAC_CTX *e);
|
||||
OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 __owur int HMAC_Init(HMAC_CTX *ctx,
|
||||
const void *key, int len,
|
||||
const EVP_MD *md);
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
|
||||
const EVP_MD *md, ENGINE *impl);
|
||||
OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
|
||||
size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
|
||||
unsigned int *len);
|
||||
OSSL_DEPRECATEDIN_3_0 __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
|
||||
OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
|
||||
OSSL_DEPRECATEDIN_3_0 const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
|
||||
# endif
|
||||
|
||||
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
|
||||
const unsigned char *data, size_t data_len,
|
||||
unsigned char *md, unsigned int *md_len);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Siemens AG 2018-2020
|
||||
*
|
||||
* 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_HTTP_H
|
||||
# define OPENSSL_HTTP_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/asn1.h>
|
||||
# include <openssl/conf.h>
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define OSSL_HTTP_NAME "http"
|
||||
# define OSSL_HTTPS_NAME "https"
|
||||
# define OSSL_HTTP_PREFIX OSSL_HTTP_NAME"://"
|
||||
# define OSSL_HTTPS_PREFIX OSSL_HTTPS_NAME"://"
|
||||
# define OSSL_HTTP_PORT "80"
|
||||
# define OSSL_HTTPS_PORT "443"
|
||||
# define OPENSSL_NO_PROXY "NO_PROXY"
|
||||
# define OPENSSL_HTTP_PROXY "HTTP_PROXY"
|
||||
# define OPENSSL_HTTPS_PROXY "HTTPS_PROXY"
|
||||
|
||||
#define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024)
|
||||
#define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024)
|
||||
|
||||
/* Low-level HTTP API */
|
||||
OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size);
|
||||
void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
|
||||
int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, int method_POST,
|
||||
const char *server, const char *port,
|
||||
const char *path);
|
||||
int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
|
||||
const char *name, const char *value);
|
||||
int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx,
|
||||
const char *content_type, int asn1,
|
||||
int timeout, int keep_alive);
|
||||
int OSSL_HTTP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
|
||||
const ASN1_ITEM *it, const ASN1_VALUE *req);
|
||||
int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx);
|
||||
int OSSL_HTTP_REQ_CTX_nbio_d2i(OSSL_HTTP_REQ_CTX *rctx,
|
||||
ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
BIO *OSSL_HTTP_REQ_CTX_exchange(OSSL_HTTP_REQ_CTX *rctx);
|
||||
BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx);
|
||||
size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx);
|
||||
void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx,
|
||||
unsigned long len);
|
||||
int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx);
|
||||
|
||||
/* High-level HTTP API */
|
||||
typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail);
|
||||
OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
|
||||
const char *proxy, const char *no_proxy,
|
||||
int use_ssl, BIO *bio, BIO *rbio,
|
||||
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
||||
int buf_size, int overall_timeout);
|
||||
int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
|
||||
const char *proxyuser, const char *proxypass,
|
||||
int timeout, BIO *bio_err, const char *prog);
|
||||
int OSSL_HTTP_set1_request(OSSL_HTTP_REQ_CTX *rctx, const char *path,
|
||||
const STACK_OF(CONF_VALUE) *headers,
|
||||
const char *content_type, BIO *req,
|
||||
const char *expected_content_type, int expect_asn1,
|
||||
size_t max_resp_len, int timeout, int keep_alive);
|
||||
BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url);
|
||||
BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
|
||||
BIO *bio, BIO *rbio,
|
||||
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
||||
int buf_size, const STACK_OF(CONF_VALUE) *headers,
|
||||
const char *expected_content_type, int expect_asn1,
|
||||
size_t max_resp_len, int timeout);
|
||||
BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx,
|
||||
const char *server, const char *port,
|
||||
const char *path, int use_ssl,
|
||||
const char *proxy, const char *no_proxy,
|
||||
BIO *bio, BIO *rbio,
|
||||
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
||||
int buf_size, const STACK_OF(CONF_VALUE) *headers,
|
||||
const char *content_type, BIO *req,
|
||||
const char *expected_content_type, int expect_asn1,
|
||||
size_t max_resp_len, int timeout, int keep_alive);
|
||||
int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok);
|
||||
|
||||
/* Auxiliary functions */
|
||||
int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
|
||||
char **pport, int *pport_num,
|
||||
char **ppath, char **pquery, char **pfrag);
|
||||
int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost,
|
||||
char **pport, int *pport_num,
|
||||
char **ppath, char **pquery, char **pfrag);
|
||||
const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy,
|
||||
const char *server, int use_ssl);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif /* !defined(OPENSSL_HTTP_H) */
|
||||
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Header for dynamic hash table routines Author - Eric Young
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_LHASH_H
|
||||
# define OPENSSL_LHASH_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_LHASH_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/bio.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct lhash_node_st OPENSSL_LH_NODE;
|
||||
typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
|
||||
typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
|
||||
typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
|
||||
typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
|
||||
typedef struct lhash_st OPENSSL_LHASH;
|
||||
|
||||
/*
|
||||
* Macros for declaring and implementing type-safe wrappers for LHASH
|
||||
* callbacks. This way, callbacks can be provided to LHASH structures without
|
||||
* function pointer casting and the macro-defined callbacks provide
|
||||
* per-variable casting before deferring to the underlying type-specific
|
||||
* callbacks. NB: It is possible to place a "static" in front of both the
|
||||
* DECLARE and IMPLEMENT macros if the functions are strictly internal.
|
||||
*/
|
||||
|
||||
/* First: "hash" functions */
|
||||
# define DECLARE_LHASH_HASH_FN(name, o_type) \
|
||||
unsigned long name##_LHASH_HASH(const void *);
|
||||
# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
|
||||
unsigned long name##_LHASH_HASH(const void *arg) { \
|
||||
const o_type *a = arg; \
|
||||
return name##_hash(a); }
|
||||
# define LHASH_HASH_FN(name) name##_LHASH_HASH
|
||||
|
||||
/* Second: "compare" functions */
|
||||
# define DECLARE_LHASH_COMP_FN(name, o_type) \
|
||||
int name##_LHASH_COMP(const void *, const void *);
|
||||
# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
|
||||
int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
|
||||
const o_type *a = arg1; \
|
||||
const o_type *b = arg2; \
|
||||
return name##_cmp(a,b); }
|
||||
# define LHASH_COMP_FN(name) name##_LHASH_COMP
|
||||
|
||||
/* Fourth: "doall_arg" functions */
|
||||
# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
||||
void name##_LHASH_DOALL_ARG(void *, void *);
|
||||
# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
||||
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
|
||||
o_type *a = arg1; \
|
||||
a_type *b = arg2; \
|
||||
name##_doall_arg(a, b); }
|
||||
# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
|
||||
|
||||
|
||||
# define LH_LOAD_MULT 256
|
||||
|
||||
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
||||
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
||||
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
||||
void OPENSSL_LH_flush(OPENSSL_LHASH *lh);
|
||||
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
||||
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
||||
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
||||
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
|
||||
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg);
|
||||
unsigned long OPENSSL_LH_strhash(const char *c);
|
||||
unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
|
||||
unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
|
||||
void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
||||
# endif
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define _LHASH OPENSSL_LHASH
|
||||
# define LHASH_NODE OPENSSL_LH_NODE
|
||||
# define lh_error OPENSSL_LH_error
|
||||
# define lh_new OPENSSL_LH_new
|
||||
# define lh_free OPENSSL_LH_free
|
||||
# define lh_insert OPENSSL_LH_insert
|
||||
# define lh_delete OPENSSL_LH_delete
|
||||
# define lh_retrieve OPENSSL_LH_retrieve
|
||||
# define lh_doall OPENSSL_LH_doall
|
||||
# define lh_doall_arg OPENSSL_LH_doall_arg
|
||||
# define lh_strhash OPENSSL_LH_strhash
|
||||
# define lh_num_items OPENSSL_LH_num_items
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# define lh_stats OPENSSL_LH_stats
|
||||
# define lh_node_stats OPENSSL_LH_node_stats
|
||||
# define lh_node_usage_stats OPENSSL_LH_node_usage_stats
|
||||
# endif
|
||||
# define lh_stats_bio OPENSSL_LH_stats_bio
|
||||
# define lh_node_stats_bio OPENSSL_LH_node_stats_bio
|
||||
# define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
|
||||
# endif
|
||||
|
||||
/* Type checking... */
|
||||
|
||||
# define LHASH_OF(type) struct lhash_st_##type
|
||||
|
||||
/* Helper macro for internal use */
|
||||
# define DEFINE_LHASH_OF_INTERNAL(type) \
|
||||
LHASH_OF(type) { \
|
||||
union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; \
|
||||
}; \
|
||||
typedef int (*lh_##type##_compfunc)(const type *a, const type *b); \
|
||||
typedef unsigned long (*lh_##type##_hashfunc)(const type *a); \
|
||||
typedef void (*lh_##type##_doallfunc)(type *a); \
|
||||
static ossl_unused ossl_inline type *\
|
||||
ossl_check_##type##_lh_plain_type(type *ptr) \
|
||||
{ \
|
||||
return ptr; \
|
||||
} \
|
||||
static ossl_unused ossl_inline const type * \
|
||||
ossl_check_const_##type##_lh_plain_type(const type *ptr) \
|
||||
{ \
|
||||
return ptr; \
|
||||
} \
|
||||
static ossl_unused ossl_inline const OPENSSL_LHASH * \
|
||||
ossl_check_const_##type##_lh_type(const LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return (const OPENSSL_LHASH *)lh; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_LHASH * \
|
||||
ossl_check_##type##_lh_type(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return (OPENSSL_LHASH *)lh; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_LH_COMPFUNC \
|
||||
ossl_check_##type##_lh_compfunc_type(lh_##type##_compfunc cmp) \
|
||||
{ \
|
||||
return (OPENSSL_LH_COMPFUNC)cmp; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_LH_HASHFUNC \
|
||||
ossl_check_##type##_lh_hashfunc_type(lh_##type##_hashfunc hfn) \
|
||||
{ \
|
||||
return (OPENSSL_LH_HASHFUNC)hfn; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_LH_DOALL_FUNC \
|
||||
ossl_check_##type##_lh_doallfunc_type(lh_##type##_doallfunc dfn) \
|
||||
{ \
|
||||
return (OPENSSL_LH_DOALL_FUNC)dfn; \
|
||||
} \
|
||||
LHASH_OF(type)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
||||
# define DEFINE_LHASH_OF_DEPRECATED(type) \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
||||
{ \
|
||||
OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
||||
}
|
||||
# else
|
||||
# define DEFINE_LHASH_OF_DEPRECATED(type)
|
||||
# endif
|
||||
|
||||
# define DEFINE_LHASH_OF_EX(type) \
|
||||
LHASH_OF(type) { \
|
||||
union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; \
|
||||
}; \
|
||||
static ossl_unused ossl_inline LHASH_OF(type) * \
|
||||
lh_##type##_new(unsigned long (*hfn)(const type *), \
|
||||
int (*cfn)(const type *, const type *)) \
|
||||
{ \
|
||||
return (LHASH_OF(type) *) \
|
||||
OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_free(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_flush(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline type * \
|
||||
lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_unused ossl_inline type * \
|
||||
lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_unused ossl_inline type * \
|
||||
lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
||||
{ \
|
||||
return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
lh_##type##_error(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline unsigned long \
|
||||
lh_##type##_num_items(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline unsigned long \
|
||||
lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
||||
{ \
|
||||
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
||||
{ \
|
||||
OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_doall(LHASH_OF(type) *lh, void (*doall)(type *)) \
|
||||
{ \
|
||||
OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_doall_arg(LHASH_OF(type) *lh, \
|
||||
void (*doallarg)(type *, void *), void *arg) \
|
||||
{ \
|
||||
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
|
||||
(OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
|
||||
} \
|
||||
LHASH_OF(type)
|
||||
|
||||
# define DEFINE_LHASH_OF(type) \
|
||||
DEFINE_LHASH_OF_EX(type); \
|
||||
DEFINE_LHASH_OF_DEPRECATED(type) \
|
||||
LHASH_OF(type)
|
||||
|
||||
#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
|
||||
int_implement_lhash_doall(type, argtype, const type)
|
||||
|
||||
#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
|
||||
int_implement_lhash_doall(type, argtype, type)
|
||||
|
||||
#define int_implement_lhash_doall(type, argtype, cbargtype) \
|
||||
static ossl_unused ossl_inline void \
|
||||
lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
|
||||
void (*fn)(cbargtype *, argtype *), \
|
||||
argtype *arg) \
|
||||
{ \
|
||||
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
|
||||
(OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
|
||||
} \
|
||||
LHASH_OF(type)
|
||||
|
||||
DEFINE_LHASH_OF_INTERNAL(OPENSSL_STRING);
|
||||
#define lh_OPENSSL_STRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_STRING) *)OPENSSL_LH_new(ossl_check_OPENSSL_STRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_STRING_lh_compfunc_type(cmp)))
|
||||
#define lh_OPENSSL_STRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_STRING_lh_type(lh))
|
||||
#define lh_OPENSSL_STRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_STRING_lh_type(lh))
|
||||
#define lh_OPENSSL_STRING_insert(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_STRING_delete(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_STRING_retrieve(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_STRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_STRING_lh_type(lh))
|
||||
#define lh_OPENSSL_STRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_STRING_lh_type(lh))
|
||||
#define lh_OPENSSL_STRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_STRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_STRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_STRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_STRING_lh_type(lh))
|
||||
#define lh_OPENSSL_STRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_STRING_lh_type(lh), dl)
|
||||
#define lh_OPENSSL_STRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_doallfunc_type(dfn))
|
||||
DEFINE_LHASH_OF_INTERNAL(OPENSSL_CSTRING);
|
||||
#define lh_OPENSSL_CSTRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_CSTRING) *)OPENSSL_LH_new(ossl_check_OPENSSL_CSTRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_CSTRING_lh_compfunc_type(cmp)))
|
||||
#define lh_OPENSSL_CSTRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
||||
#define lh_OPENSSL_CSTRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
||||
#define lh_OPENSSL_CSTRING_insert(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_CSTRING_delete(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_CSTRING_retrieve(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
||||
#define lh_OPENSSL_CSTRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
||||
#define lh_OPENSSL_CSTRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
||||
#define lh_OPENSSL_CSTRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_CSTRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
||||
#define lh_OPENSSL_CSTRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
||||
#define lh_OPENSSL_CSTRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh), dl)
|
||||
#define lh_OPENSSL_CSTRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_doallfunc_type(dfn))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Copyright 2019-2023 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_MACROS_H
|
||||
# define OPENSSL_MACROS_H
|
||||
# pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/opensslv.h>
|
||||
|
||||
|
||||
/* Helper macros for CPP string composition */
|
||||
# define OPENSSL_MSTR_HELPER(x) #x
|
||||
# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
|
||||
|
||||
/*
|
||||
* Sometimes OPENSSL_NO_xxx ends up with an empty file and some compilers
|
||||
* don't like that. This will hopefully silence them.
|
||||
*/
|
||||
# define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
|
||||
|
||||
/*
|
||||
* Generic deprecation macro
|
||||
*
|
||||
* If OPENSSL_SUPPRESS_DEPRECATED is defined, then OSSL_DEPRECATED and
|
||||
* OSSL_DEPRECATED_FOR become no-ops
|
||||
*/
|
||||
# ifndef OSSL_DEPRECATED
|
||||
# undef OSSL_DEPRECATED_FOR
|
||||
# ifndef OPENSSL_SUPPRESS_DEPRECATED
|
||||
# if defined(_MSC_VER)
|
||||
/*
|
||||
* MSVC supports __declspec(deprecated) since MSVC 2003 (13.10),
|
||||
* and __declspec(deprecated(message)) since MSVC 2005 (14.00)
|
||||
*/
|
||||
# if _MSC_VER >= 1400
|
||||
# define OSSL_DEPRECATED(since) \
|
||||
__declspec(deprecated("Since OpenSSL " # since))
|
||||
# define OSSL_DEPRECATED_FOR(since, message) \
|
||||
__declspec(deprecated("Since OpenSSL " # since ";" message))
|
||||
# elif _MSC_VER >= 1310
|
||||
# define OSSL_DEPRECATED(since) __declspec(deprecated)
|
||||
# define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated)
|
||||
# endif
|
||||
# elif defined(__GNUC__)
|
||||
/*
|
||||
* According to GCC documentation, deprecations with message appeared in
|
||||
* GCC 4.5.0
|
||||
*/
|
||||
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
||||
# define OSSL_DEPRECATED(since) \
|
||||
__attribute__((deprecated("Since OpenSSL " # since)))
|
||||
# define OSSL_DEPRECATED_FOR(since, message) \
|
||||
__attribute__((deprecated("Since OpenSSL " # since ";" message)))
|
||||
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
|
||||
# define OSSL_DEPRECATED(since) __attribute__((deprecated))
|
||||
# define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
|
||||
# endif
|
||||
# elif defined(__SUNPRO_C)
|
||||
# if (__SUNPRO_C >= 0x5130)
|
||||
# define OSSL_DEPRECATED(since) __attribute__ ((deprecated))
|
||||
# define OSSL_DEPRECATED_FOR(since, message) __attribute__ ((deprecated))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Still not defined? Then define no-op macros. This means these macros
|
||||
* are unsuitable for use in a typedef.
|
||||
*/
|
||||
# ifndef OSSL_DEPRECATED
|
||||
# define OSSL_DEPRECATED(since) extern
|
||||
# define OSSL_DEPRECATED_FOR(since, message) extern
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
|
||||
* declarations of functions deprecated in or before <version>. If this is
|
||||
* undefined, the value of the macro OPENSSL_CONFIGURED_API (defined in
|
||||
* <openssl/opensslconf.h>) is the default.
|
||||
*
|
||||
* For any version number up until version 1.1.x, <version> is expected to be
|
||||
* the calculated version number 0xMNNFFPPSL.
|
||||
* For version numbers 3.0 and on, <version> is expected to be a computation
|
||||
* of the major and minor numbers in decimal using this formula:
|
||||
*
|
||||
* MAJOR * 10000 + MINOR * 100
|
||||
*
|
||||
* So version 3.0 becomes 30000, version 3.2 becomes 30200, etc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* We use the OPENSSL_API_COMPAT value to define API level macros. These
|
||||
* macros are used to enable or disable features at that API version boundary.
|
||||
*/
|
||||
|
||||
# ifdef OPENSSL_API_LEVEL
|
||||
# error "OPENSSL_API_LEVEL must not be defined by application"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* We figure out what API level was intended by simple numeric comparison.
|
||||
* The lowest old style number we recognise is 0x00908000L, so we take some
|
||||
* safety margin and assume that anything below 0x00900000L is a new style
|
||||
* number. This allows new versions up to and including v943.71.83.
|
||||
*/
|
||||
# ifdef OPENSSL_API_COMPAT
|
||||
# if OPENSSL_API_COMPAT < 0x900000L
|
||||
# define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
|
||||
# else
|
||||
# define OPENSSL_API_LEVEL \
|
||||
(((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000 \
|
||||
+ ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
|
||||
+ ((OPENSSL_API_COMPAT >> 12) & 0xFF))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* If OPENSSL_API_COMPAT wasn't given, we use default numbers to set
|
||||
* the API compatibility level.
|
||||
*/
|
||||
# ifndef OPENSSL_API_LEVEL
|
||||
# if OPENSSL_CONFIGURED_API > 0
|
||||
# define OPENSSL_API_LEVEL (OPENSSL_CONFIGURED_API)
|
||||
# else
|
||||
# define OPENSSL_API_LEVEL \
|
||||
(OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if OPENSSL_API_LEVEL > OPENSSL_CONFIGURED_API
|
||||
# error "The requested API level higher than the configured API compatibility level"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Check of sane values.
|
||||
*/
|
||||
/* Can't go higher than the current version. */
|
||||
# if OPENSSL_API_LEVEL > (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
|
||||
# error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
||||
# endif
|
||||
/* OpenSSL will have no version 2.y.z */
|
||||
# if OPENSSL_API_LEVEL < 30000 && OPENSSL_API_LEVEL >= 20000
|
||||
# error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
||||
# endif
|
||||
/* Below 0.9.8 is unacceptably low */
|
||||
# if OPENSSL_API_LEVEL < 908
|
||||
# error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Define macros for deprecation and simulated removal purposes.
|
||||
*
|
||||
* The macros OSSL_DEPRECATED_{major}_{minor} are always defined for
|
||||
* all OpenSSL versions we care for. They can be used as attributes
|
||||
* in function declarations where appropriate.
|
||||
*
|
||||
* The macros OPENSSL_NO_DEPRECATED_{major}_{minor} are defined for
|
||||
* all OpenSSL versions up to or equal to the version given with
|
||||
* OPENSSL_API_COMPAT. They are used as guards around anything that's
|
||||
* deprecated up to that version, as an effect of the developer option
|
||||
* 'no-deprecated'.
|
||||
*/
|
||||
|
||||
# undef OPENSSL_NO_DEPRECATED_3_0
|
||||
# undef OPENSSL_NO_DEPRECATED_1_1_1
|
||||
# undef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# undef OPENSSL_NO_DEPRECATED_1_0_2
|
||||
# undef OPENSSL_NO_DEPRECATED_1_0_1
|
||||
# undef OPENSSL_NO_DEPRECATED_1_0_0
|
||||
# undef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
|
||||
# if OPENSSL_API_LEVEL >= 30100
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_3_1 OSSL_DEPRECATED(3.1)
|
||||
# define OSSL_DEPRECATEDIN_3_1_FOR(msg) OSSL_DEPRECATED_FOR(3.1, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_3_1
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_3_1
|
||||
# define OSSL_DEPRECATEDIN_3_1_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 30000
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)
|
||||
# define OSSL_DEPRECATEDIN_3_0_FOR(msg) OSSL_DEPRECATED_FOR(3.0, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_3_0
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_3_0
|
||||
# define OSSL_DEPRECATEDIN_3_0_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 10101
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_1_1_1 OSSL_DEPRECATED(1.1.1)
|
||||
# define OSSL_DEPRECATEDIN_1_1_1_FOR(msg) OSSL_DEPRECATED_FOR(1.1.1, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_1_1_1
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_1_1_1
|
||||
# define OSSL_DEPRECATEDIN_1_1_1_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 10100
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_1_1_0 OSSL_DEPRECATED(1.1.0)
|
||||
# define OSSL_DEPRECATEDIN_1_1_0_FOR(msg) OSSL_DEPRECATED_FOR(1.1.0, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_1_1_0
|
||||
# define OSSL_DEPRECATEDIN_1_1_0_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 10002
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_1_0_2 OSSL_DEPRECATED(1.0.2)
|
||||
# define OSSL_DEPRECATEDIN_1_0_2_FOR(msg) OSSL_DEPRECATED_FOR(1.0.2, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_1_0_2
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_1_0_2
|
||||
# define OSSL_DEPRECATEDIN_1_0_2_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 10001
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_1_0_1 OSSL_DEPRECATED(1.0.1)
|
||||
# define OSSL_DEPRECATEDIN_1_0_1_FOR(msg) OSSL_DEPRECATED_FOR(1.0.1, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_1_0_1
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_1_0_1
|
||||
# define OSSL_DEPRECATEDIN_1_0_1_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 10000
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_1_0_0 OSSL_DEPRECATED(1.0.0)
|
||||
# define OSSL_DEPRECATEDIN_1_0_0_FOR(msg) OSSL_DEPRECATED_FOR(1.0.0, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_1_0_0
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_1_0_0
|
||||
# define OSSL_DEPRECATEDIN_1_0_0_FOR(msg)
|
||||
# endif
|
||||
# if OPENSSL_API_LEVEL >= 908
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OSSL_DEPRECATEDIN_0_9_8 OSSL_DEPRECATED(0.9.8)
|
||||
# define OSSL_DEPRECATEDIN_0_9_8_FOR(msg) OSSL_DEPRECATED_FOR(0.9.8, msg)
|
||||
# else
|
||||
# define OPENSSL_NO_DEPRECATED_0_9_8
|
||||
# endif
|
||||
# else
|
||||
# define OSSL_DEPRECATEDIN_0_9_8
|
||||
# define OSSL_DEPRECATEDIN_0_9_8_FOR(msg)
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Make our own variants of __FILE__ and __LINE__, depending on configuration
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_FILE
|
||||
# ifdef OPENSSL_NO_FILENAMES
|
||||
# define OPENSSL_FILE ""
|
||||
# define OPENSSL_LINE 0
|
||||
# else
|
||||
# define OPENSSL_FILE __FILE__
|
||||
# define OPENSSL_LINE __LINE__
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* __func__ was standardized in C99, so for any compiler that claims
|
||||
* to implement that language level or newer, we assume we can safely
|
||||
* use that symbol.
|
||||
*
|
||||
* GNU C also provides __FUNCTION__ since version 2, which predates
|
||||
* C99. We can, however, only use this if __STDC_VERSION__ exists,
|
||||
* as it's otherwise not allowed according to ISO C standards (C90).
|
||||
* (compiling with GNU C's -pedantic tells us so)
|
||||
*
|
||||
* If none of the above applies, we check if the compiler is MSVC,
|
||||
* and use __FUNCTION__ if that's the case.
|
||||
*/
|
||||
# ifndef OPENSSL_FUNC
|
||||
# if defined(__STDC_VERSION__)
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# define OPENSSL_FUNC __func__
|
||||
# elif defined(__GNUC__) && __GNUC__ >= 2
|
||||
# define OPENSSL_FUNC __FUNCTION__
|
||||
# endif
|
||||
# elif defined(_MSC_VER)
|
||||
# define OPENSSL_FUNC __FUNCTION__
|
||||
# endif
|
||||
/*
|
||||
* If all these possibilities are exhausted, we give up and use a
|
||||
* static string.
|
||||
*/
|
||||
# ifndef OPENSSL_FUNC
|
||||
# define OPENSSL_FUNC "(unknown function)"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef OSSL_CRYPTO_ALLOC
|
||||
# if defined(__GNUC__)
|
||||
# define OSSL_CRYPTO_ALLOC __attribute__((__malloc__))
|
||||
# elif defined(_MSC_VER)
|
||||
# define OSSL_CRYPTO_ALLOC __declspec(restrict)
|
||||
# else
|
||||
# define OSSL_CRYPTO_ALLOC
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* OPENSSL_MACROS_H */
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_MD5_H
|
||||
# define OPENSSL_MD5_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_MD5_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_MD5
|
||||
# include <openssl/e_os2.h>
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define MD5_DIGEST_LENGTH 16
|
||||
|
||||
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
/*
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* ! MD5_LONG has to be at least 32 bits wide. !
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
# define MD5_LONG unsigned int
|
||||
|
||||
# define MD5_CBLOCK 64
|
||||
# define MD5_LBLOCK (MD5_CBLOCK/4)
|
||||
|
||||
typedef struct MD5state_st {
|
||||
MD5_LONG A, B, C, D;
|
||||
MD5_LONG Nl, Nh;
|
||||
MD5_LONG data[MD5_LBLOCK];
|
||||
unsigned int num;
|
||||
} MD5_CTX;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
|
||||
unsigned char *md);
|
||||
OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 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
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_OBJECTS_H
|
||||
# define OPENSSL_OBJECTS_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_OBJECTS_H
|
||||
# endif
|
||||
|
||||
# include <openssl/obj_mac.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/asn1.h>
|
||||
# include <openssl/objectserr.h>
|
||||
|
||||
# define OBJ_NAME_TYPE_UNDEF 0x00
|
||||
# define OBJ_NAME_TYPE_MD_METH 0x01
|
||||
# define OBJ_NAME_TYPE_CIPHER_METH 0x02
|
||||
# define OBJ_NAME_TYPE_PKEY_METH 0x03
|
||||
# define OBJ_NAME_TYPE_COMP_METH 0x04
|
||||
# define OBJ_NAME_TYPE_MAC_METH 0x05
|
||||
# define OBJ_NAME_TYPE_KDF_METH 0x06
|
||||
# define OBJ_NAME_TYPE_NUM 0x07
|
||||
|
||||
# define OBJ_NAME_ALIAS 0x8000
|
||||
|
||||
# define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
|
||||
# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct obj_name_st {
|
||||
int type;
|
||||
int alias;
|
||||
const char *name;
|
||||
const char *data;
|
||||
} OBJ_NAME;
|
||||
|
||||
# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
|
||||
|
||||
int OBJ_NAME_init(void);
|
||||
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
|
||||
int (*cmp_func) (const char *, const char *),
|
||||
void (*free_func) (const char *, int, const char *));
|
||||
const char *OBJ_NAME_get(const char *name, int type);
|
||||
int OBJ_NAME_add(const char *name, int type, const char *data);
|
||||
int OBJ_NAME_remove(const char *name, int type);
|
||||
void OBJ_NAME_cleanup(int type); /* -1 for everything */
|
||||
void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
|
||||
void *arg);
|
||||
void OBJ_NAME_do_all_sorted(int type,
|
||||
void (*fn) (const OBJ_NAME *, void *arg),
|
||||
void *arg);
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION_name(ASN1_OBJECT, OBJ)
|
||||
ASN1_OBJECT *OBJ_nid2obj(int n);
|
||||
const char *OBJ_nid2ln(int n);
|
||||
const char *OBJ_nid2sn(int n);
|
||||
int OBJ_obj2nid(const ASN1_OBJECT *o);
|
||||
ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
|
||||
int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
|
||||
int OBJ_txt2nid(const char *s);
|
||||
int OBJ_ln2nid(const char *s);
|
||||
int OBJ_sn2nid(const char *s);
|
||||
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
|
||||
const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
|
||||
int (*cmp) (const void *, const void *));
|
||||
const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
|
||||
int size,
|
||||
int (*cmp) (const void *, const void *),
|
||||
int flags);
|
||||
|
||||
# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \
|
||||
static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
|
||||
static int nm##_cmp(type1 const *, type2 const *); \
|
||||
scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
||||
|
||||
# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
|
||||
_DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
|
||||
# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
||||
type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
||||
|
||||
/*-
|
||||
* Unsolved problem: if a type is actually a pointer type, like
|
||||
* nid_triple is, then its impossible to get a const where you need
|
||||
* it. Consider:
|
||||
*
|
||||
* typedef int nid_triple[3];
|
||||
* const void *a_;
|
||||
* const nid_triple const *a = a_;
|
||||
*
|
||||
* The assignment discards a const because what you really want is:
|
||||
*
|
||||
* const int const * const *a = a_;
|
||||
*
|
||||
* But if you do that, you lose the fact that a is an array of 3 ints,
|
||||
* which breaks comparison functions.
|
||||
*
|
||||
* Thus we end up having to cast, sadly, or unpack the
|
||||
* declarations. Or, as I finally did in this case, declare nid_triple
|
||||
* to be a struct, which it should have been in the first place.
|
||||
*
|
||||
* Ben, August 2008.
|
||||
*
|
||||
* Also, strictly speaking not all types need be const, but handling
|
||||
* the non-constness means a lot of complication, and in practice
|
||||
* comparison routines do always not touch their arguments.
|
||||
*/
|
||||
|
||||
# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \
|
||||
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
||||
{ \
|
||||
type1 const *a = a_; \
|
||||
type2 const *b = b_; \
|
||||
return nm##_cmp(a,b); \
|
||||
} \
|
||||
static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
||||
{ \
|
||||
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
||||
nm##_cmp_BSEARCH_CMP_FN); \
|
||||
} \
|
||||
extern void dummy_prototype(void)
|
||||
|
||||
# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
||||
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
||||
{ \
|
||||
type1 const *a = a_; \
|
||||
type2 const *b = b_; \
|
||||
return nm##_cmp(a,b); \
|
||||
} \
|
||||
type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
||||
{ \
|
||||
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
||||
nm##_cmp_BSEARCH_CMP_FN); \
|
||||
} \
|
||||
extern void dummy_prototype(void)
|
||||
|
||||
# define OBJ_bsearch(type1,key,type2,base,num,cmp) \
|
||||
((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
|
||||
num,sizeof(type2), \
|
||||
((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
|
||||
(void)CHECKED_PTR_OF(type2,cmp##_type_2), \
|
||||
cmp##_BSEARCH_CMP_FN)))
|
||||
|
||||
# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \
|
||||
((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
|
||||
num,sizeof(type2), \
|
||||
((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
|
||||
(void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
|
||||
cmp##_BSEARCH_CMP_FN)),flags)
|
||||
|
||||
int OBJ_new_nid(int num);
|
||||
int OBJ_add_object(const ASN1_OBJECT *obj);
|
||||
int OBJ_create(const char *oid, const char *sn, const char *ln);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define OBJ_cleanup() while(0) continue
|
||||
#endif
|
||||
int OBJ_create_objects(BIO *in);
|
||||
|
||||
size_t OBJ_length(const ASN1_OBJECT *obj);
|
||||
const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
|
||||
|
||||
int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
|
||||
int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
|
||||
int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
|
||||
void OBJ_sigid_free(void);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_OBJECTSERR_H
|
||||
# define OPENSSL_OBJECTSERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* OBJ reason codes.
|
||||
*/
|
||||
# define OBJ_R_OID_EXISTS 102
|
||||
# define OBJ_R_UNKNOWN_NID 101
|
||||
# define OBJ_R_UNKNOWN_OBJECT_NAME 103
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2019-2021 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_OPENSSLCONF_H
|
||||
# define OPENSSL_OPENSSLCONF_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/configuration.h>
|
||||
|
||||
#undef OPENSSL_NO_DEPRECATED
|
||||
#define OPENSSL_SUPPRESS_DEPRECATED
|
||||
# include <openssl/macros.h>
|
||||
|
||||
#endif /* OPENSSL_OPENSSLCONF_H */
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/opensslv.h.in
|
||||
*
|
||||
* Copyright 1999-2020 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_OPENSSLV_H
|
||||
# define OPENSSL_OPENSSLV_H
|
||||
# pragma once
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*
|
||||
* SECTION 1: VERSION DATA. These will change for each release
|
||||
*/
|
||||
|
||||
/*
|
||||
* Base version macros
|
||||
*
|
||||
* These macros express version number MAJOR.MINOR.PATCH exactly
|
||||
*/
|
||||
# define OPENSSL_VERSION_MAJOR 3
|
||||
# define OPENSSL_VERSION_MINOR 1
|
||||
# define OPENSSL_VERSION_PATCH 7
|
||||
|
||||
/*
|
||||
* Additional version information
|
||||
*
|
||||
* These are also part of the new version scheme, but aren't part
|
||||
* of the version number itself.
|
||||
*/
|
||||
|
||||
/* Could be: #define OPENSSL_VERSION_PRE_RELEASE "-alpha.1" */
|
||||
# define OPENSSL_VERSION_PRE_RELEASE ""
|
||||
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+fips" */
|
||||
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+vendor.1" */
|
||||
# define OPENSSL_VERSION_BUILD_METADATA ""
|
||||
|
||||
/*
|
||||
* Note: The OpenSSL Project will never define OPENSSL_VERSION_BUILD_METADATA
|
||||
* to be anything but the empty string. Its use is entirely reserved for
|
||||
* others
|
||||
*/
|
||||
|
||||
/*
|
||||
* Shared library version
|
||||
*
|
||||
* This is strictly to express ABI version, which may or may not
|
||||
* be related to the API version expressed with the macros above.
|
||||
* This is defined in free form.
|
||||
*/
|
||||
# define OPENSSL_SHLIB_VERSION 3
|
||||
|
||||
/*
|
||||
* SECTION 2: USEFUL MACROS
|
||||
*/
|
||||
|
||||
/* For checking general API compatibility when preprocessing */
|
||||
# define OPENSSL_VERSION_PREREQ(maj,min) \
|
||||
((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
|
||||
|
||||
/*
|
||||
* Macros to get the version in easily digested string form, both the short
|
||||
* "MAJOR.MINOR.PATCH" variant (where MAJOR, MINOR and PATCH are replaced
|
||||
* with the values from the corresponding OPENSSL_VERSION_ macros) and the
|
||||
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
|
||||
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
|
||||
*/
|
||||
# define OPENSSL_VERSION_STR "3.1.7"
|
||||
# define OPENSSL_FULL_VERSION_STR "3.1.7"
|
||||
|
||||
/*
|
||||
* SECTION 3: ADDITIONAL METADATA
|
||||
*
|
||||
* These strings are defined separately to allow them to be parsable.
|
||||
*/
|
||||
# define OPENSSL_RELEASE_DATE "3 Sep 2024"
|
||||
|
||||
/*
|
||||
* SECTION 4: BACKWARD COMPATIBILITY
|
||||
*/
|
||||
|
||||
# define OPENSSL_VERSION_TEXT "OpenSSL 3.1.7 3 Sep 2024"
|
||||
|
||||
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
|
||||
# ifdef OPENSSL_VERSION_PRE_RELEASE
|
||||
# define _OPENSSL_VERSION_PRE_RELEASE 0x0L
|
||||
# else
|
||||
# define _OPENSSL_VERSION_PRE_RELEASE 0xfL
|
||||
# endif
|
||||
# define OPENSSL_VERSION_NUMBER \
|
||||
( (OPENSSL_VERSION_MAJOR<<28) \
|
||||
|(OPENSSL_VERSION_MINOR<<20) \
|
||||
|(OPENSSL_VERSION_PATCH<<4) \
|
||||
|_OPENSSL_VERSION_PRE_RELEASE )
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_OPENSSLV_H
|
||||
# endif
|
||||
|
||||
#endif /* OPENSSL_OPENSSLV_H */
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* The original <openssl/ossl_typ.h> was renamed to <openssl/types.h>
|
||||
*
|
||||
* This header file only exists for compatibility reasons with older
|
||||
* applications which #include <openssl/ossl_typ.h>.
|
||||
*/
|
||||
# include <openssl/types.h>
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. 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_PARAMS_H
|
||||
# define OPENSSL_PARAMS_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/core.h>
|
||||
# include <openssl/bn.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
|
||||
|
||||
# define OSSL_PARAM_END \
|
||||
{ NULL, 0, NULL, 0, 0 }
|
||||
|
||||
# define OSSL_PARAM_DEFN(key, type, addr, sz) \
|
||||
{ (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
|
||||
|
||||
/* Basic parameter types without return sizes */
|
||||
# define OSSL_PARAM_int(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
|
||||
# define OSSL_PARAM_uint(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned int))
|
||||
# define OSSL_PARAM_long(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int))
|
||||
# define OSSL_PARAM_ulong(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(unsigned long int))
|
||||
# define OSSL_PARAM_int32(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t))
|
||||
# define OSSL_PARAM_uint32(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint32_t))
|
||||
# define OSSL_PARAM_int64(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t))
|
||||
# define OSSL_PARAM_uint64(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
||||
sizeof(uint64_t))
|
||||
# define OSSL_PARAM_size_t(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t))
|
||||
# define OSSL_PARAM_time_t(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(time_t))
|
||||
# define OSSL_PARAM_double(key, addr) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double))
|
||||
|
||||
# define OSSL_PARAM_BN(key, bn, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (bn), (sz))
|
||||
# define OSSL_PARAM_utf8_string(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
|
||||
# define OSSL_PARAM_octet_string(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
|
||||
|
||||
# define OSSL_PARAM_utf8_ptr(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, (addr), sz)
|
||||
# define OSSL_PARAM_octet_ptr(key, addr, sz) \
|
||||
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, (addr), sz)
|
||||
|
||||
/* Search an OSSL_PARAM array for a matching name */
|
||||
OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key);
|
||||
const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *p, const char *key);
|
||||
|
||||
/* Basic parameter type run-time construction */
|
||||
OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_time_t(const char *key, time_t *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf);
|
||||
OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf,
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
|
||||
size_t bsize);
|
||||
OSSL_PARAM OSSL_PARAM_construct_end(void);
|
||||
|
||||
int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
|
||||
const OSSL_PARAM *paramdefs,
|
||||
const char *key, const char *value,
|
||||
size_t value_n, int *found);
|
||||
|
||||
int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val);
|
||||
int OSSL_PARAM_get_uint(const OSSL_PARAM *p, unsigned int *val);
|
||||
int OSSL_PARAM_get_long(const OSSL_PARAM *p, long int *val);
|
||||
int OSSL_PARAM_get_ulong(const OSSL_PARAM *p, unsigned long int *val);
|
||||
int OSSL_PARAM_get_int32(const OSSL_PARAM *p, int32_t *val);
|
||||
int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val);
|
||||
int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val);
|
||||
int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val);
|
||||
int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val);
|
||||
int OSSL_PARAM_get_time_t(const OSSL_PARAM *p, time_t *val);
|
||||
|
||||
int OSSL_PARAM_set_int(OSSL_PARAM *p, int val);
|
||||
int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val);
|
||||
int OSSL_PARAM_set_long(OSSL_PARAM *p, long int val);
|
||||
int OSSL_PARAM_set_ulong(OSSL_PARAM *p, unsigned long int val);
|
||||
int OSSL_PARAM_set_int32(OSSL_PARAM *p, int32_t val);
|
||||
int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val);
|
||||
int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val);
|
||||
int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val);
|
||||
int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val);
|
||||
int OSSL_PARAM_set_time_t(OSSL_PARAM *p, time_t val);
|
||||
|
||||
int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val);
|
||||
int OSSL_PARAM_set_double(OSSL_PARAM *p, double val);
|
||||
|
||||
int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val);
|
||||
int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val);
|
||||
|
||||
int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val, size_t max_len);
|
||||
int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val);
|
||||
|
||||
int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val, size_t max_len,
|
||||
size_t *used_len);
|
||||
int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len);
|
||||
|
||||
int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val);
|
||||
int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, const char *val);
|
||||
|
||||
int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val,
|
||||
size_t *used_len);
|
||||
int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val,
|
||||
size_t used_len);
|
||||
|
||||
int OSSL_PARAM_get_utf8_string_ptr(const OSSL_PARAM *p, const char **val);
|
||||
int OSSL_PARAM_get_octet_string_ptr(const OSSL_PARAM *p, const void **val,
|
||||
size_t *used_len);
|
||||
|
||||
int OSSL_PARAM_modified(const OSSL_PARAM *p);
|
||||
void OSSL_PARAM_set_all_unmodified(OSSL_PARAM *p);
|
||||
|
||||
OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *p);
|
||||
OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2);
|
||||
void OSSL_PARAM_free(OSSL_PARAM *p);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,541 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_PEM_H
|
||||
# define OPENSSL_PEM_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_PEM_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/pemerr.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define PEM_BUFSIZE 1024
|
||||
|
||||
# define PEM_STRING_X509_OLD "X509 CERTIFICATE"
|
||||
# define PEM_STRING_X509 "CERTIFICATE"
|
||||
# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
|
||||
# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
|
||||
# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
|
||||
# define PEM_STRING_X509_CRL "X509 CRL"
|
||||
# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
|
||||
# define PEM_STRING_PUBLIC "PUBLIC KEY"
|
||||
# define PEM_STRING_RSA "RSA PRIVATE KEY"
|
||||
# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
|
||||
# define PEM_STRING_DSA "DSA PRIVATE KEY"
|
||||
# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
|
||||
# define PEM_STRING_PKCS7 "PKCS7"
|
||||
# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
|
||||
# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
|
||||
# define PEM_STRING_PKCS8INF "PRIVATE KEY"
|
||||
# define PEM_STRING_DHPARAMS "DH PARAMETERS"
|
||||
# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
|
||||
# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
|
||||
# define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
|
||||
# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
|
||||
# define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
|
||||
# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
|
||||
# define PEM_STRING_PARAMETERS "PARAMETERS"
|
||||
# define PEM_STRING_CMS "CMS"
|
||||
|
||||
# define PEM_TYPE_ENCRYPTED 10
|
||||
# define PEM_TYPE_MIC_ONLY 20
|
||||
# define PEM_TYPE_MIC_CLEAR 30
|
||||
# define PEM_TYPE_CLEAR 40
|
||||
|
||||
/*
|
||||
* These macros make the PEM_read/PEM_write functions easier to maintain and
|
||||
* write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
|
||||
* IMPLEMENT_PEM_rw_cb(...)
|
||||
*/
|
||||
|
||||
# define PEM_read_cb_fnsig(name, type, INTYPE, readname) \
|
||||
type *PEM_##readname##_##name(INTYPE *out, type **x, \
|
||||
pem_password_cb *cb, void *u)
|
||||
# define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname) \
|
||||
type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \
|
||||
pem_password_cb *cb, void *u, \
|
||||
OSSL_LIB_CTX *libctx, \
|
||||
const char *propq)
|
||||
|
||||
# define PEM_write_fnsig(name, type, OUTTYPE, writename) \
|
||||
int PEM_##writename##_##name(OUTTYPE *out, const type *x)
|
||||
# define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \
|
||||
int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
|
||||
const EVP_CIPHER *enc, \
|
||||
const unsigned char *kstr, int klen, \
|
||||
pem_password_cb *cb, void *u)
|
||||
# define PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \
|
||||
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
||||
OSSL_LIB_CTX *libctx, \
|
||||
const char *propq)
|
||||
# define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename) \
|
||||
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
||||
const EVP_CIPHER *enc, \
|
||||
const unsigned char *kstr, int klen, \
|
||||
pem_password_cb *cb, void *u, \
|
||||
OSSL_LIB_CTX *libctx, \
|
||||
const char *propq)
|
||||
|
||||
# ifdef OPENSSL_NO_STDIO
|
||||
|
||||
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
|
||||
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
|
||||
# endif
|
||||
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
|
||||
# endif
|
||||
# else
|
||||
|
||||
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
|
||||
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \
|
||||
{ \
|
||||
return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp, \
|
||||
(void **)x, cb, u); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
|
||||
PEM_write_fnsig(name, type, FILE, write) \
|
||||
{ \
|
||||
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
||||
x, NULL, NULL, 0, NULL, NULL); \
|
||||
}
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
|
||||
PEM_write_cb_fnsig(name, type, FILE, write) \
|
||||
{ \
|
||||
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
||||
x, enc, kstr, klen, cb, u); \
|
||||
}
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
||||
type *PEM_read_bio_##name(BIO *bp, type **x, \
|
||||
pem_password_cb *cb, void *u) \
|
||||
{ \
|
||||
return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
|
||||
(void **)x, cb, u); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
||||
PEM_write_fnsig(name, type, BIO, write_bio) \
|
||||
{ \
|
||||
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
||||
x, NULL,NULL,0,NULL,NULL); \
|
||||
}
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_bio(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
||||
PEM_write_cb_fnsig(name, type, BIO, write_bio) \
|
||||
{ \
|
||||
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
||||
x, enc, kstr, klen, cb, u); \
|
||||
}
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_write(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_read(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_read_fp(name, type, str, asn1)
|
||||
|
||||
# define IMPLEMENT_PEM_rw(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write(name, type, str, asn1)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_const(name, type, str, asn1)
|
||||
# endif
|
||||
|
||||
# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
||||
IMPLEMENT_PEM_write_cb(name, type, str, asn1)
|
||||
|
||||
/* These are the same except they are for the declarations */
|
||||
|
||||
/*
|
||||
* The mysterious 'extern' that's passed to some macros is innocuous,
|
||||
* and is there to quiet pre-C99 compilers that may complain about empty
|
||||
* arguments in macro calls.
|
||||
*/
|
||||
# if defined(OPENSSL_NO_STDIO)
|
||||
|
||||
# define DECLARE_PEM_read_fp_attr(attr, name, type) /**/
|
||||
# define DECLARE_PEM_read_fp_ex_attr(attr, name, type) /**/
|
||||
# define DECLARE_PEM_write_fp_attr(attr, name, type) /**/
|
||||
# define DECLARE_PEM_write_fp_ex_attr(attr, name, type) /**/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_write_fp_const_attr(attr, name, type) /**/
|
||||
# endif
|
||||
# define DECLARE_PEM_write_cb_fp_attr(attr, name, type) /**/
|
||||
# define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) /**/
|
||||
|
||||
# else
|
||||
|
||||
# define DECLARE_PEM_read_fp_attr(attr, name, type) \
|
||||
attr PEM_read_cb_fnsig(name, type, FILE, read);
|
||||
# define DECLARE_PEM_read_fp_ex_attr(attr, name, type) \
|
||||
attr PEM_read_cb_fnsig(name, type, FILE, read); \
|
||||
attr PEM_read_cb_ex_fnsig(name, type, FILE, read);
|
||||
|
||||
# define DECLARE_PEM_write_fp_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, FILE, write);
|
||||
# define DECLARE_PEM_write_fp_ex_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, FILE, write); \
|
||||
attr PEM_write_ex_fnsig(name, type, FILE, write);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_write_fp_const_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, FILE, write);
|
||||
# endif
|
||||
# define DECLARE_PEM_write_cb_fp_attr(attr, name, type) \
|
||||
attr PEM_write_cb_fnsig(name, type, FILE, write);
|
||||
# define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) \
|
||||
attr PEM_write_cb_fnsig(name, type, FILE, write); \
|
||||
attr PEM_write_cb_ex_fnsig(name, type, FILE, write);
|
||||
|
||||
# endif
|
||||
|
||||
# define DECLARE_PEM_read_fp(name, type) \
|
||||
DECLARE_PEM_read_fp_attr(extern, name, type)
|
||||
# define DECLARE_PEM_write_fp(name, type) \
|
||||
DECLARE_PEM_write_fp_attr(extern, name, type)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_write_fp_const(name, type) \
|
||||
DECLARE_PEM_write_fp_const_attr(extern, name, type)
|
||||
# endif
|
||||
# define DECLARE_PEM_write_cb_fp(name, type) \
|
||||
DECLARE_PEM_write_cb_fp_attr(extern, name, type)
|
||||
|
||||
# define DECLARE_PEM_read_bio_attr(attr, name, type) \
|
||||
attr PEM_read_cb_fnsig(name, type, BIO, read_bio);
|
||||
# define DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
||||
attr PEM_read_cb_fnsig(name, type, BIO, read_bio); \
|
||||
attr PEM_read_cb_ex_fnsig(name, type, BIO, read_bio);
|
||||
# define DECLARE_PEM_read_bio(name, type) \
|
||||
DECLARE_PEM_read_bio_attr(extern, name, type)
|
||||
# define DECLARE_PEM_read_bio_ex(name, type) \
|
||||
DECLARE_PEM_read_bio_ex_attr(extern, name, type)
|
||||
|
||||
# define DECLARE_PEM_write_bio_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
||||
# define DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, BIO, write_bio); \
|
||||
attr PEM_write_ex_fnsig(name, type, BIO, write_bio);
|
||||
# define DECLARE_PEM_write_bio(name, type) \
|
||||
DECLARE_PEM_write_bio_attr(extern, name, type)
|
||||
# define DECLARE_PEM_write_bio_ex(name, type) \
|
||||
DECLARE_PEM_write_bio_ex_attr(extern, name, type)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
||||
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
||||
# define DECLARE_PEM_write_bio_const(name, type) \
|
||||
DECLARE_PEM_write_bio_const_attr(extern, name, type)
|
||||
# endif
|
||||
|
||||
# define DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
||||
attr PEM_write_cb_fnsig(name, type, BIO, write_bio);
|
||||
# define DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
||||
attr PEM_write_cb_fnsig(name, type, BIO, write_bio); \
|
||||
attr PEM_write_cb_ex_fnsig(name, type, BIO, write_bio);
|
||||
# define DECLARE_PEM_write_cb_bio(name, type) \
|
||||
DECLARE_PEM_write_cb_bio_attr(extern, name, type)
|
||||
# define DECLARE_PEM_write_cb_ex_bio(name, type) \
|
||||
DECLARE_PEM_write_cb_bio_ex_attr(extern, name, type)
|
||||
|
||||
# define DECLARE_PEM_write_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_bio_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_fp_attr(attr, name, type)
|
||||
# define DECLARE_PEM_write_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_fp_ex_attr(attr, name, type)
|
||||
# define DECLARE_PEM_write(name, type) \
|
||||
DECLARE_PEM_write_attr(extern, name, type)
|
||||
# define DECLARE_PEM_write_ex(name, type) \
|
||||
DECLARE_PEM_write_ex_attr(extern, name, type)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_write_const_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_fp_const_attr(attr, name, type)
|
||||
# define DECLARE_PEM_write_const(name, type) \
|
||||
DECLARE_PEM_write_const_attr(extern, name, type)
|
||||
# endif
|
||||
# define DECLARE_PEM_write_cb_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_fp_attr(attr, name, type)
|
||||
# define DECLARE_PEM_write_cb_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type)
|
||||
# define DECLARE_PEM_write_cb(name, type) \
|
||||
DECLARE_PEM_write_cb_attr(extern, name, type)
|
||||
# define DECLARE_PEM_write_cb_ex(name, type) \
|
||||
DECLARE_PEM_write_cb_ex_attr(extern, name, type)
|
||||
# define DECLARE_PEM_read_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_bio_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_fp_attr(attr, name, type)
|
||||
# define DECLARE_PEM_read_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_fp_ex_attr(attr, name, type)
|
||||
# define DECLARE_PEM_read(name, type) \
|
||||
DECLARE_PEM_read_attr(extern, name, type)
|
||||
# define DECLARE_PEM_read_ex(name, type) \
|
||||
DECLARE_PEM_read_ex_attr(extern, name, type)
|
||||
# define DECLARE_PEM_rw_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_attr(attr, name, type)
|
||||
# define DECLARE_PEM_rw_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_ex_attr(attr, name, type)
|
||||
# define DECLARE_PEM_rw(name, type) \
|
||||
DECLARE_PEM_rw_attr(extern, name, type)
|
||||
# define DECLARE_PEM_rw_ex(name, type) \
|
||||
DECLARE_PEM_rw_ex_attr(extern, name, type)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define DECLARE_PEM_rw_const_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_const_attr(attr, name, type)
|
||||
# define DECLARE_PEM_rw_const(name, type) \
|
||||
DECLARE_PEM_rw_const_attr(extern, name, type)
|
||||
# endif
|
||||
# define DECLARE_PEM_rw_cb_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_attr(attr, name, type)
|
||||
# define DECLARE_PEM_rw_cb_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
||||
DECLARE_PEM_write_cb_ex_attr(attr, name, type)
|
||||
# define DECLARE_PEM_rw_cb(name, type) \
|
||||
DECLARE_PEM_rw_cb_attr(extern, name, type)
|
||||
# define DECLARE_PEM_rw_cb_ex(name, type) \
|
||||
DECLARE_PEM_rw_cb_ex_attr(extern, name, type)
|
||||
|
||||
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
|
||||
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
|
||||
pem_password_cb *callback, void *u);
|
||||
|
||||
int PEM_read_bio(BIO *bp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
# define PEM_FLAG_SECURE 0x1
|
||||
# define PEM_FLAG_EAY_COMPATIBLE 0x2
|
||||
# define PEM_FLAG_ONLY_B64 0x4
|
||||
int PEM_read_bio_ex(BIO *bp, char **name, char **header,
|
||||
unsigned char **data, long *len, unsigned int flags);
|
||||
int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
|
||||
const char *name, BIO *bp, pem_password_cb *cb,
|
||||
void *u);
|
||||
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
|
||||
const char *name, BIO *bp, pem_password_cb *cb,
|
||||
void *u);
|
||||
void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
|
||||
const void *x, const EVP_CIPHER *enc,
|
||||
const unsigned char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
|
||||
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
|
||||
pem_password_cb *cb, void *u);
|
||||
STACK_OF(X509_INFO)
|
||||
*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
|
||||
pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
|
||||
const unsigned char *kstr, int klen,
|
||||
pem_password_cb *cd, void *u);
|
||||
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
int PEM_read(FILE *fp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
int PEM_write(FILE *fp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
|
||||
const void *x, const EVP_CIPHER *enc,
|
||||
const unsigned char *kstr, int klen,
|
||||
pem_password_cb *callback, void *u);
|
||||
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
|
||||
pem_password_cb *cb, void *u);
|
||||
STACK_OF(X509_INFO)
|
||||
*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
|
||||
void *u, OSSL_LIB_CTX *libctx, const char *propq);
|
||||
#endif
|
||||
|
||||
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
|
||||
int PEM_SignUpdate(EVP_MD_CTX *ctx, const unsigned char *d, unsigned int cnt);
|
||||
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
|
||||
unsigned int *siglen, EVP_PKEY *pkey);
|
||||
|
||||
/* The default pem_password_cb that's used internally */
|
||||
int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
|
||||
void PEM_proc_type(char *buf, int type);
|
||||
void PEM_dek_info(char *buf, const char *type, int len, const char *str);
|
||||
|
||||
# include <openssl/symhacks.h>
|
||||
|
||||
DECLARE_PEM_rw(X509, X509)
|
||||
DECLARE_PEM_rw(X509_AUX, X509)
|
||||
DECLARE_PEM_rw(X509_REQ, X509_REQ)
|
||||
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
|
||||
DECLARE_PEM_rw(X509_CRL, X509_CRL)
|
||||
DECLARE_PEM_rw(X509_PUBKEY, X509_PUBKEY)
|
||||
DECLARE_PEM_rw(PKCS7, PKCS7)
|
||||
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
|
||||
DECLARE_PEM_rw(PKCS8, X509_SIG)
|
||||
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA)
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSA_PUBKEY, RSA)
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# ifndef OPENSSL_NO_DSA
|
||||
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, DSAPrivateKey, DSA)
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSA_PUBKEY, DSA)
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSAparams, DSA)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# ifndef OPENSSL_NO_EC
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, ECPKParameters, EC_GROUP)
|
||||
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, ECPrivateKey, EC_KEY)
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, EC_PUBKEY, EC_KEY)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DH
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
|
||||
DECLARE_PEM_write_attr(OSSL_DEPRECATEDIN_3_0, DHxparams, DH)
|
||||
# endif
|
||||
# endif
|
||||
DECLARE_PEM_rw_cb_ex(PrivateKey, EVP_PKEY)
|
||||
DECLARE_PEM_rw_ex(PUBKEY, EVP_PKEY)
|
||||
|
||||
int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
|
||||
const EVP_CIPHER *enc,
|
||||
const unsigned char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
|
||||
/* Why do these take a signed char *kstr? */
|
||||
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_write_bio_PKCS8PrivateKey(BIO *, const EVP_PKEY *, const EVP_CIPHER *,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
|
||||
void *u);
|
||||
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
int i2d_PKCS8PrivateKey_fp(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, const EVP_PKEY *x, int nid,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cb, void *u);
|
||||
|
||||
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
|
||||
void *u);
|
||||
|
||||
int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
||||
const char *kstr, int klen,
|
||||
pem_password_cb *cd, void *u);
|
||||
# endif
|
||||
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
|
||||
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
|
||||
|
||||
EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
|
||||
EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
|
||||
EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
|
||||
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
|
||||
int i2b_PrivateKey_bio(BIO *out, const EVP_PKEY *pk);
|
||||
int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk);
|
||||
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
|
||||
EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel,
|
||||
pem_password_cb *cb, void *u);
|
||||
int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel,
|
||||
pem_password_cb *cb, void *u,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_PEMERR_H
|
||||
# define OPENSSL_PEMERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* PEM reason codes.
|
||||
*/
|
||||
# define PEM_R_BAD_BASE64_DECODE 100
|
||||
# define PEM_R_BAD_DECRYPT 101
|
||||
# define PEM_R_BAD_END_LINE 102
|
||||
# define PEM_R_BAD_IV_CHARS 103
|
||||
# define PEM_R_BAD_MAGIC_NUMBER 116
|
||||
# define PEM_R_BAD_PASSWORD_READ 104
|
||||
# define PEM_R_BAD_VERSION_NUMBER 117
|
||||
# define PEM_R_BIO_WRITE_FAILURE 118
|
||||
# define PEM_R_CIPHER_IS_NULL 127
|
||||
# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
|
||||
# define PEM_R_EXPECTING_DSS_KEY_BLOB 131
|
||||
# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
|
||||
# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
|
||||
# define PEM_R_EXPECTING_RSA_KEY_BLOB 132
|
||||
# define PEM_R_HEADER_TOO_LONG 128
|
||||
# define PEM_R_INCONSISTENT_HEADER 121
|
||||
# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
|
||||
# define PEM_R_KEYBLOB_TOO_SHORT 123
|
||||
# define PEM_R_MISSING_DEK_IV 129
|
||||
# define PEM_R_NOT_DEK_INFO 105
|
||||
# define PEM_R_NOT_ENCRYPTED 106
|
||||
# define PEM_R_NOT_PROC_TYPE 107
|
||||
# define PEM_R_NO_START_LINE 108
|
||||
# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
|
||||
# define PEM_R_PVK_DATA_TOO_SHORT 124
|
||||
# define PEM_R_PVK_TOO_SHORT 125
|
||||
# define PEM_R_READ_KEY 111
|
||||
# define PEM_R_SHORT_HEADER 112
|
||||
# define PEM_R_UNEXPECTED_DEK_IV 130
|
||||
# define PEM_R_UNSUPPORTED_CIPHER 113
|
||||
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
|
||||
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
|
||||
# define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,430 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/pkcs7.h.in
|
||||
*
|
||||
* Copyright 1995-2023 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_PKCS7_H
|
||||
# define OPENSSL_PKCS7_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_PKCS7_H
|
||||
# endif
|
||||
|
||||
# include <openssl/asn1.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/pkcs7err.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*-
|
||||
Encryption_ID DES-CBC
|
||||
Digest_ID MD5
|
||||
Digest_Encryption_ID rsaEncryption
|
||||
Key_Encryption_ID rsaEncryption
|
||||
*/
|
||||
|
||||
typedef struct PKCS7_CTX_st {
|
||||
OSSL_LIB_CTX *libctx;
|
||||
char *propq;
|
||||
} PKCS7_CTX;
|
||||
|
||||
typedef struct pkcs7_issuer_and_serial_st {
|
||||
X509_NAME *issuer;
|
||||
ASN1_INTEGER *serial;
|
||||
} PKCS7_ISSUER_AND_SERIAL;
|
||||
|
||||
typedef struct pkcs7_signer_info_st {
|
||||
ASN1_INTEGER *version; /* version 1 */
|
||||
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
||||
X509_ALGOR *digest_alg;
|
||||
STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
|
||||
X509_ALGOR *digest_enc_alg; /* confusing name, actually used for signing */
|
||||
ASN1_OCTET_STRING *enc_digest; /* confusing name, actually signature */
|
||||
STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
|
||||
/* The private key to sign with */
|
||||
EVP_PKEY *pkey;
|
||||
const PKCS7_CTX *ctx;
|
||||
} PKCS7_SIGNER_INFO;
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
|
||||
#define sk_PKCS7_SIGNER_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_SIGNER_INFO_value(sk, idx) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), (idx)))
|
||||
#define sk_PKCS7_SIGNER_INFO_new(cmp) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
||||
#define sk_PKCS7_SIGNER_INFO_new_null() ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_null())
|
||||
#define sk_PKCS7_SIGNER_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp), (n)))
|
||||
#define sk_PKCS7_SIGNER_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (n))
|
||||
#define sk_PKCS7_SIGNER_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_SIGNER_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_SIGNER_INFO_delete(sk, i) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (i)))
|
||||
#define sk_PKCS7_SIGNER_INFO_delete_ptr(sk, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
||||
#define sk_PKCS7_SIGNER_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
||||
#define sk_PKCS7_SIGNER_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
||||
#define sk_PKCS7_SIGNER_INFO_pop(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_SIGNER_INFO_shift(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_SIGNER_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk),ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc))
|
||||
#define sk_PKCS7_SIGNER_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), (idx))
|
||||
#define sk_PKCS7_SIGNER_INFO_set(sk, idx, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (idx), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
||||
#define sk_PKCS7_SIGNER_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
||||
#define sk_PKCS7_SIGNER_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
||||
#define sk_PKCS7_SIGNER_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), pnum)
|
||||
#define sk_PKCS7_SIGNER_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_SIGNER_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_SIGNER_INFO_dup(sk) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_SIGNER_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc)))
|
||||
#define sk_PKCS7_SIGNER_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_SIGNER_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
||||
|
||||
|
||||
typedef struct pkcs7_recip_info_st {
|
||||
ASN1_INTEGER *version; /* version 0 */
|
||||
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
||||
X509_ALGOR *key_enc_algor;
|
||||
ASN1_OCTET_STRING *enc_key;
|
||||
X509 *cert; /* get the pub-key from this */
|
||||
const PKCS7_CTX *ctx;
|
||||
} PKCS7_RECIP_INFO;
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
|
||||
#define sk_PKCS7_RECIP_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_RECIP_INFO_value(sk, idx) ((PKCS7_RECIP_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), (idx)))
|
||||
#define sk_PKCS7_RECIP_INFO_new(cmp) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
||||
#define sk_PKCS7_RECIP_INFO_new_null() ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_null())
|
||||
#define sk_PKCS7_RECIP_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp), (n)))
|
||||
#define sk_PKCS7_RECIP_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (n))
|
||||
#define sk_PKCS7_RECIP_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_RECIP_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_RECIP_INFO_delete(sk, i) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (i)))
|
||||
#define sk_PKCS7_RECIP_INFO_delete_ptr(sk, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
||||
#define sk_PKCS7_RECIP_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
||||
#define sk_PKCS7_RECIP_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
||||
#define sk_PKCS7_RECIP_INFO_pop(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_RECIP_INFO_shift(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_RECIP_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk),ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc))
|
||||
#define sk_PKCS7_RECIP_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), (idx))
|
||||
#define sk_PKCS7_RECIP_INFO_set(sk, idx, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (idx), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
||||
#define sk_PKCS7_RECIP_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
||||
#define sk_PKCS7_RECIP_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
||||
#define sk_PKCS7_RECIP_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), pnum)
|
||||
#define sk_PKCS7_RECIP_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_RECIP_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
||||
#define sk_PKCS7_RECIP_INFO_dup(sk) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)))
|
||||
#define sk_PKCS7_RECIP_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc)))
|
||||
#define sk_PKCS7_RECIP_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_RECIP_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
||||
|
||||
|
||||
|
||||
typedef struct pkcs7_signed_st {
|
||||
ASN1_INTEGER *version; /* version 1 */
|
||||
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
||||
STACK_OF(X509) *cert; /* [ 0 ] */
|
||||
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
|
||||
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
||||
struct pkcs7_st *contents;
|
||||
} PKCS7_SIGNED;
|
||||
/*
|
||||
* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
|
||||
* merging the two
|
||||
*/
|
||||
|
||||
typedef struct pkcs7_enc_content_st {
|
||||
ASN1_OBJECT *content_type;
|
||||
X509_ALGOR *algorithm;
|
||||
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
|
||||
const EVP_CIPHER *cipher;
|
||||
const PKCS7_CTX *ctx;
|
||||
} PKCS7_ENC_CONTENT;
|
||||
|
||||
typedef struct pkcs7_enveloped_st {
|
||||
ASN1_INTEGER *version; /* version 0 */
|
||||
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
||||
PKCS7_ENC_CONTENT *enc_data;
|
||||
} PKCS7_ENVELOPE;
|
||||
|
||||
typedef struct pkcs7_signedandenveloped_st {
|
||||
ASN1_INTEGER *version; /* version 1 */
|
||||
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
||||
STACK_OF(X509) *cert; /* [ 0 ] */
|
||||
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
|
||||
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
||||
PKCS7_ENC_CONTENT *enc_data;
|
||||
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
||||
} PKCS7_SIGN_ENVELOPE;
|
||||
|
||||
typedef struct pkcs7_digest_st {
|
||||
ASN1_INTEGER *version; /* version 0 */
|
||||
X509_ALGOR *md; /* md used */
|
||||
struct pkcs7_st *contents;
|
||||
ASN1_OCTET_STRING *digest;
|
||||
} PKCS7_DIGEST;
|
||||
|
||||
typedef struct pkcs7_encrypted_st {
|
||||
ASN1_INTEGER *version; /* version 0 */
|
||||
PKCS7_ENC_CONTENT *enc_data;
|
||||
} PKCS7_ENCRYPT;
|
||||
|
||||
typedef struct pkcs7_st {
|
||||
/*
|
||||
* The following is non NULL if it contains ASN1 encoding of this
|
||||
* structure
|
||||
*/
|
||||
unsigned char *asn1;
|
||||
long length;
|
||||
# define PKCS7_S_HEADER 0
|
||||
# define PKCS7_S_BODY 1
|
||||
# define PKCS7_S_TAIL 2
|
||||
int state; /* used during processing */
|
||||
int detached;
|
||||
ASN1_OBJECT *type;
|
||||
/* content as defined by the type */
|
||||
/*
|
||||
* all encryption/message digests are applied to the 'contents', leaving
|
||||
* out the 'type' field.
|
||||
*/
|
||||
union {
|
||||
char *ptr;
|
||||
/* NID_pkcs7_data */
|
||||
ASN1_OCTET_STRING *data;
|
||||
/* NID_pkcs7_signed */
|
||||
PKCS7_SIGNED *sign;
|
||||
/* NID_pkcs7_enveloped */
|
||||
PKCS7_ENVELOPE *enveloped;
|
||||
/* NID_pkcs7_signedAndEnveloped */
|
||||
PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
|
||||
/* NID_pkcs7_digest */
|
||||
PKCS7_DIGEST *digest;
|
||||
/* NID_pkcs7_encrypted */
|
||||
PKCS7_ENCRYPT *encrypted;
|
||||
/* Anything else */
|
||||
ASN1_TYPE *other;
|
||||
} d;
|
||||
PKCS7_CTX ctx;
|
||||
} PKCS7;
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7, PKCS7, PKCS7)
|
||||
#define sk_PKCS7_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_sk_type(sk))
|
||||
#define sk_PKCS7_value(sk, idx) ((PKCS7 *)OPENSSL_sk_value(ossl_check_const_PKCS7_sk_type(sk), (idx)))
|
||||
#define sk_PKCS7_new(cmp) ((STACK_OF(PKCS7) *)OPENSSL_sk_new(ossl_check_PKCS7_compfunc_type(cmp)))
|
||||
#define sk_PKCS7_new_null() ((STACK_OF(PKCS7) *)OPENSSL_sk_new_null())
|
||||
#define sk_PKCS7_new_reserve(cmp, n) ((STACK_OF(PKCS7) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_compfunc_type(cmp), (n)))
|
||||
#define sk_PKCS7_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_sk_type(sk), (n))
|
||||
#define sk_PKCS7_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_sk_type(sk))
|
||||
#define sk_PKCS7_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_sk_type(sk))
|
||||
#define sk_PKCS7_delete(sk, i) ((PKCS7 *)OPENSSL_sk_delete(ossl_check_PKCS7_sk_type(sk), (i)))
|
||||
#define sk_PKCS7_delete_ptr(sk, ptr) ((PKCS7 *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)))
|
||||
#define sk_PKCS7_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
||||
#define sk_PKCS7_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
||||
#define sk_PKCS7_pop(sk) ((PKCS7 *)OPENSSL_sk_pop(ossl_check_PKCS7_sk_type(sk)))
|
||||
#define sk_PKCS7_shift(sk) ((PKCS7 *)OPENSSL_sk_shift(ossl_check_PKCS7_sk_type(sk)))
|
||||
#define sk_PKCS7_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_sk_type(sk),ossl_check_PKCS7_freefunc_type(freefunc))
|
||||
#define sk_PKCS7_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), (idx))
|
||||
#define sk_PKCS7_set(sk, idx, ptr) ((PKCS7 *)OPENSSL_sk_set(ossl_check_PKCS7_sk_type(sk), (idx), ossl_check_PKCS7_type(ptr)))
|
||||
#define sk_PKCS7_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
||||
#define sk_PKCS7_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
||||
#define sk_PKCS7_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), pnum)
|
||||
#define sk_PKCS7_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_sk_type(sk))
|
||||
#define sk_PKCS7_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_sk_type(sk))
|
||||
#define sk_PKCS7_dup(sk) ((STACK_OF(PKCS7) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_sk_type(sk)))
|
||||
#define sk_PKCS7_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_sk_type(sk), ossl_check_PKCS7_copyfunc_type(copyfunc), ossl_check_PKCS7_freefunc_type(freefunc)))
|
||||
#define sk_PKCS7_set_cmp_func(sk, cmp) ((sk_PKCS7_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_compfunc_type(cmp)))
|
||||
|
||||
|
||||
|
||||
# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
|
||||
# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
|
||||
|
||||
# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
|
||||
# define PKCS7_get_attributes(si) ((si)->unauth_attr)
|
||||
|
||||
# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
|
||||
# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
|
||||
# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
|
||||
# define PKCS7_type_is_signedAndEnveloped(a) \
|
||||
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
|
||||
# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
|
||||
# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
|
||||
|
||||
# define PKCS7_set_detached(p,v) \
|
||||
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
|
||||
# define PKCS7_get_detached(p) \
|
||||
PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
|
||||
|
||||
# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
|
||||
|
||||
/* S/MIME related flags */
|
||||
|
||||
# define PKCS7_TEXT 0x1
|
||||
# define PKCS7_NOCERTS 0x2
|
||||
# define PKCS7_NOSIGS 0x4
|
||||
# define PKCS7_NOCHAIN 0x8
|
||||
# define PKCS7_NOINTERN 0x10
|
||||
# define PKCS7_NOVERIFY 0x20
|
||||
# define PKCS7_DETACHED 0x40
|
||||
# define PKCS7_BINARY 0x80
|
||||
# define PKCS7_NOATTR 0x100
|
||||
# define PKCS7_NOSMIMECAP 0x200
|
||||
# define PKCS7_NOOLDMIMETYPE 0x400
|
||||
# define PKCS7_CRLFEOL 0x800
|
||||
# define PKCS7_STREAM 0x1000
|
||||
# define PKCS7_NOCRL 0x2000
|
||||
# define PKCS7_PARTIAL 0x4000
|
||||
# define PKCS7_REUSE_DIGEST 0x8000
|
||||
# define PKCS7_NO_DUAL_CONTENT 0x10000
|
||||
|
||||
/* Flags: for compatibility with older code */
|
||||
|
||||
# define SMIME_TEXT PKCS7_TEXT
|
||||
# define SMIME_NOCERTS PKCS7_NOCERTS
|
||||
# define SMIME_NOSIGS PKCS7_NOSIGS
|
||||
# define SMIME_NOCHAIN PKCS7_NOCHAIN
|
||||
# define SMIME_NOINTERN PKCS7_NOINTERN
|
||||
# define SMIME_NOVERIFY PKCS7_NOVERIFY
|
||||
# define SMIME_DETACHED PKCS7_DETACHED
|
||||
# define SMIME_BINARY PKCS7_BINARY
|
||||
# define SMIME_NOATTR PKCS7_NOATTR
|
||||
|
||||
/* CRLF ASCII canonicalisation */
|
||||
# define SMIME_ASCIICRLF 0x80000
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
|
||||
|
||||
int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
|
||||
const EVP_MD *type, unsigned char *md,
|
||||
unsigned int *len);
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
|
||||
int i2d_PKCS7_fp(FILE *fp, const PKCS7 *p7);
|
||||
# endif
|
||||
DECLARE_ASN1_DUP_FUNCTION(PKCS7)
|
||||
PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
|
||||
int i2d_PKCS7_bio(BIO *bp, const PKCS7 *p7);
|
||||
int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
||||
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS7)
|
||||
PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
|
||||
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
|
||||
|
||||
DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
|
||||
DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
|
||||
|
||||
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
|
||||
|
||||
int PKCS7_type_is_other(PKCS7 *p7);
|
||||
int PKCS7_set_type(PKCS7 *p7, int type);
|
||||
int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
|
||||
int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
|
||||
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
|
||||
const EVP_MD *dgst);
|
||||
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
|
||||
int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
|
||||
int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
|
||||
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
|
||||
int PKCS7_content_new(PKCS7 *p7, int nid);
|
||||
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
|
||||
BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
||||
int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
|
||||
X509 *x509);
|
||||
|
||||
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
|
||||
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
|
||||
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
|
||||
|
||||
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
|
||||
EVP_PKEY *pkey, const EVP_MD *dgst);
|
||||
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
||||
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
|
||||
STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
|
||||
|
||||
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
|
||||
void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
|
||||
X509_ALGOR **pdig, X509_ALGOR **psig);
|
||||
void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
|
||||
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
|
||||
int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
|
||||
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
|
||||
int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
|
||||
|
||||
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
|
||||
ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
|
||||
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
|
||||
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
|
||||
void *data);
|
||||
int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
|
||||
void *value);
|
||||
ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
||||
ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
||||
int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
|
||||
STACK_OF(X509_ATTRIBUTE) *sk);
|
||||
int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
|
||||
STACK_OF(X509_ATTRIBUTE) *sk);
|
||||
|
||||
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
||||
BIO *data, int flags);
|
||||
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
||||
BIO *data, int flags, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
|
||||
X509 *signcert, EVP_PKEY *pkey,
|
||||
const EVP_MD *md, int flags);
|
||||
|
||||
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
|
||||
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
||||
BIO *indata, BIO *out, int flags);
|
||||
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
|
||||
int flags);
|
||||
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
|
||||
int flags);
|
||||
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
||||
const EVP_CIPHER *cipher, int flags,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
|
||||
int flags);
|
||||
|
||||
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
|
||||
STACK_OF(X509_ALGOR) *cap);
|
||||
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
|
||||
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
|
||||
|
||||
int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
|
||||
int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
|
||||
int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
|
||||
const unsigned char *md, int mdlen);
|
||||
|
||||
int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
|
||||
PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7);
|
||||
PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
|
||||
|
||||
BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_PKCS7ERR_H
|
||||
# define OPENSSL_PKCS7ERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* PKCS7 reason codes.
|
||||
*/
|
||||
# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
|
||||
# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
|
||||
# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
|
||||
# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
|
||||
# define PKCS7_R_CTRL_ERROR 152
|
||||
# define PKCS7_R_DECRYPT_ERROR 119
|
||||
# define PKCS7_R_DIGEST_FAILURE 101
|
||||
# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
|
||||
# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
|
||||
# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
|
||||
# define PKCS7_R_ERROR_SETTING_CIPHER 121
|
||||
# define PKCS7_R_INVALID_NULL_POINTER 143
|
||||
# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
|
||||
# define PKCS7_R_NO_CONTENT 122
|
||||
# define PKCS7_R_NO_DEFAULT_DIGEST 151
|
||||
# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
|
||||
# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
|
||||
# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
|
||||
# define PKCS7_R_NO_SIGNERS 142
|
||||
# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
|
||||
# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
|
||||
# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
|
||||
# define PKCS7_R_PKCS7_DATASIGN 145
|
||||
# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
|
||||
# define PKCS7_R_SIGNATURE_FAILURE 105
|
||||
# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
|
||||
# define PKCS7_R_SIGNING_CTRL_FAILURE 147
|
||||
# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
|
||||
# define PKCS7_R_SMIME_TEXT_ERROR 129
|
||||
# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
|
||||
# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
|
||||
# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
|
||||
# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
|
||||
# define PKCS7_R_UNKNOWN_OPERATION 110
|
||||
# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
|
||||
# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
|
||||
# define PKCS7_R_WRONG_CONTENT_TYPE 113
|
||||
# define PKCS7_R_WRONG_PKCS7_TYPE 114
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2021 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_PROV_SSL_H
|
||||
# define OPENSSL_PROV_SSL_H
|
||||
# pragma once
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/* SSL/TLS related defines useful to providers */
|
||||
|
||||
# define SSL_MAX_MASTER_KEY_LENGTH 48
|
||||
|
||||
# define SSL3_VERSION 0x0300
|
||||
# define TLS1_VERSION 0x0301
|
||||
# define TLS1_1_VERSION 0x0302
|
||||
# define TLS1_2_VERSION 0x0303
|
||||
# define TLS1_3_VERSION 0x0304
|
||||
# define DTLS1_VERSION 0xFEFF
|
||||
# define DTLS1_2_VERSION 0xFEFD
|
||||
# define DTLS1_BAD_VER 0x0100
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif /* OPENSSL_PROV_SSL_H */
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_RAND_H
|
||||
# define OPENSSL_RAND_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_RAND_H
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/randerr.h>
|
||||
# include <openssl/evp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default security strength (in the sense of [NIST SP 800-90Ar1])
|
||||
*
|
||||
* NIST SP 800-90Ar1 supports the strength of the DRBG being smaller than that
|
||||
* of the cipher by collecting less entropy. The current DRBG implementation
|
||||
* does not take RAND_DRBG_STRENGTH into account and sets the strength of the
|
||||
* DRBG to that of the cipher.
|
||||
*/
|
||||
# define RAND_DRBG_STRENGTH 256
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
struct rand_meth_st {
|
||||
int (*seed) (const void *buf, int num);
|
||||
int (*bytes) (unsigned char *buf, int num);
|
||||
void (*cleanup) (void);
|
||||
int (*add) (const void *buf, int num, double randomness);
|
||||
int (*pseudorand) (unsigned char *buf, int num);
|
||||
int (*status) (void);
|
||||
};
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *RAND_get_rand_method(void);
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_engine(ENGINE *engine);
|
||||
# endif
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 RAND_METHOD *RAND_OpenSSL(void);
|
||||
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define RAND_cleanup() while(0) continue
|
||||
# endif
|
||||
int RAND_bytes(unsigned char *buf, int num);
|
||||
int RAND_priv_bytes(unsigned char *buf, int num);
|
||||
|
||||
/*
|
||||
* Equivalent of RAND_priv_bytes() but additionally taking an OSSL_LIB_CTX and
|
||||
* a strength.
|
||||
*/
|
||||
int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
|
||||
unsigned int strength);
|
||||
|
||||
/*
|
||||
* Equivalent of RAND_bytes() but additionally taking an OSSL_LIB_CTX and
|
||||
* a strength.
|
||||
*/
|
||||
int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
|
||||
unsigned int strength);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 int RAND_pseudo_bytes(unsigned char *buf, int num);
|
||||
# endif
|
||||
|
||||
EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx);
|
||||
EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx);
|
||||
EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx);
|
||||
int RAND_set0_public(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand);
|
||||
int RAND_set0_private(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand);
|
||||
|
||||
int RAND_set_DRBG_type(OSSL_LIB_CTX *ctx, const char *drbg, const char *propq,
|
||||
const char *cipher, const char *digest);
|
||||
int RAND_set_seed_source_type(OSSL_LIB_CTX *ctx, const char *seed,
|
||||
const char *propq);
|
||||
|
||||
void RAND_seed(const void *buf, int num);
|
||||
void RAND_keep_random_devices_open(int keep);
|
||||
|
||||
# if defined(__ANDROID__) && defined(__NDK_FPABI__)
|
||||
__NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
|
||||
# endif
|
||||
void RAND_add(const void *buf, int num, double randomness);
|
||||
int RAND_load_file(const char *file, long max_bytes);
|
||||
int RAND_write_file(const char *file);
|
||||
const char *RAND_file_name(char *file, size_t num);
|
||||
int RAND_status(void);
|
||||
|
||||
# ifndef OPENSSL_NO_EGD
|
||||
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
|
||||
int RAND_egd(const char *path);
|
||||
int RAND_egd_bytes(const char *path, int bytes);
|
||||
# endif
|
||||
|
||||
int RAND_poll(void);
|
||||
|
||||
# if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
|
||||
/* application has to include <windows.h> in order to use these */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 void RAND_screen(void);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int RAND_event(UINT, WPARAM, LPARAM);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_RANDERR_H
|
||||
# define OPENSSL_RANDERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* RAND reason codes.
|
||||
*/
|
||||
# define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102
|
||||
# define RAND_R_ALREADY_INSTANTIATED 103
|
||||
# define RAND_R_ARGUMENT_OUT_OF_RANGE 105
|
||||
# define RAND_R_CANNOT_OPEN_FILE 121
|
||||
# define RAND_R_DRBG_ALREADY_INITIALIZED 129
|
||||
# define RAND_R_DRBG_NOT_INITIALISED 104
|
||||
# define RAND_R_ENTROPY_INPUT_TOO_LONG 106
|
||||
# define RAND_R_ENTROPY_OUT_OF_RANGE 124
|
||||
# define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127
|
||||
# define RAND_R_ERROR_INITIALISING_DRBG 107
|
||||
# define RAND_R_ERROR_INSTANTIATING_DRBG 108
|
||||
# define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109
|
||||
# define RAND_R_ERROR_RETRIEVING_ENTROPY 110
|
||||
# define RAND_R_ERROR_RETRIEVING_NONCE 111
|
||||
# define RAND_R_FAILED_TO_CREATE_LOCK 126
|
||||
# define RAND_R_FUNC_NOT_IMPLEMENTED 101
|
||||
# define RAND_R_FWRITE_ERROR 123
|
||||
# define RAND_R_GENERATE_ERROR 112
|
||||
# define RAND_R_INSUFFICIENT_DRBG_STRENGTH 139
|
||||
# define RAND_R_INTERNAL_ERROR 113
|
||||
# define RAND_R_INVALID_PROPERTY_QUERY 137
|
||||
# define RAND_R_IN_ERROR_STATE 114
|
||||
# define RAND_R_NOT_A_REGULAR_FILE 122
|
||||
# define RAND_R_NOT_INSTANTIATED 115
|
||||
# define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128
|
||||
# define RAND_R_PARENT_LOCKING_NOT_ENABLED 130
|
||||
# define RAND_R_PARENT_STRENGTH_TOO_WEAK 131
|
||||
# define RAND_R_PERSONALISATION_STRING_TOO_LONG 116
|
||||
# define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133
|
||||
# define RAND_R_PRNG_NOT_SEEDED 100
|
||||
# define RAND_R_RANDOM_POOL_OVERFLOW 125
|
||||
# define RAND_R_RANDOM_POOL_UNDERFLOW 134
|
||||
# define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117
|
||||
# define RAND_R_RESEED_ERROR 118
|
||||
# define RAND_R_SELFTEST_FAILURE 119
|
||||
# define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135
|
||||
# define RAND_R_TOO_MUCH_NONCE_REQUESTED 136
|
||||
# define RAND_R_UNABLE_TO_CREATE_DRBG 143
|
||||
# define RAND_R_UNABLE_TO_FETCH_DRBG 144
|
||||
# define RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER 141
|
||||
# define RAND_R_UNABLE_TO_GET_PARENT_STRENGTH 138
|
||||
# define RAND_R_UNABLE_TO_LOCK_PARENT 140
|
||||
# define RAND_R_UNSUPPORTED_DRBG_FLAGS 132
|
||||
# define RAND_R_UNSUPPORTED_DRBG_TYPE 120
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_RC4_H
|
||||
# define OPENSSL_RC4_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_RC4_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_RC4
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef struct rc4_key_st {
|
||||
RC4_INT x, y;
|
||||
RC4_INT data[256];
|
||||
} RC4_KEY;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *RC4_options(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void RC4_set_key(RC4_KEY *key, int len,
|
||||
const unsigned char *data);
|
||||
OSSL_DEPRECATEDIN_3_0 void RC4(RC4_KEY *key, size_t len,
|
||||
const unsigned char *indata,
|
||||
unsigned char *outdata);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 1995-2020 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_RIPEMD_H
|
||||
# define OPENSSL_RIPEMD_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_RIPEMD_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_RMD160
|
||||
# include <openssl/e_os2.h>
|
||||
# include <stddef.h>
|
||||
|
||||
# define RIPEMD160_DIGEST_LENGTH 20
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
|
||||
# define RIPEMD160_LONG unsigned int
|
||||
|
||||
# define RIPEMD160_CBLOCK 64
|
||||
# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
|
||||
|
||||
typedef struct RIPEMD160state_st {
|
||||
RIPEMD160_LONG A, B, C, D, E;
|
||||
RIPEMD160_LONG Nl, Nh;
|
||||
RIPEMD160_LONG data[RIPEMD160_LBLOCK];
|
||||
unsigned int num;
|
||||
} RIPEMD160_CTX;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Init(RIPEMD160_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
|
||||
size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 unsigned char *RIPEMD160(const unsigned char *d, size_t n,
|
||||
unsigned char *md);
|
||||
OSSL_DEPRECATEDIN_3_0 void RIPEMD160_Transform(RIPEMD160_CTX *c,
|
||||
const unsigned char *b);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,613 @@
|
||||
/*
|
||||
* Copyright 1995-2022 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_RSA_H
|
||||
# define OPENSSL_RSA_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_RSA_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# include <openssl/asn1.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/types.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/bn.h>
|
||||
# endif
|
||||
# include <openssl/rsaerr.h>
|
||||
# include <openssl/safestack.h>
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_RSA_MAX_MODULUS_BITS
|
||||
# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
|
||||
# endif
|
||||
|
||||
# define RSA_3 0x3L
|
||||
# define RSA_F4 0x10001L
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* The types RSA and RSA_METHOD are defined in ossl_typ.h */
|
||||
|
||||
# define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048
|
||||
|
||||
# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
|
||||
# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
|
||||
# endif
|
||||
|
||||
/* exponent limit enforced for "large" modulus only */
|
||||
# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
|
||||
# define OPENSSL_RSA_MAX_PUBEXP_BITS 64
|
||||
# endif
|
||||
/* based on RFC 8017 appendix A.1.2 */
|
||||
# define RSA_ASN1_VERSION_DEFAULT 0
|
||||
# define RSA_ASN1_VERSION_MULTI 1
|
||||
|
||||
# define RSA_DEFAULT_PRIME_NUM 2
|
||||
|
||||
# define RSA_METHOD_FLAG_NO_CHECK 0x0001
|
||||
# define RSA_FLAG_CACHE_PUBLIC 0x0002
|
||||
# define RSA_FLAG_CACHE_PRIVATE 0x0004
|
||||
# define RSA_FLAG_BLINDING 0x0008
|
||||
# define RSA_FLAG_THREAD_SAFE 0x0010
|
||||
/*
|
||||
* This flag means the private key operations will be handled by rsa_mod_exp
|
||||
* and that they do not depend on the private key components being present:
|
||||
* for example a key stored in external hardware. Without this flag
|
||||
* bn_mod_exp gets called when private key components are absent.
|
||||
*/
|
||||
# define RSA_FLAG_EXT_PKEY 0x0020
|
||||
|
||||
/*
|
||||
* new with 0.9.6j and 0.9.7b; the built-in
|
||||
* RSA implementation now uses blinding by
|
||||
* default (ignoring RSA_FLAG_BLINDING),
|
||||
* but other engines might not need it
|
||||
*/
|
||||
# define RSA_FLAG_NO_BLINDING 0x0080
|
||||
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
/*
|
||||
* Does nothing. Previously this switched off constant time behaviour.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define RSA_FLAG_NO_CONSTTIME 0x0000
|
||||
# endif
|
||||
/* deprecated name for the flag*/
|
||||
/*
|
||||
* new with 0.9.7h; the built-in RSA
|
||||
* implementation now uses constant time
|
||||
* modular exponentiation for secret exponents
|
||||
* by default. This flag causes the
|
||||
* faster variable sliding window method to
|
||||
* be used for all exponents.
|
||||
*/
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
|
||||
# endif
|
||||
|
||||
/*-
|
||||
* New with 3.0: use part of the flags to denote exact type of RSA key,
|
||||
* some of which are limited to specific signature and encryption schemes.
|
||||
* These different types share the same RSA structure, but indicate the
|
||||
* use of certain fields in that structure.
|
||||
* Currently known are:
|
||||
* RSA - this is the "normal" unlimited RSA structure (typenum 0)
|
||||
* RSASSA-PSS - indicates that the PSS parameters are used.
|
||||
* RSAES-OAEP - no specific field used for the moment, but OAEP padding
|
||||
* is expected. (currently unused)
|
||||
*
|
||||
* 4 bits allow for 16 types
|
||||
*/
|
||||
# define RSA_FLAG_TYPE_MASK 0xF000
|
||||
# define RSA_FLAG_TYPE_RSA 0x0000
|
||||
# define RSA_FLAG_TYPE_RSASSAPSS 0x1000
|
||||
# define RSA_FLAG_TYPE_RSAESOAEP 0x2000
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
|
||||
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
||||
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
|
||||
int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
|
||||
int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
||||
# endif
|
||||
|
||||
/* Salt length matches digest */
|
||||
# define RSA_PSS_SALTLEN_DIGEST -1
|
||||
/* Verify only: auto detect salt length */
|
||||
# define RSA_PSS_SALTLEN_AUTO -2
|
||||
/* Set salt length to maximum possible */
|
||||
# define RSA_PSS_SALTLEN_MAX -3
|
||||
/* Auto-detect on verify, set salt length to min(maximum possible, digest
|
||||
* length) on sign */
|
||||
# define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX -4
|
||||
/* Old compatible max salt length for sign only */
|
||||
# define RSA_PSS_SALTLEN_MAX_SIGN -2
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
||||
const char *mdprops);
|
||||
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
||||
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
|
||||
size_t namelen);
|
||||
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx,
|
||||
const char *mdname);
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx,
|
||||
const char *mdname,
|
||||
const char *mdprops);
|
||||
|
||||
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
||||
const char *mdprops);
|
||||
int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
||||
int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
|
||||
size_t namelen);
|
||||
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen);
|
||||
int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
|
||||
# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
|
||||
# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
|
||||
# define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
|
||||
|
||||
# define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
|
||||
# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
|
||||
# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
|
||||
# define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
|
||||
|
||||
# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
|
||||
# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
|
||||
|
||||
# define RSA_PKCS1_PADDING 1
|
||||
# define RSA_NO_PADDING 3
|
||||
# define RSA_PKCS1_OAEP_PADDING 4
|
||||
# define RSA_X931_PADDING 5
|
||||
|
||||
/* EVP_PKEY_ only */
|
||||
# define RSA_PKCS1_PSS_PADDING 6
|
||||
# define RSA_PKCS1_WITH_TLS_PADDING 7
|
||||
|
||||
# define RSA_PKCS1_PADDING_SIZE 11
|
||||
|
||||
# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
|
||||
# define RSA_get_app_data(s) RSA_get_ex_data(s,0)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r,
|
||||
BIGNUM *dmp1, BIGNUM *dmq1,
|
||||
BIGNUM *iqmp);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set0_multi_prime_params(RSA *r,
|
||||
BIGNUM *primes[],
|
||||
BIGNUM *exps[],
|
||||
BIGNUM *coeffs[],
|
||||
int pnum);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
|
||||
const BIGNUM **n, const BIGNUM **e,
|
||||
const BIGNUM **d);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_get0_factors(const RSA *r,
|
||||
const BIGNUM **p, const BIGNUM **q);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_get_multi_prime_extra_count(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_get0_multi_prime_factors(const RSA *r,
|
||||
const BIGNUM *primes[]);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
|
||||
const BIGNUM **dmp1,
|
||||
const BIGNUM **dmq1,
|
||||
const BIGNUM **iqmp);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[],
|
||||
const BIGNUM *coeffs[]);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_n(const RSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_e(const RSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_d(const RSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_p(const RSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_q(const RSA *d);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmp1(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmq1(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_iqmp(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_setnull_factors(RSA *r, int p, int q);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_setnull_key(RSA *r, int n, int e, int d);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_setnull_crt_params(RSA *r, int dmp1, int dmq1, int iqmp);
|
||||
# endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
||||
|
||||
# define EVP_RSA_gen(bits) \
|
||||
EVP_PKEY_Q_keygen(NULL, NULL, "RSA", (size_t)(0 + (bits)))
|
||||
|
||||
/* Deprecated version */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void
|
||||
(*callback) (int, int, void *),
|
||||
void *cb_arg);
|
||||
# endif
|
||||
|
||||
/* New version */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
|
||||
BN_GENCB *cb);
|
||||
/* Multi-prime version */
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits,
|
||||
int primes, BIGNUM *e,
|
||||
BN_GENCB *cb);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2,
|
||||
BIGNUM *q1, BIGNUM *q2,
|
||||
const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xq1,
|
||||
const BIGNUM *Xq2, const BIGNUM *Xq,
|
||||
const BIGNUM *e, BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_X931_generate_key_ex(RSA *rsa, int bits,
|
||||
const BIGNUM *e,
|
||||
BN_GENCB *cb);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_check_key(const RSA *);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_check_key_ex(const RSA *, BN_GENCB *cb);
|
||||
/* next 4 return -1 on error */
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
|
||||
/* "up" the RSA object's reference count */
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_up_ref(RSA *r);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_set_default_method(const RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_default_method(void);
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_null_method(void);
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_method(const RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
|
||||
|
||||
/* these are the actual RSA functions */
|
||||
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
||||
RSA, RSAPublicKey)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
||||
RSA, RSAPrivateKey)
|
||||
# endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
||||
|
||||
int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
|
||||
|
||||
struct rsa_pss_params_st {
|
||||
X509_ALGOR *hashAlgorithm;
|
||||
X509_ALGOR *maskGenAlgorithm;
|
||||
ASN1_INTEGER *saltLength;
|
||||
ASN1_INTEGER *trailerField;
|
||||
/* Decoded hash algorithm from maskGenAlgorithm */
|
||||
X509_ALGOR *maskHash;
|
||||
};
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
|
||||
DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS)
|
||||
|
||||
typedef struct rsa_oaep_params_st {
|
||||
X509_ALGOR *hashFunc;
|
||||
X509_ALGOR *maskGenFunc;
|
||||
X509_ALGOR *pSourceFunc;
|
||||
/* Decoded hash algorithm from maskGenFunc */
|
||||
X509_ALGOR *maskHash;
|
||||
} RSA_OAEP_PARAMS;
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# ifndef OPENSSL_NO_STDIO
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_print_fp(FILE *fp, const RSA *r, int offset);
|
||||
# endif
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_print(BIO *bp, const RSA *r, int offset);
|
||||
|
||||
/*
|
||||
* The following 2 functions sign and verify a X509_SIG ASN1 object inside
|
||||
* PKCS#1 padded RSA encryption
|
||||
*/
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_sign(int type, const unsigned char *m,
|
||||
unsigned int m_length, unsigned char *sigret,
|
||||
unsigned int *siglen, RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_verify(int type, const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
const unsigned char *sigbuf,
|
||||
unsigned int siglen, RSA *rsa);
|
||||
|
||||
/*
|
||||
* The following 2 function sign and verify a ASN1_OCTET_STRING object inside
|
||||
* PKCS#1 padded RSA encryption
|
||||
*/
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_sign_ASN1_OCTET_STRING(int type,
|
||||
const unsigned char *m, unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen,
|
||||
RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_verify_ASN1_OCTET_STRING(int type,
|
||||
const unsigned char *m, unsigned int m_length,
|
||||
unsigned char *sigbuf, unsigned int siglen,
|
||||
RSA *rsa);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_blinding_off(RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
OSSL_DEPRECATEDIN_3_0 int PKCS1_MGF1(unsigned char *mask, long len,
|
||||
const unsigned char *seed, long seedlen,
|
||||
const EVP_MD *dgst);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
const unsigned char *p, int pl);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl, int rsa_len,
|
||||
const unsigned char *p, int pl);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen,
|
||||
const unsigned char *param, int plen,
|
||||
const EVP_MD *md, const EVP_MD *mgf1md);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen,
|
||||
int num,
|
||||
const unsigned char *param, int plen,
|
||||
const EVP_MD *md, const EVP_MD *mgf1md);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_none(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_none(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_X931(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_X931(unsigned char *to, int tlen,
|
||||
const unsigned char *f, int fl,
|
||||
int rsa_len);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_X931_hash_id(int nid);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const unsigned char *EM,
|
||||
int sLen);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
|
||||
const unsigned char *mHash, const EVP_MD *Hash,
|
||||
int sLen);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
||||
const unsigned char *EM, int sLen);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
|
||||
const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
||||
int sLen);
|
||||
|
||||
# define RSA_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef)
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg);
|
||||
OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx);
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPublicKey)
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPrivateKey)
|
||||
|
||||
/*
|
||||
* If this flag is set the RSA method is FIPS compliant and can be used in
|
||||
* FIPS mode. This is set in the validated module method. If an application
|
||||
* sets this flag in its own methods it is its responsibility to ensure the
|
||||
* result is compliant.
|
||||
*/
|
||||
|
||||
# define RSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/*
|
||||
* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
# define RSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
/*
|
||||
* Application has decided PRNG is good enough to generate a key: don't
|
||||
* check.
|
||||
*/
|
||||
# define RSA_FLAG_CHECKED 0x0800
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *RSA_meth_get0_name(const RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set1_name(RSA_METHOD *meth,
|
||||
const char *name);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_meth_get_flags(const RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
|
||||
OSSL_DEPRECATEDIN_3_0 void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
|
||||
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set0_app_data(RSA_METHOD *meth,
|
||||
void *app_data);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) (int flen,
|
||||
const unsigned char *from,
|
||||
unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
|
||||
int (*pub_enc) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) (int flen,
|
||||
const unsigned char *from,
|
||||
unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
|
||||
int (*pub_dec) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) (int flen,
|
||||
const unsigned char *from,
|
||||
unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
|
||||
int (*priv_enc) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) (int flen,
|
||||
const unsigned char *from,
|
||||
unsigned char *to,
|
||||
RSA *rsa, int padding);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
|
||||
int (*priv_dec) (int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa,
|
||||
int padding));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r0,
|
||||
const BIGNUM *i,
|
||||
RSA *rsa, BN_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
|
||||
int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa,
|
||||
BN_CTX *ctx));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r,
|
||||
const BIGNUM *a,
|
||||
const BIGNUM *p,
|
||||
const BIGNUM *m,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa,
|
||||
int (*bn_mod_exp) (BIGNUM *r,
|
||||
const BIGNUM *a,
|
||||
const BIGNUM *p,
|
||||
const BIGNUM *m,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_sign(const RSA_METHOD *meth)) (int type,
|
||||
const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
unsigned char *sigret,
|
||||
unsigned int *siglen,
|
||||
const RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_sign(RSA_METHOD *rsa,
|
||||
int (*sign) (int type, const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
unsigned char *sigret, unsigned int *siglen,
|
||||
const RSA *rsa));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_verify(const RSA_METHOD *meth)) (int dtype,
|
||||
const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
const unsigned char *sigbuf,
|
||||
unsigned int siglen,
|
||||
const RSA *rsa);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_verify(RSA_METHOD *rsa,
|
||||
int (*verify) (int dtype, const unsigned char *m,
|
||||
unsigned int m_length,
|
||||
const unsigned char *sigbuf,
|
||||
unsigned int siglen, const RSA *rsa));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) (RSA *rsa, int bits,
|
||||
BIGNUM *e, BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_keygen(RSA_METHOD *rsa,
|
||||
int (*keygen) (RSA *rsa, int bits, BIGNUM *e,
|
||||
BN_GENCB *cb));
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) (RSA *rsa,
|
||||
int bits,
|
||||
int primes,
|
||||
BIGNUM *e,
|
||||
BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth,
|
||||
int (*keygen) (RSA *rsa, int bits,
|
||||
int primes, BIGNUM *e,
|
||||
BN_GENCB *cb));
|
||||
#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_RSAERR_H
|
||||
# define OPENSSL_RSAERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* RSA reason codes.
|
||||
*/
|
||||
# define RSA_R_ALGORITHM_MISMATCH 100
|
||||
# define RSA_R_BAD_E_VALUE 101
|
||||
# define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
|
||||
# define RSA_R_BAD_PAD_BYTE_COUNT 103
|
||||
# define RSA_R_BAD_SIGNATURE 104
|
||||
# define RSA_R_BLOCK_TYPE_IS_NOT_01 106
|
||||
# define RSA_R_BLOCK_TYPE_IS_NOT_02 107
|
||||
# define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
|
||||
# define RSA_R_DATA_TOO_LARGE 109
|
||||
# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
|
||||
# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
|
||||
# define RSA_R_DATA_TOO_SMALL 111
|
||||
# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
|
||||
# define RSA_R_DIGEST_DOES_NOT_MATCH 158
|
||||
# define RSA_R_DIGEST_NOT_ALLOWED 145
|
||||
# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
|
||||
# define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
|
||||
# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
|
||||
# define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
|
||||
# define RSA_R_FIRST_OCTET_INVALID 133
|
||||
# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
|
||||
# define RSA_R_INVALID_DIGEST 157
|
||||
# define RSA_R_INVALID_DIGEST_LENGTH 143
|
||||
# define RSA_R_INVALID_HEADER 137
|
||||
# define RSA_R_INVALID_KEYPAIR 171
|
||||
# define RSA_R_INVALID_KEY_LENGTH 173
|
||||
# define RSA_R_INVALID_LABEL 160
|
||||
# define RSA_R_INVALID_LENGTH 181
|
||||
# define RSA_R_INVALID_MESSAGE_LENGTH 131
|
||||
# define RSA_R_INVALID_MGF1_MD 156
|
||||
# define RSA_R_INVALID_MODULUS 174
|
||||
# define RSA_R_INVALID_MULTI_PRIME_KEY 167
|
||||
# define RSA_R_INVALID_OAEP_PARAMETERS 161
|
||||
# define RSA_R_INVALID_PADDING 138
|
||||
# define RSA_R_INVALID_PADDING_MODE 141
|
||||
# define RSA_R_INVALID_PSS_PARAMETERS 149
|
||||
# define RSA_R_INVALID_PSS_SALTLEN 146
|
||||
# define RSA_R_INVALID_REQUEST 175
|
||||
# define RSA_R_INVALID_SALT_LENGTH 150
|
||||
# define RSA_R_INVALID_STRENGTH 176
|
||||
# define RSA_R_INVALID_TRAILER 139
|
||||
# define RSA_R_INVALID_X931_DIGEST 142
|
||||
# define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
|
||||
# define RSA_R_KEY_PRIME_NUM_INVALID 165
|
||||
# define RSA_R_KEY_SIZE_TOO_SMALL 120
|
||||
# define RSA_R_LAST_OCTET_INVALID 134
|
||||
# define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
|
||||
# define RSA_R_MISSING_PRIVATE_KEY 179
|
||||
# define RSA_R_MODULUS_TOO_LARGE 105
|
||||
# define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168
|
||||
# define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169
|
||||
# define RSA_R_MP_R_NOT_PRIME 170
|
||||
# define RSA_R_NO_PUBLIC_EXPONENT 140
|
||||
# define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
|
||||
# define RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES 172
|
||||
# define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
|
||||
# define RSA_R_OAEP_DECODING_ERROR 121
|
||||
# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
|
||||
# define RSA_R_PADDING_CHECK_FAILED 114
|
||||
# define RSA_R_PAIRWISE_TEST_FAILURE 177
|
||||
# define RSA_R_PKCS_DECODING_ERROR 159
|
||||
# define RSA_R_PSS_SALTLEN_TOO_SMALL 164
|
||||
# define RSA_R_PUB_EXPONENT_OUT_OF_RANGE 178
|
||||
# define RSA_R_P_NOT_PRIME 128
|
||||
# define RSA_R_Q_NOT_PRIME 129
|
||||
# define RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT 180
|
||||
# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
|
||||
# define RSA_R_SLEN_CHECK_FAILED 136
|
||||
# define RSA_R_SLEN_RECOVERY_FAILED 135
|
||||
# define RSA_R_SSLV3_ROLLBACK_ATTACK 115
|
||||
# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
|
||||
# define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
|
||||
# define RSA_R_UNKNOWN_DIGEST 166
|
||||
# define RSA_R_UNKNOWN_MASK_DIGEST 151
|
||||
# define RSA_R_UNKNOWN_PADDING_TYPE 118
|
||||
# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162
|
||||
# define RSA_R_UNSUPPORTED_LABEL_SOURCE 163
|
||||
# define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
|
||||
# define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
|
||||
# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
|
||||
# define RSA_R_VALUE_MISSING 147
|
||||
# define RSA_R_WRONG_SIGNATURE_LENGTH 119
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,297 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/safestack.h.in
|
||||
*
|
||||
* Copyright 1999-2021 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_SAFESTACK_H
|
||||
# define OPENSSL_SAFESTACK_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_SAFESTACK_H
|
||||
# endif
|
||||
|
||||
# include <openssl/stack.h>
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define STACK_OF(type) struct stack_st_##type
|
||||
|
||||
/* Helper macro for internal use */
|
||||
# define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3) \
|
||||
STACK_OF(t1); \
|
||||
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
||||
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
||||
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
||||
static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr) \
|
||||
{ \
|
||||
return ptr; \
|
||||
} \
|
||||
static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (const OPENSSL_STACK *)sk; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (OPENSSL_STACK *)sk; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp) \
|
||||
{ \
|
||||
return (OPENSSL_sk_compfunc)cmp; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy) \
|
||||
{ \
|
||||
return (OPENSSL_sk_copyfunc)cpy; \
|
||||
} \
|
||||
static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr) \
|
||||
{ \
|
||||
return (OPENSSL_sk_freefunc)fr; \
|
||||
}
|
||||
|
||||
# define SKM_DEFINE_STACK_OF(t1, t2, t3) \
|
||||
STACK_OF(t1); \
|
||||
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
||||
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
||||
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
||||
static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
|
||||
} \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
|
||||
} \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
|
||||
} \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
||||
{ \
|
||||
return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_free((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
|
||||
(const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
||||
{ \
|
||||
OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
||||
{ \
|
||||
return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
|
||||
} \
|
||||
static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
||||
{ \
|
||||
return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
||||
{ \
|
||||
return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum) \
|
||||
{ \
|
||||
return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
|
||||
} \
|
||||
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
||||
sk_##t1##_copyfunc copyfunc, \
|
||||
sk_##t1##_freefunc freefunc) \
|
||||
{ \
|
||||
return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
|
||||
(OPENSSL_sk_copyfunc)copyfunc, \
|
||||
(OPENSSL_sk_freefunc)freefunc); \
|
||||
} \
|
||||
static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
||||
{ \
|
||||
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
|
||||
}
|
||||
|
||||
# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
|
||||
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
|
||||
# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
|
||||
# define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
|
||||
SKM_DEFINE_STACK_OF(t1, const t2, t2)
|
||||
|
||||
/*-
|
||||
* Strings are special: normally an lhash entry will point to a single
|
||||
* (somewhat) mutable object. In the case of strings:
|
||||
*
|
||||
* a) Instead of a single char, there is an array of chars, NUL-terminated.
|
||||
* b) The string may have be immutable.
|
||||
*
|
||||
* So, they need their own declarations. Especially important for
|
||||
* type-checking tools, such as Deputy.
|
||||
*
|
||||
* In practice, however, it appears to be hard to have a const
|
||||
* string. For now, I'm settling for dealing with the fact it is a
|
||||
* string at all.
|
||||
*/
|
||||
typedef char *OPENSSL_STRING;
|
||||
typedef const char *OPENSSL_CSTRING;
|
||||
|
||||
/*-
|
||||
* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
|
||||
* STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
|
||||
* above, instead of a single char each entry is a NUL-terminated array of
|
||||
* chars. So, we have to implement STRING specially for STACK_OF. This is
|
||||
* dealt with in the autogenerated macros below.
|
||||
*/
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)
|
||||
#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
||||
#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
|
||||
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
||||
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
|
||||
#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n)))
|
||||
#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n))
|
||||
#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
|
||||
#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk))
|
||||
#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i)))
|
||||
#define sk_OPENSSL_STRING_delete_ptr(sk, ptr) ((char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)))
|
||||
#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
||||
#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
||||
#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk),ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
|
||||
#define sk_OPENSSL_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), (idx))
|
||||
#define sk_OPENSSL_STRING_set(sk, idx, ptr) ((char *)OPENSSL_sk_set(ossl_check_OPENSSL_STRING_sk_type(sk), (idx), ossl_check_OPENSSL_STRING_type(ptr)))
|
||||
#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
||||
#define sk_OPENSSL_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
||||
#define sk_OPENSSL_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), pnum)
|
||||
#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk))
|
||||
#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
||||
#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_STRING_freefunc_type(freefunc)))
|
||||
#define sk_OPENSSL_STRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char)
|
||||
#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
||||
#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
|
||||
#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
||||
#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
|
||||
#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n)))
|
||||
#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n))
|
||||
#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
||||
#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
||||
#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i)))
|
||||
#define sk_OPENSSL_CSTRING_delete_ptr(sk, ptr) ((const char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)))
|
||||
#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
||||
#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
||||
#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_CSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_CSTRING_sk_type(sk),ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc))
|
||||
#define sk_OPENSSL_CSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), (idx))
|
||||
#define sk_OPENSSL_CSTRING_set(sk, idx, ptr) ((const char *)OPENSSL_sk_set(ossl_check_OPENSSL_CSTRING_sk_type(sk), (idx), ossl_check_OPENSSL_CSTRING_type(ptr)))
|
||||
#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
||||
#define sk_OPENSSL_CSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
||||
#define sk_OPENSSL_CSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), pnum)
|
||||
#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
||||
#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
||||
#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)))
|
||||
#define sk_OPENSSL_CSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc)))
|
||||
#define sk_OPENSSL_CSTRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_CSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
||||
|
||||
|
||||
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
/*
|
||||
* This is not used by OpenSSL. A block of bytes, NOT nul-terminated.
|
||||
* These should also be distinguished from "normal" stacks.
|
||||
*/
|
||||
typedef void *OPENSSL_BLOCK;
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void)
|
||||
#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
||||
#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx)))
|
||||
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
||||
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null())
|
||||
#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n)))
|
||||
#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n))
|
||||
#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
||||
#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
||||
#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i)))
|
||||
#define sk_OPENSSL_BLOCK_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)))
|
||||
#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
||||
#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
||||
#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
||||
#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
||||
#define sk_OPENSSL_BLOCK_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_BLOCK_sk_type(sk),ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc))
|
||||
#define sk_OPENSSL_BLOCK_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), (idx))
|
||||
#define sk_OPENSSL_BLOCK_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_OPENSSL_BLOCK_sk_type(sk), (idx), ossl_check_OPENSSL_BLOCK_type(ptr)))
|
||||
#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
||||
#define sk_OPENSSL_BLOCK_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
||||
#define sk_OPENSSL_BLOCK_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), pnum)
|
||||
#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
||||
#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
||||
#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)))
|
||||
#define sk_OPENSSL_BLOCK_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_copyfunc_type(copyfunc), ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc)))
|
||||
#define sk_OPENSSL_BLOCK_set_cmp_func(sk, cmp) ((sk_OPENSSL_BLOCK_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
||||
|
||||
#endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright 1995-2021 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_SHA_H
|
||||
# define OPENSSL_SHA_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_SHA_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
# include <stddef.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define SHA_DIGEST_LENGTH 20
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/*-
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* ! SHA_LONG has to be at least 32 bits wide. !
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
# define SHA_LONG unsigned int
|
||||
|
||||
# define SHA_LBLOCK 16
|
||||
# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
|
||||
* contiguous array of 32 bit wide
|
||||
* big-endian values. */
|
||||
# define SHA_LAST_BLOCK (SHA_CBLOCK-8)
|
||||
|
||||
typedef struct SHAstate_st {
|
||||
SHA_LONG h0, h1, h2, h3, h4;
|
||||
SHA_LONG Nl, Nh;
|
||||
SHA_LONG data[SHA_LBLOCK];
|
||||
unsigned int num;
|
||||
} SHA_CTX;
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
|
||||
# endif
|
||||
|
||||
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
|
||||
* contiguous array of 32 bit wide
|
||||
* big-endian values. */
|
||||
|
||||
typedef struct SHA256state_st {
|
||||
SHA_LONG h[8];
|
||||
SHA_LONG Nl, Nh;
|
||||
SHA_LONG data[SHA_LBLOCK];
|
||||
unsigned int num, md_len;
|
||||
} SHA256_CTX;
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA224_Update(SHA256_CTX *c,
|
||||
const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA224_Final(unsigned char *md, SHA256_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
|
||||
const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c,
|
||||
const unsigned char *data);
|
||||
# endif
|
||||
|
||||
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
|
||||
unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
|
||||
|
||||
# define SHA224_DIGEST_LENGTH 28
|
||||
# define SHA256_DIGEST_LENGTH 32
|
||||
# define SHA384_DIGEST_LENGTH 48
|
||||
# define SHA512_DIGEST_LENGTH 64
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/*
|
||||
* Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
|
||||
* being exactly 64-bit wide. See Implementation Notes in sha512.c
|
||||
* for further details.
|
||||
*/
|
||||
/*
|
||||
* SHA-512 treats input data as a
|
||||
* contiguous array of 64 bit
|
||||
* wide big-endian values.
|
||||
*/
|
||||
# define SHA512_CBLOCK (SHA_LBLOCK*8)
|
||||
# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
|
||||
# define SHA_LONG64 unsigned __int64
|
||||
# elif defined(__arch64__)
|
||||
# define SHA_LONG64 unsigned long
|
||||
# else
|
||||
# define SHA_LONG64 unsigned long long
|
||||
# endif
|
||||
|
||||
typedef struct SHA512state_st {
|
||||
SHA_LONG64 h[8];
|
||||
SHA_LONG64 Nl, Nh;
|
||||
union {
|
||||
SHA_LONG64 d[SHA_LBLOCK];
|
||||
unsigned char p[SHA512_CBLOCK];
|
||||
} u;
|
||||
unsigned int num, md_len;
|
||||
} SHA512_CTX;
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA384_Init(SHA512_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA384_Update(SHA512_CTX *c,
|
||||
const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA384_Final(unsigned char *md, SHA512_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c,
|
||||
const void *data, size_t len);
|
||||
OSSL_DEPRECATEDIN_3_0 int SHA512_Final(unsigned char *md, SHA512_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c,
|
||||
const unsigned char *data);
|
||||
# endif
|
||||
|
||||
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
|
||||
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2011-2016 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* DTLS code by Eric Rescorla <ekr@rtfm.com>
|
||||
*
|
||||
* Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_SRTP_H
|
||||
# define OPENSSL_SRTP_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_D1_SRTP_H
|
||||
# endif
|
||||
|
||||
# include <openssl/ssl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define SRTP_AES128_CM_SHA1_80 0x0001
|
||||
# define SRTP_AES128_CM_SHA1_32 0x0002
|
||||
# define SRTP_AES128_F8_SHA1_80 0x0003
|
||||
# define SRTP_AES128_F8_SHA1_32 0x0004
|
||||
# define SRTP_NULL_SHA1_80 0x0005
|
||||
# define SRTP_NULL_SHA1_32 0x0006
|
||||
|
||||
/* AEAD SRTP protection profiles from RFC 7714 */
|
||||
# define SRTP_AEAD_AES_128_GCM 0x0007
|
||||
# define SRTP_AEAD_AES_256_GCM 0x0008
|
||||
|
||||
# ifndef OPENSSL_NO_SRTP
|
||||
|
||||
__owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
|
||||
__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
|
||||
|
||||
__owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
|
||||
__owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
|
||||
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 1995-2016 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_SSL2_H
|
||||
# define OPENSSL_SSL2_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_SSL2_H
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define SSL2_VERSION 0x0002
|
||||
|
||||
# define SSL2_MT_CLIENT_HELLO 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,347 @@
|
||||
/*
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. 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_SSL3_H
|
||||
# define OPENSSL_SSL3_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_SSL3_H
|
||||
# endif
|
||||
|
||||
# include <openssl/comp.h>
|
||||
# include <openssl/buffer.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/ssl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Signalling cipher suite value from RFC 5746
|
||||
* (TLS_EMPTY_RENEGOTIATION_INFO_SCSV)
|
||||
*/
|
||||
# define SSL3_CK_SCSV 0x030000FF
|
||||
|
||||
/*
|
||||
* Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
|
||||
* (TLS_FALLBACK_SCSV)
|
||||
*/
|
||||
# define SSL3_CK_FALLBACK_SCSV 0x03005600
|
||||
|
||||
# define SSL3_CK_RSA_NULL_MD5 0x03000001
|
||||
# define SSL3_CK_RSA_NULL_SHA 0x03000002
|
||||
# define SSL3_CK_RSA_RC4_40_MD5 0x03000003
|
||||
# define SSL3_CK_RSA_RC4_128_MD5 0x03000004
|
||||
# define SSL3_CK_RSA_RC4_128_SHA 0x03000005
|
||||
# define SSL3_CK_RSA_RC2_40_MD5 0x03000006
|
||||
# define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
|
||||
# define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
|
||||
# define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
|
||||
# define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
|
||||
|
||||
# define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
|
||||
# define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
|
||||
# define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
|
||||
# define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
|
||||
# define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
|
||||
# define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
|
||||
|
||||
# define SSL3_CK_DHE_DSS_DES_40_CBC_SHA 0x03000011
|
||||
# define SSL3_CK_EDH_DSS_DES_40_CBC_SHA SSL3_CK_DHE_DSS_DES_40_CBC_SHA
|
||||
# define SSL3_CK_DHE_DSS_DES_64_CBC_SHA 0x03000012
|
||||
# define SSL3_CK_EDH_DSS_DES_64_CBC_SHA SSL3_CK_DHE_DSS_DES_64_CBC_SHA
|
||||
# define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA 0x03000013
|
||||
# define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA SSL3_CK_DHE_DSS_DES_192_CBC3_SHA
|
||||
# define SSL3_CK_DHE_RSA_DES_40_CBC_SHA 0x03000014
|
||||
# define SSL3_CK_EDH_RSA_DES_40_CBC_SHA SSL3_CK_DHE_RSA_DES_40_CBC_SHA
|
||||
# define SSL3_CK_DHE_RSA_DES_64_CBC_SHA 0x03000015
|
||||
# define SSL3_CK_EDH_RSA_DES_64_CBC_SHA SSL3_CK_DHE_RSA_DES_64_CBC_SHA
|
||||
# define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA 0x03000016
|
||||
# define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA SSL3_CK_DHE_RSA_DES_192_CBC3_SHA
|
||||
|
||||
# define SSL3_CK_ADH_RC4_40_MD5 0x03000017
|
||||
# define SSL3_CK_ADH_RC4_128_MD5 0x03000018
|
||||
# define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
|
||||
# define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
|
||||
# define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
|
||||
|
||||
/* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] */
|
||||
# define SSL3_RFC_RSA_NULL_MD5 "TLS_RSA_WITH_NULL_MD5"
|
||||
# define SSL3_RFC_RSA_NULL_SHA "TLS_RSA_WITH_NULL_SHA"
|
||||
# define SSL3_RFC_RSA_DES_192_CBC3_SHA "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
|
||||
# define SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
|
||||
# define SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"
|
||||
# define SSL3_RFC_ADH_DES_192_CBC_SHA "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"
|
||||
# define SSL3_RFC_RSA_IDEA_128_SHA "TLS_RSA_WITH_IDEA_CBC_SHA"
|
||||
# define SSL3_RFC_RSA_RC4_128_MD5 "TLS_RSA_WITH_RC4_128_MD5"
|
||||
# define SSL3_RFC_RSA_RC4_128_SHA "TLS_RSA_WITH_RC4_128_SHA"
|
||||
# define SSL3_RFC_ADH_RC4_128_MD5 "TLS_DH_anon_WITH_RC4_128_MD5"
|
||||
|
||||
# define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
|
||||
# define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
|
||||
# define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
|
||||
# define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
|
||||
# define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
|
||||
# define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
|
||||
# define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
|
||||
# define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
|
||||
# define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
|
||||
# define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
|
||||
|
||||
# define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
|
||||
# define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
|
||||
|
||||
# define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA"
|
||||
# define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA"
|
||||
|
||||
/*
|
||||
* This next block of six "EDH" labels is for backward compatibility with
|
||||
* older versions of OpenSSL. New code should use the six "DHE" labels above
|
||||
* instead:
|
||||
*/
|
||||
# define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
|
||||
# define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
|
||||
# define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
|
||||
# define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
|
||||
|
||||
# define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
|
||||
# define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
|
||||
# define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
|
||||
# define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
|
||||
# define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
|
||||
|
||||
# define SSL3_SSL_SESSION_ID_LENGTH 32
|
||||
# define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
|
||||
|
||||
# define SSL3_MASTER_SECRET_SIZE 48
|
||||
# define SSL3_RANDOM_SIZE 32
|
||||
# define SSL3_SESSION_ID_SIZE 32
|
||||
# define SSL3_RT_HEADER_LENGTH 5
|
||||
|
||||
# define SSL3_HM_HEADER_LENGTH 4
|
||||
|
||||
# ifndef SSL3_ALIGN_PAYLOAD
|
||||
/*
|
||||
* Some will argue that this increases memory footprint, but it's not
|
||||
* actually true. Point is that malloc has to return at least 64-bit aligned
|
||||
* pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
|
||||
* Suggested pre-gaping simply moves these wasted bytes from the end of
|
||||
* allocated region to its front, but makes data payload aligned, which
|
||||
* improves performance:-)
|
||||
*/
|
||||
# define SSL3_ALIGN_PAYLOAD 8
|
||||
# else
|
||||
# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0
|
||||
# error "insane SSL3_ALIGN_PAYLOAD"
|
||||
# undef SSL3_ALIGN_PAYLOAD
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* This is the maximum MAC (digest) size used by the SSL library. Currently
|
||||
* maximum of 20 is used by SHA1, but we reserve for future extension for
|
||||
* 512-bit hashes.
|
||||
*/
|
||||
|
||||
# define SSL3_RT_MAX_MD_SIZE 64
|
||||
|
||||
/*
|
||||
* Maximum block size used in all ciphersuites. Currently 16 for AES.
|
||||
*/
|
||||
|
||||
# define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
|
||||
|
||||
# define SSL3_RT_MAX_EXTRA (16384)
|
||||
|
||||
/* Maximum plaintext length: defined by SSL/TLS standards */
|
||||
# define SSL3_RT_MAX_PLAIN_LENGTH 16384
|
||||
/* Maximum compression overhead: defined by SSL/TLS standards */
|
||||
# define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
|
||||
|
||||
/*
|
||||
* The standards give a maximum encryption overhead of 1024 bytes. In
|
||||
* practice the value is lower than this. The overhead is the maximum number
|
||||
* of padding bytes (256) plus the mac size.
|
||||
*/
|
||||
# define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE)
|
||||
# define SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD 256
|
||||
|
||||
/*
|
||||
* OpenSSL currently only uses a padding length of at most one block so the
|
||||
* send overhead is smaller.
|
||||
*/
|
||||
|
||||
# define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \
|
||||
(SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
|
||||
|
||||
/* If compression isn't used don't include the compression overhead */
|
||||
|
||||
# ifdef OPENSSL_NO_COMP
|
||||
# define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
|
||||
# else
|
||||
# define SSL3_RT_MAX_COMPRESSED_LENGTH \
|
||||
(SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD)
|
||||
# endif
|
||||
# define SSL3_RT_MAX_ENCRYPTED_LENGTH \
|
||||
(SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH)
|
||||
# define SSL3_RT_MAX_TLS13_ENCRYPTED_LENGTH \
|
||||
(SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD)
|
||||
# define SSL3_RT_MAX_PACKET_SIZE \
|
||||
(SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)
|
||||
|
||||
# define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
|
||||
# define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
|
||||
|
||||
/* SSL3_VERSION is defined in prov_ssl.h */
|
||||
# define SSL3_VERSION_MAJOR 0x03
|
||||
# define SSL3_VERSION_MINOR 0x00
|
||||
|
||||
# define SSL3_RT_CHANGE_CIPHER_SPEC 20
|
||||
# define SSL3_RT_ALERT 21
|
||||
# define SSL3_RT_HANDSHAKE 22
|
||||
# define SSL3_RT_APPLICATION_DATA 23
|
||||
|
||||
/* Pseudo content types to indicate additional parameters */
|
||||
# define TLS1_RT_CRYPTO 0x1000
|
||||
# define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1)
|
||||
# define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2)
|
||||
# define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3)
|
||||
# define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4)
|
||||
|
||||
# define TLS1_RT_CRYPTO_READ 0x0000
|
||||
# define TLS1_RT_CRYPTO_WRITE 0x0100
|
||||
# define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5)
|
||||
# define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6)
|
||||
# define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7)
|
||||
# define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8)
|
||||
|
||||
/* Pseudo content types for SSL/TLS header info */
|
||||
# define SSL3_RT_HEADER 0x100
|
||||
# define SSL3_RT_INNER_CONTENT_TYPE 0x101
|
||||
|
||||
# define SSL3_AL_WARNING 1
|
||||
# define SSL3_AL_FATAL 2
|
||||
|
||||
# define SSL3_AD_CLOSE_NOTIFY 0
|
||||
# define SSL3_AD_UNEXPECTED_MESSAGE 10/* fatal */
|
||||
# define SSL3_AD_BAD_RECORD_MAC 20/* fatal */
|
||||
# define SSL3_AD_DECOMPRESSION_FAILURE 30/* fatal */
|
||||
# define SSL3_AD_HANDSHAKE_FAILURE 40/* fatal */
|
||||
# define SSL3_AD_NO_CERTIFICATE 41
|
||||
# define SSL3_AD_BAD_CERTIFICATE 42
|
||||
# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
|
||||
# define SSL3_AD_CERTIFICATE_REVOKED 44
|
||||
# define SSL3_AD_CERTIFICATE_EXPIRED 45
|
||||
# define SSL3_AD_CERTIFICATE_UNKNOWN 46
|
||||
# define SSL3_AD_ILLEGAL_PARAMETER 47/* fatal */
|
||||
|
||||
# define TLS1_HB_REQUEST 1
|
||||
# define TLS1_HB_RESPONSE 2
|
||||
|
||||
|
||||
# define SSL3_CT_RSA_SIGN 1
|
||||
# define SSL3_CT_DSS_SIGN 2
|
||||
# define SSL3_CT_RSA_FIXED_DH 3
|
||||
# define SSL3_CT_DSS_FIXED_DH 4
|
||||
# define SSL3_CT_RSA_EPHEMERAL_DH 5
|
||||
# define SSL3_CT_DSS_EPHEMERAL_DH 6
|
||||
# define SSL3_CT_FORTEZZA_DMS 20
|
||||
/*
|
||||
* SSL3_CT_NUMBER is used to size arrays and it must be large enough to
|
||||
* contain all of the cert types defined for *either* SSLv3 and TLSv1.
|
||||
*/
|
||||
# define SSL3_CT_NUMBER 12
|
||||
|
||||
# if defined(TLS_CT_NUMBER)
|
||||
# if TLS_CT_NUMBER != SSL3_CT_NUMBER
|
||||
# error "SSL/TLS CT_NUMBER values do not match"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* No longer used as of OpenSSL 1.1.1 */
|
||||
# define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
|
||||
|
||||
/* Removed from OpenSSL 1.1.0 */
|
||||
# define TLS1_FLAGS_TLS_PADDING_BUG 0x0
|
||||
|
||||
# define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
|
||||
|
||||
/* Set if we encrypt then mac instead of usual mac then encrypt */
|
||||
# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100
|
||||
# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ
|
||||
|
||||
/* Set if extended master secret extension received from peer */
|
||||
# define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
|
||||
|
||||
# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400
|
||||
|
||||
# define TLS1_FLAGS_STATELESS 0x0800
|
||||
|
||||
/* Set if extended master secret extension required on renegotiation */
|
||||
# define TLS1_FLAGS_REQUIRED_EXTMS 0x1000
|
||||
|
||||
# define SSL3_MT_HELLO_REQUEST 0
|
||||
# define SSL3_MT_CLIENT_HELLO 1
|
||||
# define SSL3_MT_SERVER_HELLO 2
|
||||
# define SSL3_MT_NEWSESSION_TICKET 4
|
||||
# define SSL3_MT_END_OF_EARLY_DATA 5
|
||||
# define SSL3_MT_ENCRYPTED_EXTENSIONS 8
|
||||
# define SSL3_MT_CERTIFICATE 11
|
||||
# define SSL3_MT_SERVER_KEY_EXCHANGE 12
|
||||
# define SSL3_MT_CERTIFICATE_REQUEST 13
|
||||
# define SSL3_MT_SERVER_DONE 14
|
||||
# define SSL3_MT_CERTIFICATE_VERIFY 15
|
||||
# define SSL3_MT_CLIENT_KEY_EXCHANGE 16
|
||||
# define SSL3_MT_FINISHED 20
|
||||
# define SSL3_MT_CERTIFICATE_URL 21
|
||||
# define SSL3_MT_CERTIFICATE_STATUS 22
|
||||
# define SSL3_MT_SUPPLEMENTAL_DATA 23
|
||||
# define SSL3_MT_KEY_UPDATE 24
|
||||
# ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
# define SSL3_MT_NEXT_PROTO 67
|
||||
# endif
|
||||
# define SSL3_MT_MESSAGE_HASH 254
|
||||
# define DTLS1_MT_HELLO_VERIFY_REQUEST 3
|
||||
|
||||
/* Dummy message type for handling CCS like a normal handshake message */
|
||||
# define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
|
||||
|
||||
# define SSL3_MT_CCS 1
|
||||
|
||||
/* These are used when changing over to a new cipher */
|
||||
# define SSL3_CC_READ 0x001
|
||||
# define SSL3_CC_WRITE 0x002
|
||||
# define SSL3_CC_CLIENT 0x010
|
||||
# define SSL3_CC_SERVER 0x020
|
||||
# define SSL3_CC_EARLY 0x040
|
||||
# define SSL3_CC_HANDSHAKE 0x080
|
||||
# define SSL3_CC_APPLICATION 0x100
|
||||
# define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)
|
||||
# define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ)
|
||||
# define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ)
|
||||
# define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,346 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2024 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_SSLERR_H
|
||||
# define OPENSSL_SSLERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/sslerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* SSL reason codes.
|
||||
*/
|
||||
# define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291
|
||||
# define SSL_R_APP_DATA_IN_HANDSHAKE 100
|
||||
# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
|
||||
# define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
|
||||
# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
|
||||
# define SSL_R_BAD_CIPHER 186
|
||||
# define SSL_R_BAD_DATA 390
|
||||
# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
|
||||
# define SSL_R_BAD_DECOMPRESSION 107
|
||||
# define SSL_R_BAD_DH_VALUE 102
|
||||
# define SSL_R_BAD_DIGEST_LENGTH 111
|
||||
# define SSL_R_BAD_EARLY_DATA 233
|
||||
# define SSL_R_BAD_ECC_CERT 304
|
||||
# define SSL_R_BAD_ECPOINT 306
|
||||
# define SSL_R_BAD_EXTENSION 110
|
||||
# define SSL_R_BAD_HANDSHAKE_LENGTH 332
|
||||
# define SSL_R_BAD_HANDSHAKE_STATE 236
|
||||
# define SSL_R_BAD_HELLO_REQUEST 105
|
||||
# define SSL_R_BAD_HRR_VERSION 263
|
||||
# define SSL_R_BAD_KEY_SHARE 108
|
||||
# define SSL_R_BAD_KEY_UPDATE 122
|
||||
# define SSL_R_BAD_LEGACY_VERSION 292
|
||||
# define SSL_R_BAD_LENGTH 271
|
||||
# define SSL_R_BAD_PACKET 240
|
||||
# define SSL_R_BAD_PACKET_LENGTH 115
|
||||
# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
|
||||
# define SSL_R_BAD_PSK 219
|
||||
# define SSL_R_BAD_PSK_IDENTITY 114
|
||||
# define SSL_R_BAD_RECORD_TYPE 443
|
||||
# define SSL_R_BAD_RSA_ENCRYPT 119
|
||||
# define SSL_R_BAD_SIGNATURE 123
|
||||
# define SSL_R_BAD_SRP_A_LENGTH 347
|
||||
# define SSL_R_BAD_SRP_PARAMETERS 371
|
||||
# define SSL_R_BAD_SRTP_MKI_VALUE 352
|
||||
# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
|
||||
# define SSL_R_BAD_SSL_FILETYPE 124
|
||||
# define SSL_R_BAD_VALUE 384
|
||||
# define SSL_R_BAD_WRITE_RETRY 127
|
||||
# define SSL_R_BINDER_DOES_NOT_VERIFY 253
|
||||
# define SSL_R_BIO_NOT_SET 128
|
||||
# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
|
||||
# define SSL_R_BN_LIB 130
|
||||
# define SSL_R_CALLBACK_FAILED 234
|
||||
# define SSL_R_CANNOT_CHANGE_CIPHER 109
|
||||
# define SSL_R_CANNOT_GET_GROUP_NAME 299
|
||||
# define SSL_R_CA_DN_LENGTH_MISMATCH 131
|
||||
# define SSL_R_CA_KEY_TOO_SMALL 397
|
||||
# define SSL_R_CA_MD_TOO_WEAK 398
|
||||
# define SSL_R_CCS_RECEIVED_EARLY 133
|
||||
# define SSL_R_CERTIFICATE_VERIFY_FAILED 134
|
||||
# define SSL_R_CERT_CB_ERROR 377
|
||||
# define SSL_R_CERT_LENGTH_MISMATCH 135
|
||||
# define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218
|
||||
# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
|
||||
# define SSL_R_CLIENTHELLO_TLSEXT 226
|
||||
# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
|
||||
# define SSL_R_COMPRESSION_DISABLED 343
|
||||
# define SSL_R_COMPRESSION_FAILURE 141
|
||||
# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
|
||||
# define SSL_R_COMPRESSION_LIBRARY_ERROR 142
|
||||
# define SSL_R_CONNECTION_TYPE_NOT_SET 144
|
||||
# define SSL_R_CONTEXT_NOT_DANE_ENABLED 167
|
||||
# define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400
|
||||
# define SSL_R_COOKIE_MISMATCH 308
|
||||
# define SSL_R_COPY_PARAMETERS_FAILED 296
|
||||
# define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206
|
||||
# define SSL_R_DANE_ALREADY_ENABLED 172
|
||||
# define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173
|
||||
# define SSL_R_DANE_NOT_ENABLED 175
|
||||
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180
|
||||
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184
|
||||
# define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189
|
||||
# define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192
|
||||
# define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200
|
||||
# define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201
|
||||
# define SSL_R_DANE_TLSA_BAD_SELECTOR 202
|
||||
# define SSL_R_DANE_TLSA_NULL_DATA 203
|
||||
# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
|
||||
# define SSL_R_DATA_LENGTH_TOO_LONG 146
|
||||
# define SSL_R_DECRYPTION_FAILED 147
|
||||
# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
|
||||
# define SSL_R_DH_KEY_TOO_SMALL 394
|
||||
# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
|
||||
# define SSL_R_DIGEST_CHECK_FAILED 149
|
||||
# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
|
||||
# define SSL_R_DUPLICATE_COMPRESSION_ID 309
|
||||
# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
|
||||
# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
|
||||
# define SSL_R_EE_KEY_TOO_SMALL 399
|
||||
# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
|
||||
# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
|
||||
# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
|
||||
# define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204
|
||||
# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194
|
||||
# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
|
||||
# define SSL_R_EXTENSION_NOT_RECEIVED 279
|
||||
# define SSL_R_EXTRA_DATA_IN_MESSAGE 153
|
||||
# define SSL_R_EXT_LENGTH_MISMATCH 163
|
||||
# define SSL_R_FAILED_TO_INIT_ASYNC 405
|
||||
# define SSL_R_FRAGMENTED_CLIENT_HELLO 401
|
||||
# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
|
||||
# define SSL_R_HTTPS_PROXY_REQUEST 155
|
||||
# define SSL_R_HTTP_REQUEST 156
|
||||
# define SSL_R_ILLEGAL_POINT_COMPRESSION 162
|
||||
# define SSL_R_ILLEGAL_SUITEB_DIGEST 380
|
||||
# define SSL_R_INAPPROPRIATE_FALLBACK 373
|
||||
# define SSL_R_INCONSISTENT_COMPRESSION 340
|
||||
# define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222
|
||||
# define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231
|
||||
# define SSL_R_INCONSISTENT_EXTMS 104
|
||||
# define SSL_R_INSUFFICIENT_SECURITY 241
|
||||
# define SSL_R_INVALID_ALERT 205
|
||||
# define SSL_R_INVALID_CCS_MESSAGE 260
|
||||
# define SSL_R_INVALID_CERTIFICATE_OR_ALG 238
|
||||
# define SSL_R_INVALID_COMMAND 280
|
||||
# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
|
||||
# define SSL_R_INVALID_CONFIG 283
|
||||
# define SSL_R_INVALID_CONFIGURATION_NAME 113
|
||||
# define SSL_R_INVALID_CONTEXT 282
|
||||
# define SSL_R_INVALID_CT_VALIDATION_TYPE 212
|
||||
# define SSL_R_INVALID_KEY_UPDATE_TYPE 120
|
||||
# define SSL_R_INVALID_MAX_EARLY_DATA 174
|
||||
# define SSL_R_INVALID_NULL_CMD_NAME 385
|
||||
# define SSL_R_INVALID_SEQUENCE_NUMBER 402
|
||||
# define SSL_R_INVALID_SERVERINFO_DATA 388
|
||||
# define SSL_R_INVALID_SESSION_ID 999
|
||||
# define SSL_R_INVALID_SRP_USERNAME 357
|
||||
# define SSL_R_INVALID_STATUS_RESPONSE 328
|
||||
# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
|
||||
# define SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED 333
|
||||
# define SSL_R_LENGTH_MISMATCH 159
|
||||
# define SSL_R_LENGTH_TOO_LONG 404
|
||||
# define SSL_R_LENGTH_TOO_SHORT 160
|
||||
# define SSL_R_LIBRARY_BUG 274
|
||||
# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
|
||||
# define SSL_R_MISSING_DSA_SIGNING_CERT 165
|
||||
# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
|
||||
# define SSL_R_MISSING_FATAL 256
|
||||
# define SSL_R_MISSING_PARAMETERS 290
|
||||
# define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310
|
||||
# define SSL_R_MISSING_RSA_CERTIFICATE 168
|
||||
# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
|
||||
# define SSL_R_MISSING_RSA_SIGNING_CERT 170
|
||||
# define SSL_R_MISSING_SIGALGS_EXTENSION 112
|
||||
# define SSL_R_MISSING_SIGNING_CERT 221
|
||||
# define SSL_R_MISSING_SRP_PARAM 358
|
||||
# define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
|
||||
# define SSL_R_MISSING_TMP_DH_KEY 171
|
||||
# define SSL_R_MISSING_TMP_ECDH_KEY 311
|
||||
# define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293
|
||||
# define SSL_R_NOT_ON_RECORD_BOUNDARY 182
|
||||
# define SSL_R_NOT_REPLACING_CERTIFICATE 289
|
||||
# define SSL_R_NOT_SERVER 284
|
||||
# define SSL_R_NO_APPLICATION_PROTOCOL 235
|
||||
# define SSL_R_NO_CERTIFICATES_RETURNED 176
|
||||
# define SSL_R_NO_CERTIFICATE_ASSIGNED 177
|
||||
# define SSL_R_NO_CERTIFICATE_SET 179
|
||||
# define SSL_R_NO_CHANGE_FOLLOWING_HRR 214
|
||||
# define SSL_R_NO_CIPHERS_AVAILABLE 181
|
||||
# define SSL_R_NO_CIPHERS_SPECIFIED 183
|
||||
# define SSL_R_NO_CIPHER_MATCH 185
|
||||
# define SSL_R_NO_CLIENT_CERT_METHOD 331
|
||||
# define SSL_R_NO_COMPRESSION_SPECIFIED 187
|
||||
# define SSL_R_NO_COOKIE_CALLBACK_SET 287
|
||||
# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
|
||||
# define SSL_R_NO_METHOD_SPECIFIED 188
|
||||
# define SSL_R_NO_PEM_EXTENSIONS 389
|
||||
# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
|
||||
# define SSL_R_NO_PROTOCOLS_AVAILABLE 191
|
||||
# define SSL_R_NO_RENEGOTIATION 339
|
||||
# define SSL_R_NO_REQUIRED_DIGEST 324
|
||||
# define SSL_R_NO_SHARED_CIPHER 193
|
||||
# define SSL_R_NO_SHARED_GROUPS 410
|
||||
# define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376
|
||||
# define SSL_R_NO_SRTP_PROFILES 359
|
||||
# define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297
|
||||
# define SSL_R_NO_SUITABLE_GROUPS 295
|
||||
# define SSL_R_NO_SUITABLE_KEY_SHARE 101
|
||||
# define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118
|
||||
# define SSL_R_NO_VALID_SCTS 216
|
||||
# define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403
|
||||
# define SSL_R_NULL_SSL_CTX 195
|
||||
# define SSL_R_NULL_SSL_METHOD_PASSED 196
|
||||
# define SSL_R_OCSP_CALLBACK_FAILURE 305
|
||||
# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
|
||||
# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
|
||||
# define SSL_R_OVERFLOW_ERROR 237
|
||||
# define SSL_R_PACKET_LENGTH_TOO_LONG 198
|
||||
# define SSL_R_PARSE_TLSEXT 227
|
||||
# define SSL_R_PATH_TOO_LONG 270
|
||||
# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
|
||||
# define SSL_R_PEM_NAME_BAD_PREFIX 391
|
||||
# define SSL_R_PEM_NAME_TOO_SHORT 392
|
||||
# define SSL_R_PIPELINE_FAILURE 406
|
||||
# define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278
|
||||
# define SSL_R_PRIVATE_KEY_MISMATCH 288
|
||||
# define SSL_R_PROTOCOL_IS_SHUTDOWN 207
|
||||
# define SSL_R_PSK_IDENTITY_NOT_FOUND 223
|
||||
# define SSL_R_PSK_NO_CLIENT_CB 224
|
||||
# define SSL_R_PSK_NO_SERVER_CB 225
|
||||
# define SSL_R_READ_BIO_NOT_SET 211
|
||||
# define SSL_R_READ_TIMEOUT_EXPIRED 312
|
||||
# define SSL_R_RECORD_LENGTH_MISMATCH 213
|
||||
# define SSL_R_RECORD_TOO_SMALL 298
|
||||
# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
|
||||
# define SSL_R_RENEGOTIATION_ENCODING_ERR 336
|
||||
# define SSL_R_RENEGOTIATION_MISMATCH 337
|
||||
# define SSL_R_REQUEST_PENDING 285
|
||||
# define SSL_R_REQUEST_SENT 286
|
||||
# define SSL_R_REQUIRED_CIPHER_MISSING 215
|
||||
# define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342
|
||||
# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
|
||||
# define SSL_R_SCT_VERIFICATION_FAILED 208
|
||||
# define SSL_R_SERVERHELLO_TLSEXT 275
|
||||
# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
|
||||
# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407
|
||||
# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
|
||||
# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
|
||||
# define SSL_R_SRP_A_CALC 361
|
||||
# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
|
||||
# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
|
||||
# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
|
||||
# define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
|
||||
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
|
||||
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
|
||||
# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
|
||||
# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
|
||||
# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
|
||||
# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
|
||||
# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
|
||||
# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
|
||||
# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
|
||||
# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
|
||||
# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
|
||||
# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
|
||||
# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
|
||||
# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
|
||||
# define SSL_R_SSL_COMMAND_SECTION_EMPTY 117
|
||||
# define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125
|
||||
# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
|
||||
# define SSL_R_SSL_HANDSHAKE_FAILURE 229
|
||||
# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
|
||||
# define SSL_R_SSL_NEGATIVE_LENGTH 372
|
||||
# define SSL_R_SSL_SECTION_EMPTY 126
|
||||
# define SSL_R_SSL_SECTION_NOT_FOUND 136
|
||||
# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
|
||||
# define SSL_R_SSL_SESSION_ID_CONFLICT 302
|
||||
# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
|
||||
# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
|
||||
# define SSL_R_SSL_SESSION_ID_TOO_LONG 408
|
||||
# define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
|
||||
# define SSL_R_STILL_IN_INIT 121
|
||||
# define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116
|
||||
# define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109
|
||||
# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
|
||||
# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
|
||||
# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
|
||||
# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
|
||||
# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
|
||||
# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
|
||||
# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
|
||||
# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
|
||||
# define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120
|
||||
# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
|
||||
# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
|
||||
# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
|
||||
# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
|
||||
# define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115
|
||||
# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
|
||||
# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
|
||||
# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
|
||||
# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
|
||||
# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
|
||||
# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
|
||||
# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
|
||||
# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
|
||||
# define SSL_R_TOO_MANY_KEY_UPDATES 132
|
||||
# define SSL_R_TOO_MANY_WARN_ALERTS 409
|
||||
# define SSL_R_TOO_MUCH_EARLY_DATA 164
|
||||
# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
|
||||
# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
|
||||
# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
|
||||
# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
|
||||
# define SSL_R_UNEXPECTED_CCS_MESSAGE 262
|
||||
# define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
|
||||
# define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
|
||||
# define SSL_R_UNEXPECTED_MESSAGE 244
|
||||
# define SSL_R_UNEXPECTED_RECORD 245
|
||||
# define SSL_R_UNINITIALIZED 276
|
||||
# define SSL_R_UNKNOWN_ALERT_TYPE 246
|
||||
# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
|
||||
# define SSL_R_UNKNOWN_CIPHER_RETURNED 248
|
||||
# define SSL_R_UNKNOWN_CIPHER_TYPE 249
|
||||
# define SSL_R_UNKNOWN_CMD_NAME 386
|
||||
# define SSL_R_UNKNOWN_COMMAND 139
|
||||
# define SSL_R_UNKNOWN_DIGEST 368
|
||||
# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
|
||||
# define SSL_R_UNKNOWN_PKEY_TYPE 251
|
||||
# define SSL_R_UNKNOWN_PROTOCOL 252
|
||||
# define SSL_R_UNKNOWN_SSL_VERSION 254
|
||||
# define SSL_R_UNKNOWN_STATE 255
|
||||
# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
|
||||
# define SSL_R_UNSOLICITED_EXTENSION 217
|
||||
# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
|
||||
# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
|
||||
# define SSL_R_UNSUPPORTED_PROTOCOL 258
|
||||
# define SSL_R_UNSUPPORTED_SSL_VERSION 259
|
||||
# define SSL_R_UNSUPPORTED_STATUS_TYPE 329
|
||||
# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
|
||||
# define SSL_R_VERSION_TOO_HIGH 166
|
||||
# define SSL_R_VERSION_TOO_LOW 396
|
||||
# define SSL_R_WRONG_CERTIFICATE_TYPE 383
|
||||
# define SSL_R_WRONG_CIPHER_RETURNED 261
|
||||
# define SSL_R_WRONG_CURVE 378
|
||||
# define SSL_R_WRONG_SIGNATURE_LENGTH 264
|
||||
# define SSL_R_WRONG_SIGNATURE_SIZE 265
|
||||
# define SSL_R_WRONG_SIGNATURE_TYPE 370
|
||||
# define SSL_R_WRONG_SSL_VERSION 266
|
||||
# define SSL_R_WRONG_VERSION_NUMBER 267
|
||||
# define SSL_R_X509_LIB 268
|
||||
# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,468 @@
|
||||
/*
|
||||
* Copyright 2020-2021 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file preserves symbols from pre-3.0 OpenSSL.
|
||||
* It should never be included directly, as it's already included
|
||||
* by the public sslerr.h headers, and since it will go away some
|
||||
* time in the future.
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_SSLERR_LEGACY_H
|
||||
# define OPENSSL_SSLERR_LEGACY_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# include <openssl/symhacks.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int ERR_load_SSL_strings(void);
|
||||
|
||||
/* Collected _F_ macros from OpenSSL 1.1.1 */
|
||||
|
||||
/*
|
||||
* SSL function codes.
|
||||
*/
|
||||
# define SSL_F_ADD_CLIENT_KEY_SHARE_EXT 0
|
||||
# define SSL_F_ADD_KEY_SHARE 0
|
||||
# define SSL_F_BYTES_TO_CIPHER_LIST 0
|
||||
# define SSL_F_CHECK_SUITEB_CIPHER_LIST 0
|
||||
# define SSL_F_CIPHERSUITE_CB 0
|
||||
# define SSL_F_CONSTRUCT_CA_NAMES 0
|
||||
# define SSL_F_CONSTRUCT_KEY_EXCHANGE_TBS 0
|
||||
# define SSL_F_CONSTRUCT_STATEFUL_TICKET 0
|
||||
# define SSL_F_CONSTRUCT_STATELESS_TICKET 0
|
||||
# define SSL_F_CREATE_SYNTHETIC_MESSAGE_HASH 0
|
||||
# define SSL_F_CREATE_TICKET_PREQUEL 0
|
||||
# define SSL_F_CT_MOVE_SCTS 0
|
||||
# define SSL_F_CT_STRICT 0
|
||||
# define SSL_F_CUSTOM_EXT_ADD 0
|
||||
# define SSL_F_CUSTOM_EXT_PARSE 0
|
||||
# define SSL_F_D2I_SSL_SESSION 0
|
||||
# define SSL_F_DANE_CTX_ENABLE 0
|
||||
# define SSL_F_DANE_MTYPE_SET 0
|
||||
# define SSL_F_DANE_TLSA_ADD 0
|
||||
# define SSL_F_DERIVE_SECRET_KEY_AND_IV 0
|
||||
# define SSL_F_DO_DTLS1_WRITE 0
|
||||
# define SSL_F_DO_SSL3_WRITE 0
|
||||
# define SSL_F_DTLS1_BUFFER_RECORD 0
|
||||
# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 0
|
||||
# define SSL_F_DTLS1_HEARTBEAT 0
|
||||
# define SSL_F_DTLS1_HM_FRAGMENT_NEW 0
|
||||
# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 0
|
||||
# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 0
|
||||
# define SSL_F_DTLS1_PROCESS_RECORD 0
|
||||
# define SSL_F_DTLS1_READ_BYTES 0
|
||||
# define SSL_F_DTLS1_READ_FAILED 0
|
||||
# define SSL_F_DTLS1_RETRANSMIT_MESSAGE 0
|
||||
# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 0
|
||||
# define SSL_F_DTLS1_WRITE_BYTES 0
|
||||
# define SSL_F_DTLSV1_LISTEN 0
|
||||
# define SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0
|
||||
# define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 0
|
||||
# define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 0
|
||||
# define SSL_F_DTLS_PROCESS_HELLO_VERIFY 0
|
||||
# define SSL_F_DTLS_RECORD_LAYER_NEW 0
|
||||
# define SSL_F_DTLS_WAIT_FOR_DRY 0
|
||||
# define SSL_F_EARLY_DATA_COUNT_OK 0
|
||||
# define SSL_F_FINAL_EARLY_DATA 0
|
||||
# define SSL_F_FINAL_EC_PT_FORMATS 0
|
||||
# define SSL_F_FINAL_EMS 0
|
||||
# define SSL_F_FINAL_KEY_SHARE 0
|
||||
# define SSL_F_FINAL_MAXFRAGMENTLEN 0
|
||||
# define SSL_F_FINAL_RENEGOTIATE 0
|
||||
# define SSL_F_FINAL_SERVER_NAME 0
|
||||
# define SSL_F_FINAL_SIG_ALGS 0
|
||||
# define SSL_F_GET_CERT_VERIFY_TBS_DATA 0
|
||||
# define SSL_F_NSS_KEYLOG_INT 0
|
||||
# define SSL_F_OPENSSL_INIT_SSL 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT13_READ_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT13_WRITE_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT_CONSTRUCT_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT_POST_PROCESS_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT_PROCESS_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_CLIENT_WRITE_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER13_READ_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER13_WRITE_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_CONSTRUCT_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_POST_PROCESS_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_POST_WORK 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_PRE_WORK 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_PROCESS_MESSAGE 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 0
|
||||
# define SSL_F_OSSL_STATEM_SERVER_WRITE_TRANSITION 0
|
||||
# define SSL_F_PARSE_CA_NAMES 0
|
||||
# define SSL_F_PITEM_NEW 0
|
||||
# define SSL_F_PQUEUE_NEW 0
|
||||
# define SSL_F_PROCESS_KEY_SHARE_EXT 0
|
||||
# define SSL_F_READ_STATE_MACHINE 0
|
||||
# define SSL_F_SET_CLIENT_CIPHERSUITE 0
|
||||
# define SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET 0
|
||||
# define SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET 0
|
||||
# define SSL_F_SRP_VERIFY_SERVER_PARAM 0
|
||||
# define SSL_F_SSL3_CHANGE_CIPHER_STATE 0
|
||||
# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 0
|
||||
# define SSL_F_SSL3_CTRL 0
|
||||
# define SSL_F_SSL3_CTX_CTRL 0
|
||||
# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 0
|
||||
# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 0
|
||||
# define SSL_F_SSL3_ENC 0
|
||||
# define SSL_F_SSL3_FINAL_FINISH_MAC 0
|
||||
# define SSL_F_SSL3_FINISH_MAC 0
|
||||
# define SSL_F_SSL3_GENERATE_KEY_BLOCK 0
|
||||
# define SSL_F_SSL3_GENERATE_MASTER_SECRET 0
|
||||
# define SSL_F_SSL3_GET_RECORD 0
|
||||
# define SSL_F_SSL3_INIT_FINISHED_MAC 0
|
||||
# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 0
|
||||
# define SSL_F_SSL3_READ_BYTES 0
|
||||
# define SSL_F_SSL3_READ_N 0
|
||||
# define SSL_F_SSL3_SETUP_KEY_BLOCK 0
|
||||
# define SSL_F_SSL3_SETUP_READ_BUFFER 0
|
||||
# define SSL_F_SSL3_SETUP_WRITE_BUFFER 0
|
||||
# define SSL_F_SSL3_WRITE_BYTES 0
|
||||
# define SSL_F_SSL3_WRITE_PENDING 0
|
||||
# define SSL_F_SSL_ADD_CERT_CHAIN 0
|
||||
# define SSL_F_SSL_ADD_CERT_TO_BUF 0
|
||||
# define SSL_F_SSL_ADD_CERT_TO_WPACKET 0
|
||||
# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 0
|
||||
# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 0
|
||||
# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 0
|
||||
# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 0
|
||||
# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 0
|
||||
# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 0
|
||||
# define SSL_F_SSL_BAD_METHOD 0
|
||||
# define SSL_F_SSL_BUILD_CERT_CHAIN 0
|
||||
# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 0
|
||||
# define SSL_F_SSL_CACHE_CIPHERLIST 0
|
||||
# define SSL_F_SSL_CERT_ADD0_CHAIN_CERT 0
|
||||
# define SSL_F_SSL_CERT_DUP 0
|
||||
# define SSL_F_SSL_CERT_NEW 0
|
||||
# define SSL_F_SSL_CERT_SET0_CHAIN 0
|
||||
# define SSL_F_SSL_CHECK_PRIVATE_KEY 0
|
||||
# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_CHECK_SRP_EXT_CLIENTHELLO 0
|
||||
# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 0
|
||||
# define SSL_F_SSL_CHOOSE_CLIENT_VERSION 0
|
||||
# define SSL_F_SSL_CIPHER_DESCRIPTION 0
|
||||
# define SSL_F_SSL_CIPHER_LIST_TO_BYTES 0
|
||||
# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 0
|
||||
# define SSL_F_SSL_CIPHER_STRENGTH_SORT 0
|
||||
# define SSL_F_SSL_CLEAR 0
|
||||
# define SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT 0
|
||||
# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 0
|
||||
# define SSL_F_SSL_CONF_CMD 0
|
||||
# define SSL_F_SSL_CREATE_CIPHER_LIST 0
|
||||
# define SSL_F_SSL_CTRL 0
|
||||
# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 0
|
||||
# define SSL_F_SSL_CTX_ENABLE_CT 0
|
||||
# define SSL_F_SSL_CTX_MAKE_PROFILES 0
|
||||
# define SSL_F_SSL_CTX_NEW 0
|
||||
# define SSL_F_SSL_CTX_SET_ALPN_PROTOS 0
|
||||
# define SSL_F_SSL_CTX_SET_CIPHER_LIST 0
|
||||
# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 0
|
||||
# define SSL_F_SSL_CTX_SET_CT_VALIDATION_CALLBACK 0
|
||||
# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 0
|
||||
# define SSL_F_SSL_CTX_SET_SSL_VERSION 0
|
||||
# define SSL_F_SSL_CTX_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0
|
||||
# define SSL_F_SSL_CTX_USE_CERTIFICATE 0
|
||||
# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 0
|
||||
# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 0
|
||||
# define SSL_F_SSL_CTX_USE_PRIVATEKEY 0
|
||||
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 0
|
||||
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 0
|
||||
# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 0
|
||||
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 0
|
||||
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 0
|
||||
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 0
|
||||
# define SSL_F_SSL_CTX_USE_SERVERINFO 0
|
||||
# define SSL_F_SSL_CTX_USE_SERVERINFO_EX 0
|
||||
# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 0
|
||||
# define SSL_F_SSL_DANE_DUP 0
|
||||
# define SSL_F_SSL_DANE_ENABLE 0
|
||||
# define SSL_F_SSL_DERIVE 0
|
||||
# define SSL_F_SSL_DO_CONFIG 0
|
||||
# define SSL_F_SSL_DO_HANDSHAKE 0
|
||||
# define SSL_F_SSL_DUP_CA_LIST 0
|
||||
# define SSL_F_SSL_ENABLE_CT 0
|
||||
# define SSL_F_SSL_GENERATE_PKEY_GROUP 0
|
||||
# define SSL_F_SSL_GENERATE_SESSION_ID 0
|
||||
# define SSL_F_SSL_GET_NEW_SESSION 0
|
||||
# define SSL_F_SSL_GET_PREV_SESSION 0
|
||||
# define SSL_F_SSL_GET_SERVER_CERT_INDEX 0
|
||||
# define SSL_F_SSL_GET_SIGN_PKEY 0
|
||||
# define SSL_F_SSL_HANDSHAKE_HASH 0
|
||||
# define SSL_F_SSL_INIT_WBIO_BUFFER 0
|
||||
# define SSL_F_SSL_KEY_UPDATE 0
|
||||
# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 0
|
||||
# define SSL_F_SSL_LOG_MASTER_SECRET 0
|
||||
# define SSL_F_SSL_LOG_RSA_CLIENT_KEY_EXCHANGE 0
|
||||
# define SSL_F_SSL_MODULE_INIT 0
|
||||
# define SSL_F_SSL_NEW 0
|
||||
# define SSL_F_SSL_NEXT_PROTO_VALIDATE 0
|
||||
# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 0
|
||||
# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 0
|
||||
# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 0
|
||||
# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 0
|
||||
# define SSL_F_SSL_PEEK 0
|
||||
# define SSL_F_SSL_PEEK_EX 0
|
||||
# define SSL_F_SSL_PEEK_INTERNAL 0
|
||||
# define SSL_F_SSL_READ 0
|
||||
# define SSL_F_SSL_READ_EARLY_DATA 0
|
||||
# define SSL_F_SSL_READ_EX 0
|
||||
# define SSL_F_SSL_READ_INTERNAL 0
|
||||
# define SSL_F_SSL_RENEGOTIATE 0
|
||||
# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 0
|
||||
# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 0
|
||||
# define SSL_F_SSL_SESSION_DUP 0
|
||||
# define SSL_F_SSL_SESSION_NEW 0
|
||||
# define SSL_F_SSL_SESSION_PRINT_FP 0
|
||||
# define SSL_F_SSL_SESSION_SET1_ID 0
|
||||
# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 0
|
||||
# define SSL_F_SSL_SET_ALPN_PROTOS 0
|
||||
# define SSL_F_SSL_SET_CERT 0
|
||||
# define SSL_F_SSL_SET_CERT_AND_KEY 0
|
||||
# define SSL_F_SSL_SET_CIPHER_LIST 0
|
||||
# define SSL_F_SSL_SET_CT_VALIDATION_CALLBACK 0
|
||||
# define SSL_F_SSL_SET_FD 0
|
||||
# define SSL_F_SSL_SET_PKEY 0
|
||||
# define SSL_F_SSL_SET_RFD 0
|
||||
# define SSL_F_SSL_SET_SESSION 0
|
||||
# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 0
|
||||
# define SSL_F_SSL_SET_SESSION_TICKET_EXT 0
|
||||
# define SSL_F_SSL_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0
|
||||
# define SSL_F_SSL_SET_WFD 0
|
||||
# define SSL_F_SSL_SHUTDOWN 0
|
||||
# define SSL_F_SSL_SRP_CTX_INIT 0
|
||||
# define SSL_F_SSL_START_ASYNC_JOB 0
|
||||
# define SSL_F_SSL_UNDEFINED_FUNCTION 0
|
||||
# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 0
|
||||
# define SSL_F_SSL_USE_CERTIFICATE 0
|
||||
# define SSL_F_SSL_USE_CERTIFICATE_ASN1 0
|
||||
# define SSL_F_SSL_USE_CERTIFICATE_FILE 0
|
||||
# define SSL_F_SSL_USE_PRIVATEKEY 0
|
||||
# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 0
|
||||
# define SSL_F_SSL_USE_PRIVATEKEY_FILE 0
|
||||
# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 0
|
||||
# define SSL_F_SSL_USE_RSAPRIVATEKEY 0
|
||||
# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 0
|
||||
# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 0
|
||||
# define SSL_F_SSL_VALIDATE_CT 0
|
||||
# define SSL_F_SSL_VERIFY_CERT_CHAIN 0
|
||||
# define SSL_F_SSL_VERIFY_CLIENT_POST_HANDSHAKE 0
|
||||
# define SSL_F_SSL_WRITE 0
|
||||
# define SSL_F_SSL_WRITE_EARLY_DATA 0
|
||||
# define SSL_F_SSL_WRITE_EARLY_FINISH 0
|
||||
# define SSL_F_SSL_WRITE_EX 0
|
||||
# define SSL_F_SSL_WRITE_INTERNAL 0
|
||||
# define SSL_F_STATE_MACHINE 0
|
||||
# define SSL_F_TLS12_CHECK_PEER_SIGALG 0
|
||||
# define SSL_F_TLS12_COPY_SIGALGS 0
|
||||
# define SSL_F_TLS13_CHANGE_CIPHER_STATE 0
|
||||
# define SSL_F_TLS13_ENC 0
|
||||
# define SSL_F_TLS13_FINAL_FINISH_MAC 0
|
||||
# define SSL_F_TLS13_GENERATE_SECRET 0
|
||||
# define SSL_F_TLS13_HKDF_EXPAND 0
|
||||
# define SSL_F_TLS13_RESTORE_HANDSHAKE_DIGEST_FOR_PHA 0
|
||||
# define SSL_F_TLS13_SAVE_HANDSHAKE_DIGEST_FOR_PHA 0
|
||||
# define SSL_F_TLS13_SETUP_KEY_BLOCK 0
|
||||
# define SSL_F_TLS1_CHANGE_CIPHER_STATE 0
|
||||
# define SSL_F_TLS1_CHECK_DUPLICATE_EXTENSIONS 0
|
||||
# define SSL_F_TLS1_ENC 0
|
||||
# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 0
|
||||
# define SSL_F_TLS1_GET_CURVELIST 0
|
||||
# define SSL_F_TLS1_PRF 0
|
||||
# define SSL_F_TLS1_SAVE_U16 0
|
||||
# define SSL_F_TLS1_SETUP_KEY_BLOCK 0
|
||||
# define SSL_F_TLS1_SET_GROUPS 0
|
||||
# define SSL_F_TLS1_SET_RAW_SIGALGS 0
|
||||
# define SSL_F_TLS1_SET_SERVER_SIGALGS 0
|
||||
# define SSL_F_TLS1_SET_SHARED_SIGALGS 0
|
||||
# define SSL_F_TLS1_SET_SIGALGS 0
|
||||
# define SSL_F_TLS_CHOOSE_SIGALG 0
|
||||
# define SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK 0
|
||||
# define SSL_F_TLS_COLLECT_EXTENSIONS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_AUTHORITIES 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CERT_VERIFY 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_DHE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_ECDHE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_GOST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_PSK_PREAMBLE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_RSA 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CKE_SRP 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CLIENT_HELLO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_ALPN 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_CERTIFICATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_COOKIE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_EARLY_DATA 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_EC_PT_FORMATS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_EMS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_ETM 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_HELLO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_MAXFRAGMENTLEN 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_NPN 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_PADDING 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SCT 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SIG_ALGS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SRP 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_STATUS_REQUEST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_GROUPS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_USE_SRTP 0
|
||||
# define SSL_F_TLS_CONSTRUCT_CTOS_VERIFY 0
|
||||
# define SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_END_OF_EARLY_DATA 0
|
||||
# define SSL_F_TLS_CONSTRUCT_EXTENSIONS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_FINISHED 0
|
||||
# define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_HELLO_RETRY_REQUEST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_KEY_UPDATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_CONSTRUCT_NEXT_PROTO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_ALPN 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_CERTIFICATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_COOKIE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_CRYPTOPRO_BUG 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_DONE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_EC_PT_FORMATS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_EMS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_ETM 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_HELLO 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_PSK 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_STATUS_REQUEST 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_GROUPS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS 0
|
||||
# define SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP 0
|
||||
# define SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO 0
|
||||
# define SSL_F_TLS_FINISH_HANDSHAKE 0
|
||||
# define SSL_F_TLS_GET_MESSAGE_BODY 0
|
||||
# define SSL_F_TLS_GET_MESSAGE_HEADER 0
|
||||
# define SSL_F_TLS_HANDLE_ALPN 0
|
||||
# define SSL_F_TLS_HANDLE_STATUS_REQUEST 0
|
||||
# define SSL_F_TLS_PARSE_CERTIFICATE_AUTHORITIES 0
|
||||
# define SSL_F_TLS_PARSE_CLIENTHELLO_TLSEXT 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_ALPN 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_COOKIE 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_EARLY_DATA 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_EC_PT_FORMATS 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_EMS 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_KEY_SHARE 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_MAXFRAGMENTLEN 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_PSK 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_RENEGOTIATE 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SERVER_NAME 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS_CERT 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SRP 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_STATUS_REQUEST 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_SUPPORTED_GROUPS 0
|
||||
# define SSL_F_TLS_PARSE_CTOS_USE_SRTP 0
|
||||
# define SSL_F_TLS_PARSE_STOC_ALPN 0
|
||||
# define SSL_F_TLS_PARSE_STOC_COOKIE 0
|
||||
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA 0
|
||||
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA_INFO 0
|
||||
# define SSL_F_TLS_PARSE_STOC_EC_PT_FORMATS 0
|
||||
# define SSL_F_TLS_PARSE_STOC_KEY_SHARE 0
|
||||
# define SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN 0
|
||||
# define SSL_F_TLS_PARSE_STOC_NPN 0
|
||||
# define SSL_F_TLS_PARSE_STOC_PSK 0
|
||||
# define SSL_F_TLS_PARSE_STOC_RENEGOTIATE 0
|
||||
# define SSL_F_TLS_PARSE_STOC_SCT 0
|
||||
# define SSL_F_TLS_PARSE_STOC_SERVER_NAME 0
|
||||
# define SSL_F_TLS_PARSE_STOC_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_PARSE_STOC_STATUS_REQUEST 0
|
||||
# define SSL_F_TLS_PARSE_STOC_SUPPORTED_VERSIONS 0
|
||||
# define SSL_F_TLS_PARSE_STOC_USE_SRTP 0
|
||||
# define SSL_F_TLS_POST_PROCESS_CLIENT_HELLO 0
|
||||
# define SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_PREPARE_CLIENT_CERTIFICATE 0
|
||||
# define SSL_F_TLS_PROCESS_AS_HELLO_RETRY_REQUEST 0
|
||||
# define SSL_F_TLS_PROCESS_CERTIFICATE_REQUEST 0
|
||||
# define SSL_F_TLS_PROCESS_CERT_STATUS 0
|
||||
# define SSL_F_TLS_PROCESS_CERT_STATUS_BODY 0
|
||||
# define SSL_F_TLS_PROCESS_CERT_VERIFY 0
|
||||
# define SSL_F_TLS_PROCESS_CHANGE_CIPHER_SPEC 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_DHE 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_ECDHE 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_GOST 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_RSA 0
|
||||
# define SSL_F_TLS_PROCESS_CKE_SRP 0
|
||||
# define SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE 0
|
||||
# define SSL_F_TLS_PROCESS_CLIENT_HELLO 0
|
||||
# define SSL_F_TLS_PROCESS_CLIENT_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_PROCESS_ENCRYPTED_EXTENSIONS 0
|
||||
# define SSL_F_TLS_PROCESS_END_OF_EARLY_DATA 0
|
||||
# define SSL_F_TLS_PROCESS_FINISHED 0
|
||||
# define SSL_F_TLS_PROCESS_HELLO_REQ 0
|
||||
# define SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST 0
|
||||
# define SSL_F_TLS_PROCESS_INITIAL_SERVER_FLIGHT 0
|
||||
# define SSL_F_TLS_PROCESS_KEY_EXCHANGE 0
|
||||
# define SSL_F_TLS_PROCESS_KEY_UPDATE 0
|
||||
# define SSL_F_TLS_PROCESS_NEW_SESSION_TICKET 0
|
||||
# define SSL_F_TLS_PROCESS_NEXT_PROTO 0
|
||||
# define SSL_F_TLS_PROCESS_SERVER_CERTIFICATE 0
|
||||
# define SSL_F_TLS_PROCESS_SERVER_DONE 0
|
||||
# define SSL_F_TLS_PROCESS_SERVER_HELLO 0
|
||||
# define SSL_F_TLS_PROCESS_SKE_DHE 0
|
||||
# define SSL_F_TLS_PROCESS_SKE_ECDHE 0
|
||||
# define SSL_F_TLS_PROCESS_SKE_PSK_PREAMBLE 0
|
||||
# define SSL_F_TLS_PROCESS_SKE_SRP 0
|
||||
# define SSL_F_TLS_PSK_DO_BINDER 0
|
||||
# define SSL_F_TLS_SCAN_CLIENTHELLO_TLSEXT 0
|
||||
# define SSL_F_TLS_SETUP_HANDSHAKE 0
|
||||
# define SSL_F_USE_CERTIFICATE_CHAIN_FILE 0
|
||||
# define SSL_F_WPACKET_INTERN_INIT_LEN 0
|
||||
# define SSL_F_WPACKET_START_SUB_PACKET_LEN__ 0
|
||||
# define SSL_F_WRITE_STATE_MACHINE 0
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 1995-2021 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_STACK_H
|
||||
# define OPENSSL_STACK_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_STACK_H
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
|
||||
|
||||
typedef int (*OPENSSL_sk_compfunc)(const void *, const void *);
|
||||
typedef void (*OPENSSL_sk_freefunc)(void *);
|
||||
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
|
||||
|
||||
int OPENSSL_sk_num(const OPENSSL_STACK *);
|
||||
void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
|
||||
|
||||
void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data);
|
||||
|
||||
OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp);
|
||||
OPENSSL_STACK *OPENSSL_sk_new_null(void);
|
||||
OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n);
|
||||
int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n);
|
||||
void OPENSSL_sk_free(OPENSSL_STACK *);
|
||||
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
|
||||
OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *,
|
||||
OPENSSL_sk_copyfunc c,
|
||||
OPENSSL_sk_freefunc f);
|
||||
int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where);
|
||||
void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
|
||||
void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p);
|
||||
int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data);
|
||||
int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data);
|
||||
int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum);
|
||||
int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
|
||||
int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data);
|
||||
void *OPENSSL_sk_shift(OPENSSL_STACK *st);
|
||||
void *OPENSSL_sk_pop(OPENSSL_STACK *st);
|
||||
void OPENSSL_sk_zero(OPENSSL_STACK *st);
|
||||
OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk,
|
||||
OPENSSL_sk_compfunc cmp);
|
||||
OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st);
|
||||
void OPENSSL_sk_sort(OPENSSL_STACK *st);
|
||||
int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st);
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define _STACK OPENSSL_STACK
|
||||
# define sk_num OPENSSL_sk_num
|
||||
# define sk_value OPENSSL_sk_value
|
||||
# define sk_set OPENSSL_sk_set
|
||||
# define sk_new OPENSSL_sk_new
|
||||
# define sk_new_null OPENSSL_sk_new_null
|
||||
# define sk_free OPENSSL_sk_free
|
||||
# define sk_pop_free OPENSSL_sk_pop_free
|
||||
# define sk_deep_copy OPENSSL_sk_deep_copy
|
||||
# define sk_insert OPENSSL_sk_insert
|
||||
# define sk_delete OPENSSL_sk_delete
|
||||
# define sk_delete_ptr OPENSSL_sk_delete_ptr
|
||||
# define sk_find OPENSSL_sk_find
|
||||
# define sk_find_ex OPENSSL_sk_find_ex
|
||||
# define sk_push OPENSSL_sk_push
|
||||
# define sk_unshift OPENSSL_sk_unshift
|
||||
# define sk_shift OPENSSL_sk_shift
|
||||
# define sk_pop OPENSSL_sk_pop
|
||||
# define sk_zero OPENSSL_sk_zero
|
||||
# define sk_set_cmp_func OPENSSL_sk_set_cmp_func
|
||||
# define sk_dup OPENSSL_sk_dup
|
||||
# define sk_sort OPENSSL_sk_sort
|
||||
# define sk_is_sorted OPENSSL_sk_is_sorted
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 1999-2021 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_SYMHACKS_H
|
||||
# define OPENSSL_SYMHACKS_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_SYMHACKS_H
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
/* Case insensitive linking causes problems.... */
|
||||
# if defined(OPENSSL_SYS_VMS)
|
||||
# undef ERR_load_CRYPTO_strings
|
||||
# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
|
||||
# undef OCSP_crlID_new
|
||||
# define OCSP_crlID_new OCSP_crlID2_new
|
||||
|
||||
# undef d2i_ECPARAMETERS
|
||||
# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
|
||||
# undef i2d_ECPARAMETERS
|
||||
# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
|
||||
# undef d2i_ECPKPARAMETERS
|
||||
# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
|
||||
# undef i2d_ECPKPARAMETERS
|
||||
# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
|
||||
|
||||
# endif
|
||||
|
||||
#endif /* ! defined HEADER_VMS_IDHACKS_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright 2001-2022 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unfortunate workaround to avoid symbol conflict with wincrypt.h
|
||||
* See https://github.com/openssl/openssl/issues/9981
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
# define WINCRYPT_USE_SYMBOL_PREFIX
|
||||
# undef X509_NAME
|
||||
# undef X509_EXTENSIONS
|
||||
# undef PKCS7_SIGNER_INFO
|
||||
# undef OCSP_REQUEST
|
||||
# undef OCSP_RESPONSE
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_TYPES_H
|
||||
# define OPENSSL_TYPES_H
|
||||
|
||||
# include <limits.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/macros.h>
|
||||
|
||||
typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */
|
||||
|
||||
# ifdef NO_ASN1_TYPEDEFS
|
||||
# define ASN1_INTEGER ASN1_STRING
|
||||
# define ASN1_ENUMERATED ASN1_STRING
|
||||
# define ASN1_BIT_STRING ASN1_STRING
|
||||
# define ASN1_OCTET_STRING ASN1_STRING
|
||||
# define ASN1_PRINTABLESTRING ASN1_STRING
|
||||
# define ASN1_T61STRING ASN1_STRING
|
||||
# define ASN1_IA5STRING ASN1_STRING
|
||||
# define ASN1_UTCTIME ASN1_STRING
|
||||
# define ASN1_GENERALIZEDTIME ASN1_STRING
|
||||
# define ASN1_TIME ASN1_STRING
|
||||
# define ASN1_GENERALSTRING ASN1_STRING
|
||||
# define ASN1_UNIVERSALSTRING ASN1_STRING
|
||||
# define ASN1_BMPSTRING ASN1_STRING
|
||||
# define ASN1_VISIBLESTRING ASN1_STRING
|
||||
# define ASN1_UTF8STRING ASN1_STRING
|
||||
# define ASN1_BOOLEAN int
|
||||
# define ASN1_NULL int
|
||||
# else
|
||||
typedef struct asn1_string_st ASN1_INTEGER;
|
||||
typedef struct asn1_string_st ASN1_ENUMERATED;
|
||||
typedef struct asn1_string_st ASN1_BIT_STRING;
|
||||
typedef struct asn1_string_st ASN1_OCTET_STRING;
|
||||
typedef struct asn1_string_st ASN1_PRINTABLESTRING;
|
||||
typedef struct asn1_string_st ASN1_T61STRING;
|
||||
typedef struct asn1_string_st ASN1_IA5STRING;
|
||||
typedef struct asn1_string_st ASN1_GENERALSTRING;
|
||||
typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
|
||||
typedef struct asn1_string_st ASN1_BMPSTRING;
|
||||
typedef struct asn1_string_st ASN1_UTCTIME;
|
||||
typedef struct asn1_string_st ASN1_TIME;
|
||||
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
|
||||
typedef struct asn1_string_st ASN1_VISIBLESTRING;
|
||||
typedef struct asn1_string_st ASN1_UTF8STRING;
|
||||
typedef struct asn1_string_st ASN1_STRING;
|
||||
typedef int ASN1_BOOLEAN;
|
||||
typedef int ASN1_NULL;
|
||||
# endif
|
||||
|
||||
typedef struct asn1_type_st ASN1_TYPE;
|
||||
typedef struct asn1_object_st ASN1_OBJECT;
|
||||
typedef struct asn1_string_table_st ASN1_STRING_TABLE;
|
||||
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct asn1_pctx_st ASN1_PCTX;
|
||||
typedef struct asn1_sctx_st ASN1_SCTX;
|
||||
|
||||
# ifdef BIGNUM
|
||||
# undef BIGNUM
|
||||
# endif
|
||||
|
||||
typedef struct bio_st BIO;
|
||||
typedef struct bignum_st BIGNUM;
|
||||
typedef struct bignum_ctx BN_CTX;
|
||||
typedef struct bn_blinding_st BN_BLINDING;
|
||||
typedef struct bn_mont_ctx_st BN_MONT_CTX;
|
||||
typedef struct bn_recp_ctx_st BN_RECP_CTX;
|
||||
typedef struct bn_gencb_st BN_GENCB;
|
||||
|
||||
typedef struct buf_mem_st BUF_MEM;
|
||||
|
||||
STACK_OF(BIGNUM);
|
||||
STACK_OF(BIGNUM_const);
|
||||
|
||||
typedef struct err_state_st ERR_STATE;
|
||||
|
||||
typedef struct evp_cipher_st EVP_CIPHER;
|
||||
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
|
||||
typedef struct evp_md_st EVP_MD;
|
||||
typedef struct evp_md_ctx_st EVP_MD_CTX;
|
||||
typedef struct evp_mac_st EVP_MAC;
|
||||
typedef struct evp_mac_ctx_st EVP_MAC_CTX;
|
||||
typedef struct evp_pkey_st EVP_PKEY;
|
||||
|
||||
typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
|
||||
|
||||
typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
|
||||
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
|
||||
|
||||
typedef struct evp_keymgmt_st EVP_KEYMGMT;
|
||||
|
||||
typedef struct evp_kdf_st EVP_KDF;
|
||||
typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
|
||||
|
||||
typedef struct evp_rand_st EVP_RAND;
|
||||
typedef struct evp_rand_ctx_st EVP_RAND_CTX;
|
||||
|
||||
typedef struct evp_keyexch_st EVP_KEYEXCH;
|
||||
|
||||
typedef struct evp_signature_st EVP_SIGNATURE;
|
||||
|
||||
typedef struct evp_asym_cipher_st EVP_ASYM_CIPHER;
|
||||
|
||||
typedef struct evp_kem_st EVP_KEM;
|
||||
|
||||
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
|
||||
|
||||
typedef struct hmac_ctx_st HMAC_CTX;
|
||||
|
||||
typedef struct dh_st DH;
|
||||
typedef struct dh_method DH_METHOD;
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef struct dsa_st DSA;
|
||||
typedef struct dsa_method DSA_METHOD;
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef struct rsa_st RSA;
|
||||
typedef struct rsa_meth_st RSA_METHOD;
|
||||
# endif
|
||||
typedef struct rsa_pss_params_st RSA_PSS_PARAMS;
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef struct ec_key_st EC_KEY;
|
||||
typedef struct ec_key_method_st EC_KEY_METHOD;
|
||||
# endif
|
||||
|
||||
typedef struct rand_meth_st RAND_METHOD;
|
||||
typedef struct rand_drbg_st RAND_DRBG;
|
||||
|
||||
typedef struct ssl_dane_st SSL_DANE;
|
||||
typedef struct x509_st X509;
|
||||
typedef struct X509_algor_st X509_ALGOR;
|
||||
typedef struct X509_crl_st X509_CRL;
|
||||
typedef struct x509_crl_method_st X509_CRL_METHOD;
|
||||
typedef struct x509_revoked_st X509_REVOKED;
|
||||
typedef struct X509_name_st X509_NAME;
|
||||
typedef struct X509_pubkey_st X509_PUBKEY;
|
||||
typedef struct x509_store_st X509_STORE;
|
||||
typedef struct x509_store_ctx_st X509_STORE_CTX;
|
||||
|
||||
typedef struct x509_object_st X509_OBJECT;
|
||||
typedef struct x509_lookup_st X509_LOOKUP;
|
||||
typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
|
||||
typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
|
||||
|
||||
typedef struct x509_sig_info_st X509_SIG_INFO;
|
||||
|
||||
typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
|
||||
|
||||
typedef struct v3_ext_ctx X509V3_CTX;
|
||||
typedef struct conf_st CONF;
|
||||
typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
|
||||
|
||||
typedef struct ui_st UI;
|
||||
typedef struct ui_method_st UI_METHOD;
|
||||
|
||||
typedef struct engine_st ENGINE;
|
||||
typedef struct ssl_st SSL;
|
||||
typedef struct ssl_ctx_st SSL_CTX;
|
||||
|
||||
typedef struct comp_ctx_st COMP_CTX;
|
||||
typedef struct comp_method_st COMP_METHOD;
|
||||
|
||||
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
|
||||
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
|
||||
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
|
||||
typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
|
||||
|
||||
typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
|
||||
typedef struct DIST_POINT_st DIST_POINT;
|
||||
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
|
||||
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
|
||||
|
||||
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
|
||||
|
||||
typedef struct ossl_http_req_ctx_st OSSL_HTTP_REQ_CTX;
|
||||
typedef struct ocsp_response_st OCSP_RESPONSE;
|
||||
typedef struct ocsp_responder_id_st OCSP_RESPID;
|
||||
|
||||
typedef struct sct_st SCT;
|
||||
typedef struct sct_ctx_st SCT_CTX;
|
||||
typedef struct ctlog_st CTLOG;
|
||||
typedef struct ctlog_store_st CTLOG_STORE;
|
||||
typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
|
||||
|
||||
typedef struct ossl_store_info_st OSSL_STORE_INFO;
|
||||
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
|
||||
|
||||
typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;
|
||||
|
||||
typedef struct ossl_dispatch_st OSSL_DISPATCH;
|
||||
typedef struct ossl_item_st OSSL_ITEM;
|
||||
typedef struct ossl_algorithm_st OSSL_ALGORITHM;
|
||||
typedef struct ossl_param_st OSSL_PARAM;
|
||||
typedef struct ossl_param_bld_st OSSL_PARAM_BLD;
|
||||
|
||||
typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
|
||||
|
||||
typedef struct ossl_encoder_st OSSL_ENCODER;
|
||||
typedef struct ossl_encoder_ctx_st OSSL_ENCODER_CTX;
|
||||
typedef struct ossl_decoder_st OSSL_DECODER;
|
||||
typedef struct ossl_decoder_ctx_st OSSL_DECODER_CTX;
|
||||
|
||||
typedef struct ossl_self_test_st OSSL_SELF_TEST;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENSSL_TYPES_H */
|
||||
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/ui.h.in
|
||||
*
|
||||
* Copyright 2001-2020 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_UI_H
|
||||
# define OPENSSL_UI_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_UI_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# include <openssl/crypto.h>
|
||||
# endif
|
||||
# include <openssl/safestack.h>
|
||||
# include <openssl/pem.h>
|
||||
# include <openssl/types.h>
|
||||
# include <openssl/uierr.h>
|
||||
|
||||
/* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# ifdef OPENSSL_NO_UI_CONSOLE
|
||||
# define OPENSSL_NO_UI
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*
|
||||
* All the following functions return -1 or NULL on error and in some cases
|
||||
* (UI_process()) -2 if interrupted or in some other way cancelled. When
|
||||
* everything is fine, they return 0, a positive value or a non-NULL pointer,
|
||||
* all depending on their purpose.
|
||||
*/
|
||||
|
||||
/* Creators and destructor. */
|
||||
UI *UI_new(void);
|
||||
UI *UI_new_method(const UI_METHOD *method);
|
||||
void UI_free(UI *ui);
|
||||
|
||||
/*-
|
||||
The following functions are used to add strings to be printed and prompt
|
||||
strings to prompt for data. The names are UI_{add,dup}_<function>_string
|
||||
and UI_{add,dup}_input_boolean.
|
||||
|
||||
UI_{add,dup}_<function>_string have the following meanings:
|
||||
add add a text or prompt string. The pointers given to these
|
||||
functions are used verbatim, no copying is done.
|
||||
dup make a copy of the text or prompt string, then add the copy
|
||||
to the collection of strings in the user interface.
|
||||
<function>
|
||||
The function is a name for the functionality that the given
|
||||
string shall be used for. It can be one of:
|
||||
input use the string as data prompt.
|
||||
verify use the string as verification prompt. This
|
||||
is used to verify a previous input.
|
||||
info use the string for informational output.
|
||||
error use the string for error output.
|
||||
Honestly, there's currently no difference between info and error for the
|
||||
moment.
|
||||
|
||||
UI_{add,dup}_input_boolean have the same semantics for "add" and "dup",
|
||||
and are typically used when one wants to prompt for a yes/no response.
|
||||
|
||||
All of the functions in this group take a UI and a prompt string.
|
||||
The string input and verify addition functions also take a flag argument,
|
||||
a buffer for the result to end up with, a minimum input size and a maximum
|
||||
input size (the result buffer MUST be large enough to be able to contain
|
||||
the maximum number of characters). Additionally, the verify addition
|
||||
functions takes another buffer to compare the result against.
|
||||
The boolean input functions take an action description string (which should
|
||||
be safe to ignore if the expected user action is obvious, for example with
|
||||
a dialog box with an OK button and a Cancel button), a string of acceptable
|
||||
characters to mean OK and to mean Cancel. The two last strings are checked
|
||||
to make sure they don't have common characters. Additionally, the same
|
||||
flag argument as for the string input is taken, as well as a result buffer.
|
||||
The result buffer is required to be at least one byte long. Depending on
|
||||
the answer, the first character from the OK or the Cancel character strings
|
||||
will be stored in the first byte of the result buffer. No NUL will be
|
||||
added, so the result is *not* a string.
|
||||
|
||||
On success, the all return an index of the added information. That index
|
||||
is useful when retrieving results with UI_get0_result(). */
|
||||
int UI_add_input_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize);
|
||||
int UI_dup_input_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize);
|
||||
int UI_add_verify_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize,
|
||||
const char *test_buf);
|
||||
int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
|
||||
char *result_buf, int minsize, int maxsize,
|
||||
const char *test_buf);
|
||||
int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
||||
const char *ok_chars, const char *cancel_chars,
|
||||
int flags, char *result_buf);
|
||||
int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
||||
const char *ok_chars, const char *cancel_chars,
|
||||
int flags, char *result_buf);
|
||||
int UI_add_info_string(UI *ui, const char *text);
|
||||
int UI_dup_info_string(UI *ui, const char *text);
|
||||
int UI_add_error_string(UI *ui, const char *text);
|
||||
int UI_dup_error_string(UI *ui, const char *text);
|
||||
|
||||
/* These are the possible flags. They can be or'ed together. */
|
||||
/* Use to have echoing of input */
|
||||
# define UI_INPUT_FLAG_ECHO 0x01
|
||||
/*
|
||||
* Use a default password. Where that password is found is completely up to
|
||||
* the application, it might for example be in the user data set with
|
||||
* UI_add_user_data(). It is not recommended to have more than one input in
|
||||
* each UI being marked with this flag, or the application might get
|
||||
* confused.
|
||||
*/
|
||||
# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
|
||||
|
||||
/*-
|
||||
* The user of these routines may want to define flags of their own. The core
|
||||
* UI won't look at those, but will pass them on to the method routines. They
|
||||
* must use higher bits so they don't get confused with the UI bits above.
|
||||
* UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good
|
||||
* example of use is this:
|
||||
*
|
||||
* #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE)
|
||||
*
|
||||
*/
|
||||
# define UI_INPUT_FLAG_USER_BASE 16
|
||||
|
||||
/*-
|
||||
* The following function helps construct a prompt.
|
||||
* phrase_desc is a textual short description of the phrase to enter,
|
||||
* for example "pass phrase", and
|
||||
* object_name is the name of the object
|
||||
* (which might be a card name or a file name) or NULL.
|
||||
* The returned string shall always be allocated on the heap with
|
||||
* OPENSSL_malloc(), and need to be free'd with OPENSSL_free().
|
||||
*
|
||||
* If the ui_method doesn't contain a pointer to a user-defined prompt
|
||||
* constructor, a default string is built, looking like this:
|
||||
*
|
||||
* "Enter {phrase_desc} for {object_name}:"
|
||||
*
|
||||
* So, if phrase_desc has the value "pass phrase" and object_name has
|
||||
* the value "foo.key", the resulting string is:
|
||||
*
|
||||
* "Enter pass phrase for foo.key:"
|
||||
*/
|
||||
char *UI_construct_prompt(UI *ui_method,
|
||||
const char *phrase_desc, const char *object_name);
|
||||
|
||||
/*
|
||||
* The following function is used to store a pointer to user-specific data.
|
||||
* Any previous such pointer will be returned and replaced.
|
||||
*
|
||||
* For callback purposes, this function makes a lot more sense than using
|
||||
* ex_data, since the latter requires that different parts of OpenSSL or
|
||||
* applications share the same ex_data index.
|
||||
*
|
||||
* Note that the UI_OpenSSL() method completely ignores the user data. Other
|
||||
* methods may not, however.
|
||||
*/
|
||||
void *UI_add_user_data(UI *ui, void *user_data);
|
||||
/*
|
||||
* Alternatively, this function is used to duplicate the user data.
|
||||
* This uses the duplicator method function. The destroy function will
|
||||
* be used to free the user data in this case.
|
||||
*/
|
||||
int UI_dup_user_data(UI *ui, void *user_data);
|
||||
/* We need a user data retrieving function as well. */
|
||||
void *UI_get0_user_data(UI *ui);
|
||||
|
||||
/* Return the result associated with a prompt given with the index i. */
|
||||
const char *UI_get0_result(UI *ui, int i);
|
||||
int UI_get_result_length(UI *ui, int i);
|
||||
|
||||
/* When all strings have been added, process the whole thing. */
|
||||
int UI_process(UI *ui);
|
||||
|
||||
/*
|
||||
* Give a user interface parameterised control commands. This can be used to
|
||||
* send down an integer, a data pointer or a function pointer, as well as be
|
||||
* used to get information from a UI.
|
||||
*/
|
||||
int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));
|
||||
|
||||
/* The commands */
|
||||
/*
|
||||
* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the
|
||||
* OpenSSL error stack before printing any info or added error messages and
|
||||
* before any prompting.
|
||||
*/
|
||||
# define UI_CTRL_PRINT_ERRORS 1
|
||||
/*
|
||||
* Check if a UI_process() is possible to do again with the same instance of
|
||||
* a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0
|
||||
* if not.
|
||||
*/
|
||||
# define UI_CTRL_IS_REDOABLE 2
|
||||
|
||||
/* Some methods may use extra data */
|
||||
# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
|
||||
# define UI_get_app_data(s) UI_get_ex_data(s,0)
|
||||
|
||||
# define UI_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef)
|
||||
int UI_set_ex_data(UI *r, int idx, void *arg);
|
||||
void *UI_get_ex_data(const UI *r, int idx);
|
||||
|
||||
/* Use specific methods instead of the built-in one */
|
||||
void UI_set_default_method(const UI_METHOD *meth);
|
||||
const UI_METHOD *UI_get_default_method(void);
|
||||
const UI_METHOD *UI_get_method(UI *ui);
|
||||
const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
|
||||
|
||||
# ifndef OPENSSL_NO_UI_CONSOLE
|
||||
|
||||
/* The method with all the built-in thingies */
|
||||
UI_METHOD *UI_OpenSSL(void);
|
||||
|
||||
# endif
|
||||
|
||||
/*
|
||||
* NULL method. Literally does nothing, but may serve as a placeholder
|
||||
* to avoid internal default.
|
||||
*/
|
||||
const UI_METHOD *UI_null(void);
|
||||
|
||||
/* ---------- For method writers ---------- */
|
||||
/*-
|
||||
A method contains a number of functions that implement the low level
|
||||
of the User Interface. The functions are:
|
||||
|
||||
an opener This function starts a session, maybe by opening
|
||||
a channel to a tty, or by opening a window.
|
||||
a writer This function is called to write a given string,
|
||||
maybe to the tty, maybe as a field label in a
|
||||
window.
|
||||
a flusher This function is called to flush everything that
|
||||
has been output so far. It can be used to actually
|
||||
display a dialog box after it has been built.
|
||||
a reader This function is called to read a given prompt,
|
||||
maybe from the tty, maybe from a field in a
|
||||
window. Note that it's called with all string
|
||||
structures, not only the prompt ones, so it must
|
||||
check such things itself.
|
||||
a closer This function closes the session, maybe by closing
|
||||
the channel to the tty, or closing the window.
|
||||
|
||||
All these functions are expected to return:
|
||||
|
||||
0 on error.
|
||||
1 on success.
|
||||
-1 on out-of-band events, for example if some prompting has
|
||||
been canceled (by pressing Ctrl-C, for example). This is
|
||||
only checked when returned by the flusher or the reader.
|
||||
|
||||
The way this is used, the opener is first called, then the writer for all
|
||||
strings, then the flusher, then the reader for all strings and finally the
|
||||
closer. Note that if you want to prompt from a terminal or other command
|
||||
line interface, the best is to have the reader also write the prompts
|
||||
instead of having the writer do it. If you want to prompt from a dialog
|
||||
box, the writer can be used to build up the contents of the box, and the
|
||||
flusher to actually display the box and run the event loop until all data
|
||||
has been given, after which the reader only grabs the given data and puts
|
||||
them back into the UI strings.
|
||||
|
||||
All method functions take a UI as argument. Additionally, the writer and
|
||||
the reader take a UI_STRING.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The UI_STRING type is the data structure that contains all the needed info
|
||||
* about a string or a prompt, including test data for a verification prompt.
|
||||
*/
|
||||
typedef struct ui_string_st UI_STRING;
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(UI_STRING, UI_STRING, UI_STRING)
|
||||
#define sk_UI_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_UI_STRING_sk_type(sk))
|
||||
#define sk_UI_STRING_value(sk, idx) ((UI_STRING *)OPENSSL_sk_value(ossl_check_const_UI_STRING_sk_type(sk), (idx)))
|
||||
#define sk_UI_STRING_new(cmp) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new(ossl_check_UI_STRING_compfunc_type(cmp)))
|
||||
#define sk_UI_STRING_new_null() ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_null())
|
||||
#define sk_UI_STRING_new_reserve(cmp, n) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_reserve(ossl_check_UI_STRING_compfunc_type(cmp), (n)))
|
||||
#define sk_UI_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_UI_STRING_sk_type(sk), (n))
|
||||
#define sk_UI_STRING_free(sk) OPENSSL_sk_free(ossl_check_UI_STRING_sk_type(sk))
|
||||
#define sk_UI_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_UI_STRING_sk_type(sk))
|
||||
#define sk_UI_STRING_delete(sk, i) ((UI_STRING *)OPENSSL_sk_delete(ossl_check_UI_STRING_sk_type(sk), (i)))
|
||||
#define sk_UI_STRING_delete_ptr(sk, ptr) ((UI_STRING *)OPENSSL_sk_delete_ptr(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)))
|
||||
#define sk_UI_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
||||
#define sk_UI_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
||||
#define sk_UI_STRING_pop(sk) ((UI_STRING *)OPENSSL_sk_pop(ossl_check_UI_STRING_sk_type(sk)))
|
||||
#define sk_UI_STRING_shift(sk) ((UI_STRING *)OPENSSL_sk_shift(ossl_check_UI_STRING_sk_type(sk)))
|
||||
#define sk_UI_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_UI_STRING_sk_type(sk),ossl_check_UI_STRING_freefunc_type(freefunc))
|
||||
#define sk_UI_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), (idx))
|
||||
#define sk_UI_STRING_set(sk, idx, ptr) ((UI_STRING *)OPENSSL_sk_set(ossl_check_UI_STRING_sk_type(sk), (idx), ossl_check_UI_STRING_type(ptr)))
|
||||
#define sk_UI_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
||||
#define sk_UI_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
||||
#define sk_UI_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), pnum)
|
||||
#define sk_UI_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_UI_STRING_sk_type(sk))
|
||||
#define sk_UI_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_UI_STRING_sk_type(sk))
|
||||
#define sk_UI_STRING_dup(sk) ((STACK_OF(UI_STRING) *)OPENSSL_sk_dup(ossl_check_const_UI_STRING_sk_type(sk)))
|
||||
#define sk_UI_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(UI_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_UI_STRING_sk_type(sk), ossl_check_UI_STRING_copyfunc_type(copyfunc), ossl_check_UI_STRING_freefunc_type(freefunc)))
|
||||
#define sk_UI_STRING_set_cmp_func(sk, cmp) ((sk_UI_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_compfunc_type(cmp)))
|
||||
|
||||
|
||||
/*
|
||||
* The different types of strings that are currently supported. This is only
|
||||
* needed by method authors.
|
||||
*/
|
||||
enum UI_string_types {
|
||||
UIT_NONE = 0,
|
||||
UIT_PROMPT, /* Prompt for a string */
|
||||
UIT_VERIFY, /* Prompt for a string and verify */
|
||||
UIT_BOOLEAN, /* Prompt for a yes/no response */
|
||||
UIT_INFO, /* Send info to the user */
|
||||
UIT_ERROR /* Send an error message to the user */
|
||||
};
|
||||
|
||||
/* Create and manipulate methods */
|
||||
UI_METHOD *UI_create_method(const char *name);
|
||||
void UI_destroy_method(UI_METHOD *ui_method);
|
||||
int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));
|
||||
int UI_method_set_writer(UI_METHOD *method,
|
||||
int (*writer) (UI *ui, UI_STRING *uis));
|
||||
int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));
|
||||
int UI_method_set_reader(UI_METHOD *method,
|
||||
int (*reader) (UI *ui, UI_STRING *uis));
|
||||
int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
|
||||
int UI_method_set_data_duplicator(UI_METHOD *method,
|
||||
void *(*duplicator) (UI *ui, void *ui_data),
|
||||
void (*destructor)(UI *ui, void *ui_data));
|
||||
int UI_method_set_prompt_constructor(UI_METHOD *method,
|
||||
char *(*prompt_constructor) (UI *ui,
|
||||
const char
|
||||
*phrase_desc,
|
||||
const char
|
||||
*object_name));
|
||||
int UI_method_set_ex_data(UI_METHOD *method, int idx, void *data);
|
||||
int (*UI_method_get_opener(const UI_METHOD *method)) (UI *);
|
||||
int (*UI_method_get_writer(const UI_METHOD *method)) (UI *, UI_STRING *);
|
||||
int (*UI_method_get_flusher(const UI_METHOD *method)) (UI *);
|
||||
int (*UI_method_get_reader(const UI_METHOD *method)) (UI *, UI_STRING *);
|
||||
int (*UI_method_get_closer(const UI_METHOD *method)) (UI *);
|
||||
char *(*UI_method_get_prompt_constructor(const UI_METHOD *method))
|
||||
(UI *, const char *, const char *);
|
||||
void *(*UI_method_get_data_duplicator(const UI_METHOD *method)) (UI *, void *);
|
||||
void (*UI_method_get_data_destructor(const UI_METHOD *method)) (UI *, void *);
|
||||
const void *UI_method_get_ex_data(const UI_METHOD *method, int idx);
|
||||
|
||||
/*
|
||||
* The following functions are helpers for method writers to access relevant
|
||||
* data from a UI_STRING.
|
||||
*/
|
||||
|
||||
/* Return type of the UI_STRING */
|
||||
enum UI_string_types UI_get_string_type(UI_STRING *uis);
|
||||
/* Return input flags of the UI_STRING */
|
||||
int UI_get_input_flags(UI_STRING *uis);
|
||||
/* Return the actual string to output (the prompt, info or error) */
|
||||
const char *UI_get0_output_string(UI_STRING *uis);
|
||||
/*
|
||||
* Return the optional action string to output (the boolean prompt
|
||||
* instruction)
|
||||
*/
|
||||
const char *UI_get0_action_string(UI_STRING *uis);
|
||||
/* Return the result of a prompt */
|
||||
const char *UI_get0_result_string(UI_STRING *uis);
|
||||
int UI_get_result_string_length(UI_STRING *uis);
|
||||
/*
|
||||
* Return the string to test the result against. Only useful with verifies.
|
||||
*/
|
||||
const char *UI_get0_test_string(UI_STRING *uis);
|
||||
/* Return the required minimum size of the result */
|
||||
int UI_get_result_minsize(UI_STRING *uis);
|
||||
/* Return the required maximum size of the result */
|
||||
int UI_get_result_maxsize(UI_STRING *uis);
|
||||
/* Set the result of a UI_STRING. */
|
||||
int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
|
||||
int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len);
|
||||
|
||||
/* A couple of popular utility functions */
|
||||
int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
|
||||
int verify);
|
||||
int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
|
||||
int verify);
|
||||
UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2021 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_UIERR_H
|
||||
# define OPENSSL_UIERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* UI reason codes.
|
||||
*/
|
||||
# define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104
|
||||
# define UI_R_INDEX_TOO_LARGE 102
|
||||
# define UI_R_INDEX_TOO_SMALL 103
|
||||
# define UI_R_NO_RESULT_BUFFER 105
|
||||
# define UI_R_PROCESSING_ERROR 107
|
||||
# define UI_R_RESULT_TOO_LARGE 100
|
||||
# define UI_R_RESULT_TOO_SMALL 101
|
||||
# define UI_R_SYSASSIGN_ERROR 109
|
||||
# define UI_R_SYSDASSGN_ERROR 110
|
||||
# define UI_R_SYSQIOW_ERROR 111
|
||||
# define UI_R_UNKNOWN_CONTROL_COMMAND 106
|
||||
# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108
|
||||
# define UI_R_USER_DATA_DUPLICATION_UNSUPPORTED 112
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2005-2020 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_WHRLPOOL_H
|
||||
# define OPENSSL_WHRLPOOL_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_WHRLPOOL_H
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_WHIRLPOOL
|
||||
# include <openssl/e_os2.h>
|
||||
# include <stddef.h>
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define WHIRLPOOL_DIGEST_LENGTH (512/8)
|
||||
|
||||
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||
|
||||
# define WHIRLPOOL_BBLOCK 512
|
||||
# define WHIRLPOOL_COUNTER (256/8)
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
|
||||
/* double q is here to ensure 64-bit alignment */
|
||||
double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
|
||||
} H;
|
||||
unsigned char data[WHIRLPOOL_BBLOCK / 8];
|
||||
unsigned int bitoff;
|
||||
size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
|
||||
} WHIRLPOOL_CTX;
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c,
|
||||
const void *inp, size_t bytes);
|
||||
OSSL_DEPRECATEDIN_3_0 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,
|
||||
const void *inp, size_t bits);
|
||||
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
|
||||
OSSL_DEPRECATEDIN_3_0 unsigned char *WHIRLPOOL(const void *inp, size_t bytes,
|
||||
unsigned char *md);
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,894 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/x509_vfy.h.in
|
||||
*
|
||||
* Copyright 1995-2021 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_X509_VFY_H
|
||||
# define OPENSSL_X509_VFY_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/macros.h>
|
||||
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
# define HEADER_X509_VFY_H
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Protect against recursion, x509.h and x509_vfy.h each include the other.
|
||||
*/
|
||||
# ifndef OPENSSL_X509_H
|
||||
# include <openssl/x509.h>
|
||||
# endif
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/lhash.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/symhacks.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-
|
||||
SSL_CTX -> X509_STORE
|
||||
-> X509_LOOKUP
|
||||
->X509_LOOKUP_METHOD
|
||||
-> X509_LOOKUP
|
||||
->X509_LOOKUP_METHOD
|
||||
|
||||
SSL -> X509_STORE_CTX
|
||||
->X509_STORE
|
||||
|
||||
The X509_STORE holds the tables etc for verification stuff.
|
||||
A X509_STORE_CTX is used while validating a single certificate.
|
||||
The X509_STORE has X509_LOOKUPs for looking up certs.
|
||||
The X509_STORE then calls a function to actually verify the
|
||||
certificate chain.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
X509_LU_NONE = 0,
|
||||
X509_LU_X509, X509_LU_CRL
|
||||
} X509_LOOKUP_TYPE;
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define X509_LU_RETRY -1
|
||||
#define X509_LU_FAIL 0
|
||||
#endif
|
||||
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP)
|
||||
#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
||||
#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
|
||||
#define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
||||
#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
|
||||
#define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n)))
|
||||
#define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n))
|
||||
#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
|
||||
#define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk))
|
||||
#define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i)))
|
||||
#define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)))
|
||||
#define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
||||
#define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
||||
#define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk)))
|
||||
#define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk)))
|
||||
#define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk),ossl_check_X509_LOOKUP_freefunc_type(freefunc))
|
||||
#define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx))
|
||||
#define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr)))
|
||||
#define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
||||
#define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
||||
#define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum)
|
||||
#define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk))
|
||||
#define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
||||
#define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk)))
|
||||
#define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc)))
|
||||
#define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT)
|
||||
#define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
|
||||
#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
|
||||
#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
||||
#define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null())
|
||||
#define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n)))
|
||||
#define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n))
|
||||
#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
|
||||
#define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk))
|
||||
#define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i)))
|
||||
#define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)))
|
||||
#define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
||||
#define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
||||
#define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk)))
|
||||
#define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk)))
|
||||
#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk),ossl_check_X509_OBJECT_freefunc_type(freefunc))
|
||||
#define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx))
|
||||
#define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr)))
|
||||
#define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
||||
#define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
||||
#define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum)
|
||||
#define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk))
|
||||
#define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk))
|
||||
#define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk)))
|
||||
#define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
|
||||
#define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
|
||||
#define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
||||
#define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
|
||||
#define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
||||
#define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null())
|
||||
#define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n)))
|
||||
#define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n))
|
||||
#define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
||||
#define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
||||
#define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i)))
|
||||
#define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
||||
#define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
||||
#define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
||||
#define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
||||
#define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
||||
#define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk),ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))
|
||||
#define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx))
|
||||
#define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
||||
#define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
||||
#define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
||||
#define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum)
|
||||
#define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
||||
#define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
||||
#define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)))
|
||||
#define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)))
|
||||
#define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
||||
|
||||
|
||||
/* This is used for a table of trust checking functions */
|
||||
typedef struct x509_trust_st {
|
||||
int trust;
|
||||
int flags;
|
||||
int (*check_trust) (struct x509_trust_st *, X509 *, int);
|
||||
char *name;
|
||||
int arg1;
|
||||
void *arg2;
|
||||
} X509_TRUST;
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST)
|
||||
#define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk))
|
||||
#define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx)))
|
||||
#define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp)))
|
||||
#define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null())
|
||||
#define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n)))
|
||||
#define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n))
|
||||
#define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk))
|
||||
#define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk))
|
||||
#define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i)))
|
||||
#define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)))
|
||||
#define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
||||
#define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
||||
#define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk)))
|
||||
#define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk)))
|
||||
#define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk),ossl_check_X509_TRUST_freefunc_type(freefunc))
|
||||
#define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx))
|
||||
#define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr)))
|
||||
#define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
||||
#define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
||||
#define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum)
|
||||
#define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk))
|
||||
#define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk))
|
||||
#define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk)))
|
||||
#define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc)))
|
||||
#define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp)))
|
||||
|
||||
|
||||
/* standard trust ids */
|
||||
# define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */
|
||||
# define X509_TRUST_COMPAT 1
|
||||
# define X509_TRUST_SSL_CLIENT 2
|
||||
# define X509_TRUST_SSL_SERVER 3
|
||||
# define X509_TRUST_EMAIL 4
|
||||
# define X509_TRUST_OBJECT_SIGN 5
|
||||
# define X509_TRUST_OCSP_SIGN 6
|
||||
# define X509_TRUST_OCSP_REQUEST 7
|
||||
# define X509_TRUST_TSA 8
|
||||
/* Keep these up to date! */
|
||||
# define X509_TRUST_MIN 1
|
||||
# define X509_TRUST_MAX 8
|
||||
|
||||
/* trust_flags values */
|
||||
# define X509_TRUST_DYNAMIC (1U << 0)
|
||||
# define X509_TRUST_DYNAMIC_NAME (1U << 1)
|
||||
/* No compat trust if self-signed, preempts "DO_SS" */
|
||||
# define X509_TRUST_NO_SS_COMPAT (1U << 2)
|
||||
/* Compat trust if no explicit accepted trust EKUs */
|
||||
# define X509_TRUST_DO_SS_COMPAT (1U << 3)
|
||||
/* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */
|
||||
# define X509_TRUST_OK_ANY_EKU (1U << 4)
|
||||
|
||||
/* check_trust return codes */
|
||||
# define X509_TRUST_TRUSTED 1
|
||||
# define X509_TRUST_REJECTED 2
|
||||
# define X509_TRUST_UNTRUSTED 3
|
||||
|
||||
int X509_TRUST_set(int *t, int trust);
|
||||
int X509_TRUST_get_count(void);
|
||||
X509_TRUST *X509_TRUST_get0(int idx);
|
||||
int X509_TRUST_get_by_id(int id);
|
||||
int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
|
||||
const char *name, int arg1, void *arg2);
|
||||
void X509_TRUST_cleanup(void);
|
||||
int X509_TRUST_get_flags(const X509_TRUST *xp);
|
||||
char *X509_TRUST_get0_name(const X509_TRUST *xp);
|
||||
int X509_TRUST_get_trust(const X509_TRUST *xp);
|
||||
|
||||
int X509_trusted(const X509 *x);
|
||||
int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
|
||||
int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
|
||||
void X509_trust_clear(X509 *x);
|
||||
void X509_reject_clear(X509 *x);
|
||||
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
|
||||
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
|
||||
|
||||
int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
|
||||
int);
|
||||
int X509_check_trust(X509 *x, int id, int flags);
|
||||
|
||||
int X509_verify_cert(X509_STORE_CTX *ctx);
|
||||
int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
|
||||
STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
|
||||
X509_STORE *store, int with_self_signed,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
int X509_STORE_set_depth(X509_STORE *store, int depth);
|
||||
|
||||
typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
|
||||
int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
|
||||
typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
|
||||
typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
|
||||
X509_STORE_CTX *ctx, X509 *x);
|
||||
typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
|
||||
X509 *x, X509 *issuer);
|
||||
typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
|
||||
typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
|
||||
X509_CRL **crl, X509 *x);
|
||||
typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
|
||||
typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
|
||||
X509_CRL *crl, X509 *x);
|
||||
typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
|
||||
typedef STACK_OF(X509)
|
||||
*(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
|
||||
const X509_NAME *nm);
|
||||
typedef STACK_OF(X509_CRL)
|
||||
*(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
|
||||
const X509_NAME *nm);
|
||||
typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
|
||||
|
||||
void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
|
||||
|
||||
# define X509_STORE_CTX_set_app_data(ctx,data) \
|
||||
X509_STORE_CTX_set_ex_data(ctx,0,data)
|
||||
# define X509_STORE_CTX_get_app_data(ctx) \
|
||||
X509_STORE_CTX_get_ex_data(ctx,0)
|
||||
|
||||
# define X509_L_FILE_LOAD 1
|
||||
# define X509_L_ADD_DIR 2
|
||||
# define X509_L_ADD_STORE 3
|
||||
# define X509_L_LOAD_STORE 4
|
||||
|
||||
# define X509_LOOKUP_load_file(x,name,type) \
|
||||
X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
|
||||
|
||||
# define X509_LOOKUP_add_dir(x,name,type) \
|
||||
X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
|
||||
|
||||
# define X509_LOOKUP_add_store(x,name) \
|
||||
X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL)
|
||||
|
||||
# define X509_LOOKUP_load_store(x,name) \
|
||||
X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL)
|
||||
|
||||
# define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \
|
||||
X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\
|
||||
(libctx), (propq))
|
||||
|
||||
# define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \
|
||||
X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \
|
||||
(libctx), (propq))
|
||||
|
||||
# define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \
|
||||
X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \
|
||||
(libctx), (propq))
|
||||
|
||||
# define X509_V_OK 0
|
||||
# define X509_V_ERR_UNSPECIFIED 1
|
||||
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
|
||||
# define X509_V_ERR_UNABLE_TO_GET_CRL 3
|
||||
# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
|
||||
# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
|
||||
# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
|
||||
# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
|
||||
# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
|
||||
# define X509_V_ERR_CERT_NOT_YET_VALID 9
|
||||
# define X509_V_ERR_CERT_HAS_EXPIRED 10
|
||||
# define X509_V_ERR_CRL_NOT_YET_VALID 11
|
||||
# define X509_V_ERR_CRL_HAS_EXPIRED 12
|
||||
# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
|
||||
# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
|
||||
# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
|
||||
# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
|
||||
# define X509_V_ERR_OUT_OF_MEM 17
|
||||
# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
|
||||
# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
|
||||
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
|
||||
# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
|
||||
# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
|
||||
# define X509_V_ERR_CERT_REVOKED 23
|
||||
# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
|
||||
# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
|
||||
# define X509_V_ERR_INVALID_PURPOSE 26
|
||||
# define X509_V_ERR_CERT_UNTRUSTED 27
|
||||
# define X509_V_ERR_CERT_REJECTED 28
|
||||
|
||||
/* These are 'informational' when looking for issuer cert */
|
||||
# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
|
||||
# define X509_V_ERR_AKID_SKID_MISMATCH 30
|
||||
# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
|
||||
# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
|
||||
# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
|
||||
# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
|
||||
# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
|
||||
# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
|
||||
# define X509_V_ERR_INVALID_NON_CA 37
|
||||
# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
|
||||
# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
|
||||
# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
|
||||
# define X509_V_ERR_INVALID_EXTENSION 41
|
||||
# define X509_V_ERR_INVALID_POLICY_EXTENSION 42
|
||||
# define X509_V_ERR_NO_EXPLICIT_POLICY 43
|
||||
# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
|
||||
# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
|
||||
# define X509_V_ERR_UNNESTED_RESOURCE 46
|
||||
# define X509_V_ERR_PERMITTED_VIOLATION 47
|
||||
# define X509_V_ERR_EXCLUDED_VIOLATION 48
|
||||
# define X509_V_ERR_SUBTREE_MINMAX 49
|
||||
/* The application is not happy */
|
||||
# define X509_V_ERR_APPLICATION_VERIFICATION 50
|
||||
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
|
||||
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
|
||||
# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
|
||||
# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
|
||||
/* Another issuer check debug option */
|
||||
# define X509_V_ERR_PATH_LOOP 55
|
||||
/* Suite B mode algorithm violation */
|
||||
# define X509_V_ERR_SUITE_B_INVALID_VERSION 56
|
||||
# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
|
||||
# define X509_V_ERR_SUITE_B_INVALID_CURVE 58
|
||||
# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
|
||||
# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
|
||||
# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
|
||||
/* Host, email and IP check errors */
|
||||
# define X509_V_ERR_HOSTNAME_MISMATCH 62
|
||||
# define X509_V_ERR_EMAIL_MISMATCH 63
|
||||
# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
|
||||
/* DANE TLSA errors */
|
||||
# define X509_V_ERR_DANE_NO_MATCH 65
|
||||
/* security level errors */
|
||||
# define X509_V_ERR_EE_KEY_TOO_SMALL 66
|
||||
# define X509_V_ERR_CA_KEY_TOO_SMALL 67
|
||||
# define X509_V_ERR_CA_MD_TOO_WEAK 68
|
||||
/* Caller error */
|
||||
# define X509_V_ERR_INVALID_CALL 69
|
||||
/* Issuer lookup error */
|
||||
# define X509_V_ERR_STORE_LOOKUP 70
|
||||
/* Certificate transparency */
|
||||
# define X509_V_ERR_NO_VALID_SCTS 71
|
||||
|
||||
# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72
|
||||
/* OCSP status errors */
|
||||
# define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */
|
||||
# define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */
|
||||
# define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */
|
||||
|
||||
# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
|
||||
# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
|
||||
|
||||
/* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */
|
||||
# define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78
|
||||
# define X509_V_ERR_INVALID_CA 79
|
||||
# define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80
|
||||
# define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81
|
||||
# define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82
|
||||
# define X509_V_ERR_ISSUER_NAME_EMPTY 83
|
||||
# define X509_V_ERR_SUBJECT_NAME_EMPTY 84
|
||||
# define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85
|
||||
# define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86
|
||||
# define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87
|
||||
# define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88
|
||||
# define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89
|
||||
# define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90
|
||||
# define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91
|
||||
# define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92
|
||||
# define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93
|
||||
# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
|
||||
|
||||
/* Certificate verify flags */
|
||||
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */
|
||||
# endif
|
||||
/* Use check time instead of current time */
|
||||
# define X509_V_FLAG_USE_CHECK_TIME 0x2
|
||||
/* Lookup CRLs */
|
||||
# define X509_V_FLAG_CRL_CHECK 0x4
|
||||
/* Lookup CRLs for whole chain */
|
||||
# define X509_V_FLAG_CRL_CHECK_ALL 0x8
|
||||
/* Ignore unhandled critical extensions */
|
||||
# define X509_V_FLAG_IGNORE_CRITICAL 0x10
|
||||
/* Disable workarounds for broken certificates */
|
||||
# define X509_V_FLAG_X509_STRICT 0x20
|
||||
/* Enable proxy certificate validation */
|
||||
# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
|
||||
/* Enable policy checking */
|
||||
# define X509_V_FLAG_POLICY_CHECK 0x80
|
||||
/* Policy variable require-explicit-policy */
|
||||
# define X509_V_FLAG_EXPLICIT_POLICY 0x100
|
||||
/* Policy variable inhibit-any-policy */
|
||||
# define X509_V_FLAG_INHIBIT_ANY 0x200
|
||||
/* Policy variable inhibit-policy-mapping */
|
||||
# define X509_V_FLAG_INHIBIT_MAP 0x400
|
||||
/* Notify callback that policy is OK */
|
||||
# define X509_V_FLAG_NOTIFY_POLICY 0x800
|
||||
/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
|
||||
# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
|
||||
/* Delta CRL support */
|
||||
# define X509_V_FLAG_USE_DELTAS 0x2000
|
||||
/* Check self-signed CA signature */
|
||||
# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
|
||||
/* Use trusted store first */
|
||||
# define X509_V_FLAG_TRUSTED_FIRST 0x8000
|
||||
/* Suite B 128 bit only mode: not normally used */
|
||||
# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
|
||||
/* Suite B 192 bit only mode */
|
||||
# define X509_V_FLAG_SUITEB_192_LOS 0x20000
|
||||
/* Suite B 128 bit mode allowing 192 bit algorithms */
|
||||
# define X509_V_FLAG_SUITEB_128_LOS 0x30000
|
||||
/* Allow partial chains if at least one certificate is in trusted store */
|
||||
# define X509_V_FLAG_PARTIAL_CHAIN 0x80000
|
||||
/*
|
||||
* If the initial chain is not trusted, do not attempt to build an alternative
|
||||
* chain. Alternate chain checking was introduced in 1.1.0. Setting this flag
|
||||
* will force the behaviour to match that of previous versions.
|
||||
*/
|
||||
# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
|
||||
/* Do not check certificate/CRL validity against current time */
|
||||
# define X509_V_FLAG_NO_CHECK_TIME 0x200000
|
||||
|
||||
# define X509_VP_FLAG_DEFAULT 0x1
|
||||
# define X509_VP_FLAG_OVERWRITE 0x2
|
||||
# define X509_VP_FLAG_RESET_FLAGS 0x4
|
||||
# define X509_VP_FLAG_LOCKED 0x8
|
||||
# define X509_VP_FLAG_ONCE 0x10
|
||||
|
||||
/* Internal use: mask of policy related options */
|
||||
# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
|
||||
| X509_V_FLAG_EXPLICIT_POLICY \
|
||||
| X509_V_FLAG_INHIBIT_ANY \
|
||||
| X509_V_FLAG_INHIBIT_MAP)
|
||||
|
||||
int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name);
|
||||
X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name);
|
||||
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
|
||||
X509_OBJECT *x);
|
||||
int X509_OBJECT_up_ref_count(X509_OBJECT *a);
|
||||
X509_OBJECT *X509_OBJECT_new(void);
|
||||
void X509_OBJECT_free(X509_OBJECT *a);
|
||||
X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a);
|
||||
X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a);
|
||||
int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
|
||||
X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a);
|
||||
int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
|
||||
X509_STORE *X509_STORE_new(void);
|
||||
void X509_STORE_free(X509_STORE *v);
|
||||
int X509_STORE_lock(X509_STORE *ctx);
|
||||
int X509_STORE_unlock(X509_STORE *ctx);
|
||||
int X509_STORE_up_ref(X509_STORE *v);
|
||||
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *v);
|
||||
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *st);
|
||||
STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st,
|
||||
const X509_NAME *nm);
|
||||
STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
|
||||
const X509_NAME *nm);
|
||||
int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
|
||||
int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
|
||||
int X509_STORE_set_trust(X509_STORE *ctx, int trust);
|
||||
int X509_STORE_set1_param(X509_STORE *ctx, const X509_VERIFY_PARAM *pm);
|
||||
X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *ctx);
|
||||
|
||||
void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify);
|
||||
#define X509_STORE_set_verify_func(ctx, func) \
|
||||
X509_STORE_set_verify((ctx),(func))
|
||||
void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx,
|
||||
X509_STORE_CTX_verify_fn verify);
|
||||
X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *ctx);
|
||||
void X509_STORE_set_verify_cb(X509_STORE *ctx,
|
||||
X509_STORE_CTX_verify_cb verify_cb);
|
||||
# define X509_STORE_set_verify_cb_func(ctx,func) \
|
||||
X509_STORE_set_verify_cb((ctx),(func))
|
||||
X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *ctx);
|
||||
void X509_STORE_set_get_issuer(X509_STORE *ctx,
|
||||
X509_STORE_CTX_get_issuer_fn get_issuer);
|
||||
X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *ctx);
|
||||
void X509_STORE_set_check_issued(X509_STORE *ctx,
|
||||
X509_STORE_CTX_check_issued_fn check_issued);
|
||||
X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *ctx);
|
||||
void X509_STORE_set_check_revocation(X509_STORE *ctx,
|
||||
X509_STORE_CTX_check_revocation_fn check_revocation);
|
||||
X509_STORE_CTX_check_revocation_fn
|
||||
X509_STORE_get_check_revocation(const X509_STORE *ctx);
|
||||
void X509_STORE_set_get_crl(X509_STORE *ctx,
|
||||
X509_STORE_CTX_get_crl_fn get_crl);
|
||||
X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *ctx);
|
||||
void X509_STORE_set_check_crl(X509_STORE *ctx,
|
||||
X509_STORE_CTX_check_crl_fn check_crl);
|
||||
X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *ctx);
|
||||
void X509_STORE_set_cert_crl(X509_STORE *ctx,
|
||||
X509_STORE_CTX_cert_crl_fn cert_crl);
|
||||
X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *ctx);
|
||||
void X509_STORE_set_check_policy(X509_STORE *ctx,
|
||||
X509_STORE_CTX_check_policy_fn check_policy);
|
||||
X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *ctx);
|
||||
void X509_STORE_set_lookup_certs(X509_STORE *ctx,
|
||||
X509_STORE_CTX_lookup_certs_fn lookup_certs);
|
||||
X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *ctx);
|
||||
void X509_STORE_set_lookup_crls(X509_STORE *ctx,
|
||||
X509_STORE_CTX_lookup_crls_fn lookup_crls);
|
||||
#define X509_STORE_set_lookup_crls_cb(ctx, func) \
|
||||
X509_STORE_set_lookup_crls((ctx), (func))
|
||||
X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *ctx);
|
||||
void X509_STORE_set_cleanup(X509_STORE *ctx,
|
||||
X509_STORE_CTX_cleanup_fn cleanup);
|
||||
X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *ctx);
|
||||
|
||||
#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
|
||||
int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data);
|
||||
void *X509_STORE_get_ex_data(const X509_STORE *ctx, int idx);
|
||||
|
||||
X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
X509_STORE_CTX *X509_STORE_CTX_new(void);
|
||||
|
||||
int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
|
||||
|
||||
void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
|
||||
int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
|
||||
X509 *target, STACK_OF(X509) *untrusted);
|
||||
void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
||||
void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
|
||||
|
||||
X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx);
|
||||
X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx);
|
||||
STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
||||
void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
|
||||
X509_STORE_CTX_verify_cb verify);
|
||||
X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
# define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
|
||||
# define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
|
||||
# define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
|
||||
# define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject
|
||||
# define X509_STORE_get1_certs X509_STORE_CTX_get1_certs
|
||||
# define X509_STORE_get1_crls X509_STORE_CTX_get1_crls
|
||||
/* the following macro is misspelled; use X509_STORE_get1_certs instead */
|
||||
# define X509_STORE_get1_cert X509_STORE_CTX_get1_certs
|
||||
/* the following macro is misspelled; use X509_STORE_get1_crls instead */
|
||||
# define X509_STORE_get1_crl X509_STORE_CTX_get1_crls
|
||||
#endif
|
||||
|
||||
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
|
||||
X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
|
||||
X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
|
||||
X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
|
||||
|
||||
typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc,
|
||||
long argl, char **ret);
|
||||
typedef int (*X509_LOOKUP_ctrl_ex_fn)(
|
||||
X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name,
|
||||
X509_OBJECT *ret);
|
||||
typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name,
|
||||
X509_OBJECT *ret,
|
||||
OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name,
|
||||
const ASN1_INTEGER *serial,
|
||||
X509_OBJECT *ret);
|
||||
typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const unsigned char* bytes,
|
||||
int len,
|
||||
X509_OBJECT *ret);
|
||||
typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const char *str,
|
||||
int len,
|
||||
X509_OBJECT *ret);
|
||||
|
||||
X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
|
||||
void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
|
||||
|
||||
int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method,
|
||||
int (*new_item) (X509_LOOKUP *ctx));
|
||||
int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
|
||||
(X509_LOOKUP *ctx);
|
||||
|
||||
int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method,
|
||||
void (*free_fn) (X509_LOOKUP *ctx));
|
||||
void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method))
|
||||
(X509_LOOKUP *ctx);
|
||||
|
||||
int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method,
|
||||
int (*init) (X509_LOOKUP *ctx));
|
||||
int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method))
|
||||
(X509_LOOKUP *ctx);
|
||||
|
||||
int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method,
|
||||
int (*shutdown) (X509_LOOKUP *ctx));
|
||||
int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method))
|
||||
(X509_LOOKUP *ctx);
|
||||
|
||||
int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method,
|
||||
X509_LOOKUP_ctrl_fn ctrl_fn);
|
||||
X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method);
|
||||
|
||||
int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method,
|
||||
X509_LOOKUP_get_by_subject_fn fn);
|
||||
X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject(
|
||||
const X509_LOOKUP_METHOD *method);
|
||||
|
||||
int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method,
|
||||
X509_LOOKUP_get_by_issuer_serial_fn fn);
|
||||
X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial(
|
||||
const X509_LOOKUP_METHOD *method);
|
||||
|
||||
int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method,
|
||||
X509_LOOKUP_get_by_fingerprint_fn fn);
|
||||
X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint(
|
||||
const X509_LOOKUP_METHOD *method);
|
||||
|
||||
int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
|
||||
X509_LOOKUP_get_by_alias_fn fn);
|
||||
X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
|
||||
const X509_LOOKUP_METHOD *method);
|
||||
|
||||
|
||||
int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
|
||||
int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
|
||||
|
||||
int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name, X509_OBJECT *ret);
|
||||
X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs,
|
||||
X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name);
|
||||
|
||||
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
|
||||
long argl, char **ret);
|
||||
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
|
||||
char **ret, OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
|
||||
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
||||
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
||||
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
|
||||
void X509_LOOKUP_free(X509_LOOKUP *ctx);
|
||||
int X509_LOOKUP_init(X509_LOOKUP *ctx);
|
||||
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name, X509_OBJECT *ret);
|
||||
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name, X509_OBJECT *ret,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
||||
const X509_NAME *name,
|
||||
const ASN1_INTEGER *serial,
|
||||
X509_OBJECT *ret);
|
||||
int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
||||
const unsigned char *bytes, int len,
|
||||
X509_OBJECT *ret);
|
||||
int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
||||
const char *str, int len, X509_OBJECT *ret);
|
||||
int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
|
||||
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
|
||||
X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
|
||||
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
|
||||
|
||||
int X509_STORE_load_file(X509_STORE *ctx, const char *file);
|
||||
int X509_STORE_load_path(X509_STORE *ctx, const char *path);
|
||||
int X509_STORE_load_store(X509_STORE *ctx, const char *store);
|
||||
int X509_STORE_load_locations(X509_STORE *ctx,
|
||||
const char *file,
|
||||
const char *dir);
|
||||
int X509_STORE_set_default_paths(X509_STORE *ctx);
|
||||
|
||||
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *store,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
|
||||
const char *dir, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
|
||||
int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
|
||||
void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx);
|
||||
int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
|
||||
int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth);
|
||||
X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x);
|
||||
X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx);
|
||||
X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx);
|
||||
X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx);
|
||||
STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx);
|
||||
STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
|
||||
void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
|
||||
void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
|
||||
int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
|
||||
int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
|
||||
int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
|
||||
int purpose, int trust);
|
||||
void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
|
||||
void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
|
||||
time_t t);
|
||||
|
||||
X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx);
|
||||
int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx);
|
||||
int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx);
|
||||
|
||||
X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx);
|
||||
void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
|
||||
int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
|
||||
|
||||
/*
|
||||
* Bridge opacity barrier between libcrypt and libssl, also needed to support
|
||||
* offline testing in test/danetest.c
|
||||
*/
|
||||
void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane);
|
||||
#define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0)
|
||||
|
||||
/* X509_VERIFY_PARAM functions */
|
||||
|
||||
X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
|
||||
void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
|
||||
const X509_VERIFY_PARAM *from);
|
||||
int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
|
||||
const X509_VERIFY_PARAM *from);
|
||||
int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
|
||||
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
|
||||
unsigned long flags);
|
||||
int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
|
||||
unsigned long flags);
|
||||
unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
|
||||
int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
|
||||
void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
|
||||
void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
|
||||
time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
|
||||
void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
|
||||
int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
|
||||
ASN1_OBJECT *policy);
|
||||
int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
|
||||
STACK_OF(ASN1_OBJECT) *policies);
|
||||
|
||||
int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
|
||||
uint32_t flags);
|
||||
uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
|
||||
|
||||
char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
|
||||
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
|
||||
const char *name, size_t namelen);
|
||||
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
|
||||
const char *name, size_t namelen);
|
||||
void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
|
||||
unsigned int flags);
|
||||
unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
|
||||
char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
|
||||
void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
|
||||
char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
|
||||
const char *email, size_t emaillen);
|
||||
char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
|
||||
const unsigned char *ip, size_t iplen);
|
||||
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
|
||||
const char *ipasc);
|
||||
|
||||
int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
|
||||
const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
|
||||
|
||||
int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
|
||||
int X509_VERIFY_PARAM_get_count(void);
|
||||
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
|
||||
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
|
||||
void X509_VERIFY_PARAM_table_cleanup(void);
|
||||
|
||||
/* Non positive return values are errors */
|
||||
#define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */
|
||||
#define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */
|
||||
#define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */
|
||||
|
||||
/*
|
||||
* Positive return values form a bit mask, all but the first are internal to
|
||||
* the library and don't appear in results from X509_policy_check().
|
||||
*/
|
||||
#define X509_PCY_TREE_VALID 1 /* The policy tree is valid */
|
||||
#define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */
|
||||
#define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */
|
||||
|
||||
int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
|
||||
STACK_OF(X509) *certs,
|
||||
STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
|
||||
|
||||
void X509_policy_tree_free(X509_POLICY_TREE *tree);
|
||||
|
||||
int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
|
||||
X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
|
||||
int i);
|
||||
|
||||
STACK_OF(X509_POLICY_NODE)
|
||||
*X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
|
||||
|
||||
STACK_OF(X509_POLICY_NODE)
|
||||
*X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
|
||||
|
||||
int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
|
||||
|
||||
X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level,
|
||||
int i);
|
||||
|
||||
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
|
||||
|
||||
STACK_OF(POLICYQUALINFO)
|
||||
*X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
|
||||
const X509_POLICY_NODE
|
||||
*X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2023 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_X509ERR_H
|
||||
# define OPENSSL_X509ERR_H
|
||||
# pragma once
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
# include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* X509 reason codes.
|
||||
*/
|
||||
# define X509_R_AKID_MISMATCH 110
|
||||
# define X509_R_BAD_SELECTOR 133
|
||||
# define X509_R_BAD_X509_FILETYPE 100
|
||||
# define X509_R_BASE64_DECODE_ERROR 118
|
||||
# define X509_R_CANT_CHECK_DH_KEY 114
|
||||
# define X509_R_CERTIFICATE_VERIFICATION_FAILED 139
|
||||
# define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
|
||||
# define X509_R_CRL_ALREADY_DELTA 127
|
||||
# define X509_R_CRL_VERIFY_FAILURE 131
|
||||
# define X509_R_DUPLICATE_ATTRIBUTE 140
|
||||
# define X509_R_ERROR_GETTING_MD_BY_NID 141
|
||||
# define X509_R_ERROR_USING_SIGINF_SET 142
|
||||
# define X509_R_IDP_MISMATCH 128
|
||||
# define X509_R_INVALID_ATTRIBUTES 138
|
||||
# define X509_R_INVALID_DIRECTORY 113
|
||||
# define X509_R_INVALID_DISTPOINT 143
|
||||
# define X509_R_INVALID_FIELD_NAME 119
|
||||
# define X509_R_INVALID_TRUST 123
|
||||
# define X509_R_ISSUER_MISMATCH 129
|
||||
# define X509_R_KEY_TYPE_MISMATCH 115
|
||||
# define X509_R_KEY_VALUES_MISMATCH 116
|
||||
# define X509_R_LOADING_CERT_DIR 103
|
||||
# define X509_R_LOADING_DEFAULTS 104
|
||||
# define X509_R_METHOD_NOT_SUPPORTED 124
|
||||
# define X509_R_NAME_TOO_LONG 134
|
||||
# define X509_R_NEWER_CRL_NOT_NEWER 132
|
||||
# define X509_R_NO_CERTIFICATE_FOUND 135
|
||||
# define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136
|
||||
# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
|
||||
# define X509_R_NO_CRL_FOUND 137
|
||||
# define X509_R_NO_CRL_NUMBER 130
|
||||
# define X509_R_PUBLIC_KEY_DECODE_ERROR 125
|
||||
# define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
|
||||
# define X509_R_SHOULD_RETRY 106
|
||||
# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
|
||||
# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
|
||||
# define X509_R_UNKNOWN_KEY_TYPE 117
|
||||
# define X509_R_UNKNOWN_NID 109
|
||||
# define X509_R_UNKNOWN_PURPOSE_ID 121
|
||||
# define X509_R_UNKNOWN_SIGID_ALGS 144
|
||||
# define X509_R_UNKNOWN_TRUST_ID 120
|
||||
# define X509_R_UNSUPPORTED_ALGORITHM 111
|
||||
# define X509_R_WRONG_LOOKUP_TYPE 112
|
||||
# define X509_R_WRONG_TYPE 122
|
||||
|
||||
#endif
|
||||
@@ -8,4 +8,16 @@
|
||||
#
|
||||
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
|
||||
all: hash crypto
|
||||
|
||||
hash:
|
||||
cd secHash && $(MAKE) -f Makefile
|
||||
|
||||
crypto:
|
||||
cd secCrypto && $(MAKE) -f Makefile
|
||||
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
@@ -6,7 +6,6 @@
|
||||
# of this software may be licensed only pursuant to the terms
|
||||
# of an applicable Wind River license agreement.
|
||||
#
|
||||
include $(WIND_KRNL_MK)/defs.layers.mk
|
||||
|
||||
|
||||
# When using the SEC_CRYPTO encryption API, you must include OPENSSL
|
||||
@@ -17,22 +16,24 @@ include $(WIND_KRNL_MK)/defs.layers.mk
|
||||
|
||||
# if CRYPTO_SUPPORTED is not set then fail with an error
|
||||
|
||||
ifdef _WRS_CONFIG_SEC_CRYPTO
|
||||
KERNEL_PUBLIC_H_DIRS += h
|
||||
KERNEL_PROTECTED_H_DIRS += protectedh
|
||||
BUILD_DIRS += src
|
||||
POST_NOBUILD_CDFDIRS += cdf
|
||||
POST_NOBUILD_CFGDIRS += cfg
|
||||
endif
|
||||
#ifdef _WRS_CONFIG_SEC_CRYPTO
|
||||
#KERNEL_PUBLIC_H_DIRS += h
|
||||
#KERNEL_PROTECTED_H_DIRS += protectedh
|
||||
#BUILD_DIRS += src
|
||||
#POST_NOBUILD_CDFDIRS += cdf
|
||||
#POST_NOBUILD_CFGDIRS += cfg
|
||||
#endif
|
||||
|
||||
ifneq ("$(wildcard vxTest/src/Makefile)","")
|
||||
ifdef _WRS_CONFIG_SEC_CRYPTO_VXTEST
|
||||
BUILD_DIRS += vxTest/src
|
||||
POST_NOBUILD_CDFDIRS += vxTest/cdf
|
||||
endif
|
||||
endif
|
||||
#ifneq ("$(wildcard vxTest/src/Makefile)","")
|
||||
#ifdef _WRS_CONFIG_SEC_CRYPTO_VXTEST
|
||||
#BUILD_DIRS += vxTest/src
|
||||
#POST_NOBUILD_CDFDIRS += vxTest/cdf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
@@ -9,11 +9,18 @@
|
||||
# DESCRIPTION
|
||||
# Makefile for secCrypto
|
||||
#
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
IPCOM_DIR=$(WIND_HOME)/components/ip_net2-6.9/ipcom
|
||||
|
||||
LIB_BASE_NAME = SECCRYPTO
|
||||
|
||||
include $(WIND_KRNL_MK)/defs.library.mk
|
||||
include $(WIND_BASE)/target/h/make/defs.library
|
||||
|
||||
EXTRA_INCLUDE += -I$(TGT_DIR)/h/security
|
||||
EXTRA_INCLUDE += -I$(IPCOM_DIR)/include
|
||||
EXTRA_INCLUDE += -I$(IPCOM_DIR)/config
|
||||
EXTRA_INCLUDE += -I$(IPCOM_DIR)/port/vxworks/config
|
||||
EXTRA_INCLUDE += -I$(IPCOM_DIR)/port/vxworks/include
|
||||
ifdef _WRS_CONFIG_CORE__BANNED_H
|
||||
ADDED_CFLAGS += -include banned.h
|
||||
endif
|
||||
@@ -67,4 +74,4 @@ OBJS += secKeyIvGenLib.o
|
||||
endif # _WRS_ALL_DOCS
|
||||
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.library.mk
|
||||
include $(WIND_BASE)/target/h/make/rules.library
|
||||
|
||||
@@ -72,10 +72,13 @@ SEE ALSO
|
||||
#include <private/iosLibP.h>
|
||||
#include <secHash.h>
|
||||
#include <secCrypto.h>
|
||||
#include <fsUtilityFuncs.h>
|
||||
#include <taskLib.h>
|
||||
#include <errno.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
/* typedefs */
|
||||
typedef __SIZE_TYPE__ rsize_t;
|
||||
typedef int errno_t;
|
||||
|
||||
typedef struct secVaultHandle
|
||||
{
|
||||
@@ -90,6 +93,32 @@ typedef struct secVaultHandle
|
||||
|
||||
LOCAL SEC_VAULT_HANDLE secVault = {0};
|
||||
|
||||
/****************************************************************************
|
||||
* memset_s and memcpy_s are not present in VxWorks 6.9, so wrapper routines are used.
|
||||
*/
|
||||
|
||||
errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
|
||||
{
|
||||
if (s == NULL) return EINVAL;
|
||||
if (n > smax) return ERANGE;
|
||||
memset(s, c, n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno_t memcpy_s(void *dest, rsize_t destsz,
|
||||
const void *src, rsize_t count)
|
||||
{
|
||||
if (dest == NULL || src == NULL) {
|
||||
return EINVAL; /* invalid pointer */
|
||||
}
|
||||
if (count > destsz) {
|
||||
/* would overflow destination buffer */
|
||||
return ERANGE;
|
||||
}
|
||||
memcpy(dest, src, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* secSecretCreateDirs - create directories for vault
|
||||
@@ -120,7 +149,7 @@ void secSecretCreateDirs
|
||||
{
|
||||
/* No slashes in path => path is a relative 'leaf' path */
|
||||
|
||||
(void)mkdir (path, 0777);
|
||||
(void)mkdir (path);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,14 +177,14 @@ void secSecretCreateDirs
|
||||
/* If we have an absolute path it will start with a slash */
|
||||
|
||||
if (strlen (tmpPath) > 0 && strcmp (tmpPath, ".") != 0)
|
||||
(void)mkdir (tmpPath, 0777);
|
||||
(void)mkdir (tmpPath);
|
||||
free (tmpPath);
|
||||
}
|
||||
|
||||
/* Create the final 'leaf' directory */
|
||||
|
||||
if (path[strlen (path)-1] != '/')
|
||||
(void)mkdir (path, 0777);
|
||||
(void)mkdir (path);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -1015,14 +1044,14 @@ STATUS securePartitionWaitMount
|
||||
const char * pPartName
|
||||
)
|
||||
{
|
||||
STATUS ret;
|
||||
STATUS ret=ERROR;
|
||||
int nProbe;
|
||||
|
||||
/* Verify the partition is mounted */
|
||||
|
||||
for (nProbe = 10; nProbe >= 0; nProbe--)
|
||||
{
|
||||
ret = fsDeviceValidateMount(pPartName, 0);
|
||||
/* ret = fsDeviceValidateMount(pPartName, 0); */
|
||||
if (ret == OK)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -17,12 +17,16 @@
|
||||
# provide its own set of hash algorithm implementations.
|
||||
|
||||
# Provides VxWorks Hash, HMAC, and PBKDF2 APIs
|
||||
KERNEL_PUBLIC_H_DIRS += h
|
||||
BUILD_DIRS += src
|
||||
POST_NOBUILD_CDFDIRS += cdf
|
||||
POST_NOBUILD_CFGDIRS += cfg
|
||||
|
||||
CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#KERNEL_PUBLIC_H_DIRS += h
|
||||
#BUILD_DIRS += src
|
||||
#POST_NOBUILD_CDFDIRS += cdf
|
||||
#POST_NOBUILD_CFGDIRS += cfg
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
#CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
|
||||
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
# DESCRIPTION
|
||||
# Makefile for sec_hash
|
||||
#
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
LIB_BASE_NAME = SEC_HASH
|
||||
|
||||
include $(WIND_KRNL_MK)/defs.library.mk
|
||||
include $(WIND_BASE)/target/h/make/defs.library
|
||||
|
||||
EXTRA_INCLUDE += -I$(TGT_DIR)/h/security
|
||||
|
||||
OBJS = secHash.o
|
||||
OBJS += secHmac.o
|
||||
@@ -27,4 +30,4 @@ OBJS += secHashWhirlpool.o
|
||||
|
||||
DOC_FILES = secHash.c secHmac.c secPbkdf2.c
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.library.mk
|
||||
include $(WIND_BASE)/target/h/make/rules.library
|
||||
|
||||
Reference in New Issue
Block a user