backup 04_physworld 2026-11-08 10:11:26 (part 2)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- physworld_p1_20261018/envs/p1/include/openssl/idea.h +82 -0
- physworld_p1_20261018/envs/p1/include/openssl/indicator.h +31 -0
- physworld_p1_20261018/envs/p1/include/openssl/kdf.h +141 -0
- physworld_p1_20261018/envs/p1/include/openssl/kdferr.h +16 -0
- physworld_p1_20261018/envs/p1/include/openssl/lhash.h +417 -0
- physworld_p1_20261018/envs/p1/include/openssl/macros.h +361 -0
- physworld_p1_20261018/envs/p1/include/openssl/md2.h +56 -0
- physworld_p1_20261018/envs/p1/include/openssl/md4.h +63 -0
- physworld_p1_20261018/envs/p1/include/openssl/md5.h +62 -0
- physworld_p1_20261018/envs/p1/include/openssl/mdc2.h +55 -0
- physworld_p1_20261018/envs/p1/include/openssl/ml_kem.h +31 -0
- physworld_p1_20261018/envs/p1/include/openssl/modes.h +219 -0
- physworld_p1_20261018/envs/p1/include/openssl/obj_mac.h +0 -0
- physworld_p1_20261018/envs/p1/include/openssl/objects.h +186 -0
- physworld_p1_20261018/envs/p1/include/openssl/objectserr.h +26 -0
- physworld_p1_20261018/envs/p1/include/openssl/ocsp.h +487 -0
- physworld_p1_20261018/envs/p1/include/openssl/ocsperr.h +51 -0
- physworld_p1_20261018/envs/p1/include/openssl/opensslconf.h +17 -0
- physworld_p1_20261018/envs/p1/include/openssl/opensslv.h +131 -0
- physworld_p1_20261018/envs/p1/include/openssl/ossl_typ.h +16 -0
- physworld_p1_20261018/envs/p1/include/openssl/param_build.h +63 -0
- physworld_p1_20261018/envs/p1/include/openssl/params.h +166 -0
- physworld_p1_20261018/envs/p1/include/openssl/pem.h +548 -0
- physworld_p1_20261018/envs/p1/include/openssl/pem2.h +19 -0
- physworld_p1_20261018/envs/p1/include/openssl/pemerr.h +57 -0
- physworld_p1_20261018/envs/p1/include/openssl/pkcs12.h +376 -0
- physworld_p1_20261018/envs/p1/include/openssl/pkcs12err.h +44 -0
- physworld_p1_20261018/envs/p1/include/openssl/pkcs7.h +435 -0
- physworld_p1_20261018/envs/p1/include/openssl/pkcs7err.h +61 -0
- physworld_p1_20261018/envs/p1/include/openssl/prov_ssl.h +38 -0
- physworld_p1_20261018/envs/p1/include/openssl/proverr.h +169 -0
- physworld_p1_20261018/envs/p1/include/openssl/provider.h +94 -0
- physworld_p1_20261018/envs/p1/include/openssl/quic.h +75 -0
- physworld_p1_20261018/envs/p1/include/openssl/rand.h +133 -0
- physworld_p1_20261018/envs/p1/include/openssl/randerr.h +68 -0
- physworld_p1_20261018/envs/p1/include/openssl/rc2.h +68 -0
- physworld_p1_20261018/envs/p1/include/openssl/rc4.h +47 -0
- physworld_p1_20261018/envs/p1/include/openssl/rc5.h +79 -0
- physworld_p1_20261018/envs/p1/include/openssl/ripemd.h +59 -0
- physworld_p1_20261018/envs/p1/include/openssl/rsa.h +614 -0
- physworld_p1_20261018/envs/p1/include/openssl/rsaerr.h +105 -0
- physworld_p1_20261018/envs/p1/include/openssl/safestack.h +326 -0
- physworld_p1_20261018/envs/p1/include/openssl/seed.h +112 -0
- physworld_p1_20261018/envs/p1/include/openssl/self_test.h +116 -0
- physworld_p1_20261018/envs/p1/include/openssl/sha.h +139 -0
- physworld_p1_20261018/envs/p1/include/openssl/srp.h +291 -0
- physworld_p1_20261018/envs/p1/include/openssl/srtp.h +68 -0
- physworld_p1_20261018/envs/p1/include/openssl/ssl.h +0 -0
- physworld_p1_20261018/envs/p1/include/openssl/ssl2.h +30 -0
- physworld_p1_20261018/envs/p1/include/openssl/ssl3.h +357 -0
physworld_p1_20261018/envs/p1/include/openssl/idea.h
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_IDEA_H
|
| 11 |
+
#define OPENSSL_IDEA_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_IDEA_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_IDEA
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#define IDEA_BLOCK 8
|
| 27 |
+
#define IDEA_KEY_LENGTH 16
|
| 28 |
+
|
| 29 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 30 |
+
|
| 31 |
+
typedef unsigned int IDEA_INT;
|
| 32 |
+
|
| 33 |
+
#define IDEA_ENCRYPT 1
|
| 34 |
+
#define IDEA_DECRYPT 0
|
| 35 |
+
|
| 36 |
+
typedef struct idea_key_st {
|
| 37 |
+
IDEA_INT data[9][6];
|
| 38 |
+
} IDEA_KEY_SCHEDULE;
|
| 39 |
+
#endif
|
| 40 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 41 |
+
OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void);
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in,
|
| 43 |
+
unsigned char *out,
|
| 44 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key,
|
| 46 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 47 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
|
| 48 |
+
IDEA_KEY_SCHEDULE *dk);
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in,
|
| 50 |
+
unsigned char *out, long length,
|
| 51 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 52 |
+
unsigned char *iv, int enc);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in,
|
| 54 |
+
unsigned char *out, long length,
|
| 55 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 56 |
+
unsigned char *iv, int *num,
|
| 57 |
+
int enc);
|
| 58 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in,
|
| 59 |
+
unsigned char *out, long length,
|
| 60 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 61 |
+
unsigned char *iv, int *num);
|
| 62 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in,
|
| 63 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 67 |
+
#define idea_options IDEA_options
|
| 68 |
+
#define idea_ecb_encrypt IDEA_ecb_encrypt
|
| 69 |
+
#define idea_set_encrypt_key IDEA_set_encrypt_key
|
| 70 |
+
#define idea_set_decrypt_key IDEA_set_decrypt_key
|
| 71 |
+
#define idea_cbc_encrypt IDEA_cbc_encrypt
|
| 72 |
+
#define idea_cfb64_encrypt IDEA_cfb64_encrypt
|
| 73 |
+
#define idea_ofb64_encrypt IDEA_ofb64_encrypt
|
| 74 |
+
#define idea_encrypt IDEA_encrypt
|
| 75 |
+
#endif
|
| 76 |
+
|
| 77 |
+
#ifdef __cplusplus
|
| 78 |
+
}
|
| 79 |
+
#endif
|
| 80 |
+
#endif
|
| 81 |
+
|
| 82 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/indicator.h
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_INDICATOR_H
|
| 11 |
+
#define OPENSSL_INDICATOR_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
#include <openssl/params.h>
|
| 19 |
+
|
| 20 |
+
typedef int(OSSL_INDICATOR_CALLBACK)(const char *type, const char *desc,
|
| 21 |
+
const OSSL_PARAM params[]);
|
| 22 |
+
|
| 23 |
+
void OSSL_INDICATOR_set_callback(OSSL_LIB_CTX *libctx,
|
| 24 |
+
OSSL_INDICATOR_CALLBACK *cb);
|
| 25 |
+
void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx,
|
| 26 |
+
OSSL_INDICATOR_CALLBACK **cb);
|
| 27 |
+
|
| 28 |
+
#ifdef __cplusplus
|
| 29 |
+
}
|
| 30 |
+
#endif
|
| 31 |
+
#endif /* OPENSSL_INDICATOR_H */
|
physworld_p1_20261018/envs/p1/include/openssl/kdf.h
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_KDF_H
|
| 11 |
+
#define OPENSSL_KDF_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_KDF_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <stdarg.h>
|
| 20 |
+
#include <stddef.h>
|
| 21 |
+
#include <openssl/types.h>
|
| 22 |
+
#include <openssl/core.h>
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
int EVP_KDF_up_ref(EVP_KDF *kdf);
|
| 29 |
+
void EVP_KDF_free(EVP_KDF *kdf);
|
| 30 |
+
EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
|
| 31 |
+
const char *properties);
|
| 32 |
+
|
| 33 |
+
EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf);
|
| 34 |
+
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
|
| 35 |
+
EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src);
|
| 36 |
+
const char *EVP_KDF_get0_description(const EVP_KDF *kdf);
|
| 37 |
+
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
|
| 38 |
+
const char *EVP_KDF_get0_name(const EVP_KDF *kdf);
|
| 39 |
+
const OSSL_PROVIDER *EVP_KDF_get0_provider(const EVP_KDF *kdf);
|
| 40 |
+
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
|
| 41 |
+
|
| 42 |
+
void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx);
|
| 43 |
+
size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx);
|
| 44 |
+
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen,
|
| 45 |
+
const OSSL_PARAM params[]);
|
| 46 |
+
int EVP_KDF_CTX_set_SKEY(EVP_KDF_CTX *ctx, EVP_SKEY *key, const char *paramname);
|
| 47 |
+
EVP_SKEY *EVP_KDF_derive_SKEY(EVP_KDF_CTX *ctx, EVP_SKEYMGMT *mgmt,
|
| 48 |
+
const char *key_type, const char *propquery,
|
| 49 |
+
size_t keylen, const OSSL_PARAM params[]);
|
| 50 |
+
int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
|
| 51 |
+
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
|
| 52 |
+
int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
|
| 53 |
+
const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
|
| 54 |
+
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
|
| 55 |
+
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
|
| 56 |
+
const OSSL_PARAM *EVP_KDF_CTX_gettable_params(EVP_KDF_CTX *ctx);
|
| 57 |
+
const OSSL_PARAM *EVP_KDF_CTX_settable_params(EVP_KDF_CTX *ctx);
|
| 58 |
+
|
| 59 |
+
void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
|
| 60 |
+
void (*fn)(EVP_KDF *kdf, void *arg),
|
| 61 |
+
void *arg);
|
| 62 |
+
int EVP_KDF_names_do_all(const EVP_KDF *kdf,
|
| 63 |
+
void (*fn)(const char *name, void *data),
|
| 64 |
+
void *data);
|
| 65 |
+
|
| 66 |
+
#define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND 0
|
| 67 |
+
#define EVP_KDF_HKDF_MODE_EXTRACT_ONLY 1
|
| 68 |
+
#define EVP_KDF_HKDF_MODE_EXPAND_ONLY 2
|
| 69 |
+
|
| 70 |
+
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65
|
| 71 |
+
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66
|
| 72 |
+
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 67
|
| 73 |
+
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI 68
|
| 74 |
+
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 69
|
| 75 |
+
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 70
|
| 76 |
+
|
| 77 |
+
/**** The legacy PKEY-based KDF API follows. ****/
|
| 78 |
+
|
| 79 |
+
#define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
|
| 80 |
+
#define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
|
| 81 |
+
#define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
|
| 82 |
+
#define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
|
| 83 |
+
#define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
|
| 84 |
+
#define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
|
| 85 |
+
#define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
|
| 86 |
+
#define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7)
|
| 87 |
+
#define EVP_PKEY_CTRL_PASS (EVP_PKEY_ALG_CTRL + 8)
|
| 88 |
+
#define EVP_PKEY_CTRL_SCRYPT_SALT (EVP_PKEY_ALG_CTRL + 9)
|
| 89 |
+
#define EVP_PKEY_CTRL_SCRYPT_N (EVP_PKEY_ALG_CTRL + 10)
|
| 90 |
+
#define EVP_PKEY_CTRL_SCRYPT_R (EVP_PKEY_ALG_CTRL + 11)
|
| 91 |
+
#define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12)
|
| 92 |
+
#define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13)
|
| 93 |
+
|
| 94 |
+
#define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND \
|
| 95 |
+
EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND
|
| 96 |
+
#define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY \
|
| 97 |
+
EVP_KDF_HKDF_MODE_EXTRACT_ONLY
|
| 98 |
+
#define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY \
|
| 99 |
+
EVP_KDF_HKDF_MODE_EXPAND_ONLY
|
| 100 |
+
|
| 101 |
+
int EVP_PKEY_CTX_set_tls1_prf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 102 |
+
|
| 103 |
+
int EVP_PKEY_CTX_set1_tls1_prf_secret(EVP_PKEY_CTX *pctx,
|
| 104 |
+
const unsigned char *sec, int seclen);
|
| 105 |
+
|
| 106 |
+
int EVP_PKEY_CTX_add1_tls1_prf_seed(EVP_PKEY_CTX *pctx,
|
| 107 |
+
const unsigned char *seed, int seedlen);
|
| 108 |
+
|
| 109 |
+
int EVP_PKEY_CTX_set_hkdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 110 |
+
|
| 111 |
+
int EVP_PKEY_CTX_set1_hkdf_salt(EVP_PKEY_CTX *ctx,
|
| 112 |
+
const unsigned char *salt, int saltlen);
|
| 113 |
+
|
| 114 |
+
int EVP_PKEY_CTX_set1_hkdf_key(EVP_PKEY_CTX *ctx,
|
| 115 |
+
const unsigned char *key, int keylen);
|
| 116 |
+
|
| 117 |
+
int EVP_PKEY_CTX_add1_hkdf_info(EVP_PKEY_CTX *ctx,
|
| 118 |
+
const unsigned char *info, int infolen);
|
| 119 |
+
|
| 120 |
+
int EVP_PKEY_CTX_set_hkdf_mode(EVP_PKEY_CTX *ctx, int mode);
|
| 121 |
+
#define EVP_PKEY_CTX_hkdf_mode EVP_PKEY_CTX_set_hkdf_mode
|
| 122 |
+
|
| 123 |
+
int EVP_PKEY_CTX_set1_pbe_pass(EVP_PKEY_CTX *ctx, const char *pass,
|
| 124 |
+
int passlen);
|
| 125 |
+
|
| 126 |
+
int EVP_PKEY_CTX_set1_scrypt_salt(EVP_PKEY_CTX *ctx,
|
| 127 |
+
const unsigned char *salt, int saltlen);
|
| 128 |
+
|
| 129 |
+
int EVP_PKEY_CTX_set_scrypt_N(EVP_PKEY_CTX *ctx, uint64_t n);
|
| 130 |
+
|
| 131 |
+
int EVP_PKEY_CTX_set_scrypt_r(EVP_PKEY_CTX *ctx, uint64_t r);
|
| 132 |
+
|
| 133 |
+
int EVP_PKEY_CTX_set_scrypt_p(EVP_PKEY_CTX *ctx, uint64_t p);
|
| 134 |
+
|
| 135 |
+
int EVP_PKEY_CTX_set_scrypt_maxmem_bytes(EVP_PKEY_CTX *ctx,
|
| 136 |
+
uint64_t maxmem_bytes);
|
| 137 |
+
|
| 138 |
+
#ifdef __cplusplus
|
| 139 |
+
}
|
| 140 |
+
#endif
|
| 141 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/kdferr.h
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_KDFERR_H
|
| 11 |
+
#define OPENSSL_KDFERR_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 15 |
+
|
| 16 |
+
#endif /* !defined(OPENSSL_KDFERR_H) */
|
physworld_p1_20261018/envs/p1/include/openssl/lhash.h
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/* clang-format off */
|
| 11 |
+
|
| 12 |
+
/* clang-format on */
|
| 13 |
+
|
| 14 |
+
/*
|
| 15 |
+
* Header for dynamic hash table routines Author - Eric Young
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#ifndef OPENSSL_LHASH_H
|
| 19 |
+
#define OPENSSL_LHASH_H
|
| 20 |
+
#pragma once
|
| 21 |
+
|
| 22 |
+
#include <openssl/macros.h>
|
| 23 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 24 |
+
#define HEADER_LHASH_H
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#include <openssl/e_os2.h>
|
| 28 |
+
#include <openssl/bio.h>
|
| 29 |
+
#ifndef OPENSSL_NO_STDIO
|
| 30 |
+
#include <stdio.h>
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#ifdef __cplusplus
|
| 34 |
+
extern "C" {
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
typedef struct lhash_node_st OPENSSL_LH_NODE;
|
| 38 |
+
typedef int (*OPENSSL_LH_COMPFUNC)(const void *, const void *);
|
| 39 |
+
typedef int (*OPENSSL_LH_COMPFUNCTHUNK)(const void *, const void *, OPENSSL_LH_COMPFUNC cfn);
|
| 40 |
+
typedef unsigned long (*OPENSSL_LH_HASHFUNC)(const void *);
|
| 41 |
+
typedef unsigned long (*OPENSSL_LH_HASHFUNCTHUNK)(const void *, OPENSSL_LH_HASHFUNC hfn);
|
| 42 |
+
typedef void (*OPENSSL_LH_DOALL_FUNC)(void *);
|
| 43 |
+
typedef void (*OPENSSL_LH_DOALL_FUNC_THUNK)(void *, OPENSSL_LH_DOALL_FUNC doall);
|
| 44 |
+
typedef void (*OPENSSL_LH_DOALL_FUNCARG)(void *, void *);
|
| 45 |
+
typedef void (*OPENSSL_LH_DOALL_FUNCARG_THUNK)(void *, void *, OPENSSL_LH_DOALL_FUNCARG doall);
|
| 46 |
+
typedef struct lhash_st OPENSSL_LHASH;
|
| 47 |
+
|
| 48 |
+
/*
|
| 49 |
+
* Macros for declaring and implementing type-safe wrappers for LHASH
|
| 50 |
+
* callbacks. This way, callbacks can be provided to LHASH structures without
|
| 51 |
+
* function pointer casting and the macro-defined callbacks provide
|
| 52 |
+
* per-variable casting before deferring to the underlying type-specific
|
| 53 |
+
* callbacks. NB: It is possible to place a "static" in front of both the
|
| 54 |
+
* DECLARE and IMPLEMENT macros if the functions are strictly internal.
|
| 55 |
+
*/
|
| 56 |
+
|
| 57 |
+
/* First: "hash" functions */
|
| 58 |
+
#define DECLARE_LHASH_HASH_FN(name, o_type) \
|
| 59 |
+
unsigned long name##_LHASH_HASH(const void *);
|
| 60 |
+
#define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
|
| 61 |
+
unsigned long name##_LHASH_HASH(const void *arg) \
|
| 62 |
+
{ \
|
| 63 |
+
const o_type *a = arg; \
|
| 64 |
+
return name##_hash(a); \
|
| 65 |
+
}
|
| 66 |
+
#define LHASH_HASH_FN(name) name##_LHASH_HASH
|
| 67 |
+
|
| 68 |
+
/* Second: "compare" functions */
|
| 69 |
+
#define DECLARE_LHASH_COMP_FN(name, o_type) \
|
| 70 |
+
int name##_LHASH_COMP(const void *, const void *);
|
| 71 |
+
#define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
|
| 72 |
+
int name##_LHASH_COMP(const void *arg1, const void *arg2) \
|
| 73 |
+
{ \
|
| 74 |
+
const o_type *a = arg1; \
|
| 75 |
+
const o_type *b = arg2; \
|
| 76 |
+
return name##_cmp(a, b); \
|
| 77 |
+
}
|
| 78 |
+
#define LHASH_COMP_FN(name) name##_LHASH_COMP
|
| 79 |
+
|
| 80 |
+
/* Fourth: "doall_arg" functions */
|
| 81 |
+
#define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 82 |
+
void name##_LHASH_DOALL_ARG(void *, void *);
|
| 83 |
+
#define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 84 |
+
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) \
|
| 85 |
+
{ \
|
| 86 |
+
o_type *a = arg1; \
|
| 87 |
+
a_type *b = arg2; \
|
| 88 |
+
name##_doall_arg(a, b); \
|
| 89 |
+
}
|
| 90 |
+
#define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
|
| 91 |
+
|
| 92 |
+
#define LH_LOAD_MULT 256
|
| 93 |
+
|
| 94 |
+
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
| 95 |
+
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
| 96 |
+
OPENSSL_LHASH *OPENSSL_LH_set_thunks(OPENSSL_LHASH *lh,
|
| 97 |
+
OPENSSL_LH_HASHFUNCTHUNK hw,
|
| 98 |
+
OPENSSL_LH_COMPFUNCTHUNK cw,
|
| 99 |
+
OPENSSL_LH_DOALL_FUNC_THUNK daw,
|
| 100 |
+
OPENSSL_LH_DOALL_FUNCARG_THUNK daaw);
|
| 101 |
+
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
| 102 |
+
void OPENSSL_LH_flush(OPENSSL_LHASH *lh);
|
| 103 |
+
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
| 104 |
+
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
| 105 |
+
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
| 106 |
+
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
|
| 107 |
+
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh,
|
| 108 |
+
OPENSSL_LH_DOALL_FUNCARG func, void *arg);
|
| 109 |
+
void OPENSSL_LH_doall_arg_thunk(OPENSSL_LHASH *lh,
|
| 110 |
+
OPENSSL_LH_DOALL_FUNCARG_THUNK daaw,
|
| 111 |
+
OPENSSL_LH_DOALL_FUNCARG fn, void *arg);
|
| 112 |
+
|
| 113 |
+
unsigned long OPENSSL_LH_strhash(const char *c);
|
| 114 |
+
unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
|
| 115 |
+
unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
|
| 116 |
+
void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
|
| 117 |
+
|
| 118 |
+
#ifndef OPENSSL_NO_STDIO
|
| 119 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 120 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 121 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 122 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 123 |
+
#endif
|
| 124 |
+
#endif
|
| 125 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 126 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 127 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 128 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 129 |
+
#endif
|
| 130 |
+
|
| 131 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 132 |
+
#define _LHASH OPENSSL_LHASH
|
| 133 |
+
#define LHASH_NODE OPENSSL_LH_NODE
|
| 134 |
+
#define lh_error OPENSSL_LH_error
|
| 135 |
+
#define lh_new OPENSSL_LH_new
|
| 136 |
+
#define lh_free OPENSSL_LH_free
|
| 137 |
+
#define lh_insert OPENSSL_LH_insert
|
| 138 |
+
#define lh_delete OPENSSL_LH_delete
|
| 139 |
+
#define lh_retrieve OPENSSL_LH_retrieve
|
| 140 |
+
#define lh_doall OPENSSL_LH_doall
|
| 141 |
+
#define lh_doall_arg OPENSSL_LH_doall_arg
|
| 142 |
+
#define lh_strhash OPENSSL_LH_strhash
|
| 143 |
+
#define lh_num_items OPENSSL_LH_num_items
|
| 144 |
+
#ifndef OPENSSL_NO_STDIO
|
| 145 |
+
#define lh_stats OPENSSL_LH_stats
|
| 146 |
+
#define lh_node_stats OPENSSL_LH_node_stats
|
| 147 |
+
#define lh_node_usage_stats OPENSSL_LH_node_usage_stats
|
| 148 |
+
#endif
|
| 149 |
+
#define lh_stats_bio OPENSSL_LH_stats_bio
|
| 150 |
+
#define lh_node_stats_bio OPENSSL_LH_node_stats_bio
|
| 151 |
+
#define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
|
| 152 |
+
#endif
|
| 153 |
+
|
| 154 |
+
/* Type checking... */
|
| 155 |
+
|
| 156 |
+
#define LHASH_OF(type) struct lhash_st_##type
|
| 157 |
+
|
| 158 |
+
/* Helper macro for internal use */
|
| 159 |
+
#define DEFINE_LHASH_OF_INTERNAL(type) \
|
| 160 |
+
LHASH_OF(type) \
|
| 161 |
+
{ \
|
| 162 |
+
union lh_##type##_dummy { \
|
| 163 |
+
void *d1; \
|
| 164 |
+
unsigned long d2; \
|
| 165 |
+
int d3; \
|
| 166 |
+
} dummy; \
|
| 167 |
+
}; \
|
| 168 |
+
typedef int (*lh_##type##_compfunc)(const type *a, const type *b); \
|
| 169 |
+
typedef unsigned long (*lh_##type##_hashfunc)(const type *a); \
|
| 170 |
+
typedef void (*lh_##type##_doallfunc)(type * a); \
|
| 171 |
+
static ossl_inline unsigned long lh_##type##_hash_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \
|
| 172 |
+
{ \
|
| 173 |
+
unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
|
| 174 |
+
return hfn_conv((const type *)data); \
|
| 175 |
+
} \
|
| 176 |
+
static ossl_inline int lh_##type##_comp_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \
|
| 177 |
+
{ \
|
| 178 |
+
int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
|
| 179 |
+
return cfn_conv((const type *)da, (const type *)db); \
|
| 180 |
+
} \
|
| 181 |
+
static ossl_inline void lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \
|
| 182 |
+
{ \
|
| 183 |
+
void (*doall_conv)(type *) = (void (*)(type *))doall; \
|
| 184 |
+
doall_conv((type *)node); \
|
| 185 |
+
} \
|
| 186 |
+
static ossl_inline void lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \
|
| 187 |
+
{ \
|
| 188 |
+
void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \
|
| 189 |
+
doall_conv((type *)node, arg); \
|
| 190 |
+
} \
|
| 191 |
+
static ossl_unused ossl_inline type * \
|
| 192 |
+
ossl_check_##type##_lh_plain_type(type *ptr) \
|
| 193 |
+
{ \
|
| 194 |
+
return ptr; \
|
| 195 |
+
} \
|
| 196 |
+
static ossl_unused ossl_inline const type * \
|
| 197 |
+
ossl_check_const_##type##_lh_plain_type(const type *ptr) \
|
| 198 |
+
{ \
|
| 199 |
+
return ptr; \
|
| 200 |
+
} \
|
| 201 |
+
static ossl_unused ossl_inline const OPENSSL_LHASH * \
|
| 202 |
+
ossl_check_const_##type##_lh_type(const LHASH_OF(type) *lh) \
|
| 203 |
+
{ \
|
| 204 |
+
return (const OPENSSL_LHASH *)lh; \
|
| 205 |
+
} \
|
| 206 |
+
static ossl_unused ossl_inline OPENSSL_LHASH * \
|
| 207 |
+
ossl_check_##type##_lh_type(LHASH_OF(type) *lh) \
|
| 208 |
+
{ \
|
| 209 |
+
return (OPENSSL_LHASH *)lh; \
|
| 210 |
+
} \
|
| 211 |
+
static ossl_unused ossl_inline OPENSSL_LH_COMPFUNC \
|
| 212 |
+
ossl_check_##type##_lh_compfunc_type(lh_##type##_compfunc cmp) \
|
| 213 |
+
{ \
|
| 214 |
+
return (OPENSSL_LH_COMPFUNC)cmp; \
|
| 215 |
+
} \
|
| 216 |
+
static ossl_unused ossl_inline OPENSSL_LH_HASHFUNC \
|
| 217 |
+
ossl_check_##type##_lh_hashfunc_type(lh_##type##_hashfunc hfn) \
|
| 218 |
+
{ \
|
| 219 |
+
return (OPENSSL_LH_HASHFUNC)hfn; \
|
| 220 |
+
} \
|
| 221 |
+
static ossl_unused ossl_inline OPENSSL_LH_DOALL_FUNC \
|
| 222 |
+
ossl_check_##type##_lh_doallfunc_type(lh_##type##_doallfunc dfn) \
|
| 223 |
+
{ \
|
| 224 |
+
return (OPENSSL_LH_DOALL_FUNC)dfn; \
|
| 225 |
+
} \
|
| 226 |
+
LHASH_OF(type)
|
| 227 |
+
|
| 228 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 229 |
+
#define DEFINE_LHASH_OF_DEPRECATED(type) \
|
| 230 |
+
static ossl_unused ossl_inline void \
|
| 231 |
+
lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 232 |
+
{ \
|
| 233 |
+
OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 234 |
+
} \
|
| 235 |
+
static ossl_unused ossl_inline void \
|
| 236 |
+
lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 237 |
+
{ \
|
| 238 |
+
OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 239 |
+
} \
|
| 240 |
+
static ossl_unused ossl_inline void \
|
| 241 |
+
lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 242 |
+
{ \
|
| 243 |
+
OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 244 |
+
}
|
| 245 |
+
#else
|
| 246 |
+
#define DEFINE_LHASH_OF_DEPRECATED(type)
|
| 247 |
+
#endif
|
| 248 |
+
|
| 249 |
+
#define DEFINE_LHASH_OF_EX(type) \
|
| 250 |
+
LHASH_OF(type) \
|
| 251 |
+
{ \
|
| 252 |
+
union lh_##type##_dummy { \
|
| 253 |
+
void *d1; \
|
| 254 |
+
unsigned long d2; \
|
| 255 |
+
int d3; \
|
| 256 |
+
} dummy; \
|
| 257 |
+
}; \
|
| 258 |
+
static unsigned long \
|
| 259 |
+
lh_##type##_hfn_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \
|
| 260 |
+
{ \
|
| 261 |
+
unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
|
| 262 |
+
return hfn_conv((const type *)data); \
|
| 263 |
+
} \
|
| 264 |
+
static int lh_##type##_cfn_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \
|
| 265 |
+
{ \
|
| 266 |
+
int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
|
| 267 |
+
return cfn_conv((const type *)da, (const type *)db); \
|
| 268 |
+
} \
|
| 269 |
+
static ossl_unused ossl_inline void \
|
| 270 |
+
lh_##type##_free(LHASH_OF(type) *lh) \
|
| 271 |
+
{ \
|
| 272 |
+
OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
|
| 273 |
+
} \
|
| 274 |
+
static ossl_unused ossl_inline void \
|
| 275 |
+
lh_##type##_flush(LHASH_OF(type) *lh) \
|
| 276 |
+
{ \
|
| 277 |
+
OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
|
| 278 |
+
} \
|
| 279 |
+
static ossl_unused ossl_inline type * \
|
| 280 |
+
lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
| 281 |
+
{ \
|
| 282 |
+
return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
|
| 283 |
+
} \
|
| 284 |
+
static ossl_unused ossl_inline type * \
|
| 285 |
+
lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
| 286 |
+
{ \
|
| 287 |
+
return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
|
| 288 |
+
} \
|
| 289 |
+
static ossl_unused ossl_inline type * \
|
| 290 |
+
lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
| 291 |
+
{ \
|
| 292 |
+
return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
|
| 293 |
+
} \
|
| 294 |
+
static ossl_unused ossl_inline int \
|
| 295 |
+
lh_##type##_error(LHASH_OF(type) *lh) \
|
| 296 |
+
{ \
|
| 297 |
+
return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
|
| 298 |
+
} \
|
| 299 |
+
static ossl_unused ossl_inline unsigned long \
|
| 300 |
+
lh_##type##_num_items(LHASH_OF(type) *lh) \
|
| 301 |
+
{ \
|
| 302 |
+
return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
|
| 303 |
+
} \
|
| 304 |
+
static ossl_unused ossl_inline unsigned long \
|
| 305 |
+
lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
| 306 |
+
{ \
|
| 307 |
+
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
|
| 308 |
+
} \
|
| 309 |
+
static ossl_unused ossl_inline void \
|
| 310 |
+
lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
| 311 |
+
{ \
|
| 312 |
+
OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
|
| 313 |
+
} \
|
| 314 |
+
static ossl_unused ossl_inline void \
|
| 315 |
+
lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \
|
| 316 |
+
{ \
|
| 317 |
+
void (*doall_conv)(type *) = (void (*)(type *))doall; \
|
| 318 |
+
doall_conv((type *)node); \
|
| 319 |
+
} \
|
| 320 |
+
static ossl_unused ossl_inline void \
|
| 321 |
+
lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \
|
| 322 |
+
{ \
|
| 323 |
+
void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \
|
| 324 |
+
doall_conv((type *)node, arg); \
|
| 325 |
+
} \
|
| 326 |
+
static ossl_unused ossl_inline void \
|
| 327 |
+
lh_##type##_doall(LHASH_OF(type) *lh, void (*doall)(type *)) \
|
| 328 |
+
{ \
|
| 329 |
+
OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
|
| 330 |
+
} \
|
| 331 |
+
static ossl_unused ossl_inline LHASH_OF(type) * \
|
| 332 |
+
lh_##type##_new(unsigned long (*hfn)(const type *), \
|
| 333 |
+
int (*cfn)(const type *, const type *)) \
|
| 334 |
+
{ \
|
| 335 |
+
return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
|
| 336 |
+
lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
|
| 337 |
+
lh_##type##_doall_thunk, \
|
| 338 |
+
lh_##type##_doall_arg_thunk); \
|
| 339 |
+
} \
|
| 340 |
+
static ossl_unused ossl_inline void \
|
| 341 |
+
lh_##type##_doall_arg(LHASH_OF(type) *lh, \
|
| 342 |
+
void (*doallarg)(type *, void *), void *arg) \
|
| 343 |
+
{ \
|
| 344 |
+
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
|
| 345 |
+
(OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
|
| 346 |
+
} \
|
| 347 |
+
LHASH_OF(type)
|
| 348 |
+
|
| 349 |
+
#define DEFINE_LHASH_OF(type) \
|
| 350 |
+
DEFINE_LHASH_OF_EX(type); \
|
| 351 |
+
DEFINE_LHASH_OF_DEPRECATED(type) \
|
| 352 |
+
LHASH_OF(type)
|
| 353 |
+
|
| 354 |
+
#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
|
| 355 |
+
int_implement_lhash_doall(type, argtype, const type)
|
| 356 |
+
|
| 357 |
+
#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
|
| 358 |
+
int_implement_lhash_doall(type, argtype, type)
|
| 359 |
+
|
| 360 |
+
#define int_implement_lhash_doall(type, argtype, cbargtype) \
|
| 361 |
+
static ossl_unused ossl_inline void \
|
| 362 |
+
lh_##type##_doall_##argtype##_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG fn) \
|
| 363 |
+
{ \
|
| 364 |
+
void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
|
| 365 |
+
fn_conv((cbargtype *)node, (argtype *)arg); \
|
| 366 |
+
} \
|
| 367 |
+
static ossl_unused ossl_inline void \
|
| 368 |
+
lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
|
| 369 |
+
void (*fn)(cbargtype *, argtype *), \
|
| 370 |
+
argtype *arg) \
|
| 371 |
+
{ \
|
| 372 |
+
OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
|
| 373 |
+
lh_##type##_doall_##argtype##_thunk, \
|
| 374 |
+
(OPENSSL_LH_DOALL_FUNCARG)fn, \
|
| 375 |
+
(void *)arg); \
|
| 376 |
+
} \
|
| 377 |
+
LHASH_OF(type)
|
| 378 |
+
|
| 379 |
+
/* clang-format off */
|
| 380 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_STRING);
|
| 381 |
+
#define lh_OPENSSL_STRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_STRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_STRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_STRING_lh_compfunc_type(cmp)), lh_OPENSSL_STRING_hash_thunk, lh_OPENSSL_STRING_comp_thunk, lh_OPENSSL_STRING_doall_thunk, lh_OPENSSL_STRING_doall_arg_thunk))
|
| 382 |
+
#define lh_OPENSSL_STRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 383 |
+
#define lh_OPENSSL_STRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 384 |
+
#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)))
|
| 385 |
+
#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)))
|
| 386 |
+
#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)))
|
| 387 |
+
#define lh_OPENSSL_STRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 388 |
+
#define lh_OPENSSL_STRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 389 |
+
#define lh_OPENSSL_STRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 390 |
+
#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)
|
| 391 |
+
#define lh_OPENSSL_STRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 392 |
+
#define lh_OPENSSL_STRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 393 |
+
#define lh_OPENSSL_STRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_STRING_lh_type(lh), dl)
|
| 394 |
+
#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))
|
| 395 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_CSTRING);
|
| 396 |
+
#define lh_OPENSSL_CSTRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_CSTRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_CSTRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_CSTRING_lh_compfunc_type(cmp)), lh_OPENSSL_CSTRING_hash_thunk, lh_OPENSSL_CSTRING_comp_thunk, lh_OPENSSL_CSTRING_doall_thunk, lh_OPENSSL_CSTRING_doall_arg_thunk))
|
| 397 |
+
#define lh_OPENSSL_CSTRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 398 |
+
#define lh_OPENSSL_CSTRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 399 |
+
#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)))
|
| 400 |
+
#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)))
|
| 401 |
+
#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)))
|
| 402 |
+
#define lh_OPENSSL_CSTRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 403 |
+
#define lh_OPENSSL_CSTRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 404 |
+
#define lh_OPENSSL_CSTRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 405 |
+
#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)
|
| 406 |
+
#define lh_OPENSSL_CSTRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 407 |
+
#define lh_OPENSSL_CSTRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 408 |
+
#define lh_OPENSSL_CSTRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh), dl)
|
| 409 |
+
#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))
|
| 410 |
+
|
| 411 |
+
/* clang-format on */
|
| 412 |
+
|
| 413 |
+
#ifdef __cplusplus
|
| 414 |
+
}
|
| 415 |
+
#endif
|
| 416 |
+
|
| 417 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/macros.h
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MACROS_H
|
| 11 |
+
#define OPENSSL_MACROS_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/opensslconf.h>
|
| 15 |
+
#include <openssl/opensslv.h>
|
| 16 |
+
|
| 17 |
+
/* Helper macros for CPP string composition */
|
| 18 |
+
#define OPENSSL_MSTR_HELPER(x) #x
|
| 19 |
+
#define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* Sometimes OPENSSL_NO_xxx ends up with an empty file and some compilers
|
| 23 |
+
* don't like that. This will hopefully silence them.
|
| 24 |
+
*/
|
| 25 |
+
#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
|
| 26 |
+
|
| 27 |
+
/*
|
| 28 |
+
* Generic deprecation macro
|
| 29 |
+
*
|
| 30 |
+
* If OPENSSL_SUPPRESS_DEPRECATED is defined, then OSSL_DEPRECATED and
|
| 31 |
+
* OSSL_DEPRECATED_FOR become no-ops
|
| 32 |
+
*/
|
| 33 |
+
#ifndef OSSL_DEPRECATED
|
| 34 |
+
#undef OSSL_DEPRECATED_FOR
|
| 35 |
+
#ifndef OPENSSL_SUPPRESS_DEPRECATED
|
| 36 |
+
#if defined(_MSC_VER)
|
| 37 |
+
/*
|
| 38 |
+
* MSVC supports __declspec(deprecated) since MSVC 2003 (13.10),
|
| 39 |
+
* and __declspec(deprecated(message)) since MSVC 2005 (14.00)
|
| 40 |
+
*/
|
| 41 |
+
#if _MSC_VER >= 1400
|
| 42 |
+
#define OSSL_DEPRECATED(since) \
|
| 43 |
+
__declspec(deprecated("Since OpenSSL " #since))
|
| 44 |
+
#define OSSL_DEPRECATED_FOR(since, message) \
|
| 45 |
+
__declspec(deprecated("Since OpenSSL " #since ";" message))
|
| 46 |
+
#elif _MSC_VER >= 1310
|
| 47 |
+
#define OSSL_DEPRECATED(since) __declspec(deprecated)
|
| 48 |
+
#define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated)
|
| 49 |
+
#endif
|
| 50 |
+
#elif defined(__GNUC__)
|
| 51 |
+
/*
|
| 52 |
+
* According to GCC documentation, deprecations with message appeared in
|
| 53 |
+
* GCC 4.5.0
|
| 54 |
+
*/
|
| 55 |
+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
| 56 |
+
#define OSSL_DEPRECATED(since) \
|
| 57 |
+
__attribute__((deprecated("Since OpenSSL " #since)))
|
| 58 |
+
#define OSSL_DEPRECATED_FOR(since, message) \
|
| 59 |
+
__attribute__((deprecated("Since OpenSSL " #since ";" message)))
|
| 60 |
+
#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
|
| 61 |
+
#define OSSL_DEPRECATED(since) __attribute__((deprecated))
|
| 62 |
+
#define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
|
| 63 |
+
#endif
|
| 64 |
+
#elif defined(__SUNPRO_C)
|
| 65 |
+
#if (__SUNPRO_C >= 0x5130)
|
| 66 |
+
#define OSSL_DEPRECATED(since) __attribute__((deprecated))
|
| 67 |
+
#define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
|
| 68 |
+
#endif
|
| 69 |
+
#endif
|
| 70 |
+
#endif
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
/*
|
| 74 |
+
* Still not defined? Then define no-op macros. This means these macros
|
| 75 |
+
* are unsuitable for use in a typedef.
|
| 76 |
+
*/
|
| 77 |
+
#ifndef OSSL_DEPRECATED
|
| 78 |
+
#define OSSL_DEPRECATED(since) extern
|
| 79 |
+
#define OSSL_DEPRECATED_FOR(since, message) extern
|
| 80 |
+
#endif
|
| 81 |
+
|
| 82 |
+
/*
|
| 83 |
+
* Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
|
| 84 |
+
* declarations of functions deprecated in or before <version>. If this is
|
| 85 |
+
* undefined, the value of the macro OPENSSL_CONFIGURED_API (defined in
|
| 86 |
+
* <openssl/opensslconf.h>) is the default.
|
| 87 |
+
*
|
| 88 |
+
* For any version number up until version 1.1.x, <version> is expected to be
|
| 89 |
+
* the calculated version number 0xMNNFFPPSL.
|
| 90 |
+
* For version numbers 3.0 and on, <version> is expected to be a computation
|
| 91 |
+
* of the major and minor numbers in decimal using this formula:
|
| 92 |
+
*
|
| 93 |
+
* MAJOR * 10000 + MINOR * 100
|
| 94 |
+
*
|
| 95 |
+
* So version 3.0 becomes 30000, version 3.2 becomes 30200, etc.
|
| 96 |
+
*/
|
| 97 |
+
|
| 98 |
+
/*
|
| 99 |
+
* We use the OPENSSL_API_COMPAT value to define API level macros. These
|
| 100 |
+
* macros are used to enable or disable features at that API version boundary.
|
| 101 |
+
*/
|
| 102 |
+
|
| 103 |
+
#ifdef OPENSSL_API_LEVEL
|
| 104 |
+
#error "OPENSSL_API_LEVEL must not be defined by application"
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
/*
|
| 108 |
+
* We figure out what API level was intended by simple numeric comparison.
|
| 109 |
+
* The lowest old style number we recognise is 0x00908000L, so we take some
|
| 110 |
+
* safety margin and assume that anything below 0x00900000L is a new style
|
| 111 |
+
* number. This allows new versions up to and including v943.71.83.
|
| 112 |
+
*/
|
| 113 |
+
#ifdef OPENSSL_API_COMPAT
|
| 114 |
+
#if OPENSSL_API_COMPAT < 0x900000L
|
| 115 |
+
#define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
|
| 116 |
+
#else
|
| 117 |
+
#define OPENSSL_API_LEVEL \
|
| 118 |
+
(((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000 \
|
| 119 |
+
+ ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
|
| 120 |
+
+ ((OPENSSL_API_COMPAT >> 12) & 0xFF))
|
| 121 |
+
#endif
|
| 122 |
+
#endif
|
| 123 |
+
|
| 124 |
+
/*
|
| 125 |
+
* If OPENSSL_API_COMPAT wasn't given, we use default numbers to set
|
| 126 |
+
* the API compatibility level.
|
| 127 |
+
*/
|
| 128 |
+
#ifndef OPENSSL_API_LEVEL
|
| 129 |
+
#if OPENSSL_CONFIGURED_API > 0
|
| 130 |
+
#define OPENSSL_API_LEVEL (OPENSSL_CONFIGURED_API)
|
| 131 |
+
#else
|
| 132 |
+
#define OPENSSL_API_LEVEL \
|
| 133 |
+
(OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
|
| 134 |
+
#endif
|
| 135 |
+
#endif
|
| 136 |
+
|
| 137 |
+
#if OPENSSL_API_LEVEL > OPENSSL_CONFIGURED_API
|
| 138 |
+
#error "The requested API level higher than the configured API compatibility level"
|
| 139 |
+
#endif
|
| 140 |
+
|
| 141 |
+
/*
|
| 142 |
+
* Check of sane values.
|
| 143 |
+
*/
|
| 144 |
+
/* Can't go higher than the current version. */
|
| 145 |
+
#if OPENSSL_API_LEVEL > (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
|
| 146 |
+
#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
| 147 |
+
#endif
|
| 148 |
+
/* OpenSSL will have no version 2.y.z */
|
| 149 |
+
#if OPENSSL_API_LEVEL < 30000 && OPENSSL_API_LEVEL >= 20000
|
| 150 |
+
#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
| 151 |
+
#endif
|
| 152 |
+
/* Below 0.9.8 is unacceptably low */
|
| 153 |
+
#if OPENSSL_API_LEVEL < 908
|
| 154 |
+
#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
|
| 155 |
+
#endif
|
| 156 |
+
|
| 157 |
+
/*
|
| 158 |
+
* Define macros for deprecation and simulated removal purposes.
|
| 159 |
+
*
|
| 160 |
+
* The macros OSSL_DEPRECATEDIN_{major}_{minor} are always defined for
|
| 161 |
+
* all OpenSSL versions we care for. They can be used as attributes
|
| 162 |
+
* in function declarations where appropriate.
|
| 163 |
+
*
|
| 164 |
+
* The macros OPENSSL_NO_DEPRECATED_{major}_{minor} are defined for
|
| 165 |
+
* all OpenSSL versions up to or equal to the version given with
|
| 166 |
+
* OPENSSL_API_COMPAT. They are used as guards around anything that's
|
| 167 |
+
* deprecated up to that version, as an effect of the developer option
|
| 168 |
+
* 'no-deprecated'.
|
| 169 |
+
*/
|
| 170 |
+
|
| 171 |
+
#undef OPENSSL_NO_DEPRECATED_3_6
|
| 172 |
+
#undef OPENSSL_NO_DEPRECATED_3_5
|
| 173 |
+
#undef OPENSSL_NO_DEPRECATED_3_4
|
| 174 |
+
#undef OPENSSL_NO_DEPRECATED_3_1
|
| 175 |
+
#undef OPENSSL_NO_DEPRECATED_3_0
|
| 176 |
+
#undef OPENSSL_NO_DEPRECATED_1_1_1
|
| 177 |
+
#undef OPENSSL_NO_DEPRECATED_1_1_0
|
| 178 |
+
#undef OPENSSL_NO_DEPRECATED_1_0_2
|
| 179 |
+
#undef OPENSSL_NO_DEPRECATED_1_0_1
|
| 180 |
+
#undef OPENSSL_NO_DEPRECATED_1_0_0
|
| 181 |
+
#undef OPENSSL_NO_DEPRECATED_0_9_8
|
| 182 |
+
|
| 183 |
+
#if OPENSSL_API_LEVEL >= 30600
|
| 184 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 185 |
+
#define OSSL_DEPRECATEDIN_3_6 OSSL_DEPRECATED(3.6)
|
| 186 |
+
#define OSSL_DEPRECATEDIN_3_6_FOR(msg) OSSL_DEPRECATED_FOR(3.6, msg)
|
| 187 |
+
#else
|
| 188 |
+
#define OPENSSL_NO_DEPRECATED_3_6
|
| 189 |
+
#endif
|
| 190 |
+
#else
|
| 191 |
+
#define OSSL_DEPRECATEDIN_3_6
|
| 192 |
+
#define OSSL_DEPRECATEDIN_3_6_FOR(msg)
|
| 193 |
+
#endif
|
| 194 |
+
#if OPENSSL_API_LEVEL >= 30500
|
| 195 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 196 |
+
#define OSSL_DEPRECATEDIN_3_5 OSSL_DEPRECATED(3.5)
|
| 197 |
+
#define OSSL_DEPRECATEDIN_3_5_FOR(msg) OSSL_DEPRECATED_FOR(3.5, msg)
|
| 198 |
+
#else
|
| 199 |
+
#define OPENSSL_NO_DEPRECATED_3_5
|
| 200 |
+
#endif
|
| 201 |
+
#else
|
| 202 |
+
#define OSSL_DEPRECATEDIN_3_5
|
| 203 |
+
#define OSSL_DEPRECATEDIN_3_5_FOR(msg)
|
| 204 |
+
#endif
|
| 205 |
+
#if OPENSSL_API_LEVEL >= 30400
|
| 206 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 207 |
+
#define OSSL_DEPRECATEDIN_3_4 OSSL_DEPRECATED(3.4)
|
| 208 |
+
#define OSSL_DEPRECATEDIN_3_4_FOR(msg) OSSL_DEPRECATED_FOR(3.4, msg)
|
| 209 |
+
#else
|
| 210 |
+
#define OPENSSL_NO_DEPRECATED_3_4
|
| 211 |
+
#endif
|
| 212 |
+
#else
|
| 213 |
+
#define OSSL_DEPRECATEDIN_3_4
|
| 214 |
+
#define OSSL_DEPRECATEDIN_3_4_FOR(msg)
|
| 215 |
+
#endif
|
| 216 |
+
#if OPENSSL_API_LEVEL >= 30100
|
| 217 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 218 |
+
#define OSSL_DEPRECATEDIN_3_1 OSSL_DEPRECATED(3.1)
|
| 219 |
+
#define OSSL_DEPRECATEDIN_3_1_FOR(msg) OSSL_DEPRECATED_FOR(3.1, msg)
|
| 220 |
+
#else
|
| 221 |
+
#define OPENSSL_NO_DEPRECATED_3_1
|
| 222 |
+
#endif
|
| 223 |
+
#else
|
| 224 |
+
#define OSSL_DEPRECATEDIN_3_1
|
| 225 |
+
#define OSSL_DEPRECATEDIN_3_1_FOR(msg)
|
| 226 |
+
#endif
|
| 227 |
+
#if OPENSSL_API_LEVEL >= 30000
|
| 228 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 229 |
+
#define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)
|
| 230 |
+
#define OSSL_DEPRECATEDIN_3_0_FOR(msg) OSSL_DEPRECATED_FOR(3.0, msg)
|
| 231 |
+
#else
|
| 232 |
+
#define OPENSSL_NO_DEPRECATED_3_0
|
| 233 |
+
#endif
|
| 234 |
+
#else
|
| 235 |
+
#define OSSL_DEPRECATEDIN_3_0
|
| 236 |
+
#define OSSL_DEPRECATEDIN_3_0_FOR(msg)
|
| 237 |
+
#endif
|
| 238 |
+
#if OPENSSL_API_LEVEL >= 10101
|
| 239 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 240 |
+
#define OSSL_DEPRECATEDIN_1_1_1 OSSL_DEPRECATED(1.1.1)
|
| 241 |
+
#define OSSL_DEPRECATEDIN_1_1_1_FOR(msg) OSSL_DEPRECATED_FOR(1.1.1, msg)
|
| 242 |
+
#else
|
| 243 |
+
#define OPENSSL_NO_DEPRECATED_1_1_1
|
| 244 |
+
#endif
|
| 245 |
+
#else
|
| 246 |
+
#define OSSL_DEPRECATEDIN_1_1_1
|
| 247 |
+
#define OSSL_DEPRECATEDIN_1_1_1_FOR(msg)
|
| 248 |
+
#endif
|
| 249 |
+
#if OPENSSL_API_LEVEL >= 10100
|
| 250 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 251 |
+
#define OSSL_DEPRECATEDIN_1_1_0 OSSL_DEPRECATED(1.1.0)
|
| 252 |
+
#define OSSL_DEPRECATEDIN_1_1_0_FOR(msg) OSSL_DEPRECATED_FOR(1.1.0, msg)
|
| 253 |
+
#else
|
| 254 |
+
#define OPENSSL_NO_DEPRECATED_1_1_0
|
| 255 |
+
#endif
|
| 256 |
+
#else
|
| 257 |
+
#define OSSL_DEPRECATEDIN_1_1_0
|
| 258 |
+
#define OSSL_DEPRECATEDIN_1_1_0_FOR(msg)
|
| 259 |
+
#endif
|
| 260 |
+
#if OPENSSL_API_LEVEL >= 10002
|
| 261 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 262 |
+
#define OSSL_DEPRECATEDIN_1_0_2 OSSL_DEPRECATED(1.0.2)
|
| 263 |
+
#define OSSL_DEPRECATEDIN_1_0_2_FOR(msg) OSSL_DEPRECATED_FOR(1.0.2, msg)
|
| 264 |
+
#else
|
| 265 |
+
#define OPENSSL_NO_DEPRECATED_1_0_2
|
| 266 |
+
#endif
|
| 267 |
+
#else
|
| 268 |
+
#define OSSL_DEPRECATEDIN_1_0_2
|
| 269 |
+
#define OSSL_DEPRECATEDIN_1_0_2_FOR(msg)
|
| 270 |
+
#endif
|
| 271 |
+
#if OPENSSL_API_LEVEL >= 10001
|
| 272 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 273 |
+
#define OSSL_DEPRECATEDIN_1_0_1 OSSL_DEPRECATED(1.0.1)
|
| 274 |
+
#define OSSL_DEPRECATEDIN_1_0_1_FOR(msg) OSSL_DEPRECATED_FOR(1.0.1, msg)
|
| 275 |
+
#else
|
| 276 |
+
#define OPENSSL_NO_DEPRECATED_1_0_1
|
| 277 |
+
#endif
|
| 278 |
+
#else
|
| 279 |
+
#define OSSL_DEPRECATEDIN_1_0_1
|
| 280 |
+
#define OSSL_DEPRECATEDIN_1_0_1_FOR(msg)
|
| 281 |
+
#endif
|
| 282 |
+
#if OPENSSL_API_LEVEL >= 10000
|
| 283 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 284 |
+
#define OSSL_DEPRECATEDIN_1_0_0 OSSL_DEPRECATED(1.0.0)
|
| 285 |
+
#define OSSL_DEPRECATEDIN_1_0_0_FOR(msg) OSSL_DEPRECATED_FOR(1.0.0, msg)
|
| 286 |
+
#else
|
| 287 |
+
#define OPENSSL_NO_DEPRECATED_1_0_0
|
| 288 |
+
#endif
|
| 289 |
+
#else
|
| 290 |
+
#define OSSL_DEPRECATEDIN_1_0_0
|
| 291 |
+
#define OSSL_DEPRECATEDIN_1_0_0_FOR(msg)
|
| 292 |
+
#endif
|
| 293 |
+
#if OPENSSL_API_LEVEL >= 908
|
| 294 |
+
#ifndef OPENSSL_NO_DEPRECATED
|
| 295 |
+
#define OSSL_DEPRECATEDIN_0_9_8 OSSL_DEPRECATED(0.9.8)
|
| 296 |
+
#define OSSL_DEPRECATEDIN_0_9_8_FOR(msg) OSSL_DEPRECATED_FOR(0.9.8, msg)
|
| 297 |
+
#else
|
| 298 |
+
#define OPENSSL_NO_DEPRECATED_0_9_8
|
| 299 |
+
#endif
|
| 300 |
+
#else
|
| 301 |
+
#define OSSL_DEPRECATEDIN_0_9_8
|
| 302 |
+
#define OSSL_DEPRECATEDIN_0_9_8_FOR(msg)
|
| 303 |
+
#endif
|
| 304 |
+
|
| 305 |
+
/*
|
| 306 |
+
* Make our own variants of __FILE__ and __LINE__, depending on configuration
|
| 307 |
+
*/
|
| 308 |
+
|
| 309 |
+
#ifndef OPENSSL_FILE
|
| 310 |
+
#ifdef OPENSSL_NO_FILENAMES
|
| 311 |
+
#define OPENSSL_FILE ""
|
| 312 |
+
#define OPENSSL_LINE 0
|
| 313 |
+
#else
|
| 314 |
+
#define OPENSSL_FILE __FILE__
|
| 315 |
+
#define OPENSSL_LINE __LINE__
|
| 316 |
+
#endif
|
| 317 |
+
#endif
|
| 318 |
+
|
| 319 |
+
/*
|
| 320 |
+
* __func__ was standardized in C99, so for any compiler that claims
|
| 321 |
+
* to implement that language level or newer, we assume we can safely
|
| 322 |
+
* use that symbol.
|
| 323 |
+
*
|
| 324 |
+
* GNU C also provides __FUNCTION__ since version 2, which predates
|
| 325 |
+
* C99. We can, however, only use this if __STDC_VERSION__ exists,
|
| 326 |
+
* as it's otherwise not allowed according to ISO C standards (C90).
|
| 327 |
+
* (compiling with GNU C's -pedantic tells us so)
|
| 328 |
+
*
|
| 329 |
+
* If none of the above applies, we check if the compiler is MSVC,
|
| 330 |
+
* and use __FUNCTION__ if that's the case.
|
| 331 |
+
*/
|
| 332 |
+
#ifndef OPENSSL_FUNC
|
| 333 |
+
#if defined(__STDC_VERSION__)
|
| 334 |
+
#if __STDC_VERSION__ >= 199901L
|
| 335 |
+
#define OPENSSL_FUNC __func__
|
| 336 |
+
#elif defined(__GNUC__) && __GNUC__ >= 2
|
| 337 |
+
#define OPENSSL_FUNC __FUNCTION__
|
| 338 |
+
#endif
|
| 339 |
+
#elif defined(_MSC_VER)
|
| 340 |
+
#define OPENSSL_FUNC __FUNCTION__
|
| 341 |
+
#endif
|
| 342 |
+
/*
|
| 343 |
+
* If all these possibilities are exhausted, we give up and use a
|
| 344 |
+
* static string.
|
| 345 |
+
*/
|
| 346 |
+
#ifndef OPENSSL_FUNC
|
| 347 |
+
#define OPENSSL_FUNC "(unknown function)"
|
| 348 |
+
#endif
|
| 349 |
+
#endif
|
| 350 |
+
|
| 351 |
+
#ifndef OSSL_CRYPTO_ALLOC
|
| 352 |
+
#if defined(__GNUC__)
|
| 353 |
+
#define OSSL_CRYPTO_ALLOC __attribute__((__malloc__))
|
| 354 |
+
#elif defined(_MSC_VER)
|
| 355 |
+
#define OSSL_CRYPTO_ALLOC __declspec(restrict)
|
| 356 |
+
#else
|
| 357 |
+
#define OSSL_CRYPTO_ALLOC
|
| 358 |
+
#endif
|
| 359 |
+
#endif
|
| 360 |
+
|
| 361 |
+
#endif /* OPENSSL_MACROS_H */
|
physworld_p1_20261018/envs/p1/include/openssl/md2.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MD2_H
|
| 11 |
+
#define OPENSSL_MD2_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_MD2_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_MD2
|
| 22 |
+
#include <stddef.h>
|
| 23 |
+
#ifdef __cplusplus
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#define MD2_DIGEST_LENGTH 16
|
| 28 |
+
|
| 29 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 30 |
+
|
| 31 |
+
typedef unsigned char MD2_INT;
|
| 32 |
+
|
| 33 |
+
#define MD2_BLOCK 16
|
| 34 |
+
|
| 35 |
+
typedef struct MD2state_st {
|
| 36 |
+
unsigned int num;
|
| 37 |
+
unsigned char data[MD2_BLOCK];
|
| 38 |
+
MD2_INT cksm[MD2_BLOCK];
|
| 39 |
+
MD2_INT state[MD2_BLOCK];
|
| 40 |
+
} MD2_CTX;
|
| 41 |
+
#endif
|
| 42 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 43 |
+
OSSL_DEPRECATEDIN_3_0 const char *MD2_options(void);
|
| 44 |
+
OSSL_DEPRECATEDIN_3_0 int MD2_Init(MD2_CTX *c);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 int MD2_Update(MD2_CTX *c, const unsigned char *data,
|
| 46 |
+
size_t len);
|
| 47 |
+
OSSL_DEPRECATEDIN_3_0 int MD2_Final(unsigned char *md, MD2_CTX *c);
|
| 48 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MD2(const unsigned char *d, size_t n,
|
| 49 |
+
unsigned char *md);
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
#ifdef __cplusplus
|
| 53 |
+
}
|
| 54 |
+
#endif
|
| 55 |
+
#endif
|
| 56 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/md4.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MD4_H
|
| 11 |
+
#define OPENSSL_MD4_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_MD4_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_MD4
|
| 22 |
+
#include <openssl/e_os2.h>
|
| 23 |
+
#include <stddef.h>
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
#define MD4_DIGEST_LENGTH 16
|
| 29 |
+
|
| 30 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
|
| 32 |
+
/*-
|
| 33 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 34 |
+
* ! MD4_LONG has to be at least 32 bits wide. !
|
| 35 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 36 |
+
*/
|
| 37 |
+
#define MD4_LONG unsigned int
|
| 38 |
+
|
| 39 |
+
#define MD4_CBLOCK 64
|
| 40 |
+
#define MD4_LBLOCK (MD4_CBLOCK / 4)
|
| 41 |
+
|
| 42 |
+
typedef struct MD4state_st {
|
| 43 |
+
MD4_LONG A, B, C, D;
|
| 44 |
+
MD4_LONG Nl, Nh;
|
| 45 |
+
MD4_LONG data[MD4_LBLOCK];
|
| 46 |
+
unsigned int num;
|
| 47 |
+
} MD4_CTX;
|
| 48 |
+
#endif
|
| 49 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 int MD4_Final(unsigned char *md, MD4_CTX *c);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MD4(const unsigned char *d, size_t n,
|
| 54 |
+
unsigned char *md);
|
| 55 |
+
OSSL_DEPRECATEDIN_3_0 void MD4_Transform(MD4_CTX *c, const unsigned char *b);
|
| 56 |
+
#endif
|
| 57 |
+
|
| 58 |
+
#ifdef __cplusplus
|
| 59 |
+
}
|
| 60 |
+
#endif
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/md5.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MD5_H
|
| 11 |
+
#define OPENSSL_MD5_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_MD5_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_MD5
|
| 22 |
+
#include <openssl/e_os2.h>
|
| 23 |
+
#include <stddef.h>
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
#define MD5_DIGEST_LENGTH 16
|
| 29 |
+
|
| 30 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
/*
|
| 32 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 33 |
+
* ! MD5_LONG has to be at least 32 bits wide. !
|
| 34 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 35 |
+
*/
|
| 36 |
+
#define MD5_LONG unsigned int
|
| 37 |
+
|
| 38 |
+
#define MD5_CBLOCK 64
|
| 39 |
+
#define MD5_LBLOCK (MD5_CBLOCK / 4)
|
| 40 |
+
|
| 41 |
+
typedef struct MD5state_st {
|
| 42 |
+
MD5_LONG A, B, C, D;
|
| 43 |
+
MD5_LONG Nl, Nh;
|
| 44 |
+
MD5_LONG data[MD5_LBLOCK];
|
| 45 |
+
unsigned int num;
|
| 46 |
+
} MD5_CTX;
|
| 47 |
+
#endif
|
| 48 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
|
| 53 |
+
unsigned char *md);
|
| 54 |
+
OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#ifdef __cplusplus
|
| 58 |
+
}
|
| 59 |
+
#endif
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/mdc2.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MDC2_H
|
| 11 |
+
#define OPENSSL_MDC2_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_MDC2_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_MDC2
|
| 22 |
+
#include <stdlib.h>
|
| 23 |
+
#include <openssl/des.h>
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
#define MDC2_DIGEST_LENGTH 16
|
| 29 |
+
|
| 30 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
|
| 32 |
+
#define MDC2_BLOCK 8
|
| 33 |
+
|
| 34 |
+
typedef struct mdc2_ctx_st {
|
| 35 |
+
unsigned int num;
|
| 36 |
+
unsigned char data[MDC2_BLOCK];
|
| 37 |
+
DES_cblock h, hh;
|
| 38 |
+
unsigned int pad_type; /* either 1 or 2, default 1 */
|
| 39 |
+
} MDC2_CTX;
|
| 40 |
+
#endif
|
| 41 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Init(MDC2_CTX *c);
|
| 43 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
|
| 44 |
+
size_t len);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Final(unsigned char *md, MDC2_CTX *c);
|
| 46 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MDC2(const unsigned char *d, size_t n,
|
| 47 |
+
unsigned char *md);
|
| 48 |
+
#endif
|
| 49 |
+
|
| 50 |
+
#ifdef __cplusplus
|
| 51 |
+
}
|
| 52 |
+
#endif
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ml_kem.h
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_ML_KEM_H
|
| 11 |
+
#define OPENSSL_ML_KEM_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#define OSSL_ML_KEM_SHARED_SECRET_BYTES 32
|
| 15 |
+
|
| 16 |
+
#define OSSL_ML_KEM_512_BITS 512
|
| 17 |
+
#define OSSL_ML_KEM_512_SECURITY_BITS 128
|
| 18 |
+
#define OSSL_ML_KEM_512_CIPHERTEXT_BYTES 768
|
| 19 |
+
#define OSSL_ML_KEM_512_PUBLIC_KEY_BYTES 800
|
| 20 |
+
|
| 21 |
+
#define OSSL_ML_KEM_768_BITS 768
|
| 22 |
+
#define OSSL_ML_KEM_768_SECURITY_BITS 192
|
| 23 |
+
#define OSSL_ML_KEM_768_CIPHERTEXT_BYTES 1088
|
| 24 |
+
#define OSSL_ML_KEM_768_PUBLIC_KEY_BYTES 1184
|
| 25 |
+
|
| 26 |
+
#define OSSL_ML_KEM_1024_BITS 1024
|
| 27 |
+
#define OSSL_ML_KEM_1024_SECURITY_BITS 256
|
| 28 |
+
#define OSSL_ML_KEM_1024_CIPHERTEXT_BYTES 1568
|
| 29 |
+
#define OSSL_ML_KEM_1024_PUBLIC_KEY_BYTES 1568
|
| 30 |
+
|
| 31 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/modes.h
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MODES_H
|
| 11 |
+
#define OPENSSL_MODES_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_MODES_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <stddef.h>
|
| 20 |
+
#include <openssl/types.h>
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
typedef void (*block128_f)(const unsigned char in[16],
|
| 26 |
+
unsigned char out[16], const void *key);
|
| 27 |
+
|
| 28 |
+
typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
|
| 29 |
+
size_t len, const void *key,
|
| 30 |
+
unsigned char ivec[16], int enc);
|
| 31 |
+
|
| 32 |
+
typedef void (*ecb128_f)(const unsigned char *in, unsigned char *out,
|
| 33 |
+
size_t len, const void *key,
|
| 34 |
+
int enc);
|
| 35 |
+
|
| 36 |
+
typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out,
|
| 37 |
+
size_t blocks, const void *key,
|
| 38 |
+
const unsigned char ivec[16]);
|
| 39 |
+
|
| 40 |
+
typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out,
|
| 41 |
+
size_t blocks, const void *key,
|
| 42 |
+
const unsigned char ivec[16],
|
| 43 |
+
unsigned char cmac[16]);
|
| 44 |
+
|
| 45 |
+
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
|
| 46 |
+
size_t len, const void *key,
|
| 47 |
+
unsigned char ivec[16], block128_f block);
|
| 48 |
+
void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
|
| 49 |
+
size_t len, const void *key,
|
| 50 |
+
unsigned char ivec[16], block128_f block);
|
| 51 |
+
|
| 52 |
+
void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
| 53 |
+
size_t len, const void *key,
|
| 54 |
+
unsigned char ivec[16],
|
| 55 |
+
unsigned char ecount_buf[16], unsigned int *num,
|
| 56 |
+
block128_f block);
|
| 57 |
+
|
| 58 |
+
void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
|
| 59 |
+
size_t len, const void *key,
|
| 60 |
+
unsigned char ivec[16],
|
| 61 |
+
unsigned char ecount_buf[16],
|
| 62 |
+
unsigned int *num, ctr128_f ctr);
|
| 63 |
+
|
| 64 |
+
void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 65 |
+
size_t len, const void *key,
|
| 66 |
+
unsigned char ivec[16], int *num,
|
| 67 |
+
block128_f block);
|
| 68 |
+
|
| 69 |
+
void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 70 |
+
size_t len, const void *key,
|
| 71 |
+
unsigned char ivec[16], int *num,
|
| 72 |
+
int enc, block128_f block);
|
| 73 |
+
void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
|
| 74 |
+
size_t length, const void *key,
|
| 75 |
+
unsigned char ivec[16], int *num,
|
| 76 |
+
int enc, block128_f block);
|
| 77 |
+
void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
|
| 78 |
+
size_t bits, const void *key,
|
| 79 |
+
unsigned char ivec[16], int *num,
|
| 80 |
+
int enc, block128_f block);
|
| 81 |
+
|
| 82 |
+
size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
|
| 83 |
+
unsigned char *out, size_t len,
|
| 84 |
+
const void *key, unsigned char ivec[16],
|
| 85 |
+
block128_f block);
|
| 86 |
+
size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
|
| 87 |
+
size_t len, const void *key,
|
| 88 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 89 |
+
size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
|
| 90 |
+
unsigned char *out, size_t len,
|
| 91 |
+
const void *key, unsigned char ivec[16],
|
| 92 |
+
block128_f block);
|
| 93 |
+
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
|
| 94 |
+
size_t len, const void *key,
|
| 95 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 96 |
+
|
| 97 |
+
size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
|
| 98 |
+
unsigned char *out, size_t len,
|
| 99 |
+
const void *key,
|
| 100 |
+
unsigned char ivec[16],
|
| 101 |
+
block128_f block);
|
| 102 |
+
size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
|
| 103 |
+
size_t len, const void *key,
|
| 104 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 105 |
+
size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
|
| 106 |
+
unsigned char *out, size_t len,
|
| 107 |
+
const void *key,
|
| 108 |
+
unsigned char ivec[16],
|
| 109 |
+
block128_f block);
|
| 110 |
+
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
|
| 111 |
+
size_t len, const void *key,
|
| 112 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 113 |
+
|
| 114 |
+
typedef struct gcm128_context GCM128_CONTEXT;
|
| 115 |
+
|
| 116 |
+
GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
|
| 117 |
+
void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
|
| 118 |
+
void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
|
| 119 |
+
size_t len);
|
| 120 |
+
int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
|
| 121 |
+
size_t len);
|
| 122 |
+
int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
|
| 123 |
+
const unsigned char *in, unsigned char *out,
|
| 124 |
+
size_t len);
|
| 125 |
+
int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
|
| 126 |
+
const unsigned char *in, unsigned char *out,
|
| 127 |
+
size_t len);
|
| 128 |
+
int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
|
| 129 |
+
const unsigned char *in, unsigned char *out,
|
| 130 |
+
size_t len, ctr128_f stream);
|
| 131 |
+
int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
|
| 132 |
+
const unsigned char *in, unsigned char *out,
|
| 133 |
+
size_t len, ctr128_f stream);
|
| 134 |
+
int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
|
| 135 |
+
size_t len);
|
| 136 |
+
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 137 |
+
void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
|
| 138 |
+
|
| 139 |
+
typedef struct ccm128_context CCM128_CONTEXT;
|
| 140 |
+
|
| 141 |
+
void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
|
| 142 |
+
unsigned int M, unsigned int L, void *key,
|
| 143 |
+
block128_f block);
|
| 144 |
+
int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
|
| 145 |
+
size_t nlen, size_t mlen);
|
| 146 |
+
void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
|
| 147 |
+
size_t alen);
|
| 148 |
+
int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 149 |
+
unsigned char *out, size_t len);
|
| 150 |
+
int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 151 |
+
unsigned char *out, size_t len);
|
| 152 |
+
int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 153 |
+
unsigned char *out, size_t len,
|
| 154 |
+
ccm128_f stream);
|
| 155 |
+
int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 156 |
+
unsigned char *out, size_t len,
|
| 157 |
+
ccm128_f stream);
|
| 158 |
+
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 159 |
+
|
| 160 |
+
typedef struct xts128_context XTS128_CONTEXT;
|
| 161 |
+
|
| 162 |
+
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
|
| 163 |
+
const unsigned char iv[16],
|
| 164 |
+
const unsigned char *inp, unsigned char *out,
|
| 165 |
+
size_t len, int enc);
|
| 166 |
+
|
| 167 |
+
size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
|
| 168 |
+
unsigned char *out,
|
| 169 |
+
const unsigned char *in, size_t inlen,
|
| 170 |
+
block128_f block);
|
| 171 |
+
|
| 172 |
+
size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
|
| 173 |
+
unsigned char *out,
|
| 174 |
+
const unsigned char *in, size_t inlen,
|
| 175 |
+
block128_f block);
|
| 176 |
+
size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
|
| 177 |
+
unsigned char *out, const unsigned char *in,
|
| 178 |
+
size_t inlen, block128_f block);
|
| 179 |
+
size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
|
| 180 |
+
unsigned char *out, const unsigned char *in,
|
| 181 |
+
size_t inlen, block128_f block);
|
| 182 |
+
|
| 183 |
+
#ifndef OPENSSL_NO_OCB
|
| 184 |
+
typedef struct ocb128_context OCB128_CONTEXT;
|
| 185 |
+
|
| 186 |
+
typedef void (*ocb128_f)(const unsigned char *in, unsigned char *out,
|
| 187 |
+
size_t blocks, const void *key,
|
| 188 |
+
size_t start_block_num,
|
| 189 |
+
unsigned char offset_i[16],
|
| 190 |
+
const unsigned char L_[][16],
|
| 191 |
+
unsigned char checksum[16]);
|
| 192 |
+
|
| 193 |
+
OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec,
|
| 194 |
+
block128_f encrypt, block128_f decrypt,
|
| 195 |
+
ocb128_f stream);
|
| 196 |
+
int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
|
| 197 |
+
block128_f encrypt, block128_f decrypt,
|
| 198 |
+
ocb128_f stream);
|
| 199 |
+
int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
|
| 200 |
+
void *keyenc, void *keydec);
|
| 201 |
+
int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
|
| 202 |
+
size_t len, size_t taglen);
|
| 203 |
+
int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
|
| 204 |
+
size_t len);
|
| 205 |
+
int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
|
| 206 |
+
unsigned char *out, size_t len);
|
| 207 |
+
int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
|
| 208 |
+
unsigned char *out, size_t len);
|
| 209 |
+
int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
|
| 210 |
+
size_t len);
|
| 211 |
+
int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 212 |
+
void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
|
| 213 |
+
#endif /* OPENSSL_NO_OCB */
|
| 214 |
+
|
| 215 |
+
#ifdef __cplusplus
|
| 216 |
+
}
|
| 217 |
+
#endif
|
| 218 |
+
|
| 219 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/obj_mac.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
physworld_p1_20261018/envs/p1/include/openssl/objects.h
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_OBJECTS_H
|
| 11 |
+
#define OPENSSL_OBJECTS_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_OBJECTS_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/obj_mac.h>
|
| 20 |
+
#include <openssl/bio.h>
|
| 21 |
+
#include <openssl/asn1.h>
|
| 22 |
+
#include <openssl/objectserr.h>
|
| 23 |
+
|
| 24 |
+
#define OBJ_NAME_TYPE_UNDEF 0x00
|
| 25 |
+
#define OBJ_NAME_TYPE_MD_METH 0x01
|
| 26 |
+
#define OBJ_NAME_TYPE_CIPHER_METH 0x02
|
| 27 |
+
#define OBJ_NAME_TYPE_PKEY_METH 0x03
|
| 28 |
+
#define OBJ_NAME_TYPE_COMP_METH 0x04
|
| 29 |
+
#define OBJ_NAME_TYPE_MAC_METH 0x05
|
| 30 |
+
#define OBJ_NAME_TYPE_KDF_METH 0x06
|
| 31 |
+
#define OBJ_NAME_TYPE_NUM 0x07
|
| 32 |
+
|
| 33 |
+
#define OBJ_NAME_ALIAS 0x8000
|
| 34 |
+
|
| 35 |
+
#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
|
| 36 |
+
#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
|
| 37 |
+
|
| 38 |
+
#ifdef __cplusplus
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
typedef struct obj_name_st {
|
| 43 |
+
int type;
|
| 44 |
+
int alias;
|
| 45 |
+
const char *name;
|
| 46 |
+
const char *data;
|
| 47 |
+
} OBJ_NAME;
|
| 48 |
+
|
| 49 |
+
#define OBJ_create_and_add_object(a, b, c) OBJ_create(a, b, c)
|
| 50 |
+
|
| 51 |
+
int OBJ_NAME_init(void);
|
| 52 |
+
int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
|
| 53 |
+
int (*cmp_func)(const char *, const char *),
|
| 54 |
+
void (*free_func)(const char *, int, const char *));
|
| 55 |
+
const char *OBJ_NAME_get(const char *name, int type);
|
| 56 |
+
int OBJ_NAME_add(const char *name, int type, const char *data);
|
| 57 |
+
int OBJ_NAME_remove(const char *name, int type);
|
| 58 |
+
void OBJ_NAME_cleanup(int type); /* -1 for everything */
|
| 59 |
+
void OBJ_NAME_do_all(int type, void (*fn)(const OBJ_NAME *, void *arg),
|
| 60 |
+
void *arg);
|
| 61 |
+
void OBJ_NAME_do_all_sorted(int type,
|
| 62 |
+
void (*fn)(const OBJ_NAME *, void *arg),
|
| 63 |
+
void *arg);
|
| 64 |
+
|
| 65 |
+
DECLARE_ASN1_DUP_FUNCTION_name(ASN1_OBJECT, OBJ)
|
| 66 |
+
ASN1_OBJECT *OBJ_nid2obj(int n);
|
| 67 |
+
const char *OBJ_nid2ln(int n);
|
| 68 |
+
const char *OBJ_nid2sn(int n);
|
| 69 |
+
int OBJ_obj2nid(const ASN1_OBJECT *o);
|
| 70 |
+
ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
|
| 71 |
+
int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
|
| 72 |
+
int OBJ_txt2nid(const char *s);
|
| 73 |
+
int OBJ_ln2nid(const char *s);
|
| 74 |
+
int OBJ_sn2nid(const char *s);
|
| 75 |
+
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
|
| 76 |
+
const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
|
| 77 |
+
int (*cmp)(const void *, const void *));
|
| 78 |
+
const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
|
| 79 |
+
int size,
|
| 80 |
+
int (*cmp)(const void *, const void *),
|
| 81 |
+
int flags);
|
| 82 |
+
|
| 83 |
+
#define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \
|
| 84 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
|
| 85 |
+
static int nm##_cmp(type1 const *, type2 const *); \
|
| 86 |
+
scope type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
| 87 |
+
|
| 88 |
+
#define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
|
| 89 |
+
_DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
|
| 90 |
+
#define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
| 91 |
+
type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
| 92 |
+
|
| 93 |
+
/*-
|
| 94 |
+
* Unsolved problem: if a type is actually a pointer type, like
|
| 95 |
+
* nid_triple is, then its impossible to get a const where you need
|
| 96 |
+
* it. Consider:
|
| 97 |
+
*
|
| 98 |
+
* typedef int nid_triple[3];
|
| 99 |
+
* const void *a_;
|
| 100 |
+
* const nid_triple const *a = a_;
|
| 101 |
+
*
|
| 102 |
+
* The assignment discards a const because what you really want is:
|
| 103 |
+
*
|
| 104 |
+
* const int const * const *a = a_;
|
| 105 |
+
*
|
| 106 |
+
* But if you do that, you lose the fact that a is an array of 3 ints,
|
| 107 |
+
* which breaks comparison functions.
|
| 108 |
+
*
|
| 109 |
+
* Thus we end up having to cast, sadly, or unpack the
|
| 110 |
+
* declarations. Or, as I finally did in this case, declare nid_triple
|
| 111 |
+
* to be a struct, which it should have been in the first place.
|
| 112 |
+
*
|
| 113 |
+
* Ben, August 2008.
|
| 114 |
+
*
|
| 115 |
+
* Also, strictly speaking not all types need be const, but handling
|
| 116 |
+
* the non-constness means a lot of complication, and in practice
|
| 117 |
+
* comparison routines do always not touch their arguments.
|
| 118 |
+
*/
|
| 119 |
+
|
| 120 |
+
#define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \
|
| 121 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
| 122 |
+
{ \
|
| 123 |
+
type1 const *a = a_; \
|
| 124 |
+
type2 const *b = b_; \
|
| 125 |
+
return nm##_cmp(a, b); \
|
| 126 |
+
} \
|
| 127 |
+
static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
| 128 |
+
{ \
|
| 129 |
+
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
| 130 |
+
nm##_cmp_BSEARCH_CMP_FN); \
|
| 131 |
+
} \
|
| 132 |
+
extern void dummy_prototype(void)
|
| 133 |
+
|
| 134 |
+
#define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
| 135 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
| 136 |
+
{ \
|
| 137 |
+
type1 const *a = a_; \
|
| 138 |
+
type2 const *b = b_; \
|
| 139 |
+
return nm##_cmp(a, b); \
|
| 140 |
+
} \
|
| 141 |
+
type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
| 142 |
+
{ \
|
| 143 |
+
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
| 144 |
+
nm##_cmp_BSEARCH_CMP_FN); \
|
| 145 |
+
} \
|
| 146 |
+
extern void dummy_prototype(void)
|
| 147 |
+
|
| 148 |
+
#define OBJ_bsearch(type1, key, type2, base, num, cmp) \
|
| 149 |
+
((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1, key), CHECKED_PTR_OF(type2, base), \
|
| 150 |
+
num, sizeof(type2), \
|
| 151 |
+
((void)CHECKED_PTR_OF(type1, cmp##_type_1), \
|
| 152 |
+
(void)CHECKED_PTR_OF(type2, cmp##_type_2), \
|
| 153 |
+
cmp##_BSEARCH_CMP_FN)))
|
| 154 |
+
|
| 155 |
+
#define OBJ_bsearch_ex(type1, key, type2, base, num, cmp, flags) \
|
| 156 |
+
((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1, key), CHECKED_PTR_OF(type2, base), \
|
| 157 |
+
num, sizeof(type2), \
|
| 158 |
+
((void)CHECKED_PTR_OF(type1, cmp##_type_1), \
|
| 159 |
+
(void)type_2 = CHECKED_PTR_OF(type2, cmp##_type_2), \
|
| 160 |
+
cmp##_BSEARCH_CMP_FN)), \
|
| 161 |
+
flags)
|
| 162 |
+
|
| 163 |
+
int OBJ_new_nid(int num);
|
| 164 |
+
int OBJ_add_object(const ASN1_OBJECT *obj);
|
| 165 |
+
int OBJ_create(const char *oid, const char *sn, const char *ln);
|
| 166 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 167 |
+
#define OBJ_cleanup() \
|
| 168 |
+
while (0) \
|
| 169 |
+
continue
|
| 170 |
+
#endif
|
| 171 |
+
int OBJ_create_objects(BIO *in);
|
| 172 |
+
|
| 173 |
+
size_t OBJ_length(const ASN1_OBJECT *obj);
|
| 174 |
+
const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
|
| 175 |
+
|
| 176 |
+
int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
|
| 177 |
+
int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
|
| 178 |
+
int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
|
| 179 |
+
void OBJ_sigid_free(void);
|
| 180 |
+
|
| 181 |
+
#define SN_ac_auditEntity SN_ac_auditIdentity
|
| 182 |
+
|
| 183 |
+
#ifdef __cplusplus
|
| 184 |
+
}
|
| 185 |
+
#endif
|
| 186 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/objectserr.h
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_OBJECTSERR_H
|
| 12 |
+
#define OPENSSL_OBJECTSERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* OBJ reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define OBJ_R_OID_EXISTS 102
|
| 23 |
+
#define OBJ_R_UNKNOWN_NID 101
|
| 24 |
+
#define OBJ_R_UNKNOWN_OBJECT_NAME 103
|
| 25 |
+
|
| 26 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ocsp.h
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/ocsp.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/* clang-format off */
|
| 14 |
+
|
| 15 |
+
/* clang-format on */
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_OCSP_H
|
| 18 |
+
#define OPENSSL_OCSP_H
|
| 19 |
+
#pragma once
|
| 20 |
+
|
| 21 |
+
#include <openssl/macros.h>
|
| 22 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 23 |
+
#define HEADER_OCSP_H
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#include <openssl/opensslconf.h>
|
| 27 |
+
#include <openssl/http.h>
|
| 28 |
+
#include <openssl/asn1.h>
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
* These definitions are outside the OPENSSL_NO_OCSP guard because although for
|
| 32 |
+
* historical reasons they have OCSP_* names, they can actually be used
|
| 33 |
+
* independently of OCSP. E.g. see RFC5280
|
| 34 |
+
*/
|
| 35 |
+
/*-
|
| 36 |
+
* CRLReason ::= ENUMERATED {
|
| 37 |
+
* unspecified (0),
|
| 38 |
+
* keyCompromise (1),
|
| 39 |
+
* cACompromise (2),
|
| 40 |
+
* affiliationChanged (3),
|
| 41 |
+
* superseded (4),
|
| 42 |
+
* cessationOfOperation (5),
|
| 43 |
+
* certificateHold (6),
|
| 44 |
+
* -- value 7 is not used
|
| 45 |
+
* removeFromCRL (8),
|
| 46 |
+
* privilegeWithdrawn (9),
|
| 47 |
+
* aACompromise (10) }
|
| 48 |
+
*/
|
| 49 |
+
#define OCSP_REVOKED_STATUS_NOSTATUS -1
|
| 50 |
+
#define OCSP_REVOKED_STATUS_UNSPECIFIED 0
|
| 51 |
+
#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
|
| 52 |
+
#define OCSP_REVOKED_STATUS_CACOMPROMISE 2
|
| 53 |
+
#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
|
| 54 |
+
#define OCSP_REVOKED_STATUS_SUPERSEDED 4
|
| 55 |
+
#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
|
| 56 |
+
#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
|
| 57 |
+
#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
|
| 58 |
+
#define OCSP_REVOKED_STATUS_PRIVILEGEWITHDRAWN 9
|
| 59 |
+
#define OCSP_REVOKED_STATUS_AACOMPROMISE 10
|
| 60 |
+
|
| 61 |
+
#ifndef OPENSSL_NO_OCSP
|
| 62 |
+
|
| 63 |
+
#include <openssl/x509.h>
|
| 64 |
+
#include <openssl/x509v3.h>
|
| 65 |
+
#include <openssl/safestack.h>
|
| 66 |
+
#include <openssl/ocsperr.h>
|
| 67 |
+
|
| 68 |
+
#ifdef __cplusplus
|
| 69 |
+
extern "C" {
|
| 70 |
+
#endif
|
| 71 |
+
|
| 72 |
+
/* Various flags and values */
|
| 73 |
+
|
| 74 |
+
#define OCSP_DEFAULT_NONCE_LENGTH 16
|
| 75 |
+
|
| 76 |
+
#define OCSP_NOCERTS 0x1
|
| 77 |
+
#define OCSP_NOINTERN 0x2
|
| 78 |
+
#define OCSP_NOSIGS 0x4
|
| 79 |
+
#define OCSP_NOCHAIN 0x8
|
| 80 |
+
#define OCSP_NOVERIFY 0x10
|
| 81 |
+
#define OCSP_NOEXPLICIT 0x20
|
| 82 |
+
#define OCSP_NOCASIGN 0x40
|
| 83 |
+
#define OCSP_NODELEGATED 0x80
|
| 84 |
+
#define OCSP_NOCHECKS 0x100
|
| 85 |
+
#define OCSP_TRUSTOTHER 0x200
|
| 86 |
+
#define OCSP_RESPID_KEY 0x400
|
| 87 |
+
#define OCSP_NOTIME 0x800
|
| 88 |
+
#define OCSP_PARTIAL_CHAIN 0x1000
|
| 89 |
+
|
| 90 |
+
typedef struct ocsp_cert_id_st OCSP_CERTID;
|
| 91 |
+
typedef struct ocsp_one_request_st OCSP_ONEREQ;
|
| 92 |
+
typedef struct ocsp_req_info_st OCSP_REQINFO;
|
| 93 |
+
typedef struct ocsp_signature_st OCSP_SIGNATURE;
|
| 94 |
+
typedef struct ocsp_request_st OCSP_REQUEST;
|
| 95 |
+
|
| 96 |
+
/* clang-format off */
|
| 97 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_CERTID, OCSP_CERTID, OCSP_CERTID)
|
| 98 |
+
#define sk_OCSP_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_CERTID_sk_type(sk))
|
| 99 |
+
#define sk_OCSP_CERTID_value(sk, idx) ((OCSP_CERTID *)OPENSSL_sk_value(ossl_check_const_OCSP_CERTID_sk_type(sk), (idx)))
|
| 100 |
+
#define sk_OCSP_CERTID_new(cmp) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new(ossl_check_OCSP_CERTID_compfunc_type(cmp)))
|
| 101 |
+
#define sk_OCSP_CERTID_new_null() ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_null())
|
| 102 |
+
#define sk_OCSP_CERTID_new_reserve(cmp, n) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_CERTID_compfunc_type(cmp), (n)))
|
| 103 |
+
#define sk_OCSP_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_CERTID_sk_type(sk), (n))
|
| 104 |
+
#define sk_OCSP_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 105 |
+
#define sk_OCSP_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 106 |
+
#define sk_OCSP_CERTID_delete(sk, i) ((OCSP_CERTID *)OPENSSL_sk_delete(ossl_check_OCSP_CERTID_sk_type(sk), (i)))
|
| 107 |
+
#define sk_OCSP_CERTID_delete_ptr(sk, ptr) ((OCSP_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)))
|
| 108 |
+
#define sk_OCSP_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 109 |
+
#define sk_OCSP_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 110 |
+
#define sk_OCSP_CERTID_pop(sk) ((OCSP_CERTID *)OPENSSL_sk_pop(ossl_check_OCSP_CERTID_sk_type(sk)))
|
| 111 |
+
#define sk_OCSP_CERTID_shift(sk) ((OCSP_CERTID *)OPENSSL_sk_shift(ossl_check_OCSP_CERTID_sk_type(sk)))
|
| 112 |
+
#define sk_OCSP_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_freefunc_type(freefunc))
|
| 113 |
+
#define sk_OCSP_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), (idx))
|
| 114 |
+
#define sk_OCSP_CERTID_set(sk, idx, ptr) ((OCSP_CERTID *)OPENSSL_sk_set(ossl_check_OCSP_CERTID_sk_type(sk), (idx), ossl_check_OCSP_CERTID_type(ptr)))
|
| 115 |
+
#define sk_OCSP_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 116 |
+
#define sk_OCSP_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 117 |
+
#define sk_OCSP_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), pnum)
|
| 118 |
+
#define sk_OCSP_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 119 |
+
#define sk_OCSP_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_CERTID_sk_type(sk))
|
| 120 |
+
#define sk_OCSP_CERTID_dup(sk) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_CERTID_sk_type(sk)))
|
| 121 |
+
#define sk_OCSP_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_copyfunc_type(copyfunc), ossl_check_OCSP_CERTID_freefunc_type(freefunc)))
|
| 122 |
+
#define sk_OCSP_CERTID_set_cmp_func(sk, cmp) ((sk_OCSP_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_compfunc_type(cmp)))
|
| 123 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_ONEREQ, OCSP_ONEREQ, OCSP_ONEREQ)
|
| 124 |
+
#define sk_OCSP_ONEREQ_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_ONEREQ_sk_type(sk))
|
| 125 |
+
#define sk_OCSP_ONEREQ_value(sk, idx) ((OCSP_ONEREQ *)OPENSSL_sk_value(ossl_check_const_OCSP_ONEREQ_sk_type(sk), (idx)))
|
| 126 |
+
#define sk_OCSP_ONEREQ_new(cmp) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new(ossl_check_OCSP_ONEREQ_compfunc_type(cmp)))
|
| 127 |
+
#define sk_OCSP_ONEREQ_new_null() ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_null())
|
| 128 |
+
#define sk_OCSP_ONEREQ_new_reserve(cmp, n) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_ONEREQ_compfunc_type(cmp), (n)))
|
| 129 |
+
#define sk_OCSP_ONEREQ_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_ONEREQ_sk_type(sk), (n))
|
| 130 |
+
#define sk_OCSP_ONEREQ_free(sk) OPENSSL_sk_free(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 131 |
+
#define sk_OCSP_ONEREQ_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 132 |
+
#define sk_OCSP_ONEREQ_delete(sk, i) ((OCSP_ONEREQ *)OPENSSL_sk_delete(ossl_check_OCSP_ONEREQ_sk_type(sk), (i)))
|
| 133 |
+
#define sk_OCSP_ONEREQ_delete_ptr(sk, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)))
|
| 134 |
+
#define sk_OCSP_ONEREQ_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 135 |
+
#define sk_OCSP_ONEREQ_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 136 |
+
#define sk_OCSP_ONEREQ_pop(sk) ((OCSP_ONEREQ *)OPENSSL_sk_pop(ossl_check_OCSP_ONEREQ_sk_type(sk)))
|
| 137 |
+
#define sk_OCSP_ONEREQ_shift(sk) ((OCSP_ONEREQ *)OPENSSL_sk_shift(ossl_check_OCSP_ONEREQ_sk_type(sk)))
|
| 138 |
+
#define sk_OCSP_ONEREQ_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_freefunc_type(freefunc))
|
| 139 |
+
#define sk_OCSP_ONEREQ_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), (idx))
|
| 140 |
+
#define sk_OCSP_ONEREQ_set(sk, idx, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_set(ossl_check_OCSP_ONEREQ_sk_type(sk), (idx), ossl_check_OCSP_ONEREQ_type(ptr)))
|
| 141 |
+
#define sk_OCSP_ONEREQ_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 142 |
+
#define sk_OCSP_ONEREQ_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 143 |
+
#define sk_OCSP_ONEREQ_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), pnum)
|
| 144 |
+
#define sk_OCSP_ONEREQ_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 145 |
+
#define sk_OCSP_ONEREQ_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_ONEREQ_sk_type(sk))
|
| 146 |
+
#define sk_OCSP_ONEREQ_dup(sk) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_dup(ossl_check_const_OCSP_ONEREQ_sk_type(sk)))
|
| 147 |
+
#define sk_OCSP_ONEREQ_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_copyfunc_type(copyfunc), ossl_check_OCSP_ONEREQ_freefunc_type(freefunc)))
|
| 148 |
+
#define sk_OCSP_ONEREQ_set_cmp_func(sk, cmp) ((sk_OCSP_ONEREQ_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_compfunc_type(cmp)))
|
| 149 |
+
|
| 150 |
+
/* clang-format on */
|
| 151 |
+
|
| 152 |
+
#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
|
| 153 |
+
#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
|
| 154 |
+
#define OCSP_RESPONSE_STATUS_INTERNALERROR 2
|
| 155 |
+
#define OCSP_RESPONSE_STATUS_TRYLATER 3
|
| 156 |
+
#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
|
| 157 |
+
#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
|
| 158 |
+
|
| 159 |
+
typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
|
| 160 |
+
|
| 161 |
+
#define V_OCSP_RESPID_NAME 0
|
| 162 |
+
#define V_OCSP_RESPID_KEY 1
|
| 163 |
+
|
| 164 |
+
/* clang-format off */
|
| 165 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_RESPID, OCSP_RESPID, OCSP_RESPID)
|
| 166 |
+
#define sk_OCSP_RESPID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_RESPID_sk_type(sk))
|
| 167 |
+
#define sk_OCSP_RESPID_value(sk, idx) ((OCSP_RESPID *)OPENSSL_sk_value(ossl_check_const_OCSP_RESPID_sk_type(sk), (idx)))
|
| 168 |
+
#define sk_OCSP_RESPID_new(cmp) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new(ossl_check_OCSP_RESPID_compfunc_type(cmp)))
|
| 169 |
+
#define sk_OCSP_RESPID_new_null() ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_null())
|
| 170 |
+
#define sk_OCSP_RESPID_new_reserve(cmp, n) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_RESPID_compfunc_type(cmp), (n)))
|
| 171 |
+
#define sk_OCSP_RESPID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_RESPID_sk_type(sk), (n))
|
| 172 |
+
#define sk_OCSP_RESPID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 173 |
+
#define sk_OCSP_RESPID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 174 |
+
#define sk_OCSP_RESPID_delete(sk, i) ((OCSP_RESPID *)OPENSSL_sk_delete(ossl_check_OCSP_RESPID_sk_type(sk), (i)))
|
| 175 |
+
#define sk_OCSP_RESPID_delete_ptr(sk, ptr) ((OCSP_RESPID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)))
|
| 176 |
+
#define sk_OCSP_RESPID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 177 |
+
#define sk_OCSP_RESPID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 178 |
+
#define sk_OCSP_RESPID_pop(sk) ((OCSP_RESPID *)OPENSSL_sk_pop(ossl_check_OCSP_RESPID_sk_type(sk)))
|
| 179 |
+
#define sk_OCSP_RESPID_shift(sk) ((OCSP_RESPID *)OPENSSL_sk_shift(ossl_check_OCSP_RESPID_sk_type(sk)))
|
| 180 |
+
#define sk_OCSP_RESPID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_freefunc_type(freefunc))
|
| 181 |
+
#define sk_OCSP_RESPID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), (idx))
|
| 182 |
+
#define sk_OCSP_RESPID_set(sk, idx, ptr) ((OCSP_RESPID *)OPENSSL_sk_set(ossl_check_OCSP_RESPID_sk_type(sk), (idx), ossl_check_OCSP_RESPID_type(ptr)))
|
| 183 |
+
#define sk_OCSP_RESPID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 184 |
+
#define sk_OCSP_RESPID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 185 |
+
#define sk_OCSP_RESPID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), pnum)
|
| 186 |
+
#define sk_OCSP_RESPID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 187 |
+
#define sk_OCSP_RESPID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_RESPID_sk_type(sk))
|
| 188 |
+
#define sk_OCSP_RESPID_dup(sk) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_RESPID_sk_type(sk)))
|
| 189 |
+
#define sk_OCSP_RESPID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_copyfunc_type(copyfunc), ossl_check_OCSP_RESPID_freefunc_type(freefunc)))
|
| 190 |
+
#define sk_OCSP_RESPID_set_cmp_func(sk, cmp) ((sk_OCSP_RESPID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_compfunc_type(cmp)))
|
| 191 |
+
|
| 192 |
+
/* clang-format on */
|
| 193 |
+
|
| 194 |
+
typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
|
| 195 |
+
|
| 196 |
+
#define V_OCSP_CERTSTATUS_GOOD 0
|
| 197 |
+
#define V_OCSP_CERTSTATUS_REVOKED 1
|
| 198 |
+
#define V_OCSP_CERTSTATUS_UNKNOWN 2
|
| 199 |
+
|
| 200 |
+
typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
|
| 201 |
+
typedef struct ocsp_single_response_st OCSP_SINGLERESP;
|
| 202 |
+
|
| 203 |
+
/* clang-format off */
|
| 204 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_SINGLERESP, OCSP_SINGLERESP, OCSP_SINGLERESP)
|
| 205 |
+
#define sk_OCSP_SINGLERESP_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_SINGLERESP_sk_type(sk))
|
| 206 |
+
#define sk_OCSP_SINGLERESP_value(sk, idx) ((OCSP_SINGLERESP *)OPENSSL_sk_value(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), (idx)))
|
| 207 |
+
#define sk_OCSP_SINGLERESP_new(cmp) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp)))
|
| 208 |
+
#define sk_OCSP_SINGLERESP_new_null() ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_null())
|
| 209 |
+
#define sk_OCSP_SINGLERESP_new_reserve(cmp, n) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp), (n)))
|
| 210 |
+
#define sk_OCSP_SINGLERESP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_SINGLERESP_sk_type(sk), (n))
|
| 211 |
+
#define sk_OCSP_SINGLERESP_free(sk) OPENSSL_sk_free(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 212 |
+
#define sk_OCSP_SINGLERESP_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 213 |
+
#define sk_OCSP_SINGLERESP_delete(sk, i) ((OCSP_SINGLERESP *)OPENSSL_sk_delete(ossl_check_OCSP_SINGLERESP_sk_type(sk), (i)))
|
| 214 |
+
#define sk_OCSP_SINGLERESP_delete_ptr(sk, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)))
|
| 215 |
+
#define sk_OCSP_SINGLERESP_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 216 |
+
#define sk_OCSP_SINGLERESP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 217 |
+
#define sk_OCSP_SINGLERESP_pop(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_pop(ossl_check_OCSP_SINGLERESP_sk_type(sk)))
|
| 218 |
+
#define sk_OCSP_SINGLERESP_shift(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_shift(ossl_check_OCSP_SINGLERESP_sk_type(sk)))
|
| 219 |
+
#define sk_OCSP_SINGLERESP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc))
|
| 220 |
+
#define sk_OCSP_SINGLERESP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), (idx))
|
| 221 |
+
#define sk_OCSP_SINGLERESP_set(sk, idx, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_set(ossl_check_OCSP_SINGLERESP_sk_type(sk), (idx), ossl_check_OCSP_SINGLERESP_type(ptr)))
|
| 222 |
+
#define sk_OCSP_SINGLERESP_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 223 |
+
#define sk_OCSP_SINGLERESP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 224 |
+
#define sk_OCSP_SINGLERESP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), pnum)
|
| 225 |
+
#define sk_OCSP_SINGLERESP_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 226 |
+
#define sk_OCSP_SINGLERESP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_SINGLERESP_sk_type(sk))
|
| 227 |
+
#define sk_OCSP_SINGLERESP_dup(sk) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_dup(ossl_check_const_OCSP_SINGLERESP_sk_type(sk)))
|
| 228 |
+
#define sk_OCSP_SINGLERESP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_copyfunc_type(copyfunc), ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc)))
|
| 229 |
+
#define sk_OCSP_SINGLERESP_set_cmp_func(sk, cmp) ((sk_OCSP_SINGLERESP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_compfunc_type(cmp)))
|
| 230 |
+
|
| 231 |
+
/* clang-format on */
|
| 232 |
+
|
| 233 |
+
typedef struct ocsp_response_data_st OCSP_RESPDATA;
|
| 234 |
+
|
| 235 |
+
typedef struct ocsp_basic_response_st OCSP_BASICRESP;
|
| 236 |
+
|
| 237 |
+
typedef struct ocsp_crl_id_st OCSP_CRLID;
|
| 238 |
+
typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
|
| 239 |
+
|
| 240 |
+
#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
|
| 241 |
+
#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
|
| 242 |
+
|
| 243 |
+
#define d2i_OCSP_REQUEST_bio(bp, p) ASN1_d2i_bio_of(OCSP_REQUEST, OCSP_REQUEST_new, d2i_OCSP_REQUEST, bp, p)
|
| 244 |
+
|
| 245 |
+
#define d2i_OCSP_RESPONSE_bio(bp, p) ASN1_d2i_bio_of(OCSP_RESPONSE, OCSP_RESPONSE_new, d2i_OCSP_RESPONSE, bp, p)
|
| 246 |
+
|
| 247 |
+
#define PEM_read_bio_OCSP_REQUEST(bp, x, cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
|
| 248 |
+
(d2i_of_void *)d2i_OCSP_REQUEST, PEM_STRING_OCSP_REQUEST, \
|
| 249 |
+
bp, (char **)(x), cb, NULL)
|
| 250 |
+
|
| 251 |
+
#define PEM_read_bio_OCSP_RESPONSE(bp, x, cb) (OCSP_RESPONSE *)PEM_ASN1_read_bio( \
|
| 252 |
+
(d2i_of_void *)d2i_OCSP_RESPONSE, PEM_STRING_OCSP_RESPONSE, \
|
| 253 |
+
bp, (char **)(x), cb, NULL)
|
| 254 |
+
|
| 255 |
+
#define PEM_write_bio_OCSP_REQUEST(bp, o) \
|
| 256 |
+
PEM_ASN1_write_bio((i2d_of_void *)i2d_OCSP_REQUEST, PEM_STRING_OCSP_REQUEST, \
|
| 257 |
+
bp, (char *)(o), NULL, NULL, 0, NULL, NULL)
|
| 258 |
+
|
| 259 |
+
#define PEM_write_bio_OCSP_RESPONSE(bp, o) \
|
| 260 |
+
PEM_ASN1_write_bio((i2d_of_void *)i2d_OCSP_RESPONSE, PEM_STRING_OCSP_RESPONSE, \
|
| 261 |
+
bp, (char *)(o), NULL, NULL, 0, NULL, NULL)
|
| 262 |
+
|
| 263 |
+
#define i2d_OCSP_RESPONSE_bio(bp, o) ASN1_i2d_bio_of(OCSP_RESPONSE, i2d_OCSP_RESPONSE, bp, o)
|
| 264 |
+
|
| 265 |
+
#define i2d_OCSP_REQUEST_bio(bp, o) ASN1_i2d_bio_of(OCSP_REQUEST, i2d_OCSP_REQUEST, bp, o)
|
| 266 |
+
|
| 267 |
+
#define ASN1_BIT_STRING_digest(data, type, md, len) \
|
| 268 |
+
ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING), type, data, md, len)
|
| 269 |
+
|
| 270 |
+
#define OCSP_CERTSTATUS_dup(cs) \
|
| 271 |
+
(OCSP_CERTSTATUS *)ASN1_dup((i2d_of_void *)i2d_OCSP_CERTSTATUS, \
|
| 272 |
+
(d2i_of_void *)d2i_OCSP_CERTSTATUS, (char *)(cs))
|
| 273 |
+
|
| 274 |
+
DECLARE_ASN1_DUP_FUNCTION(OCSP_CERTID)
|
| 275 |
+
|
| 276 |
+
OSSL_HTTP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path,
|
| 277 |
+
const OCSP_REQUEST *req, int buf_size);
|
| 278 |
+
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
|
| 279 |
+
|
| 280 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 281 |
+
typedef OSSL_HTTP_REQ_CTX OCSP_REQ_CTX;
|
| 282 |
+
#define OCSP_REQ_CTX_new(io, buf_size) \
|
| 283 |
+
OSSL_HTTP_REQ_CTX_new(io, io, buf_size)
|
| 284 |
+
#define OCSP_REQ_CTX_free OSSL_HTTP_REQ_CTX_free
|
| 285 |
+
#define OCSP_REQ_CTX_http(rctx, op, path) \
|
| 286 |
+
(OSSL_HTTP_REQ_CTX_set_expected(rctx, NULL, 1 /* asn1 */, 0, 0) && OSSL_HTTP_REQ_CTX_set_request_line(rctx, strcmp(op, "POST") == 0, NULL, NULL, path))
|
| 287 |
+
#define OCSP_REQ_CTX_add1_header OSSL_HTTP_REQ_CTX_add1_header
|
| 288 |
+
#define OCSP_REQ_CTX_i2d(r, it, req) \
|
| 289 |
+
OSSL_HTTP_REQ_CTX_set1_req(r, "application/ocsp-request", it, req)
|
| 290 |
+
#define OCSP_REQ_CTX_set1_req(r, req) \
|
| 291 |
+
OCSP_REQ_CTX_i2d(r, ASN1_ITEM_rptr(OCSP_REQUEST), (ASN1_VALUE *)(req))
|
| 292 |
+
#define OCSP_REQ_CTX_nbio OSSL_HTTP_REQ_CTX_nbio
|
| 293 |
+
#define OCSP_REQ_CTX_nbio_d2i OSSL_HTTP_REQ_CTX_nbio_d2i
|
| 294 |
+
#define OCSP_sendreq_nbio(p, r) \
|
| 295 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(r, (ASN1_VALUE **)(p), \
|
| 296 |
+
ASN1_ITEM_rptr(OCSP_RESPONSE))
|
| 297 |
+
#define OCSP_REQ_CTX_get0_mem_bio OSSL_HTTP_REQ_CTX_get0_mem_bio
|
| 298 |
+
#define OCSP_set_max_response_length OSSL_HTTP_REQ_CTX_set_max_response_length
|
| 299 |
+
#endif
|
| 300 |
+
|
| 301 |
+
OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
|
| 302 |
+
const X509 *issuer);
|
| 303 |
+
|
| 304 |
+
OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
|
| 305 |
+
const X509_NAME *issuerName,
|
| 306 |
+
const ASN1_BIT_STRING *issuerKey,
|
| 307 |
+
const ASN1_INTEGER *serialNumber);
|
| 308 |
+
|
| 309 |
+
OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
|
| 310 |
+
|
| 311 |
+
int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
|
| 312 |
+
int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
|
| 313 |
+
int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
|
| 314 |
+
int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
|
| 315 |
+
|
| 316 |
+
int OCSP_request_set1_name(OCSP_REQUEST *req, const X509_NAME *nm);
|
| 317 |
+
int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
|
| 318 |
+
|
| 319 |
+
int OCSP_request_sign(OCSP_REQUEST *req,
|
| 320 |
+
X509 *signer,
|
| 321 |
+
EVP_PKEY *key,
|
| 322 |
+
const EVP_MD *dgst,
|
| 323 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 324 |
+
|
| 325 |
+
int OCSP_response_status(OCSP_RESPONSE *resp);
|
| 326 |
+
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
|
| 327 |
+
|
| 328 |
+
const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
|
| 329 |
+
const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
|
| 330 |
+
const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs);
|
| 331 |
+
int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
|
| 332 |
+
STACK_OF(X509) *extra_certs);
|
| 333 |
+
|
| 334 |
+
int OCSP_resp_count(OCSP_BASICRESP *bs);
|
| 335 |
+
OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
|
| 336 |
+
const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs);
|
| 337 |
+
const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
|
| 338 |
+
int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
|
| 339 |
+
const ASN1_OCTET_STRING **pid,
|
| 340 |
+
const X509_NAME **pname);
|
| 341 |
+
int OCSP_resp_get1_id(const OCSP_BASICRESP *bs,
|
| 342 |
+
ASN1_OCTET_STRING **pid,
|
| 343 |
+
X509_NAME **pname);
|
| 344 |
+
|
| 345 |
+
int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
|
| 346 |
+
int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
|
| 347 |
+
ASN1_GENERALIZEDTIME **revtime,
|
| 348 |
+
ASN1_GENERALIZEDTIME **thisupd,
|
| 349 |
+
ASN1_GENERALIZEDTIME **nextupd);
|
| 350 |
+
int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
|
| 351 |
+
int *reason,
|
| 352 |
+
ASN1_GENERALIZEDTIME **revtime,
|
| 353 |
+
ASN1_GENERALIZEDTIME **thisupd,
|
| 354 |
+
ASN1_GENERALIZEDTIME **nextupd);
|
| 355 |
+
int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
| 356 |
+
ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
|
| 357 |
+
|
| 358 |
+
int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
|
| 359 |
+
X509_STORE *store, unsigned long flags);
|
| 360 |
+
|
| 361 |
+
#define OCSP_parse_url(url, host, port, path, ssl) \
|
| 362 |
+
OSSL_HTTP_parse_url(url, ssl, NULL, host, port, NULL, path, NULL, NULL)
|
| 363 |
+
|
| 364 |
+
int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
|
| 365 |
+
int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
|
| 366 |
+
|
| 367 |
+
int OCSP_request_onereq_count(OCSP_REQUEST *req);
|
| 368 |
+
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
|
| 369 |
+
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
|
| 370 |
+
int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
|
| 371 |
+
ASN1_OCTET_STRING **pikeyHash,
|
| 372 |
+
ASN1_INTEGER **pserial, OCSP_CERTID *cid);
|
| 373 |
+
int OCSP_request_is_signed(OCSP_REQUEST *req);
|
| 374 |
+
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
|
| 375 |
+
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
|
| 376 |
+
OCSP_CERTID *cid,
|
| 377 |
+
int status, int reason,
|
| 378 |
+
ASN1_TIME *revtime,
|
| 379 |
+
ASN1_TIME *thisupd,
|
| 380 |
+
ASN1_TIME *nextupd);
|
| 381 |
+
int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
|
| 382 |
+
int OCSP_basic_sign(OCSP_BASICRESP *brsp,
|
| 383 |
+
X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
|
| 384 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 385 |
+
int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp,
|
| 386 |
+
X509 *signer, EVP_MD_CTX *ctx,
|
| 387 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 388 |
+
int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
|
| 389 |
+
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
|
| 390 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 391 |
+
int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
|
| 392 |
+
int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
|
| 393 |
+
const char *propq);
|
| 394 |
+
int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
|
| 395 |
+
|
| 396 |
+
X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim);
|
| 397 |
+
|
| 398 |
+
X509_EXTENSION *OCSP_accept_responses_new(char **oids);
|
| 399 |
+
|
| 400 |
+
X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
|
| 401 |
+
|
| 402 |
+
X509_EXTENSION *OCSP_url_svcloc_new(const X509_NAME *issuer, const char **urls);
|
| 403 |
+
|
| 404 |
+
int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
|
| 405 |
+
int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
|
| 406 |
+
int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
|
| 407 |
+
int lastpos);
|
| 408 |
+
int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
|
| 409 |
+
X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
|
| 410 |
+
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
|
| 411 |
+
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
|
| 412 |
+
int *idx);
|
| 413 |
+
int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
|
| 414 |
+
unsigned long flags);
|
| 415 |
+
int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
|
| 416 |
+
|
| 417 |
+
int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
|
| 418 |
+
int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
|
| 419 |
+
int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos);
|
| 420 |
+
int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
|
| 421 |
+
X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
|
| 422 |
+
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
|
| 423 |
+
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
|
| 424 |
+
int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
|
| 425 |
+
unsigned long flags);
|
| 426 |
+
int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
|
| 427 |
+
|
| 428 |
+
int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
|
| 429 |
+
int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
|
| 430 |
+
int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
|
| 431 |
+
int lastpos);
|
| 432 |
+
int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
|
| 433 |
+
int lastpos);
|
| 434 |
+
X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
|
| 435 |
+
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
|
| 436 |
+
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
|
| 437 |
+
int *idx);
|
| 438 |
+
int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
|
| 439 |
+
int crit, unsigned long flags);
|
| 440 |
+
int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
|
| 441 |
+
|
| 442 |
+
int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
|
| 443 |
+
int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
|
| 444 |
+
int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj,
|
| 445 |
+
int lastpos);
|
| 446 |
+
int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
|
| 447 |
+
int lastpos);
|
| 448 |
+
X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
|
| 449 |
+
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
|
| 450 |
+
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
|
| 451 |
+
int *idx);
|
| 452 |
+
int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
|
| 453 |
+
int crit, unsigned long flags);
|
| 454 |
+
int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
|
| 455 |
+
const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
|
| 456 |
+
|
| 457 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
|
| 458 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
|
| 459 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
|
| 460 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
|
| 461 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
|
| 462 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
|
| 463 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
|
| 464 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
|
| 465 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
|
| 466 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
|
| 467 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
|
| 468 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
|
| 469 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
|
| 470 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
|
| 471 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
|
| 472 |
+
|
| 473 |
+
const char *OCSP_response_status_str(long s);
|
| 474 |
+
const char *OCSP_cert_status_str(long s);
|
| 475 |
+
const char *OCSP_crl_reason_str(long s);
|
| 476 |
+
|
| 477 |
+
int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
|
| 478 |
+
int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
|
| 479 |
+
|
| 480 |
+
int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
|
| 481 |
+
X509_STORE *st, unsigned long flags);
|
| 482 |
+
|
| 483 |
+
#ifdef __cplusplus
|
| 484 |
+
}
|
| 485 |
+
#endif
|
| 486 |
+
#endif /* !defined(OPENSSL_NO_OCSP) */
|
| 487 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ocsperr.h
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_OCSPERR_H
|
| 12 |
+
#define OPENSSL_OCSPERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
#ifndef OPENSSL_NO_OCSP
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* OCSP reason codes.
|
| 23 |
+
*/
|
| 24 |
+
#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
|
| 25 |
+
#define OCSP_R_DIGEST_ERR 102
|
| 26 |
+
#define OCSP_R_DIGEST_NAME_ERR 106
|
| 27 |
+
#define OCSP_R_DIGEST_SIZE_ERR 107
|
| 28 |
+
#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
|
| 29 |
+
#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
|
| 30 |
+
#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
|
| 31 |
+
#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
|
| 32 |
+
#define OCSP_R_NOT_BASIC_RESPONSE 104
|
| 33 |
+
#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
|
| 34 |
+
#define OCSP_R_NO_RESPONSE_DATA 108
|
| 35 |
+
#define OCSP_R_NO_REVOKED_TIME 109
|
| 36 |
+
#define OCSP_R_NO_SIGNER_KEY 130
|
| 37 |
+
#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
|
| 38 |
+
#define OCSP_R_REQUEST_NOT_SIGNED 128
|
| 39 |
+
#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
|
| 40 |
+
#define OCSP_R_ROOT_CA_NOT_TRUSTED 112
|
| 41 |
+
#define OCSP_R_SIGNATURE_FAILURE 117
|
| 42 |
+
#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
|
| 43 |
+
#define OCSP_R_STATUS_EXPIRED 125
|
| 44 |
+
#define OCSP_R_STATUS_NOT_YET_VALID 126
|
| 45 |
+
#define OCSP_R_STATUS_TOO_OLD 127
|
| 46 |
+
#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
|
| 47 |
+
#define OCSP_R_UNKNOWN_NID 120
|
| 48 |
+
#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
|
| 49 |
+
|
| 50 |
+
#endif
|
| 51 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/opensslconf.h
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_OPENSSLCONF_H
|
| 11 |
+
#define OPENSSL_OPENSSLCONF_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/configuration.h>
|
| 15 |
+
#include <openssl/macros.h>
|
| 16 |
+
|
| 17 |
+
#endif /* OPENSSL_OPENSSLCONF_H */
|
physworld_p1_20261018/envs/p1/include/openssl/opensslv.h
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/opensslv.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef OPENSSL_OPENSSLV_H
|
| 14 |
+
#define OPENSSL_OPENSSLV_H
|
| 15 |
+
#pragma once
|
| 16 |
+
|
| 17 |
+
#ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* SECTION 1: VERSION DATA. These will change for each release
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* Base version macros
|
| 27 |
+
*
|
| 28 |
+
* These macros express version number MAJOR.MINOR.PATCH exactly
|
| 29 |
+
*/
|
| 30 |
+
/* clang-format off */
|
| 31 |
+
# define OPENSSL_VERSION_MAJOR 3
|
| 32 |
+
/* clang-format on */
|
| 33 |
+
/* clang-format off */
|
| 34 |
+
# define OPENSSL_VERSION_MINOR 6
|
| 35 |
+
/* clang-format on */
|
| 36 |
+
/* clang-format off */
|
| 37 |
+
# define OPENSSL_VERSION_PATCH 5
|
| 38 |
+
/* clang-format on */
|
| 39 |
+
|
| 40 |
+
/*
|
| 41 |
+
* Additional version information
|
| 42 |
+
*
|
| 43 |
+
* These are also part of the new version scheme, but aren't part
|
| 44 |
+
* of the version number itself.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
/* Could be: #define OPENSSL_VERSION_PRE_RELEASE "-alpha.1" */
|
| 48 |
+
/* clang-format off */
|
| 49 |
+
# define OPENSSL_VERSION_PRE_RELEASE ""
|
| 50 |
+
/* clang-format on */
|
| 51 |
+
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+fips" */
|
| 52 |
+
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+vendor.1" */
|
| 53 |
+
/* clang-format off */
|
| 54 |
+
# define OPENSSL_VERSION_BUILD_METADATA ""
|
| 55 |
+
/* clang-format on */
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* Note: The OpenSSL Project will never define OPENSSL_VERSION_BUILD_METADATA
|
| 59 |
+
* to be anything but the empty string. Its use is entirely reserved for
|
| 60 |
+
* others
|
| 61 |
+
*/
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Shared library version
|
| 65 |
+
*
|
| 66 |
+
* This is strictly to express ABI version, which may or may not
|
| 67 |
+
* be related to the API version expressed with the macros above.
|
| 68 |
+
* This is defined in free form.
|
| 69 |
+
*/
|
| 70 |
+
/* clang-format off */
|
| 71 |
+
# define OPENSSL_SHLIB_VERSION 3
|
| 72 |
+
/* clang-format on */
|
| 73 |
+
|
| 74 |
+
/*
|
| 75 |
+
* SECTION 2: USEFUL MACROS
|
| 76 |
+
*/
|
| 77 |
+
|
| 78 |
+
/* For checking general API compatibility when preprocessing */
|
| 79 |
+
#define OPENSSL_VERSION_PREREQ(maj, min) \
|
| 80 |
+
((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
|
| 81 |
+
|
| 82 |
+
/*
|
| 83 |
+
* Macros to get the version in easily digested string form, both the short
|
| 84 |
+
* "MAJOR.MINOR.PATCH" variant (where MAJOR, MINOR and PATCH are replaced
|
| 85 |
+
* with the values from the corresponding OPENSSL_VERSION_ macros) and the
|
| 86 |
+
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
|
| 87 |
+
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
|
| 88 |
+
*/
|
| 89 |
+
/* clang-format off */
|
| 90 |
+
# define OPENSSL_VERSION_STR "3.6.5"
|
| 91 |
+
/* clang-format on */
|
| 92 |
+
/* clang-format off */
|
| 93 |
+
# define OPENSSL_FULL_VERSION_STR "3.6.5"
|
| 94 |
+
/* clang-format on */
|
| 95 |
+
|
| 96 |
+
/*
|
| 97 |
+
* SECTION 3: ADDITIONAL METADATA
|
| 98 |
+
*
|
| 99 |
+
* These strings are defined separately to allow them to be parsable.
|
| 100 |
+
*/
|
| 101 |
+
/* clang-format off */
|
| 102 |
+
# define OPENSSL_RELEASE_DATE "29 Sep 2026"
|
| 103 |
+
/* clang-format on */
|
| 104 |
+
|
| 105 |
+
/*
|
| 106 |
+
* SECTION 4: BACKWARD COMPATIBILITY
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
/* clang-format off */
|
| 110 |
+
# define OPENSSL_VERSION_TEXT "OpenSSL 3.6.5 29 Sep 2026"
|
| 111 |
+
/* clang-format on */
|
| 112 |
+
|
| 113 |
+
/* clang-format off */
|
| 114 |
+
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PP0L */
|
| 115 |
+
# define OPENSSL_VERSION_NUMBER \
|
| 116 |
+
( (OPENSSL_VERSION_MAJOR<<28) \
|
| 117 |
+
|(OPENSSL_VERSION_MINOR<<20) \
|
| 118 |
+
|(OPENSSL_VERSION_PATCH<<4) \
|
| 119 |
+
|0x0L )
|
| 120 |
+
/* clang-format on */
|
| 121 |
+
|
| 122 |
+
#ifdef __cplusplus
|
| 123 |
+
}
|
| 124 |
+
#endif
|
| 125 |
+
|
| 126 |
+
#include <openssl/macros.h>
|
| 127 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 128 |
+
#define HEADER_OPENSSLV_H
|
| 129 |
+
#endif
|
| 130 |
+
|
| 131 |
+
#endif /* OPENSSL_OPENSSLV_H */
|
physworld_p1_20261018/envs/p1/include/openssl/ossl_typ.h
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* The original <openssl/ossl_typ.h> was renamed to <openssl/types.h>
|
| 12 |
+
*
|
| 13 |
+
* This header file only exists for compatibility reasons with older
|
| 14 |
+
* applications which #include <openssl/ossl_typ.h>.
|
| 15 |
+
*/
|
| 16 |
+
#include <openssl/types.h>
|
physworld_p1_20261018/envs/p1/include/openssl/param_build.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PARAM_BUILD_H
|
| 12 |
+
#define OPENSSL_PARAM_BUILD_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/params.h>
|
| 16 |
+
#include <openssl/types.h>
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
OSSL_PARAM_BLD *OSSL_PARAM_BLD_new(void);
|
| 23 |
+
OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld);
|
| 24 |
+
void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld);
|
| 25 |
+
|
| 26 |
+
int OSSL_PARAM_BLD_push_int(OSSL_PARAM_BLD *bld, const char *key, int val);
|
| 27 |
+
int OSSL_PARAM_BLD_push_uint(OSSL_PARAM_BLD *bld, const char *key,
|
| 28 |
+
unsigned int val);
|
| 29 |
+
int OSSL_PARAM_BLD_push_long(OSSL_PARAM_BLD *bld, const char *key,
|
| 30 |
+
long int val);
|
| 31 |
+
int OSSL_PARAM_BLD_push_ulong(OSSL_PARAM_BLD *bld, const char *key,
|
| 32 |
+
unsigned long int val);
|
| 33 |
+
int OSSL_PARAM_BLD_push_int32(OSSL_PARAM_BLD *bld, const char *key,
|
| 34 |
+
int32_t val);
|
| 35 |
+
int OSSL_PARAM_BLD_push_uint32(OSSL_PARAM_BLD *bld, const char *key,
|
| 36 |
+
uint32_t val);
|
| 37 |
+
int OSSL_PARAM_BLD_push_int64(OSSL_PARAM_BLD *bld, const char *key,
|
| 38 |
+
int64_t val);
|
| 39 |
+
int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key,
|
| 40 |
+
uint64_t val);
|
| 41 |
+
int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key,
|
| 42 |
+
size_t val);
|
| 43 |
+
int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key,
|
| 44 |
+
time_t val);
|
| 45 |
+
int OSSL_PARAM_BLD_push_double(OSSL_PARAM_BLD *bld, const char *key,
|
| 46 |
+
double val);
|
| 47 |
+
int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key,
|
| 48 |
+
const BIGNUM *bn);
|
| 49 |
+
int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key,
|
| 50 |
+
const BIGNUM *bn, size_t sz);
|
| 51 |
+
int OSSL_PARAM_BLD_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key,
|
| 52 |
+
const char *buf, size_t bsize);
|
| 53 |
+
int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key,
|
| 54 |
+
char *buf, size_t bsize);
|
| 55 |
+
int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key,
|
| 56 |
+
const void *buf, size_t bsize);
|
| 57 |
+
int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key,
|
| 58 |
+
void *buf, size_t bsize);
|
| 59 |
+
|
| 60 |
+
#ifdef __cplusplus
|
| 61 |
+
}
|
| 62 |
+
#endif
|
| 63 |
+
#endif /* OPENSSL_PARAM_BUILD_H */
|
physworld_p1_20261018/envs/p1/include/openssl/params.h
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PARAMS_H
|
| 12 |
+
#define OPENSSL_PARAMS_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/core.h>
|
| 16 |
+
#include <openssl/bn.h>
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
|
| 23 |
+
|
| 24 |
+
#define OSSL_PARAM_END \
|
| 25 |
+
{ NULL, 0, NULL, 0, 0 }
|
| 26 |
+
|
| 27 |
+
#define OSSL_PARAM_DEFN(key, type, addr, sz) \
|
| 28 |
+
{ (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
|
| 29 |
+
|
| 30 |
+
/* Basic parameter types without return sizes */
|
| 31 |
+
#define OSSL_PARAM_int(key, addr) \
|
| 32 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
|
| 33 |
+
#define OSSL_PARAM_uint(key, addr) \
|
| 34 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
| 35 |
+
sizeof(unsigned int))
|
| 36 |
+
#define OSSL_PARAM_long(key, addr) \
|
| 37 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int))
|
| 38 |
+
#define OSSL_PARAM_ulong(key, addr) \
|
| 39 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
| 40 |
+
sizeof(unsigned long int))
|
| 41 |
+
#define OSSL_PARAM_int32(key, addr) \
|
| 42 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t))
|
| 43 |
+
#define OSSL_PARAM_uint32(key, addr) \
|
| 44 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
| 45 |
+
sizeof(uint32_t))
|
| 46 |
+
#define OSSL_PARAM_int64(key, addr) \
|
| 47 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t))
|
| 48 |
+
#define OSSL_PARAM_uint64(key, addr) \
|
| 49 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
|
| 50 |
+
sizeof(uint64_t))
|
| 51 |
+
#define OSSL_PARAM_size_t(key, addr) \
|
| 52 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t))
|
| 53 |
+
#define OSSL_PARAM_time_t(key, addr) \
|
| 54 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(time_t))
|
| 55 |
+
#define OSSL_PARAM_double(key, addr) \
|
| 56 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double))
|
| 57 |
+
|
| 58 |
+
#define OSSL_PARAM_BN(key, bn, sz) \
|
| 59 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (bn), (sz))
|
| 60 |
+
#define OSSL_PARAM_utf8_string(key, addr, sz) \
|
| 61 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
|
| 62 |
+
#define OSSL_PARAM_octet_string(key, addr, sz) \
|
| 63 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
|
| 64 |
+
|
| 65 |
+
#define OSSL_PARAM_utf8_ptr(key, addr, sz) \
|
| 66 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, (addr), sz)
|
| 67 |
+
#define OSSL_PARAM_octet_ptr(key, addr, sz) \
|
| 68 |
+
OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, (addr), sz)
|
| 69 |
+
|
| 70 |
+
/* Search an OSSL_PARAM array for a matching name */
|
| 71 |
+
OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key);
|
| 72 |
+
const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *p, const char *key);
|
| 73 |
+
|
| 74 |
+
/* Basic parameter type run-time construction */
|
| 75 |
+
OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf);
|
| 76 |
+
OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf);
|
| 77 |
+
OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf);
|
| 78 |
+
OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf);
|
| 79 |
+
OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf);
|
| 80 |
+
OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf);
|
| 81 |
+
OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf);
|
| 82 |
+
OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf);
|
| 83 |
+
OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf);
|
| 84 |
+
OSSL_PARAM OSSL_PARAM_construct_time_t(const char *key, time_t *buf);
|
| 85 |
+
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
|
| 86 |
+
size_t bsize);
|
| 87 |
+
OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf);
|
| 88 |
+
OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
|
| 89 |
+
size_t bsize);
|
| 90 |
+
OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf,
|
| 91 |
+
size_t bsize);
|
| 92 |
+
OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
|
| 93 |
+
size_t bsize);
|
| 94 |
+
OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
|
| 95 |
+
size_t bsize);
|
| 96 |
+
OSSL_PARAM OSSL_PARAM_construct_end(void);
|
| 97 |
+
|
| 98 |
+
int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
|
| 99 |
+
const OSSL_PARAM *paramdefs,
|
| 100 |
+
const char *key, const char *value,
|
| 101 |
+
size_t value_n, int *found);
|
| 102 |
+
|
| 103 |
+
int OSSL_PARAM_print_to_bio(const OSSL_PARAM *params, BIO *bio,
|
| 104 |
+
int print_values);
|
| 105 |
+
|
| 106 |
+
int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val);
|
| 107 |
+
int OSSL_PARAM_get_uint(const OSSL_PARAM *p, unsigned int *val);
|
| 108 |
+
int OSSL_PARAM_get_long(const OSSL_PARAM *p, long int *val);
|
| 109 |
+
int OSSL_PARAM_get_ulong(const OSSL_PARAM *p, unsigned long int *val);
|
| 110 |
+
int OSSL_PARAM_get_int32(const OSSL_PARAM *p, int32_t *val);
|
| 111 |
+
int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val);
|
| 112 |
+
int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val);
|
| 113 |
+
int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val);
|
| 114 |
+
int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val);
|
| 115 |
+
int OSSL_PARAM_get_time_t(const OSSL_PARAM *p, time_t *val);
|
| 116 |
+
|
| 117 |
+
int OSSL_PARAM_set_int(OSSL_PARAM *p, int val);
|
| 118 |
+
int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val);
|
| 119 |
+
int OSSL_PARAM_set_long(OSSL_PARAM *p, long int val);
|
| 120 |
+
int OSSL_PARAM_set_ulong(OSSL_PARAM *p, unsigned long int val);
|
| 121 |
+
int OSSL_PARAM_set_int32(OSSL_PARAM *p, int32_t val);
|
| 122 |
+
int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val);
|
| 123 |
+
int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val);
|
| 124 |
+
int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val);
|
| 125 |
+
int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val);
|
| 126 |
+
int OSSL_PARAM_set_time_t(OSSL_PARAM *p, time_t val);
|
| 127 |
+
|
| 128 |
+
int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val);
|
| 129 |
+
int OSSL_PARAM_set_double(OSSL_PARAM *p, double val);
|
| 130 |
+
|
| 131 |
+
int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val);
|
| 132 |
+
int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val);
|
| 133 |
+
|
| 134 |
+
int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val, size_t max_len);
|
| 135 |
+
int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val);
|
| 136 |
+
|
| 137 |
+
int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val, size_t max_len,
|
| 138 |
+
size_t *used_len);
|
| 139 |
+
int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len);
|
| 140 |
+
|
| 141 |
+
int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val);
|
| 142 |
+
int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, const char *val);
|
| 143 |
+
|
| 144 |
+
int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val,
|
| 145 |
+
size_t *used_len);
|
| 146 |
+
int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val,
|
| 147 |
+
size_t used_len);
|
| 148 |
+
|
| 149 |
+
int OSSL_PARAM_get_utf8_string_ptr(const OSSL_PARAM *p, const char **val);
|
| 150 |
+
int OSSL_PARAM_get_octet_string_ptr(const OSSL_PARAM *p, const void **val,
|
| 151 |
+
size_t *used_len);
|
| 152 |
+
|
| 153 |
+
int OSSL_PARAM_modified(const OSSL_PARAM *p);
|
| 154 |
+
void OSSL_PARAM_set_all_unmodified(OSSL_PARAM *p);
|
| 155 |
+
|
| 156 |
+
OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *p);
|
| 157 |
+
OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2);
|
| 158 |
+
void OSSL_PARAM_free(OSSL_PARAM *p);
|
| 159 |
+
|
| 160 |
+
int OSSL_PARAM_set_octet_string_or_ptr(OSSL_PARAM *p, const void *val,
|
| 161 |
+
size_t len);
|
| 162 |
+
|
| 163 |
+
#ifdef __cplusplus
|
| 164 |
+
}
|
| 165 |
+
#endif
|
| 166 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pem.h
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_PEM_H
|
| 11 |
+
#define OPENSSL_PEM_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_PEM_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/e_os2.h>
|
| 20 |
+
#include <openssl/bio.h>
|
| 21 |
+
#include <openssl/safestack.h>
|
| 22 |
+
#include <openssl/evp.h>
|
| 23 |
+
#include <openssl/x509.h>
|
| 24 |
+
#include <openssl/pemerr.h>
|
| 25 |
+
#ifndef OPENSSL_NO_STDIO
|
| 26 |
+
#include <stdio.h>
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
#ifdef __cplusplus
|
| 30 |
+
extern "C" {
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#define PEM_BUFSIZE 1024
|
| 34 |
+
|
| 35 |
+
#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
|
| 36 |
+
#define PEM_STRING_X509 "CERTIFICATE"
|
| 37 |
+
#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
|
| 38 |
+
#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
|
| 39 |
+
#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
|
| 40 |
+
#define PEM_STRING_X509_CRL "X509 CRL"
|
| 41 |
+
#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
|
| 42 |
+
#define PEM_STRING_PUBLIC "PUBLIC KEY"
|
| 43 |
+
#define PEM_STRING_RSA "RSA PRIVATE KEY"
|
| 44 |
+
#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
|
| 45 |
+
#define PEM_STRING_DSA "DSA PRIVATE KEY"
|
| 46 |
+
#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
|
| 47 |
+
#define PEM_STRING_PKCS7 "PKCS7"
|
| 48 |
+
#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
|
| 49 |
+
#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
|
| 50 |
+
#define PEM_STRING_PKCS8INF "PRIVATE KEY"
|
| 51 |
+
#define PEM_STRING_DHPARAMS "DH PARAMETERS"
|
| 52 |
+
#define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
|
| 53 |
+
#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
|
| 54 |
+
#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
|
| 55 |
+
#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
|
| 56 |
+
#define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
|
| 57 |
+
#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
|
| 58 |
+
#define PEM_STRING_PARAMETERS "PARAMETERS"
|
| 59 |
+
#define PEM_STRING_CMS "CMS"
|
| 60 |
+
#define PEM_STRING_SM2PRIVATEKEY "SM2 PRIVATE KEY"
|
| 61 |
+
#define PEM_STRING_SM2PARAMETERS "SM2 PARAMETERS"
|
| 62 |
+
#define PEM_STRING_ACERT "ATTRIBUTE CERTIFICATE"
|
| 63 |
+
|
| 64 |
+
#define PEM_TYPE_ENCRYPTED 10
|
| 65 |
+
#define PEM_TYPE_MIC_ONLY 20
|
| 66 |
+
#define PEM_TYPE_MIC_CLEAR 30
|
| 67 |
+
#define PEM_TYPE_CLEAR 40
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
+
* These macros make the PEM_read/PEM_write functions easier to maintain and
|
| 71 |
+
* write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
|
| 72 |
+
* IMPLEMENT_PEM_rw_cb(...)
|
| 73 |
+
*/
|
| 74 |
+
|
| 75 |
+
#define PEM_read_cb_fnsig(name, type, INTYPE, readname) \
|
| 76 |
+
type *PEM_##readname##_##name(INTYPE *out, type **x, \
|
| 77 |
+
pem_password_cb *cb, void *u)
|
| 78 |
+
#define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname) \
|
| 79 |
+
type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \
|
| 80 |
+
pem_password_cb *cb, void *u, \
|
| 81 |
+
OSSL_LIB_CTX *libctx, \
|
| 82 |
+
const char *propq)
|
| 83 |
+
|
| 84 |
+
#define PEM_write_fnsig(name, type, OUTTYPE, writename) \
|
| 85 |
+
int PEM_##writename##_##name(OUTTYPE *out, const type *x)
|
| 86 |
+
#define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \
|
| 87 |
+
int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
|
| 88 |
+
const EVP_CIPHER *enc, \
|
| 89 |
+
const unsigned char *kstr, int klen, \
|
| 90 |
+
pem_password_cb *cb, void *u)
|
| 91 |
+
#define PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \
|
| 92 |
+
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
| 93 |
+
OSSL_LIB_CTX *libctx, \
|
| 94 |
+
const char *propq)
|
| 95 |
+
#define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename) \
|
| 96 |
+
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
| 97 |
+
const EVP_CIPHER *enc, \
|
| 98 |
+
const unsigned char *kstr, int klen, \
|
| 99 |
+
pem_password_cb *cb, void *u, \
|
| 100 |
+
OSSL_LIB_CTX *libctx, \
|
| 101 |
+
const char *propq)
|
| 102 |
+
|
| 103 |
+
#ifdef OPENSSL_NO_STDIO
|
| 104 |
+
|
| 105 |
+
#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
|
| 106 |
+
#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
|
| 107 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 108 |
+
#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
|
| 109 |
+
#endif
|
| 110 |
+
#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
|
| 111 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 112 |
+
#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
|
| 113 |
+
#endif
|
| 114 |
+
#else
|
| 115 |
+
|
| 116 |
+
#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
|
| 117 |
+
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \
|
| 118 |
+
{ \
|
| 119 |
+
return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp, \
|
| 120 |
+
(void **)x, cb, u); \
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
|
| 124 |
+
PEM_write_fnsig(name, type, FILE, write) \
|
| 125 |
+
{ \
|
| 126 |
+
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
| 127 |
+
x, NULL, NULL, 0, NULL, NULL); \
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 131 |
+
#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
|
| 132 |
+
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
| 133 |
+
#endif
|
| 134 |
+
|
| 135 |
+
#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
|
| 136 |
+
PEM_write_cb_fnsig(name, type, FILE, write) \
|
| 137 |
+
{ \
|
| 138 |
+
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
| 139 |
+
x, enc, kstr, klen, cb, u); \
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 143 |
+
#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
|
| 144 |
+
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
| 145 |
+
#endif
|
| 146 |
+
#endif
|
| 147 |
+
|
| 148 |
+
#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
| 149 |
+
type *PEM_read_bio_##name(BIO *bp, type **x, \
|
| 150 |
+
pem_password_cb *cb, void *u) \
|
| 151 |
+
{ \
|
| 152 |
+
return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
|
| 153 |
+
(void **)x, cb, u); \
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
| 157 |
+
PEM_write_fnsig(name, type, BIO, write_bio) \
|
| 158 |
+
{ \
|
| 159 |
+
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
| 160 |
+
x, NULL, NULL, 0, NULL, NULL); \
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 164 |
+
#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
| 165 |
+
IMPLEMENT_PEM_write_bio(name, type, str, asn1)
|
| 166 |
+
#endif
|
| 167 |
+
|
| 168 |
+
#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
| 169 |
+
PEM_write_cb_fnsig(name, type, BIO, write_bio) \
|
| 170 |
+
{ \
|
| 171 |
+
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
| 172 |
+
x, enc, kstr, klen, cb, u); \
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 176 |
+
#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
| 177 |
+
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1)
|
| 178 |
+
#endif
|
| 179 |
+
|
| 180 |
+
#define IMPLEMENT_PEM_write(name, type, str, asn1) \
|
| 181 |
+
IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
| 182 |
+
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
| 183 |
+
|
| 184 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 185 |
+
#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
|
| 186 |
+
IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
| 187 |
+
IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
|
| 188 |
+
#endif
|
| 189 |
+
|
| 190 |
+
#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
|
| 191 |
+
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
| 192 |
+
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
| 193 |
+
|
| 194 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 195 |
+
#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
|
| 196 |
+
IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
| 197 |
+
IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
|
| 198 |
+
#endif
|
| 199 |
+
|
| 200 |
+
#define IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 201 |
+
IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
| 202 |
+
IMPLEMENT_PEM_read_fp(name, type, str, asn1)
|
| 203 |
+
|
| 204 |
+
#define IMPLEMENT_PEM_rw(name, type, str, asn1) \
|
| 205 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 206 |
+
IMPLEMENT_PEM_write(name, type, str, asn1)
|
| 207 |
+
|
| 208 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 209 |
+
#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
|
| 210 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 211 |
+
IMPLEMENT_PEM_write_const(name, type, str, asn1)
|
| 212 |
+
#endif
|
| 213 |
+
|
| 214 |
+
#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
|
| 215 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 216 |
+
IMPLEMENT_PEM_write_cb(name, type, str, asn1)
|
| 217 |
+
|
| 218 |
+
/* These are the same except they are for the declarations */
|
| 219 |
+
|
| 220 |
+
/*
|
| 221 |
+
* The mysterious 'extern' that's passed to some macros is innocuous,
|
| 222 |
+
* and is there to quiet pre-C99 compilers that may complain about empty
|
| 223 |
+
* arguments in macro calls.
|
| 224 |
+
*/
|
| 225 |
+
#if defined(OPENSSL_NO_STDIO)
|
| 226 |
+
|
| 227 |
+
#define DECLARE_PEM_read_fp_attr(attr, name, type) /**/
|
| 228 |
+
#define DECLARE_PEM_read_fp_ex_attr(attr, name, type) /**/
|
| 229 |
+
#define DECLARE_PEM_write_fp_attr(attr, name, type) /**/
|
| 230 |
+
#define DECLARE_PEM_write_fp_ex_attr(attr, name, type) /**/
|
| 231 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 232 |
+
#define DECLARE_PEM_write_fp_const_attr(attr, name, type) /**/
|
| 233 |
+
#endif
|
| 234 |
+
#define DECLARE_PEM_write_cb_fp_attr(attr, name, type) /**/
|
| 235 |
+
#define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) /**/
|
| 236 |
+
|
| 237 |
+
#else
|
| 238 |
+
|
| 239 |
+
#define DECLARE_PEM_read_fp_attr(attr, name, type) \
|
| 240 |
+
attr PEM_read_cb_fnsig(name, type, FILE, read);
|
| 241 |
+
#define DECLARE_PEM_read_fp_ex_attr(attr, name, type) \
|
| 242 |
+
attr PEM_read_cb_fnsig(name, type, FILE, read); \
|
| 243 |
+
attr PEM_read_cb_ex_fnsig(name, type, FILE, read);
|
| 244 |
+
|
| 245 |
+
#define DECLARE_PEM_write_fp_attr(attr, name, type) \
|
| 246 |
+
attr PEM_write_fnsig(name, type, FILE, write);
|
| 247 |
+
#define DECLARE_PEM_write_fp_ex_attr(attr, name, type) \
|
| 248 |
+
attr PEM_write_fnsig(name, type, FILE, write); \
|
| 249 |
+
attr PEM_write_ex_fnsig(name, type, FILE, write);
|
| 250 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 251 |
+
#define DECLARE_PEM_write_fp_const_attr(attr, name, type) \
|
| 252 |
+
attr PEM_write_fnsig(name, type, FILE, write);
|
| 253 |
+
#endif
|
| 254 |
+
#define DECLARE_PEM_write_cb_fp_attr(attr, name, type) \
|
| 255 |
+
attr PEM_write_cb_fnsig(name, type, FILE, write);
|
| 256 |
+
#define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) \
|
| 257 |
+
attr PEM_write_cb_fnsig(name, type, FILE, write); \
|
| 258 |
+
attr PEM_write_cb_ex_fnsig(name, type, FILE, write);
|
| 259 |
+
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
#define DECLARE_PEM_read_fp(name, type) \
|
| 263 |
+
DECLARE_PEM_read_fp_attr(extern, name, type)
|
| 264 |
+
#define DECLARE_PEM_write_fp(name, type) \
|
| 265 |
+
DECLARE_PEM_write_fp_attr(extern, name, type)
|
| 266 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 267 |
+
#define DECLARE_PEM_write_fp_const(name, type) \
|
| 268 |
+
DECLARE_PEM_write_fp_const_attr(extern, name, type)
|
| 269 |
+
#endif
|
| 270 |
+
#define DECLARE_PEM_write_cb_fp(name, type) \
|
| 271 |
+
DECLARE_PEM_write_cb_fp_attr(extern, name, type)
|
| 272 |
+
|
| 273 |
+
#define DECLARE_PEM_read_bio_attr(attr, name, type) \
|
| 274 |
+
attr PEM_read_cb_fnsig(name, type, BIO, read_bio);
|
| 275 |
+
#define DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
| 276 |
+
attr PEM_read_cb_fnsig(name, type, BIO, read_bio); \
|
| 277 |
+
attr PEM_read_cb_ex_fnsig(name, type, BIO, read_bio);
|
| 278 |
+
#define DECLARE_PEM_read_bio(name, type) \
|
| 279 |
+
DECLARE_PEM_read_bio_attr(extern, name, type)
|
| 280 |
+
#define DECLARE_PEM_read_bio_ex(name, type) \
|
| 281 |
+
DECLARE_PEM_read_bio_ex_attr(extern, name, type)
|
| 282 |
+
|
| 283 |
+
#define DECLARE_PEM_write_bio_attr(attr, name, type) \
|
| 284 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
| 285 |
+
#define DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
| 286 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio); \
|
| 287 |
+
attr PEM_write_ex_fnsig(name, type, BIO, write_bio);
|
| 288 |
+
#define DECLARE_PEM_write_bio(name, type) \
|
| 289 |
+
DECLARE_PEM_write_bio_attr(extern, name, type)
|
| 290 |
+
#define DECLARE_PEM_write_bio_ex(name, type) \
|
| 291 |
+
DECLARE_PEM_write_bio_ex_attr(extern, name, type)
|
| 292 |
+
|
| 293 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 294 |
+
#define DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
| 295 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
| 296 |
+
#define DECLARE_PEM_write_bio_const(name, type) \
|
| 297 |
+
DECLARE_PEM_write_bio_const_attr(extern, name, type)
|
| 298 |
+
#endif
|
| 299 |
+
|
| 300 |
+
#define DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
| 301 |
+
attr PEM_write_cb_fnsig(name, type, BIO, write_bio);
|
| 302 |
+
#define DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
| 303 |
+
attr PEM_write_cb_fnsig(name, type, BIO, write_bio); \
|
| 304 |
+
attr PEM_write_cb_ex_fnsig(name, type, BIO, write_bio);
|
| 305 |
+
#define DECLARE_PEM_write_cb_bio(name, type) \
|
| 306 |
+
DECLARE_PEM_write_cb_bio_attr(extern, name, type)
|
| 307 |
+
#define DECLARE_PEM_write_cb_ex_bio(name, type) \
|
| 308 |
+
DECLARE_PEM_write_cb_bio_ex_attr(extern, name, type)
|
| 309 |
+
|
| 310 |
+
#define DECLARE_PEM_write_attr(attr, name, type) \
|
| 311 |
+
DECLARE_PEM_write_bio_attr(attr, name, type) \
|
| 312 |
+
DECLARE_PEM_write_fp_attr(attr, name, type)
|
| 313 |
+
#define DECLARE_PEM_write_ex_attr(attr, name, type) \
|
| 314 |
+
DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
| 315 |
+
DECLARE_PEM_write_fp_ex_attr(attr, name, type)
|
| 316 |
+
#define DECLARE_PEM_write(name, type) \
|
| 317 |
+
DECLARE_PEM_write_attr(extern, name, type)
|
| 318 |
+
#define DECLARE_PEM_write_ex(name, type) \
|
| 319 |
+
DECLARE_PEM_write_ex_attr(extern, name, type)
|
| 320 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 321 |
+
#define DECLARE_PEM_write_const_attr(attr, name, type) \
|
| 322 |
+
DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
| 323 |
+
DECLARE_PEM_write_fp_const_attr(attr, name, type)
|
| 324 |
+
#define DECLARE_PEM_write_const(name, type) \
|
| 325 |
+
DECLARE_PEM_write_const_attr(extern, name, type)
|
| 326 |
+
#endif
|
| 327 |
+
#define DECLARE_PEM_write_cb_attr(attr, name, type) \
|
| 328 |
+
DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
| 329 |
+
DECLARE_PEM_write_cb_fp_attr(attr, name, type)
|
| 330 |
+
#define DECLARE_PEM_write_cb_ex_attr(attr, name, type) \
|
| 331 |
+
DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
| 332 |
+
DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type)
|
| 333 |
+
#define DECLARE_PEM_write_cb(name, type) \
|
| 334 |
+
DECLARE_PEM_write_cb_attr(extern, name, type)
|
| 335 |
+
#define DECLARE_PEM_write_cb_ex(name, type) \
|
| 336 |
+
DECLARE_PEM_write_cb_ex_attr(extern, name, type)
|
| 337 |
+
#define DECLARE_PEM_read_attr(attr, name, type) \
|
| 338 |
+
DECLARE_PEM_read_bio_attr(attr, name, type) \
|
| 339 |
+
DECLARE_PEM_read_fp_attr(attr, name, type)
|
| 340 |
+
#define DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 341 |
+
DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
| 342 |
+
DECLARE_PEM_read_fp_ex_attr(attr, name, type)
|
| 343 |
+
#define DECLARE_PEM_read(name, type) \
|
| 344 |
+
DECLARE_PEM_read_attr(extern, name, type)
|
| 345 |
+
#define DECLARE_PEM_read_ex(name, type) \
|
| 346 |
+
DECLARE_PEM_read_ex_attr(extern, name, type)
|
| 347 |
+
#define DECLARE_PEM_rw_attr(attr, name, type) \
|
| 348 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 349 |
+
DECLARE_PEM_write_attr(attr, name, type)
|
| 350 |
+
#define DECLARE_PEM_rw_ex_attr(attr, name, type) \
|
| 351 |
+
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 352 |
+
DECLARE_PEM_write_ex_attr(attr, name, type)
|
| 353 |
+
#define DECLARE_PEM_rw(name, type) \
|
| 354 |
+
DECLARE_PEM_rw_attr(extern, name, type)
|
| 355 |
+
#define DECLARE_PEM_rw_ex(name, type) \
|
| 356 |
+
DECLARE_PEM_rw_ex_attr(extern, name, type)
|
| 357 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 358 |
+
#define DECLARE_PEM_rw_const_attr(attr, name, type) \
|
| 359 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 360 |
+
DECLARE_PEM_write_const_attr(attr, name, type)
|
| 361 |
+
#define DECLARE_PEM_rw_const(name, type) \
|
| 362 |
+
DECLARE_PEM_rw_const_attr(extern, name, type)
|
| 363 |
+
#endif
|
| 364 |
+
#define DECLARE_PEM_rw_cb_attr(attr, name, type) \
|
| 365 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 366 |
+
DECLARE_PEM_write_cb_attr(attr, name, type)
|
| 367 |
+
#define DECLARE_PEM_rw_cb_ex_attr(attr, name, type) \
|
| 368 |
+
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 369 |
+
DECLARE_PEM_write_cb_ex_attr(attr, name, type)
|
| 370 |
+
#define DECLARE_PEM_rw_cb(name, type) \
|
| 371 |
+
DECLARE_PEM_rw_cb_attr(extern, name, type)
|
| 372 |
+
#define DECLARE_PEM_rw_cb_ex(name, type) \
|
| 373 |
+
DECLARE_PEM_rw_cb_ex_attr(extern, name, type)
|
| 374 |
+
|
| 375 |
+
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
|
| 376 |
+
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
|
| 377 |
+
pem_password_cb *callback, void *u);
|
| 378 |
+
|
| 379 |
+
int PEM_read_bio(BIO *bp, char **name, char **header,
|
| 380 |
+
unsigned char **data, long *len);
|
| 381 |
+
#define PEM_FLAG_SECURE 0x1
|
| 382 |
+
#define PEM_FLAG_EAY_COMPATIBLE 0x2
|
| 383 |
+
#define PEM_FLAG_ONLY_B64 0x4
|
| 384 |
+
int PEM_read_bio_ex(BIO *bp, char **name, char **header,
|
| 385 |
+
unsigned char **data, long *len, unsigned int flags);
|
| 386 |
+
int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
|
| 387 |
+
const char *name, BIO *bp, pem_password_cb *cb,
|
| 388 |
+
void *u);
|
| 389 |
+
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
|
| 390 |
+
const unsigned char *data, long len);
|
| 391 |
+
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
|
| 392 |
+
const char *name, BIO *bp, pem_password_cb *cb,
|
| 393 |
+
void *u);
|
| 394 |
+
void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
|
| 395 |
+
pem_password_cb *cb, void *u);
|
| 396 |
+
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
|
| 397 |
+
const void *x, const EVP_CIPHER *enc,
|
| 398 |
+
const unsigned char *kstr, int klen,
|
| 399 |
+
pem_password_cb *cb, void *u);
|
| 400 |
+
int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx,
|
| 401 |
+
const char *name, BIO *bp, const void *x,
|
| 402 |
+
const EVP_CIPHER *enc, const unsigned char *kstr,
|
| 403 |
+
int klen, pem_password_cb *cb, void *u);
|
| 404 |
+
|
| 405 |
+
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
|
| 406 |
+
pem_password_cb *cb, void *u);
|
| 407 |
+
STACK_OF(X509_INFO)
|
| 408 |
+
*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
|
| 409 |
+
pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
|
| 410 |
+
const char *propq);
|
| 411 |
+
|
| 412 |
+
int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
|
| 413 |
+
const unsigned char *kstr, int klen,
|
| 414 |
+
pem_password_cb *cd, void *u);
|
| 415 |
+
|
| 416 |
+
#ifndef OPENSSL_NO_STDIO
|
| 417 |
+
int PEM_read(FILE *fp, char **name, char **header,
|
| 418 |
+
unsigned char **data, long *len);
|
| 419 |
+
int PEM_write(FILE *fp, const char *name, const char *hdr,
|
| 420 |
+
const unsigned char *data, long len);
|
| 421 |
+
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
|
| 422 |
+
pem_password_cb *cb, void *u);
|
| 423 |
+
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
|
| 424 |
+
const void *x, const EVP_CIPHER *enc,
|
| 425 |
+
const unsigned char *kstr, int klen,
|
| 426 |
+
pem_password_cb *callback, void *u);
|
| 427 |
+
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
|
| 428 |
+
pem_password_cb *cb, void *u);
|
| 429 |
+
STACK_OF(X509_INFO)
|
| 430 |
+
*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
|
| 431 |
+
void *u, OSSL_LIB_CTX *libctx, const char *propq);
|
| 432 |
+
#endif
|
| 433 |
+
|
| 434 |
+
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
|
| 435 |
+
int PEM_SignUpdate(EVP_MD_CTX *ctx, const unsigned char *d, unsigned int cnt);
|
| 436 |
+
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
|
| 437 |
+
unsigned int *siglen, EVP_PKEY *pkey);
|
| 438 |
+
|
| 439 |
+
/* The default pem_password_cb that's used internally */
|
| 440 |
+
int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
|
| 441 |
+
void PEM_proc_type(char *buf, int type);
|
| 442 |
+
void PEM_dek_info(char *buf, const char *type, int len, const char *str);
|
| 443 |
+
|
| 444 |
+
#include <openssl/symhacks.h>
|
| 445 |
+
|
| 446 |
+
DECLARE_PEM_rw(X509, X509)
|
| 447 |
+
DECLARE_PEM_rw(X509_AUX, X509)
|
| 448 |
+
DECLARE_PEM_rw(X509_REQ, X509_REQ)
|
| 449 |
+
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
|
| 450 |
+
DECLARE_PEM_rw(X509_CRL, X509_CRL)
|
| 451 |
+
DECLARE_PEM_rw(X509_PUBKEY, X509_PUBKEY)
|
| 452 |
+
DECLARE_PEM_rw(PKCS7, PKCS7)
|
| 453 |
+
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
|
| 454 |
+
DECLARE_PEM_rw(PKCS8, X509_SIG)
|
| 455 |
+
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
|
| 456 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 457 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
|
| 458 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA)
|
| 459 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSA_PUBKEY, RSA)
|
| 460 |
+
#endif
|
| 461 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 462 |
+
#ifndef OPENSSL_NO_DSA
|
| 463 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, DSAPrivateKey, DSA)
|
| 464 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSA_PUBKEY, DSA)
|
| 465 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSAparams, DSA)
|
| 466 |
+
#endif
|
| 467 |
+
#endif
|
| 468 |
+
|
| 469 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 470 |
+
#ifndef OPENSSL_NO_EC
|
| 471 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, ECPKParameters, EC_GROUP)
|
| 472 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, ECPrivateKey, EC_KEY)
|
| 473 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, EC_PUBKEY, EC_KEY)
|
| 474 |
+
#endif
|
| 475 |
+
#endif
|
| 476 |
+
|
| 477 |
+
#ifndef OPENSSL_NO_DH
|
| 478 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 479 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
|
| 480 |
+
DECLARE_PEM_write_attr(OSSL_DEPRECATEDIN_3_0, DHxparams, DH)
|
| 481 |
+
#endif
|
| 482 |
+
#endif
|
| 483 |
+
DECLARE_PEM_rw_cb_ex(PrivateKey, EVP_PKEY)
|
| 484 |
+
DECLARE_PEM_rw_ex(PUBKEY, EVP_PKEY)
|
| 485 |
+
|
| 486 |
+
int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
|
| 487 |
+
const EVP_CIPHER *enc,
|
| 488 |
+
const unsigned char *kstr, int klen,
|
| 489 |
+
pem_password_cb *cb, void *u);
|
| 490 |
+
|
| 491 |
+
/* Why do these take a signed char *kstr? */
|
| 492 |
+
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid,
|
| 493 |
+
const char *kstr, int klen,
|
| 494 |
+
pem_password_cb *cb, void *u);
|
| 495 |
+
int PEM_write_bio_PKCS8PrivateKey(BIO *, const EVP_PKEY *, const EVP_CIPHER *,
|
| 496 |
+
const char *kstr, int klen,
|
| 497 |
+
pem_password_cb *cb, void *u);
|
| 498 |
+
int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
| 499 |
+
const char *kstr, int klen,
|
| 500 |
+
pem_password_cb *cb, void *u);
|
| 501 |
+
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid,
|
| 502 |
+
const char *kstr, int klen,
|
| 503 |
+
pem_password_cb *cb, void *u);
|
| 504 |
+
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
|
| 505 |
+
void *u);
|
| 506 |
+
|
| 507 |
+
#ifndef OPENSSL_NO_STDIO
|
| 508 |
+
int i2d_PKCS8PrivateKey_fp(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
| 509 |
+
const char *kstr, int klen,
|
| 510 |
+
pem_password_cb *cb, void *u);
|
| 511 |
+
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, const EVP_PKEY *x, int nid,
|
| 512 |
+
const char *kstr, int klen,
|
| 513 |
+
pem_password_cb *cb, void *u);
|
| 514 |
+
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid,
|
| 515 |
+
const char *kstr, int klen,
|
| 516 |
+
pem_password_cb *cb, void *u);
|
| 517 |
+
|
| 518 |
+
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
|
| 519 |
+
void *u);
|
| 520 |
+
|
| 521 |
+
int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
| 522 |
+
const char *kstr, int klen,
|
| 523 |
+
pem_password_cb *cd, void *u);
|
| 524 |
+
#endif
|
| 525 |
+
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
|
| 526 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 527 |
+
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
|
| 528 |
+
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
|
| 529 |
+
|
| 530 |
+
EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
|
| 531 |
+
EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
|
| 532 |
+
EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
|
| 533 |
+
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
|
| 534 |
+
int i2b_PrivateKey_bio(BIO *out, const EVP_PKEY *pk);
|
| 535 |
+
int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk);
|
| 536 |
+
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
|
| 537 |
+
EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
|
| 538 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 539 |
+
int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel,
|
| 540 |
+
pem_password_cb *cb, void *u);
|
| 541 |
+
int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel,
|
| 542 |
+
pem_password_cb *cb, void *u,
|
| 543 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 544 |
+
|
| 545 |
+
#ifdef __cplusplus
|
| 546 |
+
}
|
| 547 |
+
#endif
|
| 548 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pem2.h
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_PEM2_H
|
| 11 |
+
#define OPENSSL_PEM2_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_PEM2_H
|
| 17 |
+
#endif
|
| 18 |
+
#include <openssl/pemerr.h>
|
| 19 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pemerr.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PEMERR_H
|
| 12 |
+
#define OPENSSL_PEMERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* PEM reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define PEM_R_BAD_BASE64_DECODE 100
|
| 23 |
+
#define PEM_R_BAD_DECRYPT 101
|
| 24 |
+
#define PEM_R_BAD_END_LINE 102
|
| 25 |
+
#define PEM_R_BAD_IV_CHARS 103
|
| 26 |
+
#define PEM_R_BAD_MAGIC_NUMBER 116
|
| 27 |
+
#define PEM_R_BAD_PASSWORD_READ 104
|
| 28 |
+
#define PEM_R_BAD_VERSION_NUMBER 117
|
| 29 |
+
#define PEM_R_BIO_WRITE_FAILURE 118
|
| 30 |
+
#define PEM_R_CIPHER_IS_NULL 127
|
| 31 |
+
#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
|
| 32 |
+
#define PEM_R_EXPECTING_DSS_KEY_BLOB 131
|
| 33 |
+
#define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
|
| 34 |
+
#define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
|
| 35 |
+
#define PEM_R_EXPECTING_RSA_KEY_BLOB 132
|
| 36 |
+
#define PEM_R_HEADER_TOO_LONG 128
|
| 37 |
+
#define PEM_R_INCONSISTENT_HEADER 121
|
| 38 |
+
#define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
|
| 39 |
+
#define PEM_R_KEYBLOB_TOO_SHORT 123
|
| 40 |
+
#define PEM_R_MISSING_DEK_IV 129
|
| 41 |
+
#define PEM_R_NOT_DEK_INFO 105
|
| 42 |
+
#define PEM_R_NOT_ENCRYPTED 106
|
| 43 |
+
#define PEM_R_NOT_PROC_TYPE 107
|
| 44 |
+
#define PEM_R_NO_START_LINE 108
|
| 45 |
+
#define PEM_R_PROBLEMS_GETTING_PASSWORD 109
|
| 46 |
+
#define PEM_R_PVK_DATA_TOO_SHORT 124
|
| 47 |
+
#define PEM_R_PVK_TOO_SHORT 125
|
| 48 |
+
#define PEM_R_READ_KEY 111
|
| 49 |
+
#define PEM_R_SHORT_HEADER 112
|
| 50 |
+
#define PEM_R_UNEXPECTED_DEK_IV 130
|
| 51 |
+
#define PEM_R_UNSUPPORTED_CIPHER 113
|
| 52 |
+
#define PEM_R_UNSUPPORTED_ENCRYPTION 114
|
| 53 |
+
#define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
|
| 54 |
+
#define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110
|
| 55 |
+
#define PEM_R_UNSUPPORTED_PVK_KEY_TYPE 133
|
| 56 |
+
|
| 57 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pkcs12.h
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs12.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/* clang-format off */
|
| 14 |
+
|
| 15 |
+
/* clang-format on */
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_PKCS12_H
|
| 18 |
+
#define OPENSSL_PKCS12_H
|
| 19 |
+
#pragma once
|
| 20 |
+
|
| 21 |
+
#include <openssl/macros.h>
|
| 22 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 23 |
+
#define HEADER_PKCS12_H
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#include <openssl/bio.h>
|
| 27 |
+
#include <openssl/core.h>
|
| 28 |
+
#include <openssl/x509.h>
|
| 29 |
+
#include <openssl/pkcs12err.h>
|
| 30 |
+
#ifndef OPENSSL_NO_STDIO
|
| 31 |
+
#include <stdio.h>
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
#define PKCS12_KEY_ID 1
|
| 39 |
+
#define PKCS12_IV_ID 2
|
| 40 |
+
#define PKCS12_MAC_ID 3
|
| 41 |
+
|
| 42 |
+
/* Default iteration count */
|
| 43 |
+
#ifndef PKCS12_DEFAULT_ITER
|
| 44 |
+
#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
#define PKCS12_MAC_KEY_LENGTH 20
|
| 48 |
+
|
| 49 |
+
/*
|
| 50 |
+
* The macro is expected to be used only internally. Kept for
|
| 51 |
+
* backwards compatibility. NIST requires 16, previous value was
|
| 52 |
+
* 8. Allow to override this at compile time.
|
| 53 |
+
*/
|
| 54 |
+
#ifndef PKCS12_SALT_LEN
|
| 55 |
+
#define PKCS12_SALT_LEN 16
|
| 56 |
+
#endif
|
| 57 |
+
|
| 58 |
+
/* It's not clear if these are actually needed... */
|
| 59 |
+
#define PKCS12_key_gen PKCS12_key_gen_utf8
|
| 60 |
+
#define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8
|
| 61 |
+
|
| 62 |
+
/* MS key usage constants */
|
| 63 |
+
|
| 64 |
+
#define KEY_EX 0x10
|
| 65 |
+
#define KEY_SIG 0x80
|
| 66 |
+
|
| 67 |
+
typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
|
| 68 |
+
|
| 69 |
+
typedef struct PKCS12_st PKCS12;
|
| 70 |
+
|
| 71 |
+
typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
|
| 72 |
+
|
| 73 |
+
/* clang-format off */
|
| 74 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS12_SAFEBAG, PKCS12_SAFEBAG, PKCS12_SAFEBAG)
|
| 75 |
+
#define sk_PKCS12_SAFEBAG_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 76 |
+
#define sk_PKCS12_SAFEBAG_value(sk, idx) ((PKCS12_SAFEBAG *)OPENSSL_sk_value(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), (idx)))
|
| 77 |
+
#define sk_PKCS12_SAFEBAG_new(cmp) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
| 78 |
+
#define sk_PKCS12_SAFEBAG_new_null() ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_null())
|
| 79 |
+
#define sk_PKCS12_SAFEBAG_new_reserve(cmp, n) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_reserve(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp), (n)))
|
| 80 |
+
#define sk_PKCS12_SAFEBAG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (n))
|
| 81 |
+
#define sk_PKCS12_SAFEBAG_free(sk) OPENSSL_sk_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 82 |
+
#define sk_PKCS12_SAFEBAG_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 83 |
+
#define sk_PKCS12_SAFEBAG_delete(sk, i) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (i)))
|
| 84 |
+
#define sk_PKCS12_SAFEBAG_delete_ptr(sk, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete_ptr(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
| 85 |
+
#define sk_PKCS12_SAFEBAG_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 86 |
+
#define sk_PKCS12_SAFEBAG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 87 |
+
#define sk_PKCS12_SAFEBAG_pop(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_pop(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 88 |
+
#define sk_PKCS12_SAFEBAG_shift(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_shift(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 89 |
+
#define sk_PKCS12_SAFEBAG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc))
|
| 90 |
+
#define sk_PKCS12_SAFEBAG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), (idx))
|
| 91 |
+
#define sk_PKCS12_SAFEBAG_set(sk, idx, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_set(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (idx), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
| 92 |
+
#define sk_PKCS12_SAFEBAG_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 93 |
+
#define sk_PKCS12_SAFEBAG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 94 |
+
#define sk_PKCS12_SAFEBAG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), pnum)
|
| 95 |
+
#define sk_PKCS12_SAFEBAG_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 96 |
+
#define sk_PKCS12_SAFEBAG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 97 |
+
#define sk_PKCS12_SAFEBAG_dup(sk) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_dup(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)))
|
| 98 |
+
#define sk_PKCS12_SAFEBAG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_copyfunc_type(copyfunc), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc)))
|
| 99 |
+
#define sk_PKCS12_SAFEBAG_set_cmp_func(sk, cmp) ((sk_PKCS12_SAFEBAG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
| 100 |
+
|
| 101 |
+
/* clang-format on */
|
| 102 |
+
|
| 103 |
+
typedef struct pkcs12_bag_st PKCS12_BAGS;
|
| 104 |
+
|
| 105 |
+
#define PKCS12_ERROR 0
|
| 106 |
+
#define PKCS12_OK 1
|
| 107 |
+
|
| 108 |
+
/* Compatibility macros */
|
| 109 |
+
|
| 110 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 111 |
+
|
| 112 |
+
#define M_PKCS12_bag_type PKCS12_bag_type
|
| 113 |
+
#define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
|
| 114 |
+
#define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
|
| 115 |
+
|
| 116 |
+
#define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
|
| 117 |
+
#define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl
|
| 118 |
+
#define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
|
| 119 |
+
#define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
|
| 120 |
+
#define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
|
| 121 |
+
#define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
|
| 122 |
+
#define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
|
| 123 |
+
#define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
|
| 124 |
+
|
| 125 |
+
#endif
|
| 126 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 127 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
|
| 128 |
+
int attr_nid);
|
| 129 |
+
#endif
|
| 130 |
+
|
| 131 |
+
ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
|
| 132 |
+
int PKCS12_mac_present(const PKCS12 *p12);
|
| 133 |
+
void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
|
| 134 |
+
const X509_ALGOR **pmacalg,
|
| 135 |
+
const ASN1_OCTET_STRING **psalt,
|
| 136 |
+
const ASN1_INTEGER **piter,
|
| 137 |
+
const PKCS12 *p12);
|
| 138 |
+
|
| 139 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
|
| 140 |
+
int attr_nid);
|
| 141 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
|
| 142 |
+
int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
|
| 143 |
+
int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
|
| 144 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag);
|
| 145 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag);
|
| 146 |
+
|
| 147 |
+
X509 *PKCS12_SAFEBAG_get1_cert_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
| 148 |
+
X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
|
| 149 |
+
X509_CRL *PKCS12_SAFEBAG_get1_crl_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
| 150 |
+
X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
|
| 151 |
+
const STACK_OF(PKCS12_SAFEBAG) *
|
| 152 |
+
PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
|
| 153 |
+
const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
|
| 154 |
+
const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
|
| 155 |
+
|
| 156 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
|
| 157 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
|
| 158 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, const unsigned char *value, int len);
|
| 159 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
|
| 160 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
|
| 161 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
|
| 162 |
+
const char *pass,
|
| 163 |
+
int passlen,
|
| 164 |
+
unsigned char *salt,
|
| 165 |
+
int saltlen, int iter,
|
| 166 |
+
PKCS8_PRIV_KEY_INFO *p8inf);
|
| 167 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
|
| 168 |
+
const char *pass,
|
| 169 |
+
int passlen,
|
| 170 |
+
unsigned char *salt,
|
| 171 |
+
int saltlen, int iter,
|
| 172 |
+
PKCS8_PRIV_KEY_INFO *p8inf,
|
| 173 |
+
OSSL_LIB_CTX *ctx,
|
| 174 |
+
const char *propq);
|
| 175 |
+
|
| 176 |
+
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
|
| 177 |
+
int nid1, int nid2);
|
| 178 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
|
| 179 |
+
int passlen);
|
| 180 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt_ex(const X509_SIG *p8, const char *pass,
|
| 181 |
+
int passlen, OSSL_LIB_CTX *ctx,
|
| 182 |
+
const char *propq);
|
| 183 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
|
| 184 |
+
const char *pass, int passlen);
|
| 185 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag,
|
| 186 |
+
const char *pass, int passlen,
|
| 187 |
+
OSSL_LIB_CTX *ctx,
|
| 188 |
+
const char *propq);
|
| 189 |
+
X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
|
| 190 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 191 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
|
| 192 |
+
X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher,
|
| 193 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 194 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
|
| 195 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 196 |
+
X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen,
|
| 197 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe);
|
| 198 |
+
X509_SIG *PKCS8_set0_pbe_ex(const char *pass, int passlen,
|
| 199 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe,
|
| 200 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 201 |
+
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
|
| 202 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
|
| 203 |
+
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
|
| 204 |
+
unsigned char *salt, int saltlen, int iter,
|
| 205 |
+
STACK_OF(PKCS12_SAFEBAG) *bags);
|
| 206 |
+
PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
|
| 207 |
+
unsigned char *salt, int saltlen, int iter,
|
| 208 |
+
STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 209 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 210 |
+
|
| 211 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
|
| 212 |
+
int passlen);
|
| 213 |
+
|
| 214 |
+
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
|
| 215 |
+
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
|
| 216 |
+
|
| 217 |
+
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
|
| 218 |
+
int namelen);
|
| 219 |
+
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 220 |
+
int namelen);
|
| 221 |
+
int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
|
| 222 |
+
int namelen);
|
| 223 |
+
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 224 |
+
int namelen);
|
| 225 |
+
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
|
| 226 |
+
const unsigned char *name, int namelen);
|
| 227 |
+
int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
|
| 228 |
+
const unsigned char *bytes, int len);
|
| 229 |
+
int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
|
| 230 |
+
const unsigned char *bytes, int len);
|
| 231 |
+
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
|
| 232 |
+
ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
|
| 233 |
+
int attr_nid);
|
| 234 |
+
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
| 235 |
+
const STACK_OF(X509_ATTRIBUTE) *
|
| 236 |
+
PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
|
| 237 |
+
void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, STACK_OF(X509_ATTRIBUTE) *attrs);
|
| 238 |
+
unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor,
|
| 239 |
+
const char *pass, int passlen,
|
| 240 |
+
const unsigned char *in, int inlen,
|
| 241 |
+
unsigned char **data, int *datalen,
|
| 242 |
+
int en_de);
|
| 243 |
+
unsigned char *PKCS12_pbe_crypt_ex(const X509_ALGOR *algor,
|
| 244 |
+
const char *pass, int passlen,
|
| 245 |
+
const unsigned char *in, int inlen,
|
| 246 |
+
unsigned char **data, int *datalen,
|
| 247 |
+
int en_de, OSSL_LIB_CTX *libctx,
|
| 248 |
+
const char *propq);
|
| 249 |
+
void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 250 |
+
const char *pass, int passlen,
|
| 251 |
+
const ASN1_OCTET_STRING *oct, int zbuf);
|
| 252 |
+
void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 253 |
+
const char *pass, int passlen,
|
| 254 |
+
const ASN1_OCTET_STRING *oct, int zbuf,
|
| 255 |
+
OSSL_LIB_CTX *libctx,
|
| 256 |
+
const char *propq);
|
| 257 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
|
| 258 |
+
const ASN1_ITEM *it,
|
| 259 |
+
const char *pass, int passlen,
|
| 260 |
+
void *obj, int zbuf);
|
| 261 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
|
| 262 |
+
const ASN1_ITEM *it,
|
| 263 |
+
const char *pass, int passlen,
|
| 264 |
+
void *obj, int zbuf,
|
| 265 |
+
OSSL_LIB_CTX *ctx,
|
| 266 |
+
const char *propq);
|
| 267 |
+
PKCS12 *PKCS12_init(int mode);
|
| 268 |
+
PKCS12 *PKCS12_init_ex(int mode, OSSL_LIB_CTX *ctx, const char *propq);
|
| 269 |
+
|
| 270 |
+
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
|
| 271 |
+
int saltlen, int id, int iter, int n,
|
| 272 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 273 |
+
int PKCS12_key_gen_asc_ex(const char *pass, int passlen, unsigned char *salt,
|
| 274 |
+
int saltlen, int id, int iter, int n,
|
| 275 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 276 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 277 |
+
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
|
| 278 |
+
int saltlen, int id, int iter, int n,
|
| 279 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 280 |
+
int PKCS12_key_gen_uni_ex(unsigned char *pass, int passlen, unsigned char *salt,
|
| 281 |
+
int saltlen, int id, int iter, int n,
|
| 282 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 283 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 284 |
+
int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
|
| 285 |
+
int saltlen, int id, int iter, int n,
|
| 286 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 287 |
+
int PKCS12_key_gen_utf8_ex(const char *pass, int passlen, unsigned char *salt,
|
| 288 |
+
int saltlen, int id, int iter, int n,
|
| 289 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 290 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 291 |
+
|
| 292 |
+
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 293 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 294 |
+
const EVP_MD *md_type, int en_de);
|
| 295 |
+
int PKCS12_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 296 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 297 |
+
const EVP_MD *md_type, int en_de,
|
| 298 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 299 |
+
int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 300 |
+
unsigned char *mac, unsigned int *maclen);
|
| 301 |
+
int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
|
| 302 |
+
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 303 |
+
unsigned char *salt, int saltlen, int iter,
|
| 304 |
+
const EVP_MD *md_type);
|
| 305 |
+
int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen,
|
| 306 |
+
unsigned char *salt, int saltlen, int iter,
|
| 307 |
+
const EVP_MD *md_type, const char *prf_md_name);
|
| 308 |
+
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
|
| 309 |
+
int saltlen, const EVP_MD *md_type);
|
| 310 |
+
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
|
| 311 |
+
unsigned char **uni, int *unilen);
|
| 312 |
+
char *OPENSSL_uni2asc(const unsigned char *uni, int unilen);
|
| 313 |
+
unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
|
| 314 |
+
unsigned char **uni, int *unilen);
|
| 315 |
+
char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen);
|
| 316 |
+
|
| 317 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12)
|
| 318 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
|
| 319 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
|
| 320 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
|
| 321 |
+
|
| 322 |
+
DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
|
| 323 |
+
DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
|
| 324 |
+
|
| 325 |
+
void PKCS12_PBE_add(void);
|
| 326 |
+
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
|
| 327 |
+
STACK_OF(X509) **ca);
|
| 328 |
+
typedef int PKCS12_create_cb(PKCS12_SAFEBAG *bag, void *cbarg);
|
| 329 |
+
PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 330 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 331 |
+
int iter, int mac_iter, int keytype);
|
| 332 |
+
PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 333 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 334 |
+
int iter, int mac_iter, int keytype,
|
| 335 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 336 |
+
PKCS12 *PKCS12_create_ex2(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 337 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 338 |
+
int iter, int mac_iter, int keytype,
|
| 339 |
+
OSSL_LIB_CTX *ctx, const char *propq,
|
| 340 |
+
PKCS12_create_cb *cb, void *cbarg);
|
| 341 |
+
|
| 342 |
+
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
|
| 343 |
+
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 344 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 345 |
+
int key_nid, const char *pass);
|
| 346 |
+
PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 347 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 348 |
+
int key_nid, const char *pass,
|
| 349 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 350 |
+
|
| 351 |
+
PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 352 |
+
int nid_type, const unsigned char *value, int len);
|
| 353 |
+
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 354 |
+
int safe_nid, int iter, const char *pass);
|
| 355 |
+
int PKCS12_add_safe_ex(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 356 |
+
int safe_nid, int iter, const char *pass,
|
| 357 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 358 |
+
|
| 359 |
+
PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
|
| 360 |
+
PKCS12 *PKCS12_add_safes_ex(STACK_OF(PKCS7) *safes, int p7_nid,
|
| 361 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 362 |
+
|
| 363 |
+
int i2d_PKCS12_bio(BIO *bp, const PKCS12 *p12);
|
| 364 |
+
#ifndef OPENSSL_NO_STDIO
|
| 365 |
+
int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12);
|
| 366 |
+
#endif
|
| 367 |
+
PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
|
| 368 |
+
#ifndef OPENSSL_NO_STDIO
|
| 369 |
+
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
|
| 370 |
+
#endif
|
| 371 |
+
int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
|
| 372 |
+
|
| 373 |
+
#ifdef __cplusplus
|
| 374 |
+
}
|
| 375 |
+
#endif
|
| 376 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pkcs12err.h
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PKCS12ERR_H
|
| 12 |
+
#define OPENSSL_PKCS12ERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* PKCS12 reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define PKCS12_R_CALLBACK_FAILED 115
|
| 23 |
+
#define PKCS12_R_CANT_PACK_STRUCTURE 100
|
| 24 |
+
#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
|
| 25 |
+
#define PKCS12_R_DECODE_ERROR 101
|
| 26 |
+
#define PKCS12_R_ENCODE_ERROR 102
|
| 27 |
+
#define PKCS12_R_ENCRYPT_ERROR 103
|
| 28 |
+
#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
|
| 29 |
+
#define PKCS12_R_INVALID_NULL_ARGUMENT 104
|
| 30 |
+
#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
|
| 31 |
+
#define PKCS12_R_INVALID_TYPE 112
|
| 32 |
+
#define PKCS12_R_IV_GEN_ERROR 106
|
| 33 |
+
#define PKCS12_R_KEY_GEN_ERROR 107
|
| 34 |
+
#define PKCS12_R_MAC_ABSENT 108
|
| 35 |
+
#define PKCS12_R_MAC_GENERATION_ERROR 109
|
| 36 |
+
#define PKCS12_R_MAC_SETUP_ERROR 110
|
| 37 |
+
#define PKCS12_R_MAC_STRING_SET_ERROR 111
|
| 38 |
+
#define PKCS12_R_MAC_VERIFY_FAILURE 113
|
| 39 |
+
#define PKCS12_R_PARSE_ERROR 114
|
| 40 |
+
#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
|
| 41 |
+
#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
|
| 42 |
+
#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
|
| 43 |
+
|
| 44 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pkcs7.h
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs7.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/* clang-format off */
|
| 14 |
+
|
| 15 |
+
/* clang-format on */
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_PKCS7_H
|
| 18 |
+
#define OPENSSL_PKCS7_H
|
| 19 |
+
#pragma once
|
| 20 |
+
|
| 21 |
+
#include <openssl/macros.h>
|
| 22 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 23 |
+
#define HEADER_PKCS7_H
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#include <openssl/asn1.h>
|
| 27 |
+
#include <openssl/bio.h>
|
| 28 |
+
#include <openssl/e_os2.h>
|
| 29 |
+
|
| 30 |
+
#include <openssl/symhacks.h>
|
| 31 |
+
#include <openssl/types.h>
|
| 32 |
+
#include <openssl/pkcs7err.h>
|
| 33 |
+
#ifndef OPENSSL_NO_STDIO
|
| 34 |
+
#include <stdio.h>
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
/*-
|
| 42 |
+
Encryption_ID DES-CBC
|
| 43 |
+
Digest_ID MD5
|
| 44 |
+
Digest_Encryption_ID rsaEncryption
|
| 45 |
+
Key_Encryption_ID rsaEncryption
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
typedef struct PKCS7_CTX_st {
|
| 49 |
+
OSSL_LIB_CTX *libctx;
|
| 50 |
+
char *propq;
|
| 51 |
+
} PKCS7_CTX;
|
| 52 |
+
|
| 53 |
+
typedef struct pkcs7_issuer_and_serial_st {
|
| 54 |
+
X509_NAME *issuer;
|
| 55 |
+
ASN1_INTEGER *serial;
|
| 56 |
+
} PKCS7_ISSUER_AND_SERIAL;
|
| 57 |
+
|
| 58 |
+
typedef struct pkcs7_signer_info_st {
|
| 59 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 60 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 61 |
+
X509_ALGOR *digest_alg;
|
| 62 |
+
STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
|
| 63 |
+
X509_ALGOR *digest_enc_alg; /* confusing name, actually used for signing */
|
| 64 |
+
ASN1_OCTET_STRING *enc_digest; /* confusing name, actually signature */
|
| 65 |
+
STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
|
| 66 |
+
/* The private key to sign with */
|
| 67 |
+
EVP_PKEY *pkey;
|
| 68 |
+
const PKCS7_CTX *ctx;
|
| 69 |
+
} PKCS7_SIGNER_INFO;
|
| 70 |
+
/* clang-format off */
|
| 71 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
|
| 72 |
+
#define sk_PKCS7_SIGNER_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 73 |
+
#define sk_PKCS7_SIGNER_INFO_value(sk, idx) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), (idx)))
|
| 74 |
+
#define sk_PKCS7_SIGNER_INFO_new(cmp) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
| 75 |
+
#define sk_PKCS7_SIGNER_INFO_new_null() ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_null())
|
| 76 |
+
#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)))
|
| 77 |
+
#define sk_PKCS7_SIGNER_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (n))
|
| 78 |
+
#define sk_PKCS7_SIGNER_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 79 |
+
#define sk_PKCS7_SIGNER_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 80 |
+
#define sk_PKCS7_SIGNER_INFO_delete(sk, i) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (i)))
|
| 81 |
+
#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)))
|
| 82 |
+
#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))
|
| 83 |
+
#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))
|
| 84 |
+
#define sk_PKCS7_SIGNER_INFO_pop(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 85 |
+
#define sk_PKCS7_SIGNER_INFO_shift(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 86 |
+
#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))
|
| 87 |
+
#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))
|
| 88 |
+
#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)))
|
| 89 |
+
#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))
|
| 90 |
+
#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))
|
| 91 |
+
#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)
|
| 92 |
+
#define sk_PKCS7_SIGNER_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 93 |
+
#define sk_PKCS7_SIGNER_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 94 |
+
#define sk_PKCS7_SIGNER_INFO_dup(sk) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 95 |
+
#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)))
|
| 96 |
+
#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)))
|
| 97 |
+
|
| 98 |
+
/* clang-format on */
|
| 99 |
+
|
| 100 |
+
typedef struct pkcs7_recip_info_st {
|
| 101 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 102 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 103 |
+
X509_ALGOR *key_enc_algor;
|
| 104 |
+
ASN1_OCTET_STRING *enc_key;
|
| 105 |
+
X509 *cert; /* get the pub-key from this */
|
| 106 |
+
const PKCS7_CTX *ctx;
|
| 107 |
+
} PKCS7_RECIP_INFO;
|
| 108 |
+
/* clang-format off */
|
| 109 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
|
| 110 |
+
#define sk_PKCS7_RECIP_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 111 |
+
#define sk_PKCS7_RECIP_INFO_value(sk, idx) ((PKCS7_RECIP_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), (idx)))
|
| 112 |
+
#define sk_PKCS7_RECIP_INFO_new(cmp) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
| 113 |
+
#define sk_PKCS7_RECIP_INFO_new_null() ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_null())
|
| 114 |
+
#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)))
|
| 115 |
+
#define sk_PKCS7_RECIP_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (n))
|
| 116 |
+
#define sk_PKCS7_RECIP_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 117 |
+
#define sk_PKCS7_RECIP_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 118 |
+
#define sk_PKCS7_RECIP_INFO_delete(sk, i) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (i)))
|
| 119 |
+
#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)))
|
| 120 |
+
#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))
|
| 121 |
+
#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))
|
| 122 |
+
#define sk_PKCS7_RECIP_INFO_pop(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 123 |
+
#define sk_PKCS7_RECIP_INFO_shift(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 124 |
+
#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))
|
| 125 |
+
#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))
|
| 126 |
+
#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)))
|
| 127 |
+
#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))
|
| 128 |
+
#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))
|
| 129 |
+
#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)
|
| 130 |
+
#define sk_PKCS7_RECIP_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 131 |
+
#define sk_PKCS7_RECIP_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 132 |
+
#define sk_PKCS7_RECIP_INFO_dup(sk) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 133 |
+
#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)))
|
| 134 |
+
#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)))
|
| 135 |
+
|
| 136 |
+
/* clang-format on */
|
| 137 |
+
|
| 138 |
+
typedef struct pkcs7_signed_st {
|
| 139 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 140 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 141 |
+
STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
|
| 142 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
|
| 143 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 144 |
+
struct pkcs7_st *contents;
|
| 145 |
+
} PKCS7_SIGNED;
|
| 146 |
+
/*
|
| 147 |
+
* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
|
| 148 |
+
* merging the two
|
| 149 |
+
*/
|
| 150 |
+
|
| 151 |
+
typedef struct pkcs7_enc_content_st {
|
| 152 |
+
ASN1_OBJECT *content_type;
|
| 153 |
+
X509_ALGOR *algorithm;
|
| 154 |
+
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
|
| 155 |
+
const EVP_CIPHER *cipher;
|
| 156 |
+
const PKCS7_CTX *ctx;
|
| 157 |
+
} PKCS7_ENC_CONTENT;
|
| 158 |
+
|
| 159 |
+
typedef struct pkcs7_enveloped_st {
|
| 160 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 161 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 162 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 163 |
+
} PKCS7_ENVELOPE;
|
| 164 |
+
|
| 165 |
+
typedef struct pkcs7_signedandenveloped_st {
|
| 166 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 167 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 168 |
+
STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
|
| 169 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
|
| 170 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 171 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 172 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 173 |
+
} PKCS7_SIGN_ENVELOPE;
|
| 174 |
+
|
| 175 |
+
typedef struct pkcs7_digest_st {
|
| 176 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 177 |
+
X509_ALGOR *md; /* md used */
|
| 178 |
+
struct pkcs7_st *contents;
|
| 179 |
+
ASN1_OCTET_STRING *digest;
|
| 180 |
+
} PKCS7_DIGEST;
|
| 181 |
+
|
| 182 |
+
typedef struct pkcs7_encrypted_st {
|
| 183 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 184 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 185 |
+
} PKCS7_ENCRYPT;
|
| 186 |
+
|
| 187 |
+
typedef struct pkcs7_st {
|
| 188 |
+
/*
|
| 189 |
+
* The following is non NULL if it contains ASN1 encoding of this
|
| 190 |
+
* structure
|
| 191 |
+
*/
|
| 192 |
+
unsigned char *asn1;
|
| 193 |
+
long length;
|
| 194 |
+
#define PKCS7_S_HEADER 0
|
| 195 |
+
#define PKCS7_S_BODY 1
|
| 196 |
+
#define PKCS7_S_TAIL 2
|
| 197 |
+
int state; /* used during processing */
|
| 198 |
+
int detached;
|
| 199 |
+
ASN1_OBJECT *type;
|
| 200 |
+
/* content as defined by the type */
|
| 201 |
+
/*
|
| 202 |
+
* all encryption/message digests are applied to the 'contents', leaving
|
| 203 |
+
* out the 'type' field.
|
| 204 |
+
*/
|
| 205 |
+
union {
|
| 206 |
+
char *ptr;
|
| 207 |
+
/* NID_pkcs7_data */
|
| 208 |
+
ASN1_OCTET_STRING *data;
|
| 209 |
+
/* NID_pkcs7_signed */
|
| 210 |
+
PKCS7_SIGNED *sign; /* field name 'signed' would clash with C keyword */
|
| 211 |
+
/* NID_pkcs7_enveloped */
|
| 212 |
+
PKCS7_ENVELOPE *enveloped;
|
| 213 |
+
/* NID_pkcs7_signedAndEnveloped */
|
| 214 |
+
PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
|
| 215 |
+
/* NID_pkcs7_digest */
|
| 216 |
+
PKCS7_DIGEST *digest;
|
| 217 |
+
/* NID_pkcs7_encrypted */
|
| 218 |
+
PKCS7_ENCRYPT *encrypted;
|
| 219 |
+
/* Anything else */
|
| 220 |
+
ASN1_TYPE *other;
|
| 221 |
+
} d;
|
| 222 |
+
PKCS7_CTX ctx;
|
| 223 |
+
} PKCS7;
|
| 224 |
+
/* clang-format off */
|
| 225 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7, PKCS7, PKCS7)
|
| 226 |
+
#define sk_PKCS7_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_sk_type(sk))
|
| 227 |
+
#define sk_PKCS7_value(sk, idx) ((PKCS7 *)OPENSSL_sk_value(ossl_check_const_PKCS7_sk_type(sk), (idx)))
|
| 228 |
+
#define sk_PKCS7_new(cmp) ((STACK_OF(PKCS7) *)OPENSSL_sk_new(ossl_check_PKCS7_compfunc_type(cmp)))
|
| 229 |
+
#define sk_PKCS7_new_null() ((STACK_OF(PKCS7) *)OPENSSL_sk_new_null())
|
| 230 |
+
#define sk_PKCS7_new_reserve(cmp, n) ((STACK_OF(PKCS7) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_compfunc_type(cmp), (n)))
|
| 231 |
+
#define sk_PKCS7_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_sk_type(sk), (n))
|
| 232 |
+
#define sk_PKCS7_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_sk_type(sk))
|
| 233 |
+
#define sk_PKCS7_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_sk_type(sk))
|
| 234 |
+
#define sk_PKCS7_delete(sk, i) ((PKCS7 *)OPENSSL_sk_delete(ossl_check_PKCS7_sk_type(sk), (i)))
|
| 235 |
+
#define sk_PKCS7_delete_ptr(sk, ptr) ((PKCS7 *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)))
|
| 236 |
+
#define sk_PKCS7_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 237 |
+
#define sk_PKCS7_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 238 |
+
#define sk_PKCS7_pop(sk) ((PKCS7 *)OPENSSL_sk_pop(ossl_check_PKCS7_sk_type(sk)))
|
| 239 |
+
#define sk_PKCS7_shift(sk) ((PKCS7 *)OPENSSL_sk_shift(ossl_check_PKCS7_sk_type(sk)))
|
| 240 |
+
#define sk_PKCS7_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_freefunc_type(freefunc))
|
| 241 |
+
#define sk_PKCS7_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), (idx))
|
| 242 |
+
#define sk_PKCS7_set(sk, idx, ptr) ((PKCS7 *)OPENSSL_sk_set(ossl_check_PKCS7_sk_type(sk), (idx), ossl_check_PKCS7_type(ptr)))
|
| 243 |
+
#define sk_PKCS7_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 244 |
+
#define sk_PKCS7_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 245 |
+
#define sk_PKCS7_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), pnum)
|
| 246 |
+
#define sk_PKCS7_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_sk_type(sk))
|
| 247 |
+
#define sk_PKCS7_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_sk_type(sk))
|
| 248 |
+
#define sk_PKCS7_dup(sk) ((STACK_OF(PKCS7) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_sk_type(sk)))
|
| 249 |
+
#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)))
|
| 250 |
+
#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)))
|
| 251 |
+
|
| 252 |
+
/* clang-format on */
|
| 253 |
+
|
| 254 |
+
#define PKCS7_OP_SET_DETACHED_SIGNATURE 1
|
| 255 |
+
#define PKCS7_OP_GET_DETACHED_SIGNATURE 2
|
| 256 |
+
|
| 257 |
+
#define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
|
| 258 |
+
#define PKCS7_get_attributes(si) ((si)->unauth_attr)
|
| 259 |
+
|
| 260 |
+
#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
|
| 261 |
+
#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
|
| 262 |
+
#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
|
| 263 |
+
#define PKCS7_type_is_signedAndEnveloped(a) \
|
| 264 |
+
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
|
| 265 |
+
#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
|
| 266 |
+
#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
|
| 267 |
+
|
| 268 |
+
#define PKCS7_set_detached(p, v) \
|
| 269 |
+
PKCS7_ctrl(p, PKCS7_OP_SET_DETACHED_SIGNATURE, v, NULL)
|
| 270 |
+
#define PKCS7_get_detached(p) \
|
| 271 |
+
PKCS7_ctrl(p, PKCS7_OP_GET_DETACHED_SIGNATURE, 0, NULL)
|
| 272 |
+
|
| 273 |
+
#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
|
| 274 |
+
|
| 275 |
+
/* S/MIME related flags */
|
| 276 |
+
|
| 277 |
+
#define PKCS7_TEXT 0x1
|
| 278 |
+
#define PKCS7_NOCERTS 0x2
|
| 279 |
+
#define PKCS7_NOSIGS 0x4
|
| 280 |
+
#define PKCS7_NOCHAIN 0x8
|
| 281 |
+
#define PKCS7_NOINTERN 0x10
|
| 282 |
+
#define PKCS7_NOVERIFY 0x20
|
| 283 |
+
#define PKCS7_DETACHED 0x40
|
| 284 |
+
#define PKCS7_BINARY 0x80
|
| 285 |
+
#define PKCS7_NOATTR 0x100
|
| 286 |
+
#define PKCS7_NOSMIMECAP 0x200
|
| 287 |
+
#define PKCS7_NOOLDMIMETYPE 0x400
|
| 288 |
+
#define PKCS7_CRLFEOL 0x800
|
| 289 |
+
#define PKCS7_STREAM 0x1000
|
| 290 |
+
#define PKCS7_NOCRL 0x2000
|
| 291 |
+
#define PKCS7_PARTIAL 0x4000
|
| 292 |
+
#define PKCS7_REUSE_DIGEST 0x8000
|
| 293 |
+
#define PKCS7_NO_DUAL_CONTENT 0x10000
|
| 294 |
+
|
| 295 |
+
/* Flags: for compatibility with older code */
|
| 296 |
+
|
| 297 |
+
#define SMIME_TEXT PKCS7_TEXT
|
| 298 |
+
#define SMIME_NOCERTS PKCS7_NOCERTS
|
| 299 |
+
#define SMIME_NOSIGS PKCS7_NOSIGS
|
| 300 |
+
#define SMIME_NOCHAIN PKCS7_NOCHAIN
|
| 301 |
+
#define SMIME_NOINTERN PKCS7_NOINTERN
|
| 302 |
+
#define SMIME_NOVERIFY PKCS7_NOVERIFY
|
| 303 |
+
#define SMIME_DETACHED PKCS7_DETACHED
|
| 304 |
+
#define SMIME_BINARY PKCS7_BINARY
|
| 305 |
+
#define SMIME_NOATTR PKCS7_NOATTR
|
| 306 |
+
|
| 307 |
+
/* CRLF ASCII canonicalisation */
|
| 308 |
+
#define SMIME_ASCIICRLF 0x80000
|
| 309 |
+
|
| 310 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
|
| 311 |
+
|
| 312 |
+
int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
|
| 313 |
+
const EVP_MD *type, unsigned char *md,
|
| 314 |
+
unsigned int *len);
|
| 315 |
+
#ifndef OPENSSL_NO_STDIO
|
| 316 |
+
PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
|
| 317 |
+
int i2d_PKCS7_fp(FILE *fp, const PKCS7 *p7);
|
| 318 |
+
#endif
|
| 319 |
+
DECLARE_ASN1_DUP_FUNCTION(PKCS7)
|
| 320 |
+
PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
|
| 321 |
+
int i2d_PKCS7_bio(BIO *bp, const PKCS7 *p7);
|
| 322 |
+
int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 323 |
+
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 324 |
+
|
| 325 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
|
| 326 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
|
| 327 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
|
| 328 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
|
| 329 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
|
| 330 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
|
| 331 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
|
| 332 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
|
| 333 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7)
|
| 334 |
+
PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 335 |
+
|
| 336 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
|
| 337 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
|
| 338 |
+
|
| 339 |
+
DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
|
| 340 |
+
DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
|
| 341 |
+
|
| 342 |
+
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
|
| 343 |
+
|
| 344 |
+
int PKCS7_type_is_other(PKCS7 *p7);
|
| 345 |
+
int PKCS7_set_type(PKCS7 *p7, int type);
|
| 346 |
+
int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
|
| 347 |
+
int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
|
| 348 |
+
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
|
| 349 |
+
const EVP_MD *dgst);
|
| 350 |
+
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
|
| 351 |
+
int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
|
| 352 |
+
int PKCS7_add_certificate(PKCS7 *p7, X509 *cert);
|
| 353 |
+
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl);
|
| 354 |
+
int PKCS7_content_new(PKCS7 *p7, int nid);
|
| 355 |
+
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
|
| 356 |
+
BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 357 |
+
int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
|
| 358 |
+
X509 *signer);
|
| 359 |
+
|
| 360 |
+
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
|
| 361 |
+
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
|
| 362 |
+
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
|
| 363 |
+
|
| 364 |
+
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
|
| 365 |
+
EVP_PKEY *pkey, const EVP_MD *dgst);
|
| 366 |
+
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 367 |
+
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
|
| 368 |
+
STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
|
| 369 |
+
|
| 370 |
+
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
|
| 371 |
+
void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
|
| 372 |
+
X509_ALGOR **pdig, X509_ALGOR **psig);
|
| 373 |
+
void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
|
| 374 |
+
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
|
| 375 |
+
int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
|
| 376 |
+
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
|
| 377 |
+
int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
|
| 378 |
+
|
| 379 |
+
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
|
| 380 |
+
ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
|
| 381 |
+
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
|
| 382 |
+
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
|
| 383 |
+
void *data);
|
| 384 |
+
int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
|
| 385 |
+
void *value);
|
| 386 |
+
ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 387 |
+
ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 388 |
+
int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 389 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 390 |
+
int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 391 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 392 |
+
|
| 393 |
+
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 394 |
+
BIO *data, int flags);
|
| 395 |
+
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 396 |
+
BIO *data, int flags, OSSL_LIB_CTX *libctx,
|
| 397 |
+
const char *propq);
|
| 398 |
+
|
| 399 |
+
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
|
| 400 |
+
X509 *signcert, EVP_PKEY *pkey,
|
| 401 |
+
const EVP_MD *md, int flags);
|
| 402 |
+
|
| 403 |
+
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
|
| 404 |
+
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
| 405 |
+
BIO *indata, BIO *out, int flags);
|
| 406 |
+
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
|
| 407 |
+
int flags);
|
| 408 |
+
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
|
| 409 |
+
int flags);
|
| 410 |
+
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
| 411 |
+
const EVP_CIPHER *cipher, int flags,
|
| 412 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 413 |
+
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
|
| 414 |
+
int flags);
|
| 415 |
+
|
| 416 |
+
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
|
| 417 |
+
STACK_OF(X509_ALGOR) *cap);
|
| 418 |
+
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
|
| 419 |
+
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
|
| 420 |
+
|
| 421 |
+
int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
|
| 422 |
+
int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
|
| 423 |
+
int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
|
| 424 |
+
const unsigned char *md, int mdlen);
|
| 425 |
+
|
| 426 |
+
int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
|
| 427 |
+
PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7);
|
| 428 |
+
PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
|
| 429 |
+
|
| 430 |
+
BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
|
| 431 |
+
|
| 432 |
+
#ifdef __cplusplus
|
| 433 |
+
}
|
| 434 |
+
#endif
|
| 435 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/pkcs7err.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PKCS7ERR_H
|
| 12 |
+
#define OPENSSL_PKCS7ERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* PKCS7 reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
|
| 23 |
+
#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
|
| 24 |
+
#define PKCS7_R_CIPHER_NOT_INITIALIZED 116
|
| 25 |
+
#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
|
| 26 |
+
#define PKCS7_R_CTRL_ERROR 152
|
| 27 |
+
#define PKCS7_R_DECRYPT_ERROR 119
|
| 28 |
+
#define PKCS7_R_DIGEST_FAILURE 101
|
| 29 |
+
#define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
|
| 30 |
+
#define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
|
| 31 |
+
#define PKCS7_R_ERROR_ADDING_RECIPIENT 120
|
| 32 |
+
#define PKCS7_R_ERROR_SETTING_CIPHER 121
|
| 33 |
+
#define PKCS7_R_INVALID_NULL_POINTER 143
|
| 34 |
+
#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
|
| 35 |
+
#define PKCS7_R_NO_CONTENT 122
|
| 36 |
+
#define PKCS7_R_NO_DEFAULT_DIGEST 151
|
| 37 |
+
#define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
|
| 38 |
+
#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
|
| 39 |
+
#define PKCS7_R_NO_SIGNATURES_ON_DATA 123
|
| 40 |
+
#define PKCS7_R_NO_SIGNERS 142
|
| 41 |
+
#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
|
| 42 |
+
#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
|
| 43 |
+
#define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
|
| 44 |
+
#define PKCS7_R_PKCS7_DATASIGN 145
|
| 45 |
+
#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
|
| 46 |
+
#define PKCS7_R_SIGNATURE_FAILURE 105
|
| 47 |
+
#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
|
| 48 |
+
#define PKCS7_R_SIGNING_CTRL_FAILURE 147
|
| 49 |
+
#define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
|
| 50 |
+
#define PKCS7_R_SMIME_TEXT_ERROR 129
|
| 51 |
+
#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
|
| 52 |
+
#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
|
| 53 |
+
#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
|
| 54 |
+
#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
|
| 55 |
+
#define PKCS7_R_UNKNOWN_OPERATION 110
|
| 56 |
+
#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
|
| 57 |
+
#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
|
| 58 |
+
#define PKCS7_R_WRONG_CONTENT_TYPE 113
|
| 59 |
+
#define PKCS7_R_WRONG_PKCS7_TYPE 114
|
| 60 |
+
|
| 61 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/prov_ssl.h
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_PROV_SSL_H
|
| 11 |
+
#define OPENSSL_PROV_SSL_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
/* SSL/TLS related defines useful to providers */
|
| 19 |
+
|
| 20 |
+
#define SSL_MAX_MASTER_KEY_LENGTH 48
|
| 21 |
+
|
| 22 |
+
/* SSL/TLS uses a 2 byte unsigned version number */
|
| 23 |
+
#define SSL3_VERSION 0x0300
|
| 24 |
+
#define TLS1_VERSION 0x0301
|
| 25 |
+
#define TLS1_1_VERSION 0x0302
|
| 26 |
+
#define TLS1_2_VERSION 0x0303
|
| 27 |
+
#define TLS1_3_VERSION 0x0304
|
| 28 |
+
#define DTLS1_VERSION 0xFEFF
|
| 29 |
+
#define DTLS1_2_VERSION 0xFEFD
|
| 30 |
+
#define DTLS1_BAD_VER 0x0100
|
| 31 |
+
|
| 32 |
+
/* QUIC uses a 4 byte unsigned version number */
|
| 33 |
+
#define OSSL_QUIC1_VERSION 0x0000001
|
| 34 |
+
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
}
|
| 37 |
+
#endif
|
| 38 |
+
#endif /* OPENSSL_PROV_SSL_H */
|
physworld_p1_20261018/envs/p1/include/openssl/proverr.h
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PROVERR_H
|
| 12 |
+
#define OPENSSL_PROVERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* PROV reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define PROV_R_ADDITIONAL_INPUT_TOO_LONG 184
|
| 23 |
+
#define PROV_R_ALGORITHM_MISMATCH 173
|
| 24 |
+
#define PROV_R_ALREADY_INSTANTIATED 185
|
| 25 |
+
#define PROV_R_BAD_DECRYPT 100
|
| 26 |
+
#define PROV_R_BAD_ENCODING 141
|
| 27 |
+
#define PROV_R_BAD_LENGTH 142
|
| 28 |
+
#define PROV_R_BAD_TLS_CLIENT_VERSION 161
|
| 29 |
+
#define PROV_R_BN_ERROR 160
|
| 30 |
+
#define PROV_R_CIPHER_OPERATION_FAILED 102
|
| 31 |
+
#define PROV_R_COFACTOR_REQUIRED 236
|
| 32 |
+
#define PROV_R_DERIVATION_FUNCTION_INIT_FAILED 205
|
| 33 |
+
#define PROV_R_DIGEST_NOT_ALLOWED 174
|
| 34 |
+
#define PROV_R_EMS_NOT_ENABLED 233
|
| 35 |
+
#define PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS 244
|
| 36 |
+
#define PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK 186
|
| 37 |
+
#define PROV_R_ERROR_INSTANTIATING_DRBG 188
|
| 38 |
+
#define PROV_R_ERROR_RETRIEVING_ENTROPY 189
|
| 39 |
+
#define PROV_R_ERROR_RETRIEVING_NONCE 190
|
| 40 |
+
#define PROV_R_FAILED_DURING_DERIVATION 164
|
| 41 |
+
#define PROV_R_FAILED_TO_CREATE_LOCK 180
|
| 42 |
+
#define PROV_R_FAILED_TO_DECRYPT 162
|
| 43 |
+
#define PROV_R_FAILED_TO_GENERATE_KEY 121
|
| 44 |
+
#define PROV_R_FAILED_TO_GET_PARAMETER 103
|
| 45 |
+
#define PROV_R_FAILED_TO_SET_PARAMETER 104
|
| 46 |
+
#define PROV_R_FAILED_TO_SIGN 175
|
| 47 |
+
#define PROV_R_FINAL_CALL_OUT_OF_ORDER 237
|
| 48 |
+
#define PROV_R_FIPS_MODULE_CONDITIONAL_ERROR 227
|
| 49 |
+
#define PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE 224
|
| 50 |
+
#define PROV_R_FIPS_MODULE_IMPORT_PCT_ERROR 253
|
| 51 |
+
#define PROV_R_FIPS_MODULE_IN_ERROR_STATE 225
|
| 52 |
+
#define PROV_R_GENERATE_ERROR 191
|
| 53 |
+
#define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 165
|
| 54 |
+
#define PROV_R_INDICATOR_INTEGRITY_FAILURE 210
|
| 55 |
+
#define PROV_R_INIT_CALL_OUT_OF_ORDER 238
|
| 56 |
+
#define PROV_R_INSUFFICIENT_DRBG_STRENGTH 181
|
| 57 |
+
#define PROV_R_INVALID_AAD 108
|
| 58 |
+
#define PROV_R_INVALID_AEAD 231
|
| 59 |
+
#define PROV_R_INVALID_CONFIG_DATA 211
|
| 60 |
+
#define PROV_R_INVALID_CONSTANT_LENGTH 157
|
| 61 |
+
#define PROV_R_INVALID_CURVE 176
|
| 62 |
+
#define PROV_R_INVALID_CUSTOM_LENGTH 111
|
| 63 |
+
#define PROV_R_INVALID_DATA 115
|
| 64 |
+
#define PROV_R_INVALID_DIGEST 122
|
| 65 |
+
#define PROV_R_INVALID_DIGEST_LENGTH 166
|
| 66 |
+
#define PROV_R_INVALID_DIGEST_SIZE 218
|
| 67 |
+
#define PROV_R_INVALID_EDDSA_INSTANCE_FOR_ATTEMPTED_OPERATION 243
|
| 68 |
+
#define PROV_R_INVALID_INPUT_LENGTH 230
|
| 69 |
+
#define PROV_R_INVALID_ITERATION_COUNT 123
|
| 70 |
+
#define PROV_R_INVALID_IV_LENGTH 109
|
| 71 |
+
#define PROV_R_INVALID_KDF 232
|
| 72 |
+
#define PROV_R_INVALID_KEY 158
|
| 73 |
+
#define PROV_R_INVALID_KEY_LENGTH 105
|
| 74 |
+
#define PROV_R_INVALID_MAC 151
|
| 75 |
+
#define PROV_R_INVALID_MEMORY_SIZE 235
|
| 76 |
+
#define PROV_R_INVALID_MGF1_MD 167
|
| 77 |
+
#define PROV_R_INVALID_MODE 125
|
| 78 |
+
#define PROV_R_INVALID_OUTPUT_LENGTH 217
|
| 79 |
+
#define PROV_R_INVALID_PADDING_MODE 168
|
| 80 |
+
#define PROV_R_INVALID_PREHASHED_DIGEST_LENGTH 241
|
| 81 |
+
#define PROV_R_INVALID_PUBINFO 198
|
| 82 |
+
#define PROV_R_INVALID_SALT_LENGTH 112
|
| 83 |
+
#define PROV_R_INVALID_SEED_LENGTH 154
|
| 84 |
+
#define PROV_R_INVALID_SIGNATURE_SIZE 179
|
| 85 |
+
#define PROV_R_INVALID_STATE 212
|
| 86 |
+
#define PROV_R_INVALID_TAG 110
|
| 87 |
+
#define PROV_R_INVALID_TAG_LENGTH 118
|
| 88 |
+
#define PROV_R_INVALID_THREAD_POOL_SIZE 234
|
| 89 |
+
#define PROV_R_INVALID_UKM_LENGTH 200
|
| 90 |
+
#define PROV_R_INVALID_X931_DIGEST 170
|
| 91 |
+
#define PROV_R_IN_ERROR_STATE 192
|
| 92 |
+
#define PROV_R_KEY_SETUP_FAILED 101
|
| 93 |
+
#define PROV_R_KEY_SIZE_TOO_SMALL 171
|
| 94 |
+
#define PROV_R_LENGTH_TOO_LARGE 202
|
| 95 |
+
#define PROV_R_MISMATCHING_DOMAIN_PARAMETERS 203
|
| 96 |
+
#define PROV_R_MISSING_CEK_ALG 144
|
| 97 |
+
#define PROV_R_MISSING_CIPHER 155
|
| 98 |
+
#define PROV_R_MISSING_CONFIG_DATA 213
|
| 99 |
+
#define PROV_R_MISSING_CONSTANT 156
|
| 100 |
+
#define PROV_R_MISSING_KEY 128
|
| 101 |
+
#define PROV_R_MISSING_MAC 150
|
| 102 |
+
#define PROV_R_MISSING_MESSAGE_DIGEST 129
|
| 103 |
+
#define PROV_R_MISSING_OID 209
|
| 104 |
+
#define PROV_R_MISSING_PASS 130
|
| 105 |
+
#define PROV_R_MISSING_SALT 131
|
| 106 |
+
#define PROV_R_MISSING_SECRET 132
|
| 107 |
+
#define PROV_R_MISSING_SEED 140
|
| 108 |
+
#define PROV_R_MISSING_SESSION_ID 133
|
| 109 |
+
#define PROV_R_MISSING_TYPE 134
|
| 110 |
+
#define PROV_R_MISSING_XCGHASH 135
|
| 111 |
+
#define PROV_R_ML_DSA_NO_FORMAT 245
|
| 112 |
+
#define PROV_R_ML_KEM_NO_FORMAT 246
|
| 113 |
+
#define PROV_R_MODULE_INTEGRITY_FAILURE 214
|
| 114 |
+
#define PROV_R_NOT_A_PRIVATE_KEY 221
|
| 115 |
+
#define PROV_R_NOT_A_PUBLIC_KEY 220
|
| 116 |
+
#define PROV_R_NOT_INSTANTIATED 193
|
| 117 |
+
#define PROV_R_NOT_PARAMETERS 226
|
| 118 |
+
#define PROV_R_NOT_SUPPORTED 136
|
| 119 |
+
#define PROV_R_NOT_XOF_OR_INVALID_LENGTH 113
|
| 120 |
+
#define PROV_R_NO_INSTANCE_ALLOWED 242
|
| 121 |
+
#define PROV_R_NO_KEY_SET 114
|
| 122 |
+
#define PROV_R_NO_PARAMETERS_SET 177
|
| 123 |
+
#define PROV_R_NULL_LENGTH_POINTER 247
|
| 124 |
+
#define PROV_R_NULL_OUTPUT_BUFFER 248
|
| 125 |
+
#define PROV_R_ONESHOT_CALL_OUT_OF_ORDER 239
|
| 126 |
+
#define PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 178
|
| 127 |
+
#define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106
|
| 128 |
+
#define PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS 228
|
| 129 |
+
#define PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED 187
|
| 130 |
+
#define PROV_R_PARENT_LOCKING_NOT_ENABLED 182
|
| 131 |
+
#define PROV_R_PARENT_STRENGTH_TOO_WEAK 194
|
| 132 |
+
#define PROV_R_PATH_MUST_BE_ABSOLUTE 219
|
| 133 |
+
#define PROV_R_PERSONALISATION_STRING_TOO_LONG 195
|
| 134 |
+
#define PROV_R_PSS_SALTLEN_TOO_SMALL 172
|
| 135 |
+
#define PROV_R_REPEATED_PARAMETER 252
|
| 136 |
+
#define PROV_R_REQUEST_TOO_LARGE_FOR_DRBG 196
|
| 137 |
+
#define PROV_R_REQUIRE_CTR_MODE_CIPHER 206
|
| 138 |
+
#define PROV_R_RESEED_ERROR 197
|
| 139 |
+
#define PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 222
|
| 140 |
+
#define PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT 229
|
| 141 |
+
#define PROV_R_SELF_TEST_KAT_FAILURE 215
|
| 142 |
+
#define PROV_R_SELF_TEST_POST_FAILURE 216
|
| 143 |
+
#define PROV_R_TAG_NOT_NEEDED 120
|
| 144 |
+
#define PROV_R_TAG_NOT_SET 119
|
| 145 |
+
#define PROV_R_TOO_MANY_RECORDS 126
|
| 146 |
+
#define PROV_R_UNABLE_TO_FIND_CIPHERS 207
|
| 147 |
+
#define PROV_R_UNABLE_TO_GET_PARENT_STRENGTH 199
|
| 148 |
+
#define PROV_R_UNABLE_TO_GET_PASSPHRASE 159
|
| 149 |
+
#define PROV_R_UNABLE_TO_INITIALISE_CIPHERS 208
|
| 150 |
+
#define PROV_R_UNABLE_TO_LOAD_SHA256 147
|
| 151 |
+
#define PROV_R_UNABLE_TO_LOCK_PARENT 201
|
| 152 |
+
#define PROV_R_UNABLE_TO_RESEED 204
|
| 153 |
+
#define PROV_R_UNEXPECTED_KEY_PARAMETERS 249
|
| 154 |
+
#define PROV_R_UNSUPPORTED_CEK_ALG 145
|
| 155 |
+
#define PROV_R_UNSUPPORTED_KEY_SIZE 153
|
| 156 |
+
#define PROV_R_UNSUPPORTED_MAC_TYPE 137
|
| 157 |
+
#define PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS 152
|
| 158 |
+
#define PROV_R_UNSUPPORTED_SELECTION 250
|
| 159 |
+
#define PROV_R_UPDATE_CALL_OUT_OF_ORDER 240
|
| 160 |
+
#define PROV_R_URI_AUTHORITY_UNSUPPORTED 223
|
| 161 |
+
#define PROV_R_VALUE_ERROR 138
|
| 162 |
+
#define PROV_R_WRONG_CIPHERTEXT_SIZE 251
|
| 163 |
+
#define PROV_R_WRONG_FINAL_BLOCK_LENGTH 107
|
| 164 |
+
#define PROV_R_WRONG_OUTPUT_BUFFER_SIZE 139
|
| 165 |
+
#define PROV_R_XOF_DIGESTS_NOT_ALLOWED 183
|
| 166 |
+
#define PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE 148
|
| 167 |
+
#define PROV_R_XTS_DUPLICATED_KEYS 149
|
| 168 |
+
|
| 169 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/provider.h
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_PROVIDER_H
|
| 11 |
+
#define OPENSSL_PROVIDER_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/core.h>
|
| 15 |
+
|
| 16 |
+
#ifdef __cplusplus
|
| 17 |
+
extern "C" {
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/* Set and Get a library context search path */
|
| 21 |
+
int OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *, const char *path);
|
| 22 |
+
const char *OSSL_PROVIDER_get0_default_search_path(OSSL_LIB_CTX *libctx);
|
| 23 |
+
|
| 24 |
+
/* Load and unload a provider */
|
| 25 |
+
OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *, const char *name);
|
| 26 |
+
OSSL_PROVIDER *OSSL_PROVIDER_load_ex(OSSL_LIB_CTX *, const char *name,
|
| 27 |
+
OSSL_PARAM *params);
|
| 28 |
+
OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *, const char *name,
|
| 29 |
+
int retain_fallbacks);
|
| 30 |
+
OSSL_PROVIDER *OSSL_PROVIDER_try_load_ex(OSSL_LIB_CTX *, const char *name,
|
| 31 |
+
OSSL_PARAM *params,
|
| 32 |
+
int retain_fallbacks);
|
| 33 |
+
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
|
| 34 |
+
int OSSL_PROVIDER_available(OSSL_LIB_CTX *, const char *name);
|
| 35 |
+
int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx,
|
| 36 |
+
int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
|
| 37 |
+
void *cbdata);
|
| 38 |
+
|
| 39 |
+
const OSSL_PARAM *OSSL_PROVIDER_gettable_params(const OSSL_PROVIDER *prov);
|
| 40 |
+
int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
|
| 41 |
+
int OSSL_PROVIDER_self_test(const OSSL_PROVIDER *prov);
|
| 42 |
+
int OSSL_PROVIDER_get_capabilities(const OSSL_PROVIDER *prov,
|
| 43 |
+
const char *capability,
|
| 44 |
+
OSSL_CALLBACK *cb,
|
| 45 |
+
void *arg);
|
| 46 |
+
|
| 47 |
+
/*-
|
| 48 |
+
* Provider configuration parameters are normally set in the configuration file,
|
| 49 |
+
* but can also be set early in the main program before a provider is in use by
|
| 50 |
+
* multiple threads.
|
| 51 |
+
*
|
| 52 |
+
* Only UTF8-string values are supported.
|
| 53 |
+
*/
|
| 54 |
+
int OSSL_PROVIDER_add_conf_parameter(OSSL_PROVIDER *prov, const char *name,
|
| 55 |
+
const char *value);
|
| 56 |
+
/*
|
| 57 |
+
* Retrieves any of the requested configuration parameters for the given
|
| 58 |
+
* provider that were set in the configuration file or via the above
|
| 59 |
+
* OSSL_PROVIDER_add_parameter() function.
|
| 60 |
+
*
|
| 61 |
+
* The |params| array elements MUST have type OSSL_PARAM_UTF8_PTR, values are
|
| 62 |
+
* returned by reference, not as copies.
|
| 63 |
+
*/
|
| 64 |
+
int OSSL_PROVIDER_get_conf_parameters(const OSSL_PROVIDER *prov,
|
| 65 |
+
OSSL_PARAM params[]);
|
| 66 |
+
/*
|
| 67 |
+
* Parse a provider configuration parameter as a boolean value,
|
| 68 |
+
* or return a default value if unable to retrieve the parameter.
|
| 69 |
+
* Values like "1", "yes", "true", ... are true (nonzero).
|
| 70 |
+
* Values like "0", "no", "false", ... are false (zero).
|
| 71 |
+
*/
|
| 72 |
+
int OSSL_PROVIDER_conf_get_bool(const OSSL_PROVIDER *prov,
|
| 73 |
+
const char *name, int defval);
|
| 74 |
+
|
| 75 |
+
const OSSL_ALGORITHM *OSSL_PROVIDER_query_operation(const OSSL_PROVIDER *prov,
|
| 76 |
+
int operation_id,
|
| 77 |
+
int *no_cache);
|
| 78 |
+
void OSSL_PROVIDER_unquery_operation(const OSSL_PROVIDER *prov,
|
| 79 |
+
int operation_id, const OSSL_ALGORITHM *algs);
|
| 80 |
+
void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov);
|
| 81 |
+
const OSSL_DISPATCH *OSSL_PROVIDER_get0_dispatch(const OSSL_PROVIDER *prov);
|
| 82 |
+
|
| 83 |
+
/* Add a built in providers */
|
| 84 |
+
int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *, const char *name,
|
| 85 |
+
OSSL_provider_init_fn *init_fn);
|
| 86 |
+
|
| 87 |
+
/* Information */
|
| 88 |
+
const char *OSSL_PROVIDER_get0_name(const OSSL_PROVIDER *prov);
|
| 89 |
+
|
| 90 |
+
#ifdef __cplusplus
|
| 91 |
+
}
|
| 92 |
+
#endif
|
| 93 |
+
|
| 94 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/quic.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_QUIC_H
|
| 11 |
+
#define OPENSSL_QUIC_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#include <openssl/ssl.h>
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_NO_QUIC
|
| 18 |
+
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* Method used for non-thread-assisted QUIC client operation.
|
| 25 |
+
*/
|
| 26 |
+
__owur const SSL_METHOD *OSSL_QUIC_client_method(void);
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* Method used for thread-assisted QUIC client operation.
|
| 30 |
+
*/
|
| 31 |
+
__owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void);
|
| 32 |
+
|
| 33 |
+
/*
|
| 34 |
+
* QUIC transport error codes (RFC 9000 s. 20.1)
|
| 35 |
+
*/
|
| 36 |
+
#define OSSL_QUIC_ERR_NO_ERROR 0x00
|
| 37 |
+
#define OSSL_QUIC_ERR_INTERNAL_ERROR 0x01
|
| 38 |
+
#define OSSL_QUIC_ERR_CONNECTION_REFUSED 0x02
|
| 39 |
+
#define OSSL_QUIC_ERR_FLOW_CONTROL_ERROR 0x03
|
| 40 |
+
#define OSSL_QUIC_ERR_STREAM_LIMIT_ERROR 0x04
|
| 41 |
+
#define OSSL_QUIC_ERR_STREAM_STATE_ERROR 0x05
|
| 42 |
+
#define OSSL_QUIC_ERR_FINAL_SIZE_ERROR 0x06
|
| 43 |
+
#define OSSL_QUIC_ERR_FRAME_ENCODING_ERROR 0x07
|
| 44 |
+
#define OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08
|
| 45 |
+
#define OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09
|
| 46 |
+
#define OSSL_QUIC_ERR_PROTOCOL_VIOLATION 0x0A
|
| 47 |
+
#define OSSL_QUIC_ERR_INVALID_TOKEN 0x0B
|
| 48 |
+
#define OSSL_QUIC_ERR_APPLICATION_ERROR 0x0C
|
| 49 |
+
#define OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D
|
| 50 |
+
#define OSSL_QUIC_ERR_KEY_UPDATE_ERROR 0x0E
|
| 51 |
+
#define OSSL_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F
|
| 52 |
+
#define OSSL_QUIC_ERR_NO_VIABLE_PATH 0x10
|
| 53 |
+
|
| 54 |
+
/* Inclusive range for handshake-specific errors. */
|
| 55 |
+
#define OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN 0x0100
|
| 56 |
+
#define OSSL_QUIC_ERR_CRYPTO_ERR_END 0x01FF
|
| 57 |
+
|
| 58 |
+
#define OSSL_QUIC_ERR_CRYPTO_ERR(X) \
|
| 59 |
+
(OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN + (X))
|
| 60 |
+
|
| 61 |
+
/* Local errors. */
|
| 62 |
+
#define OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT \
|
| 63 |
+
((uint64_t)0xFFFFFFFFFFFFFFFFULL)
|
| 64 |
+
|
| 65 |
+
/*
|
| 66 |
+
* Method used for QUIC server operation.
|
| 67 |
+
*/
|
| 68 |
+
__owur const SSL_METHOD *OSSL_QUIC_server_method(void);
|
| 69 |
+
|
| 70 |
+
#ifdef __cplusplus
|
| 71 |
+
}
|
| 72 |
+
#endif
|
| 73 |
+
|
| 74 |
+
#endif /* OPENSSL_NO_QUIC */
|
| 75 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rand.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RAND_H
|
| 11 |
+
#define OPENSSL_RAND_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RAND_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <stdlib.h>
|
| 20 |
+
#include <openssl/types.h>
|
| 21 |
+
#include <openssl/e_os2.h>
|
| 22 |
+
#include <openssl/randerr.h>
|
| 23 |
+
#include <openssl/evp.h>
|
| 24 |
+
|
| 25 |
+
#ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Default security strength (in the sense of [NIST SP 800-90Ar1])
|
| 31 |
+
*
|
| 32 |
+
* NIST SP 800-90Ar1 supports the strength of the DRBG being smaller than that
|
| 33 |
+
* of the cipher by collecting less entropy. The current DRBG implementation
|
| 34 |
+
* does not take RAND_DRBG_STRENGTH into account and sets the strength of the
|
| 35 |
+
* DRBG to that of the cipher.
|
| 36 |
+
*/
|
| 37 |
+
#define RAND_DRBG_STRENGTH 256
|
| 38 |
+
|
| 39 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 40 |
+
struct rand_meth_st {
|
| 41 |
+
int (*seed)(const void *buf, int num);
|
| 42 |
+
int (*bytes)(unsigned char *buf, int num);
|
| 43 |
+
void (*cleanup)(void);
|
| 44 |
+
int (*add)(const void *buf, int num, double randomness);
|
| 45 |
+
int (*pseudorand)(unsigned char *buf, int num);
|
| 46 |
+
int (*status)(void);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *RAND_get_rand_method(void);
|
| 51 |
+
#ifndef OPENSSL_NO_ENGINE
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_engine(ENGINE *engine);
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
OSSL_DEPRECATEDIN_3_0 RAND_METHOD *RAND_OpenSSL(void);
|
| 56 |
+
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 57 |
+
|
| 58 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 59 |
+
#define RAND_cleanup() \
|
| 60 |
+
while (0) \
|
| 61 |
+
continue
|
| 62 |
+
#endif
|
| 63 |
+
int RAND_bytes(unsigned char *buf, int num);
|
| 64 |
+
int RAND_priv_bytes(unsigned char *buf, int num);
|
| 65 |
+
|
| 66 |
+
/*
|
| 67 |
+
* Equivalent of RAND_priv_bytes() but additionally taking an OSSL_LIB_CTX and
|
| 68 |
+
* a strength.
|
| 69 |
+
*/
|
| 70 |
+
int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
|
| 71 |
+
unsigned int strength);
|
| 72 |
+
|
| 73 |
+
/*
|
| 74 |
+
* Equivalent of RAND_bytes() but additionally taking an OSSL_LIB_CTX and
|
| 75 |
+
* a strength.
|
| 76 |
+
*/
|
| 77 |
+
int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
|
| 78 |
+
unsigned int strength);
|
| 79 |
+
|
| 80 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 81 |
+
OSSL_DEPRECATEDIN_1_1_0 int RAND_pseudo_bytes(unsigned char *buf, int num);
|
| 82 |
+
#endif
|
| 83 |
+
|
| 84 |
+
EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx);
|
| 85 |
+
EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx);
|
| 86 |
+
EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx);
|
| 87 |
+
int RAND_set0_public(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand);
|
| 88 |
+
int RAND_set0_private(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand);
|
| 89 |
+
|
| 90 |
+
int RAND_set_DRBG_type(OSSL_LIB_CTX *ctx, const char *drbg, const char *propq,
|
| 91 |
+
const char *cipher, const char *digest);
|
| 92 |
+
int RAND_set_seed_source_type(OSSL_LIB_CTX *ctx, const char *seed,
|
| 93 |
+
const char *propq);
|
| 94 |
+
|
| 95 |
+
void RAND_seed(const void *buf, int num);
|
| 96 |
+
void RAND_keep_random_devices_open(int keep);
|
| 97 |
+
|
| 98 |
+
#if defined(__ANDROID__) && defined(__NDK_FPABI__)
|
| 99 |
+
__NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
|
| 100 |
+
#endif
|
| 101 |
+
void RAND_add(const void *buf, int num, double randomness);
|
| 102 |
+
int RAND_load_file(const char *file, long max_bytes);
|
| 103 |
+
int RAND_write_file(const char *file);
|
| 104 |
+
const char *RAND_file_name(char *file, size_t num);
|
| 105 |
+
int RAND_status(void);
|
| 106 |
+
|
| 107 |
+
#ifndef OPENSSL_NO_EGD
|
| 108 |
+
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
|
| 109 |
+
int RAND_egd(const char *path);
|
| 110 |
+
int RAND_egd_bytes(const char *path, int bytes);
|
| 111 |
+
#endif
|
| 112 |
+
|
| 113 |
+
int RAND_poll(void);
|
| 114 |
+
|
| 115 |
+
#if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
|
| 116 |
+
/* application has to include <windows.h> in order to use these */
|
| 117 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 118 |
+
OSSL_DEPRECATEDIN_1_1_0 void RAND_screen(void);
|
| 119 |
+
OSSL_DEPRECATEDIN_1_1_0 int RAND_event(UINT, WPARAM, LPARAM);
|
| 120 |
+
#endif
|
| 121 |
+
#endif
|
| 122 |
+
|
| 123 |
+
int RAND_set1_random_provider(OSSL_LIB_CTX *ctx, OSSL_PROVIDER *p);
|
| 124 |
+
|
| 125 |
+
/* Which parameter to provider_random call */
|
| 126 |
+
#define OSSL_PROV_RANDOM_PUBLIC 0
|
| 127 |
+
#define OSSL_PROV_RANDOM_PRIVATE 1
|
| 128 |
+
|
| 129 |
+
#ifdef __cplusplus
|
| 130 |
+
}
|
| 131 |
+
#endif
|
| 132 |
+
|
| 133 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/randerr.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_RANDERR_H
|
| 12 |
+
#define OPENSSL_RANDERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* RAND reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102
|
| 23 |
+
#define RAND_R_ALREADY_INSTANTIATED 103
|
| 24 |
+
#define RAND_R_ARGUMENT_OUT_OF_RANGE 105
|
| 25 |
+
#define RAND_R_CANNOT_OPEN_FILE 121
|
| 26 |
+
#define RAND_R_DRBG_ALREADY_INITIALIZED 129
|
| 27 |
+
#define RAND_R_DRBG_NOT_INITIALISED 104
|
| 28 |
+
#define RAND_R_ENTROPY_INPUT_TOO_LONG 106
|
| 29 |
+
#define RAND_R_ENTROPY_OUT_OF_RANGE 124
|
| 30 |
+
#define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127
|
| 31 |
+
#define RAND_R_ERROR_INITIALISING_DRBG 107
|
| 32 |
+
#define RAND_R_ERROR_INSTANTIATING_DRBG 108
|
| 33 |
+
#define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109
|
| 34 |
+
#define RAND_R_ERROR_RETRIEVING_ENTROPY 110
|
| 35 |
+
#define RAND_R_ERROR_RETRIEVING_NONCE 111
|
| 36 |
+
#define RAND_R_FAILED_TO_CREATE_LOCK 126
|
| 37 |
+
#define RAND_R_FUNC_NOT_IMPLEMENTED 101
|
| 38 |
+
#define RAND_R_FWRITE_ERROR 123
|
| 39 |
+
#define RAND_R_GENERATE_ERROR 112
|
| 40 |
+
#define RAND_R_INSUFFICIENT_DRBG_STRENGTH 139
|
| 41 |
+
#define RAND_R_INTERNAL_ERROR 113
|
| 42 |
+
#define RAND_R_INVALID_PROPERTY_QUERY 137
|
| 43 |
+
#define RAND_R_IN_ERROR_STATE 114
|
| 44 |
+
#define RAND_R_NOT_A_REGULAR_FILE 122
|
| 45 |
+
#define RAND_R_NOT_INSTANTIATED 115
|
| 46 |
+
#define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128
|
| 47 |
+
#define RAND_R_PARENT_LOCKING_NOT_ENABLED 130
|
| 48 |
+
#define RAND_R_PARENT_STRENGTH_TOO_WEAK 131
|
| 49 |
+
#define RAND_R_PERSONALISATION_STRING_TOO_LONG 116
|
| 50 |
+
#define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133
|
| 51 |
+
#define RAND_R_PRNG_NOT_SEEDED 100
|
| 52 |
+
#define RAND_R_RANDOM_POOL_IS_EMPTY 142
|
| 53 |
+
#define RAND_R_RANDOM_POOL_OVERFLOW 125
|
| 54 |
+
#define RAND_R_RANDOM_POOL_UNDERFLOW 134
|
| 55 |
+
#define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117
|
| 56 |
+
#define RAND_R_RESEED_ERROR 118
|
| 57 |
+
#define RAND_R_SELFTEST_FAILURE 119
|
| 58 |
+
#define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135
|
| 59 |
+
#define RAND_R_TOO_MUCH_NONCE_REQUESTED 136
|
| 60 |
+
#define RAND_R_UNABLE_TO_CREATE_DRBG 143
|
| 61 |
+
#define RAND_R_UNABLE_TO_FETCH_DRBG 144
|
| 62 |
+
#define RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER 141
|
| 63 |
+
#define RAND_R_UNABLE_TO_GET_PARENT_STRENGTH 138
|
| 64 |
+
#define RAND_R_UNABLE_TO_LOCK_PARENT 140
|
| 65 |
+
#define RAND_R_UNSUPPORTED_DRBG_FLAGS 132
|
| 66 |
+
#define RAND_R_UNSUPPORTED_DRBG_TYPE 120
|
| 67 |
+
|
| 68 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rc2.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RC2_H
|
| 11 |
+
#define OPENSSL_RC2_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RC2_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_RC2
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#define RC2_BLOCK 8
|
| 27 |
+
#define RC2_KEY_LENGTH 16
|
| 28 |
+
|
| 29 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 30 |
+
typedef unsigned int RC2_INT;
|
| 31 |
+
|
| 32 |
+
#define RC2_ENCRYPT 1
|
| 33 |
+
#define RC2_DECRYPT 0
|
| 34 |
+
|
| 35 |
+
typedef struct rc2_key_st {
|
| 36 |
+
RC2_INT data[64];
|
| 37 |
+
} RC2_KEY;
|
| 38 |
+
#endif
|
| 39 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 40 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_set_key(RC2_KEY *key, int len,
|
| 41 |
+
const unsigned char *data, int bits);
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_ecb_encrypt(const unsigned char *in,
|
| 43 |
+
unsigned char *out, RC2_KEY *key,
|
| 44 |
+
int enc);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_encrypt(unsigned long *data, RC2_KEY *key);
|
| 46 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_decrypt(unsigned long *data, RC2_KEY *key);
|
| 47 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_cbc_encrypt(const unsigned char *in,
|
| 48 |
+
unsigned char *out, long length,
|
| 49 |
+
RC2_KEY *ks, unsigned char *iv,
|
| 50 |
+
int enc);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_cfb64_encrypt(const unsigned char *in,
|
| 52 |
+
unsigned char *out, long length,
|
| 53 |
+
RC2_KEY *schedule,
|
| 54 |
+
unsigned char *ivec,
|
| 55 |
+
int *num, int enc);
|
| 56 |
+
OSSL_DEPRECATEDIN_3_0 void RC2_ofb64_encrypt(const unsigned char *in,
|
| 57 |
+
unsigned char *out, long length,
|
| 58 |
+
RC2_KEY *schedule,
|
| 59 |
+
unsigned char *ivec,
|
| 60 |
+
int *num);
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
#ifdef __cplusplus
|
| 64 |
+
}
|
| 65 |
+
#endif
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rc4.h
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RC4_H
|
| 11 |
+
#define OPENSSL_RC4_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RC4_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_RC4
|
| 22 |
+
#include <stddef.h>
|
| 23 |
+
#ifdef __cplusplus
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 28 |
+
typedef struct rc4_key_st {
|
| 29 |
+
RC4_INT x, y;
|
| 30 |
+
RC4_INT data[256];
|
| 31 |
+
} RC4_KEY;
|
| 32 |
+
#endif
|
| 33 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 34 |
+
OSSL_DEPRECATEDIN_3_0 const char *RC4_options(void);
|
| 35 |
+
OSSL_DEPRECATEDIN_3_0 void RC4_set_key(RC4_KEY *key, int len,
|
| 36 |
+
const unsigned char *data);
|
| 37 |
+
OSSL_DEPRECATEDIN_3_0 void RC4(RC4_KEY *key, size_t len,
|
| 38 |
+
const unsigned char *indata,
|
| 39 |
+
unsigned char *outdata);
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
#ifdef __cplusplus
|
| 43 |
+
}
|
| 44 |
+
#endif
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rc5.h
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RC5_H
|
| 11 |
+
#define OPENSSL_RC5_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RC5_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_RC5
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#define RC5_32_BLOCK 8
|
| 27 |
+
#define RC5_32_KEY_LENGTH 16 /* This is a default, max is 255 */
|
| 28 |
+
|
| 29 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 30 |
+
#define RC5_ENCRYPT 1
|
| 31 |
+
#define RC5_DECRYPT 0
|
| 32 |
+
|
| 33 |
+
#define RC5_32_INT unsigned int
|
| 34 |
+
|
| 35 |
+
/*
|
| 36 |
+
* This are the only values supported. Tweak the code if you want more The
|
| 37 |
+
* most supported modes will be RC5-32/12/16 RC5-32/16/8
|
| 38 |
+
*/
|
| 39 |
+
#define RC5_8_ROUNDS 8
|
| 40 |
+
#define RC5_12_ROUNDS 12
|
| 41 |
+
#define RC5_16_ROUNDS 16
|
| 42 |
+
|
| 43 |
+
typedef struct rc5_key_st {
|
| 44 |
+
/* Number of rounds */
|
| 45 |
+
int rounds;
|
| 46 |
+
RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
|
| 47 |
+
} RC5_32_KEY;
|
| 48 |
+
#endif
|
| 49 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 int RC5_32_set_key(RC5_32_KEY *key, int len,
|
| 51 |
+
const unsigned char *data,
|
| 52 |
+
int rounds);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_ecb_encrypt(const unsigned char *in,
|
| 54 |
+
unsigned char *out,
|
| 55 |
+
RC5_32_KEY *key,
|
| 56 |
+
int enc);
|
| 57 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
|
| 58 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
|
| 59 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_cbc_encrypt(const unsigned char *in,
|
| 60 |
+
unsigned char *out, long length,
|
| 61 |
+
RC5_32_KEY *ks, unsigned char *iv,
|
| 62 |
+
int enc);
|
| 63 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_cfb64_encrypt(const unsigned char *in,
|
| 64 |
+
unsigned char *out, long length,
|
| 65 |
+
RC5_32_KEY *schedule,
|
| 66 |
+
unsigned char *ivec, int *num,
|
| 67 |
+
int enc);
|
| 68 |
+
OSSL_DEPRECATEDIN_3_0 void RC5_32_ofb64_encrypt(const unsigned char *in,
|
| 69 |
+
unsigned char *out, long length,
|
| 70 |
+
RC5_32_KEY *schedule,
|
| 71 |
+
unsigned char *ivec, int *num);
|
| 72 |
+
#endif
|
| 73 |
+
|
| 74 |
+
#ifdef __cplusplus
|
| 75 |
+
}
|
| 76 |
+
#endif
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ripemd.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RIPEMD_H
|
| 11 |
+
#define OPENSSL_RIPEMD_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RIPEMD_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_NO_RMD160
|
| 22 |
+
#include <openssl/e_os2.h>
|
| 23 |
+
#include <stddef.h>
|
| 24 |
+
|
| 25 |
+
#define RIPEMD160_DIGEST_LENGTH 20
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
|
| 32 |
+
#define RIPEMD160_LONG unsigned int
|
| 33 |
+
|
| 34 |
+
#define RIPEMD160_CBLOCK 64
|
| 35 |
+
#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK / 4)
|
| 36 |
+
|
| 37 |
+
typedef struct RIPEMD160state_st {
|
| 38 |
+
RIPEMD160_LONG A, B, C, D, E;
|
| 39 |
+
RIPEMD160_LONG Nl, Nh;
|
| 40 |
+
RIPEMD160_LONG data[RIPEMD160_LBLOCK];
|
| 41 |
+
unsigned int num;
|
| 42 |
+
} RIPEMD160_CTX;
|
| 43 |
+
#endif
|
| 44 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Init(RIPEMD160_CTX *c);
|
| 46 |
+
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
|
| 47 |
+
size_t len);
|
| 48 |
+
OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *RIPEMD160(const unsigned char *d, size_t n,
|
| 50 |
+
unsigned char *md);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 void RIPEMD160_Transform(RIPEMD160_CTX *c,
|
| 52 |
+
const unsigned char *b);
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#ifdef __cplusplus
|
| 56 |
+
}
|
| 57 |
+
#endif
|
| 58 |
+
#endif
|
| 59 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rsa.h
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_RSA_H
|
| 11 |
+
#define OPENSSL_RSA_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_RSA_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
#include <openssl/asn1.h>
|
| 22 |
+
#include <openssl/bio.h>
|
| 23 |
+
#include <openssl/crypto.h>
|
| 24 |
+
#include <openssl/types.h>
|
| 25 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 26 |
+
#include <openssl/bn.h>
|
| 27 |
+
#endif
|
| 28 |
+
#include <openssl/rsaerr.h>
|
| 29 |
+
#include <openssl/safestack.h>
|
| 30 |
+
#ifndef OPENSSL_NO_STDIO
|
| 31 |
+
#include <stdio.h>
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
|
| 39 |
+
#define OPENSSL_RSA_MAX_MODULUS_BITS 16384
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
#define RSA_3 0x3L
|
| 43 |
+
#define RSA_F4 0x10001L
|
| 44 |
+
|
| 45 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 46 |
+
/* The types RSA and RSA_METHOD are defined in ossl_typ.h */
|
| 47 |
+
|
| 48 |
+
#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048
|
| 49 |
+
|
| 50 |
+
#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
|
| 51 |
+
#define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
|
| 52 |
+
#endif
|
| 53 |
+
|
| 54 |
+
/* exponent limit enforced for "large" modulus only */
|
| 55 |
+
#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
|
| 56 |
+
#define OPENSSL_RSA_MAX_PUBEXP_BITS 64
|
| 57 |
+
#endif
|
| 58 |
+
/* based on RFC 8017 appendix A.1.2 */
|
| 59 |
+
#define RSA_ASN1_VERSION_DEFAULT 0
|
| 60 |
+
#define RSA_ASN1_VERSION_MULTI 1
|
| 61 |
+
|
| 62 |
+
#define RSA_DEFAULT_PRIME_NUM 2
|
| 63 |
+
|
| 64 |
+
#define RSA_METHOD_FLAG_NO_CHECK 0x0001
|
| 65 |
+
#define RSA_FLAG_CACHE_PUBLIC 0x0002
|
| 66 |
+
#define RSA_FLAG_CACHE_PRIVATE 0x0004
|
| 67 |
+
#define RSA_FLAG_BLINDING 0x0008
|
| 68 |
+
#define RSA_FLAG_THREAD_SAFE 0x0010
|
| 69 |
+
/*
|
| 70 |
+
* This flag means the private key operations will be handled by rsa_mod_exp
|
| 71 |
+
* and that they do not depend on the private key components being present:
|
| 72 |
+
* for example a key stored in external hardware. Without this flag
|
| 73 |
+
* bn_mod_exp gets called when private key components are absent.
|
| 74 |
+
*/
|
| 75 |
+
#define RSA_FLAG_EXT_PKEY 0x0020
|
| 76 |
+
|
| 77 |
+
/*
|
| 78 |
+
* new with 0.9.6j and 0.9.7b; the built-in
|
| 79 |
+
* RSA implementation now uses blinding by
|
| 80 |
+
* default (ignoring RSA_FLAG_BLINDING),
|
| 81 |
+
* but other engines might not need it
|
| 82 |
+
*/
|
| 83 |
+
#define RSA_FLAG_NO_BLINDING 0x0080
|
| 84 |
+
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 85 |
+
/*
|
| 86 |
+
* Does nothing. Previously this switched off constant time behaviour.
|
| 87 |
+
*/
|
| 88 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 89 |
+
#define RSA_FLAG_NO_CONSTTIME 0x0000
|
| 90 |
+
#endif
|
| 91 |
+
/* deprecated name for the flag*/
|
| 92 |
+
/*
|
| 93 |
+
* new with 0.9.7h; the built-in RSA
|
| 94 |
+
* implementation now uses constant time
|
| 95 |
+
* modular exponentiation for secret exponents
|
| 96 |
+
* by default. This flag causes the
|
| 97 |
+
* faster variable sliding window method to
|
| 98 |
+
* be used for all exponents.
|
| 99 |
+
*/
|
| 100 |
+
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
| 101 |
+
#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
|
| 102 |
+
#endif
|
| 103 |
+
|
| 104 |
+
/*-
|
| 105 |
+
* New with 3.0: use part of the flags to denote exact type of RSA key,
|
| 106 |
+
* some of which are limited to specific signature and encryption schemes.
|
| 107 |
+
* These different types share the same RSA structure, but indicate the
|
| 108 |
+
* use of certain fields in that structure.
|
| 109 |
+
* Currently known are:
|
| 110 |
+
* RSA - this is the "normal" unlimited RSA structure (typenum 0)
|
| 111 |
+
* RSASSA-PSS - indicates that the PSS parameters are used.
|
| 112 |
+
* RSAES-OAEP - no specific field used for the moment, but OAEP padding
|
| 113 |
+
* is expected. (currently unused)
|
| 114 |
+
*
|
| 115 |
+
* 4 bits allow for 16 types
|
| 116 |
+
*/
|
| 117 |
+
#define RSA_FLAG_TYPE_MASK 0xF000
|
| 118 |
+
#define RSA_FLAG_TYPE_RSA 0x0000
|
| 119 |
+
#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
|
| 120 |
+
#define RSA_FLAG_TYPE_RSAESOAEP 0x2000
|
| 121 |
+
|
| 122 |
+
int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
|
| 123 |
+
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);
|
| 124 |
+
|
| 125 |
+
int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
| 126 |
+
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
|
| 127 |
+
|
| 128 |
+
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
|
| 129 |
+
int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
| 130 |
+
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
|
| 131 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
| 132 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 133 |
+
OSSL_DEPRECATEDIN_3_0
|
| 134 |
+
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
| 135 |
+
#endif
|
| 136 |
+
|
| 137 |
+
/* Salt length matches digest */
|
| 138 |
+
#define RSA_PSS_SALTLEN_DIGEST -1
|
| 139 |
+
/* Verify only: auto detect salt length */
|
| 140 |
+
#define RSA_PSS_SALTLEN_AUTO -2
|
| 141 |
+
/* Set salt length to maximum possible */
|
| 142 |
+
#define RSA_PSS_SALTLEN_MAX -3
|
| 143 |
+
/* Auto-detect on verify, set salt length to min(maximum possible, digest
|
| 144 |
+
* length) on sign */
|
| 145 |
+
#define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX -4
|
| 146 |
+
/* Old compatible max salt length for sign only */
|
| 147 |
+
#define RSA_PSS_SALTLEN_MAX_SIGN -2
|
| 148 |
+
|
| 149 |
+
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 150 |
+
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
| 151 |
+
const char *mdprops);
|
| 152 |
+
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
| 153 |
+
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
|
| 154 |
+
size_t namelen);
|
| 155 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 156 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx,
|
| 157 |
+
const char *mdname);
|
| 158 |
+
|
| 159 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 160 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx,
|
| 161 |
+
const char *mdname,
|
| 162 |
+
const char *mdprops);
|
| 163 |
+
|
| 164 |
+
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 165 |
+
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
| 166 |
+
const char *mdprops);
|
| 167 |
+
int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
| 168 |
+
int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
|
| 169 |
+
size_t namelen);
|
| 170 |
+
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen);
|
| 171 |
+
int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
| 172 |
+
|
| 173 |
+
#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
|
| 174 |
+
#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
|
| 175 |
+
|
| 176 |
+
#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
|
| 177 |
+
#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
|
| 178 |
+
#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
|
| 179 |
+
|
| 180 |
+
#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
|
| 181 |
+
#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
|
| 182 |
+
#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
|
| 183 |
+
|
| 184 |
+
#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
|
| 185 |
+
#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
|
| 186 |
+
|
| 187 |
+
#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
|
| 188 |
+
#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
|
| 189 |
+
|
| 190 |
+
#define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
|
| 191 |
+
|
| 192 |
+
#define EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION (EVP_PKEY_ALG_CTRL + 14)
|
| 193 |
+
|
| 194 |
+
#define RSA_PKCS1_PADDING 1
|
| 195 |
+
#define RSA_NO_PADDING 3
|
| 196 |
+
#define RSA_PKCS1_OAEP_PADDING 4
|
| 197 |
+
#define RSA_X931_PADDING 5
|
| 198 |
+
|
| 199 |
+
/* EVP_PKEY_ only */
|
| 200 |
+
#define RSA_PKCS1_PSS_PADDING 6
|
| 201 |
+
#define RSA_PKCS1_WITH_TLS_PADDING 7
|
| 202 |
+
|
| 203 |
+
/* internal RSA_ only */
|
| 204 |
+
#define RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING 8
|
| 205 |
+
|
| 206 |
+
#define RSA_PKCS1_PADDING_SIZE 11
|
| 207 |
+
|
| 208 |
+
#define RSA_set_app_data(s, arg) RSA_set_ex_data(s, 0, arg)
|
| 209 |
+
#define RSA_get_app_data(s) RSA_get_ex_data(s, 0)
|
| 210 |
+
|
| 211 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 212 |
+
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
|
| 213 |
+
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
|
| 214 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
|
| 215 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
|
| 216 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
|
| 217 |
+
|
| 218 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
|
| 219 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
|
| 220 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r,
|
| 221 |
+
BIGNUM *dmp1, BIGNUM *dmq1,
|
| 222 |
+
BIGNUM *iqmp);
|
| 223 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_multi_prime_params(RSA *r,
|
| 224 |
+
BIGNUM *primes[],
|
| 225 |
+
BIGNUM *exps[],
|
| 226 |
+
BIGNUM *coeffs[],
|
| 227 |
+
int pnum);
|
| 228 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
|
| 229 |
+
const BIGNUM **n, const BIGNUM **e,
|
| 230 |
+
const BIGNUM **d);
|
| 231 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_factors(const RSA *r,
|
| 232 |
+
const BIGNUM **p, const BIGNUM **q);
|
| 233 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get_multi_prime_extra_count(const RSA *r);
|
| 234 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get0_multi_prime_factors(const RSA *r,
|
| 235 |
+
const BIGNUM *primes[]);
|
| 236 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
|
| 237 |
+
const BIGNUM **dmp1,
|
| 238 |
+
const BIGNUM **dmq1,
|
| 239 |
+
const BIGNUM **iqmp);
|
| 240 |
+
OSSL_DEPRECATEDIN_3_0
|
| 241 |
+
int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[],
|
| 242 |
+
const BIGNUM *coeffs[]);
|
| 243 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_n(const RSA *d);
|
| 244 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_e(const RSA *d);
|
| 245 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_d(const RSA *d);
|
| 246 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_p(const RSA *d);
|
| 247 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_q(const RSA *d);
|
| 248 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmp1(const RSA *r);
|
| 249 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmq1(const RSA *r);
|
| 250 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_iqmp(const RSA *r);
|
| 251 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r);
|
| 252 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
|
| 253 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags);
|
| 254 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
|
| 255 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
|
| 256 |
+
OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r);
|
| 257 |
+
#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 258 |
+
|
| 259 |
+
#define EVP_RSA_gen(bits) \
|
| 260 |
+
EVP_PKEY_Q_keygen(NULL, NULL, "RSA", (size_t)(0 + (bits)))
|
| 261 |
+
|
| 262 |
+
/* Deprecated version */
|
| 263 |
+
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
| 264 |
+
OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void (*callback)(int, int, void *),
|
| 265 |
+
void *cb_arg);
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
/* New version */
|
| 269 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 270 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
|
| 271 |
+
BN_GENCB *cb);
|
| 272 |
+
/* Multi-prime version */
|
| 273 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits,
|
| 274 |
+
int primes, BIGNUM *e,
|
| 275 |
+
BN_GENCB *cb);
|
| 276 |
+
|
| 277 |
+
OSSL_DEPRECATEDIN_3_0
|
| 278 |
+
int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2,
|
| 279 |
+
BIGNUM *q1, BIGNUM *q2,
|
| 280 |
+
const BIGNUM *Xp1, const BIGNUM *Xp2,
|
| 281 |
+
const BIGNUM *Xp, const BIGNUM *Xq1,
|
| 282 |
+
const BIGNUM *Xq2, const BIGNUM *Xq,
|
| 283 |
+
const BIGNUM *e, BN_GENCB *cb);
|
| 284 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_X931_generate_key_ex(RSA *rsa, int bits,
|
| 285 |
+
const BIGNUM *e,
|
| 286 |
+
BN_GENCB *cb);
|
| 287 |
+
|
| 288 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_check_key(const RSA *);
|
| 289 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_check_key_ex(const RSA *, BN_GENCB *cb);
|
| 290 |
+
/* next 4 return -1 on error */
|
| 291 |
+
OSSL_DEPRECATEDIN_3_0
|
| 292 |
+
int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 293 |
+
RSA *rsa, int padding);
|
| 294 |
+
OSSL_DEPRECATEDIN_3_0
|
| 295 |
+
int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 296 |
+
RSA *rsa, int padding);
|
| 297 |
+
OSSL_DEPRECATEDIN_3_0
|
| 298 |
+
int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 299 |
+
RSA *rsa, int padding);
|
| 300 |
+
OSSL_DEPRECATEDIN_3_0
|
| 301 |
+
int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 302 |
+
RSA *rsa, int padding);
|
| 303 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
|
| 304 |
+
/* "up" the RSA object's reference count */
|
| 305 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_up_ref(RSA *r);
|
| 306 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
|
| 307 |
+
|
| 308 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_set_default_method(const RSA_METHOD *meth);
|
| 309 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_default_method(void);
|
| 310 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_null_method(void);
|
| 311 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_method(const RSA *rsa);
|
| 312 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
|
| 313 |
+
|
| 314 |
+
/* these are the actual RSA functions */
|
| 315 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
|
| 316 |
+
|
| 317 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
| 318 |
+
RSA, RSAPublicKey)
|
| 319 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
| 320 |
+
RSA, RSAPrivateKey)
|
| 321 |
+
#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 322 |
+
|
| 323 |
+
int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
|
| 324 |
+
|
| 325 |
+
struct rsa_pss_params_st {
|
| 326 |
+
X509_ALGOR *hashAlgorithm;
|
| 327 |
+
X509_ALGOR *maskGenAlgorithm;
|
| 328 |
+
ASN1_INTEGER *saltLength;
|
| 329 |
+
ASN1_INTEGER *trailerField;
|
| 330 |
+
/* Decoded hash algorithm from maskGenAlgorithm */
|
| 331 |
+
X509_ALGOR *maskHash;
|
| 332 |
+
};
|
| 333 |
+
|
| 334 |
+
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
|
| 335 |
+
DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS)
|
| 336 |
+
|
| 337 |
+
struct rsa_oaep_params_st {
|
| 338 |
+
X509_ALGOR *hashFunc;
|
| 339 |
+
X509_ALGOR *maskGenFunc;
|
| 340 |
+
X509_ALGOR *pSourceFunc;
|
| 341 |
+
/* Decoded hash algorithm from maskGenFunc */
|
| 342 |
+
X509_ALGOR *maskHash;
|
| 343 |
+
};
|
| 344 |
+
|
| 345 |
+
DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
|
| 346 |
+
|
| 347 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 348 |
+
#ifndef OPENSSL_NO_STDIO
|
| 349 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_print_fp(FILE *fp, const RSA *r, int offset);
|
| 350 |
+
#endif
|
| 351 |
+
|
| 352 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_print(BIO *bp, const RSA *r, int offset);
|
| 353 |
+
|
| 354 |
+
/*
|
| 355 |
+
* The following 2 functions sign and verify a X509_SIG ASN1 object inside
|
| 356 |
+
* PKCS#1 padded RSA encryption
|
| 357 |
+
*/
|
| 358 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_sign(int type, const unsigned char *m,
|
| 359 |
+
unsigned int m_length, unsigned char *sigret,
|
| 360 |
+
unsigned int *siglen, RSA *rsa);
|
| 361 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_verify(int type, const unsigned char *m,
|
| 362 |
+
unsigned int m_length,
|
| 363 |
+
const unsigned char *sigbuf,
|
| 364 |
+
unsigned int siglen, RSA *rsa);
|
| 365 |
+
|
| 366 |
+
/*
|
| 367 |
+
* The following 2 function sign and verify a ASN1_OCTET_STRING object inside
|
| 368 |
+
* PKCS#1 padded RSA encryption
|
| 369 |
+
*/
|
| 370 |
+
OSSL_DEPRECATEDIN_3_0
|
| 371 |
+
int RSA_sign_ASN1_OCTET_STRING(int type,
|
| 372 |
+
const unsigned char *m, unsigned int m_length,
|
| 373 |
+
unsigned char *sigret, unsigned int *siglen,
|
| 374 |
+
RSA *rsa);
|
| 375 |
+
OSSL_DEPRECATEDIN_3_0
|
| 376 |
+
int RSA_verify_ASN1_OCTET_STRING(int type,
|
| 377 |
+
const unsigned char *m, unsigned int m_length,
|
| 378 |
+
unsigned char *sigbuf, unsigned int siglen,
|
| 379 |
+
RSA *rsa);
|
| 380 |
+
|
| 381 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
| 382 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_blinding_off(RSA *rsa);
|
| 383 |
+
OSSL_DEPRECATEDIN_3_0 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
|
| 384 |
+
|
| 385 |
+
OSSL_DEPRECATEDIN_3_0
|
| 386 |
+
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
| 387 |
+
const unsigned char *f, int fl);
|
| 388 |
+
OSSL_DEPRECATEDIN_3_0
|
| 389 |
+
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
|
| 390 |
+
const unsigned char *f, int fl,
|
| 391 |
+
int rsa_len);
|
| 392 |
+
OSSL_DEPRECATEDIN_3_0
|
| 393 |
+
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
|
| 394 |
+
const unsigned char *f, int fl);
|
| 395 |
+
OSSL_DEPRECATEDIN_3_0
|
| 396 |
+
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
| 397 |
+
const unsigned char *f, int fl,
|
| 398 |
+
int rsa_len);
|
| 399 |
+
OSSL_DEPRECATEDIN_3_0 int PKCS1_MGF1(unsigned char *mask, long len,
|
| 400 |
+
const unsigned char *seed, long seedlen,
|
| 401 |
+
const EVP_MD *dgst);
|
| 402 |
+
OSSL_DEPRECATEDIN_3_0
|
| 403 |
+
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
|
| 404 |
+
const unsigned char *f, int fl,
|
| 405 |
+
const unsigned char *p, int pl);
|
| 406 |
+
OSSL_DEPRECATEDIN_3_0
|
| 407 |
+
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
|
| 408 |
+
const unsigned char *f, int fl, int rsa_len,
|
| 409 |
+
const unsigned char *p, int pl);
|
| 410 |
+
OSSL_DEPRECATEDIN_3_0
|
| 411 |
+
int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
| 412 |
+
const unsigned char *from, int flen,
|
| 413 |
+
const unsigned char *param, int plen,
|
| 414 |
+
const EVP_MD *md, const EVP_MD *mgf1md);
|
| 415 |
+
OSSL_DEPRECATEDIN_3_0
|
| 416 |
+
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
| 417 |
+
const unsigned char *from, int flen,
|
| 418 |
+
int num,
|
| 419 |
+
const unsigned char *param, int plen,
|
| 420 |
+
const EVP_MD *md, const EVP_MD *mgf1md);
|
| 421 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_none(unsigned char *to, int tlen,
|
| 422 |
+
const unsigned char *f, int fl);
|
| 423 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_none(unsigned char *to, int tlen,
|
| 424 |
+
const unsigned char *f, int fl,
|
| 425 |
+
int rsa_len);
|
| 426 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_X931(unsigned char *to, int tlen,
|
| 427 |
+
const unsigned char *f, int fl);
|
| 428 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_X931(unsigned char *to, int tlen,
|
| 429 |
+
const unsigned char *f, int fl,
|
| 430 |
+
int rsa_len);
|
| 431 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_X931_hash_id(int nid);
|
| 432 |
+
|
| 433 |
+
OSSL_DEPRECATEDIN_3_0
|
| 434 |
+
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
|
| 435 |
+
const EVP_MD *Hash, const unsigned char *EM,
|
| 436 |
+
int sLen);
|
| 437 |
+
OSSL_DEPRECATEDIN_3_0
|
| 438 |
+
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
|
| 439 |
+
const unsigned char *mHash, const EVP_MD *Hash,
|
| 440 |
+
int sLen);
|
| 441 |
+
|
| 442 |
+
OSSL_DEPRECATEDIN_3_0
|
| 443 |
+
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
|
| 444 |
+
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
| 445 |
+
const unsigned char *EM, int sLen);
|
| 446 |
+
|
| 447 |
+
OSSL_DEPRECATEDIN_3_0
|
| 448 |
+
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
|
| 449 |
+
const unsigned char *mHash,
|
| 450 |
+
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
| 451 |
+
int sLen);
|
| 452 |
+
|
| 453 |
+
#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 454 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef)
|
| 455 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg);
|
| 456 |
+
OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx);
|
| 457 |
+
|
| 458 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPublicKey)
|
| 459 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPrivateKey)
|
| 460 |
+
|
| 461 |
+
/*
|
| 462 |
+
* If this flag is set the RSA method is FIPS compliant and can be used in
|
| 463 |
+
* FIPS mode. This is set in the validated module method. If an application
|
| 464 |
+
* sets this flag in its own methods it is its responsibility to ensure the
|
| 465 |
+
* result is compliant.
|
| 466 |
+
*/
|
| 467 |
+
|
| 468 |
+
#define RSA_FLAG_FIPS_METHOD 0x0400
|
| 469 |
+
|
| 470 |
+
/*
|
| 471 |
+
* If this flag is set the operations normally disabled in FIPS mode are
|
| 472 |
+
* permitted it is then the applications responsibility to ensure that the
|
| 473 |
+
* usage is compliant.
|
| 474 |
+
*/
|
| 475 |
+
|
| 476 |
+
#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
|
| 477 |
+
/*
|
| 478 |
+
* Application has decided PRNG is good enough to generate a key: don't
|
| 479 |
+
* check.
|
| 480 |
+
*/
|
| 481 |
+
#define RSA_FLAG_CHECKED 0x0800
|
| 482 |
+
|
| 483 |
+
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags);
|
| 484 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth);
|
| 485 |
+
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
|
| 486 |
+
OSSL_DEPRECATEDIN_3_0 const char *RSA_meth_get0_name(const RSA_METHOD *meth);
|
| 487 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set1_name(RSA_METHOD *meth,
|
| 488 |
+
const char *name);
|
| 489 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_get_flags(const RSA_METHOD *meth);
|
| 490 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
|
| 491 |
+
OSSL_DEPRECATEDIN_3_0 void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
|
| 492 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set0_app_data(RSA_METHOD *meth,
|
| 493 |
+
void *app_data);
|
| 494 |
+
OSSL_DEPRECATEDIN_3_0
|
| 495 |
+
int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen,
|
| 496 |
+
const unsigned char *from,
|
| 497 |
+
unsigned char *to,
|
| 498 |
+
RSA *rsa, int padding);
|
| 499 |
+
OSSL_DEPRECATEDIN_3_0
|
| 500 |
+
int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
|
| 501 |
+
int (*pub_enc)(int flen, const unsigned char *from,
|
| 502 |
+
unsigned char *to, RSA *rsa,
|
| 503 |
+
int padding));
|
| 504 |
+
OSSL_DEPRECATEDIN_3_0
|
| 505 |
+
int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen,
|
| 506 |
+
const unsigned char *from,
|
| 507 |
+
unsigned char *to,
|
| 508 |
+
RSA *rsa, int padding);
|
| 509 |
+
OSSL_DEPRECATEDIN_3_0
|
| 510 |
+
int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
|
| 511 |
+
int (*pub_dec)(int flen, const unsigned char *from,
|
| 512 |
+
unsigned char *to, RSA *rsa,
|
| 513 |
+
int padding));
|
| 514 |
+
OSSL_DEPRECATEDIN_3_0
|
| 515 |
+
int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen,
|
| 516 |
+
const unsigned char *from,
|
| 517 |
+
unsigned char *to,
|
| 518 |
+
RSA *rsa, int padding);
|
| 519 |
+
OSSL_DEPRECATEDIN_3_0
|
| 520 |
+
int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
|
| 521 |
+
int (*priv_enc)(int flen, const unsigned char *from,
|
| 522 |
+
unsigned char *to, RSA *rsa,
|
| 523 |
+
int padding));
|
| 524 |
+
OSSL_DEPRECATEDIN_3_0
|
| 525 |
+
int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen,
|
| 526 |
+
const unsigned char *from,
|
| 527 |
+
unsigned char *to,
|
| 528 |
+
RSA *rsa, int padding);
|
| 529 |
+
OSSL_DEPRECATEDIN_3_0
|
| 530 |
+
int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
|
| 531 |
+
int (*priv_dec)(int flen, const unsigned char *from,
|
| 532 |
+
unsigned char *to, RSA *rsa,
|
| 533 |
+
int padding));
|
| 534 |
+
OSSL_DEPRECATEDIN_3_0
|
| 535 |
+
int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0,
|
| 536 |
+
const BIGNUM *i,
|
| 537 |
+
RSA *rsa, BN_CTX *ctx);
|
| 538 |
+
OSSL_DEPRECATEDIN_3_0
|
| 539 |
+
int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
|
| 540 |
+
int (*mod_exp)(BIGNUM *r0, const BIGNUM *i, RSA *rsa,
|
| 541 |
+
BN_CTX *ctx));
|
| 542 |
+
OSSL_DEPRECATEDIN_3_0
|
| 543 |
+
int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r,
|
| 544 |
+
const BIGNUM *a,
|
| 545 |
+
const BIGNUM *p,
|
| 546 |
+
const BIGNUM *m,
|
| 547 |
+
BN_CTX *ctx,
|
| 548 |
+
BN_MONT_CTX *m_ctx);
|
| 549 |
+
OSSL_DEPRECATEDIN_3_0
|
| 550 |
+
int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa,
|
| 551 |
+
int (*bn_mod_exp)(BIGNUM *r,
|
| 552 |
+
const BIGNUM *a,
|
| 553 |
+
const BIGNUM *p,
|
| 554 |
+
const BIGNUM *m,
|
| 555 |
+
BN_CTX *ctx,
|
| 556 |
+
BN_MONT_CTX *m_ctx));
|
| 557 |
+
OSSL_DEPRECATEDIN_3_0
|
| 558 |
+
int (*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa);
|
| 559 |
+
OSSL_DEPRECATEDIN_3_0
|
| 560 |
+
int RSA_meth_set_init(RSA_METHOD *rsa, int (*init)(RSA *rsa));
|
| 561 |
+
OSSL_DEPRECATEDIN_3_0
|
| 562 |
+
int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa);
|
| 563 |
+
OSSL_DEPRECATEDIN_3_0
|
| 564 |
+
int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish)(RSA *rsa));
|
| 565 |
+
OSSL_DEPRECATEDIN_3_0
|
| 566 |
+
int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type,
|
| 567 |
+
const unsigned char *m,
|
| 568 |
+
unsigned int m_length,
|
| 569 |
+
unsigned char *sigret,
|
| 570 |
+
unsigned int *siglen,
|
| 571 |
+
const RSA *rsa);
|
| 572 |
+
OSSL_DEPRECATEDIN_3_0
|
| 573 |
+
int RSA_meth_set_sign(RSA_METHOD *rsa,
|
| 574 |
+
int (*sign)(int type, const unsigned char *m,
|
| 575 |
+
unsigned int m_length,
|
| 576 |
+
unsigned char *sigret, unsigned int *siglen,
|
| 577 |
+
const RSA *rsa));
|
| 578 |
+
OSSL_DEPRECATEDIN_3_0
|
| 579 |
+
int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype,
|
| 580 |
+
const unsigned char *m,
|
| 581 |
+
unsigned int m_length,
|
| 582 |
+
const unsigned char *sigbuf,
|
| 583 |
+
unsigned int siglen,
|
| 584 |
+
const RSA *rsa);
|
| 585 |
+
OSSL_DEPRECATEDIN_3_0
|
| 586 |
+
int RSA_meth_set_verify(RSA_METHOD *rsa,
|
| 587 |
+
int (*verify)(int dtype, const unsigned char *m,
|
| 588 |
+
unsigned int m_length,
|
| 589 |
+
const unsigned char *sigbuf,
|
| 590 |
+
unsigned int siglen, const RSA *rsa));
|
| 591 |
+
OSSL_DEPRECATEDIN_3_0
|
| 592 |
+
int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits,
|
| 593 |
+
BIGNUM *e, BN_GENCB *cb);
|
| 594 |
+
OSSL_DEPRECATEDIN_3_0
|
| 595 |
+
int RSA_meth_set_keygen(RSA_METHOD *rsa,
|
| 596 |
+
int (*keygen)(RSA *rsa, int bits, BIGNUM *e,
|
| 597 |
+
BN_GENCB *cb));
|
| 598 |
+
OSSL_DEPRECATEDIN_3_0
|
| 599 |
+
int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth))(RSA *rsa,
|
| 600 |
+
int bits,
|
| 601 |
+
int primes,
|
| 602 |
+
BIGNUM *e,
|
| 603 |
+
BN_GENCB *cb);
|
| 604 |
+
OSSL_DEPRECATEDIN_3_0
|
| 605 |
+
int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth,
|
| 606 |
+
int (*keygen)(RSA *rsa, int bits,
|
| 607 |
+
int primes, BIGNUM *e,
|
| 608 |
+
BN_GENCB *cb));
|
| 609 |
+
#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 610 |
+
|
| 611 |
+
#ifdef __cplusplus
|
| 612 |
+
}
|
| 613 |
+
#endif
|
| 614 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/rsaerr.h
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_RSAERR_H
|
| 12 |
+
#define OPENSSL_RSAERR_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/opensslconf.h>
|
| 16 |
+
#include <openssl/symhacks.h>
|
| 17 |
+
#include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* RSA reason codes.
|
| 21 |
+
*/
|
| 22 |
+
#define RSA_R_ALGORITHM_MISMATCH 100
|
| 23 |
+
#define RSA_R_BAD_E_VALUE 101
|
| 24 |
+
#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
|
| 25 |
+
#define RSA_R_BAD_PAD_BYTE_COUNT 103
|
| 26 |
+
#define RSA_R_BAD_SIGNATURE 104
|
| 27 |
+
#define RSA_R_BLOCK_TYPE_IS_NOT_01 106
|
| 28 |
+
#define RSA_R_BLOCK_TYPE_IS_NOT_02 107
|
| 29 |
+
#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
|
| 30 |
+
#define RSA_R_DATA_TOO_LARGE 109
|
| 31 |
+
#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
|
| 32 |
+
#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
|
| 33 |
+
#define RSA_R_DATA_TOO_SMALL 111
|
| 34 |
+
#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
|
| 35 |
+
#define RSA_R_DIGEST_DOES_NOT_MATCH 158
|
| 36 |
+
#define RSA_R_DIGEST_NOT_ALLOWED 145
|
| 37 |
+
#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
|
| 38 |
+
#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
|
| 39 |
+
#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
|
| 40 |
+
#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
|
| 41 |
+
#define RSA_R_FIRST_OCTET_INVALID 133
|
| 42 |
+
#define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
|
| 43 |
+
#define RSA_R_INVALID_DIGEST 157
|
| 44 |
+
#define RSA_R_INVALID_DIGEST_LENGTH 143
|
| 45 |
+
#define RSA_R_INVALID_HEADER 137
|
| 46 |
+
#define RSA_R_INVALID_KEYPAIR 171
|
| 47 |
+
#define RSA_R_INVALID_KEY_LENGTH 173
|
| 48 |
+
#define RSA_R_INVALID_LABEL 160
|
| 49 |
+
#define RSA_R_INVALID_LENGTH 181
|
| 50 |
+
#define RSA_R_INVALID_MESSAGE_LENGTH 131
|
| 51 |
+
#define RSA_R_INVALID_MGF1_MD 156
|
| 52 |
+
#define RSA_R_INVALID_MODULUS 174
|
| 53 |
+
#define RSA_R_INVALID_MULTI_PRIME_KEY 167
|
| 54 |
+
#define RSA_R_INVALID_OAEP_PARAMETERS 161
|
| 55 |
+
#define RSA_R_INVALID_PADDING 138
|
| 56 |
+
#define RSA_R_INVALID_PADDING_MODE 141
|
| 57 |
+
#define RSA_R_INVALID_PSS_PARAMETERS 149
|
| 58 |
+
#define RSA_R_INVALID_PSS_SALTLEN 146
|
| 59 |
+
#define RSA_R_INVALID_REQUEST 175
|
| 60 |
+
#define RSA_R_INVALID_SALT_LENGTH 150
|
| 61 |
+
#define RSA_R_INVALID_STRENGTH 176
|
| 62 |
+
#define RSA_R_INVALID_TRAILER 139
|
| 63 |
+
#define RSA_R_INVALID_X931_DIGEST 142
|
| 64 |
+
#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
|
| 65 |
+
#define RSA_R_KEY_PRIME_NUM_INVALID 165
|
| 66 |
+
#define RSA_R_KEY_SIZE_TOO_SMALL 120
|
| 67 |
+
#define RSA_R_LAST_OCTET_INVALID 134
|
| 68 |
+
#define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
|
| 69 |
+
#define RSA_R_MISSING_PRIVATE_KEY 179
|
| 70 |
+
#define RSA_R_MODULUS_TOO_LARGE 105
|
| 71 |
+
#define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168
|
| 72 |
+
#define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169
|
| 73 |
+
#define RSA_R_MP_R_NOT_PRIME 170
|
| 74 |
+
#define RSA_R_NO_PUBLIC_EXPONENT 140
|
| 75 |
+
#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
|
| 76 |
+
#define RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES 172
|
| 77 |
+
#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
|
| 78 |
+
#define RSA_R_OAEP_DECODING_ERROR 121
|
| 79 |
+
#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
|
| 80 |
+
#define RSA_R_PADDING_CHECK_FAILED 114
|
| 81 |
+
#define RSA_R_PAIRWISE_TEST_FAILURE 177
|
| 82 |
+
#define RSA_R_PKCS_DECODING_ERROR 159
|
| 83 |
+
#define RSA_R_PSS_SALTLEN_TOO_SMALL 164
|
| 84 |
+
#define RSA_R_PUB_EXPONENT_OUT_OF_RANGE 178
|
| 85 |
+
#define RSA_R_P_NOT_PRIME 128
|
| 86 |
+
#define RSA_R_Q_NOT_PRIME 129
|
| 87 |
+
#define RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT 180
|
| 88 |
+
#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
|
| 89 |
+
#define RSA_R_SLEN_CHECK_FAILED 136
|
| 90 |
+
#define RSA_R_SLEN_RECOVERY_FAILED 135
|
| 91 |
+
#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
|
| 92 |
+
#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
|
| 93 |
+
#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
|
| 94 |
+
#define RSA_R_UNKNOWN_DIGEST 166
|
| 95 |
+
#define RSA_R_UNKNOWN_MASK_DIGEST 151
|
| 96 |
+
#define RSA_R_UNKNOWN_PADDING_TYPE 118
|
| 97 |
+
#define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162
|
| 98 |
+
#define RSA_R_UNSUPPORTED_LABEL_SOURCE 163
|
| 99 |
+
#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
|
| 100 |
+
#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
|
| 101 |
+
#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
|
| 102 |
+
#define RSA_R_VALUE_MISSING 147
|
| 103 |
+
#define RSA_R_WRONG_SIGNATURE_LENGTH 119
|
| 104 |
+
|
| 105 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/safestack.h
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/safestack.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/* clang-format off */
|
| 14 |
+
|
| 15 |
+
/* clang-format on */
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_SAFESTACK_H
|
| 18 |
+
#define OPENSSL_SAFESTACK_H
|
| 19 |
+
#pragma once
|
| 20 |
+
|
| 21 |
+
#include <openssl/macros.h>
|
| 22 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 23 |
+
#define HEADER_SAFESTACK_H
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#include <openssl/stack.h>
|
| 27 |
+
#include <openssl/e_os2.h>
|
| 28 |
+
|
| 29 |
+
#ifdef __cplusplus
|
| 30 |
+
extern "C" {
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#define STACK_OF(type) struct stack_st_##type
|
| 34 |
+
|
| 35 |
+
/* Helper macro for internal use */
|
| 36 |
+
#define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3) \
|
| 37 |
+
STACK_OF(t1); \
|
| 38 |
+
typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b); \
|
| 39 |
+
typedef void (*sk_##t1##_freefunc)(t3 * a); \
|
| 40 |
+
typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a); \
|
| 41 |
+
static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr) \
|
| 42 |
+
{ \
|
| 43 |
+
sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg; \
|
| 44 |
+
freefunc((t3 *)ptr); \
|
| 45 |
+
} \
|
| 46 |
+
static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr) \
|
| 47 |
+
{ \
|
| 48 |
+
return ptr; \
|
| 49 |
+
} \
|
| 50 |
+
static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \
|
| 51 |
+
{ \
|
| 52 |
+
return (const OPENSSL_STACK *)sk; \
|
| 53 |
+
} \
|
| 54 |
+
static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk) \
|
| 55 |
+
{ \
|
| 56 |
+
return (OPENSSL_STACK *)sk; \
|
| 57 |
+
} \
|
| 58 |
+
static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp) \
|
| 59 |
+
{ \
|
| 60 |
+
return (OPENSSL_sk_compfunc)cmp; \
|
| 61 |
+
} \
|
| 62 |
+
static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy) \
|
| 63 |
+
{ \
|
| 64 |
+
return (OPENSSL_sk_copyfunc)cpy; \
|
| 65 |
+
} \
|
| 66 |
+
static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr) \
|
| 67 |
+
{ \
|
| 68 |
+
return (OPENSSL_sk_freefunc)fr; \
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
#define SKM_DEFINE_STACK_OF(t1, t2, t3) \
|
| 72 |
+
STACK_OF(t1); \
|
| 73 |
+
typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b); \
|
| 74 |
+
typedef void (*sk_##t1##_freefunc)(t3 * a); \
|
| 75 |
+
typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a); \
|
| 76 |
+
static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr) \
|
| 77 |
+
{ \
|
| 78 |
+
sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg; \
|
| 79 |
+
freefunc((t3 *)ptr); \
|
| 80 |
+
} \
|
| 81 |
+
static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
| 82 |
+
{ \
|
| 83 |
+
return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
|
| 84 |
+
} \
|
| 85 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
| 86 |
+
{ \
|
| 87 |
+
return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
|
| 88 |
+
} \
|
| 89 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
| 90 |
+
{ \
|
| 91 |
+
OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
|
| 92 |
+
OPENSSL_sk_freefunc_thunk f_thunk; \
|
| 93 |
+
\
|
| 94 |
+
f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
|
| 95 |
+
return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
|
| 96 |
+
} \
|
| 97 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
| 98 |
+
{ \
|
| 99 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
|
| 100 |
+
} \
|
| 101 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
| 102 |
+
{ \
|
| 103 |
+
OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
|
| 104 |
+
OPENSSL_sk_freefunc_thunk f_thunk; \
|
| 105 |
+
\
|
| 106 |
+
f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
|
| 107 |
+
return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
|
| 108 |
+
} \
|
| 109 |
+
static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
| 110 |
+
{ \
|
| 111 |
+
return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
|
| 112 |
+
} \
|
| 113 |
+
static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
| 114 |
+
{ \
|
| 115 |
+
OPENSSL_sk_free((OPENSSL_STACK *)sk); \
|
| 116 |
+
} \
|
| 117 |
+
static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
| 118 |
+
{ \
|
| 119 |
+
OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
|
| 120 |
+
} \
|
| 121 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
| 122 |
+
{ \
|
| 123 |
+
return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
|
| 124 |
+
} \
|
| 125 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
| 126 |
+
{ \
|
| 127 |
+
return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
|
| 128 |
+
(const void *)ptr); \
|
| 129 |
+
} \
|
| 130 |
+
static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
| 131 |
+
{ \
|
| 132 |
+
return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 133 |
+
} \
|
| 134 |
+
static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
| 135 |
+
{ \
|
| 136 |
+
return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 137 |
+
} \
|
| 138 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
| 139 |
+
{ \
|
| 140 |
+
return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
|
| 141 |
+
} \
|
| 142 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
| 143 |
+
{ \
|
| 144 |
+
return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
|
| 145 |
+
} \
|
| 146 |
+
static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
| 147 |
+
{ \
|
| 148 |
+
OPENSSL_sk_freefunc_thunk f_thunk; \
|
| 149 |
+
\
|
| 150 |
+
f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
|
| 151 |
+
sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
|
| 152 |
+
\
|
| 153 |
+
OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
|
| 154 |
+
} \
|
| 155 |
+
static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
| 156 |
+
{ \
|
| 157 |
+
return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
|
| 158 |
+
} \
|
| 159 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
| 160 |
+
{ \
|
| 161 |
+
return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
|
| 162 |
+
} \
|
| 163 |
+
static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
| 164 |
+
{ \
|
| 165 |
+
return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 166 |
+
} \
|
| 167 |
+
static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
| 168 |
+
{ \
|
| 169 |
+
return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 170 |
+
} \
|
| 171 |
+
static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum) \
|
| 172 |
+
{ \
|
| 173 |
+
return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum); \
|
| 174 |
+
} \
|
| 175 |
+
static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
| 176 |
+
{ \
|
| 177 |
+
OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
|
| 178 |
+
} \
|
| 179 |
+
static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
| 180 |
+
{ \
|
| 181 |
+
return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
|
| 182 |
+
} \
|
| 183 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
| 184 |
+
{ \
|
| 185 |
+
return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
|
| 186 |
+
} \
|
| 187 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
| 188 |
+
sk_##t1##_copyfunc copyfunc, \
|
| 189 |
+
sk_##t1##_freefunc freefunc) \
|
| 190 |
+
{ \
|
| 191 |
+
return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
|
| 192 |
+
(OPENSSL_sk_copyfunc)copyfunc, \
|
| 193 |
+
(OPENSSL_sk_freefunc)freefunc); \
|
| 194 |
+
} \
|
| 195 |
+
static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
| 196 |
+
{ \
|
| 197 |
+
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
#define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
|
| 201 |
+
#define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
|
| 202 |
+
#define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
|
| 203 |
+
#define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
|
| 204 |
+
SKM_DEFINE_STACK_OF(t1, const t2, t2)
|
| 205 |
+
|
| 206 |
+
/*-
|
| 207 |
+
* Strings are special: normally an lhash entry will point to a single
|
| 208 |
+
* (somewhat) mutable object. In the case of strings:
|
| 209 |
+
*
|
| 210 |
+
* a) Instead of a single char, there is an array of chars, NUL-terminated.
|
| 211 |
+
* b) The string may have be immutable.
|
| 212 |
+
*
|
| 213 |
+
* So, they need their own declarations. Especially important for
|
| 214 |
+
* type-checking tools, such as Deputy.
|
| 215 |
+
*
|
| 216 |
+
* In practice, however, it appears to be hard to have a const
|
| 217 |
+
* string. For now, I'm settling for dealing with the fact it is a
|
| 218 |
+
* string at all.
|
| 219 |
+
*/
|
| 220 |
+
typedef char *OPENSSL_STRING;
|
| 221 |
+
typedef const char *OPENSSL_CSTRING;
|
| 222 |
+
|
| 223 |
+
/*-
|
| 224 |
+
* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
|
| 225 |
+
* STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
|
| 226 |
+
* above, instead of a single char each entry is a NUL-terminated array of
|
| 227 |
+
* chars. So, we have to implement STRING specially for STACK_OF. This is
|
| 228 |
+
* dealt with in the autogenerated macros below.
|
| 229 |
+
*/
|
| 230 |
+
/* clang-format off */
|
| 231 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)
|
| 232 |
+
#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 233 |
+
#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
|
| 234 |
+
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
| 235 |
+
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
|
| 236 |
+
#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n)))
|
| 237 |
+
#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n))
|
| 238 |
+
#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 239 |
+
#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 240 |
+
#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i)))
|
| 241 |
+
#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)))
|
| 242 |
+
#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 243 |
+
#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 244 |
+
#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 245 |
+
#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 246 |
+
#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))
|
| 247 |
+
#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))
|
| 248 |
+
#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)))
|
| 249 |
+
#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 250 |
+
#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))
|
| 251 |
+
#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)
|
| 252 |
+
#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 253 |
+
#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 254 |
+
#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
|
| 255 |
+
#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)))
|
| 256 |
+
#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)))
|
| 257 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char)
|
| 258 |
+
#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 259 |
+
#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
|
| 260 |
+
#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
| 261 |
+
#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
|
| 262 |
+
#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n)))
|
| 263 |
+
#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n))
|
| 264 |
+
#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 265 |
+
#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 266 |
+
#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i)))
|
| 267 |
+
#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)))
|
| 268 |
+
#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 269 |
+
#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 270 |
+
#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 271 |
+
#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 272 |
+
#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))
|
| 273 |
+
#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))
|
| 274 |
+
#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)))
|
| 275 |
+
#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 276 |
+
#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))
|
| 277 |
+
#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)
|
| 278 |
+
#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 279 |
+
#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 280 |
+
#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)))
|
| 281 |
+
#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)))
|
| 282 |
+
#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)))
|
| 283 |
+
|
| 284 |
+
/* clang-format on */
|
| 285 |
+
|
| 286 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 287 |
+
/*
|
| 288 |
+
* This is not used by OpenSSL. A block of bytes, NOT nul-terminated.
|
| 289 |
+
* These should also be distinguished from "normal" stacks.
|
| 290 |
+
*/
|
| 291 |
+
typedef void *OPENSSL_BLOCK;
|
| 292 |
+
/* clang-format off */
|
| 293 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void)
|
| 294 |
+
#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 295 |
+
#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx)))
|
| 296 |
+
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
| 297 |
+
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null())
|
| 298 |
+
#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n)))
|
| 299 |
+
#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n))
|
| 300 |
+
#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 301 |
+
#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 302 |
+
#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i)))
|
| 303 |
+
#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)))
|
| 304 |
+
#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 305 |
+
#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 306 |
+
#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 307 |
+
#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 308 |
+
#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))
|
| 309 |
+
#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))
|
| 310 |
+
#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)))
|
| 311 |
+
#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 312 |
+
#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))
|
| 313 |
+
#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)
|
| 314 |
+
#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 315 |
+
#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 316 |
+
#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)))
|
| 317 |
+
#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)))
|
| 318 |
+
#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)))
|
| 319 |
+
|
| 320 |
+
/* clang-format on */
|
| 321 |
+
#endif
|
| 322 |
+
|
| 323 |
+
#ifdef __cplusplus
|
| 324 |
+
}
|
| 325 |
+
#endif
|
| 326 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/seed.h
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
|
| 12 |
+
*
|
| 13 |
+
* Redistribution and use in source and binary forms, with or without
|
| 14 |
+
* modification, are permitted provided that the following conditions
|
| 15 |
+
* are met:
|
| 16 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 17 |
+
* notice, this list of conditions and the following disclaimer.
|
| 18 |
+
* 2. Neither the name of author nor the names of its contributors may
|
| 19 |
+
* be used to endorse or promote products derived from this software
|
| 20 |
+
* without specific prior written permission.
|
| 21 |
+
*
|
| 22 |
+
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 23 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 24 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 25 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 26 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 27 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 28 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 29 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 30 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 31 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 32 |
+
* SUCH DAMAGE.
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
#ifndef OPENSSL_SEED_H
|
| 36 |
+
#define OPENSSL_SEED_H
|
| 37 |
+
#pragma once
|
| 38 |
+
|
| 39 |
+
#include <openssl/macros.h>
|
| 40 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 41 |
+
#define HEADER_SEED_H
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#include <openssl/opensslconf.h>
|
| 45 |
+
|
| 46 |
+
#ifndef OPENSSL_NO_SEED
|
| 47 |
+
#include <openssl/e_os2.h>
|
| 48 |
+
#include <openssl/crypto.h>
|
| 49 |
+
#include <sys/types.h>
|
| 50 |
+
|
| 51 |
+
#ifdef __cplusplus
|
| 52 |
+
extern "C" {
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#define SEED_BLOCK_SIZE 16
|
| 56 |
+
#define SEED_KEY_LENGTH 16
|
| 57 |
+
|
| 58 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 59 |
+
/* look whether we need 'long' to get 32 bits */
|
| 60 |
+
#ifdef AES_LONG
|
| 61 |
+
#ifndef SEED_LONG
|
| 62 |
+
#define SEED_LONG 1
|
| 63 |
+
#endif
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
typedef struct seed_key_st {
|
| 67 |
+
#ifdef SEED_LONG
|
| 68 |
+
unsigned long data[32];
|
| 69 |
+
#else
|
| 70 |
+
unsigned int data[32];
|
| 71 |
+
#endif
|
| 72 |
+
} SEED_KEY_SCHEDULE;
|
| 73 |
+
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 74 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 75 |
+
OSSL_DEPRECATEDIN_3_0
|
| 76 |
+
void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
|
| 77 |
+
SEED_KEY_SCHEDULE *ks);
|
| 78 |
+
OSSL_DEPRECATEDIN_3_0
|
| 79 |
+
void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
|
| 80 |
+
unsigned char d[SEED_BLOCK_SIZE],
|
| 81 |
+
const SEED_KEY_SCHEDULE *ks);
|
| 82 |
+
OSSL_DEPRECATEDIN_3_0
|
| 83 |
+
void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
|
| 84 |
+
unsigned char d[SEED_BLOCK_SIZE],
|
| 85 |
+
const SEED_KEY_SCHEDULE *ks);
|
| 86 |
+
OSSL_DEPRECATEDIN_3_0
|
| 87 |
+
void SEED_ecb_encrypt(const unsigned char *in,
|
| 88 |
+
unsigned char *out,
|
| 89 |
+
const SEED_KEY_SCHEDULE *ks, int enc);
|
| 90 |
+
OSSL_DEPRECATEDIN_3_0
|
| 91 |
+
void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
|
| 92 |
+
const SEED_KEY_SCHEDULE *ks,
|
| 93 |
+
unsigned char ivec[SEED_BLOCK_SIZE],
|
| 94 |
+
int enc);
|
| 95 |
+
OSSL_DEPRECATEDIN_3_0
|
| 96 |
+
void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 97 |
+
size_t len, const SEED_KEY_SCHEDULE *ks,
|
| 98 |
+
unsigned char ivec[SEED_BLOCK_SIZE],
|
| 99 |
+
int *num, int enc);
|
| 100 |
+
OSSL_DEPRECATEDIN_3_0
|
| 101 |
+
void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 102 |
+
size_t len, const SEED_KEY_SCHEDULE *ks,
|
| 103 |
+
unsigned char ivec[SEED_BLOCK_SIZE],
|
| 104 |
+
int *num);
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
#ifdef __cplusplus
|
| 108 |
+
}
|
| 109 |
+
#endif
|
| 110 |
+
#endif
|
| 111 |
+
|
| 112 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/self_test.h
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_SELF_TEST_H
|
| 11 |
+
#define OPENSSL_SELF_TEST_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/core.h> /* OSSL_CALLBACK */
|
| 15 |
+
|
| 16 |
+
#ifdef __cplusplus
|
| 17 |
+
extern "C" {
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/* The test event phases */
|
| 21 |
+
#define OSSL_SELF_TEST_PHASE_NONE "None"
|
| 22 |
+
#define OSSL_SELF_TEST_PHASE_START "Start"
|
| 23 |
+
#define OSSL_SELF_TEST_PHASE_CORRUPT "Corrupt"
|
| 24 |
+
#define OSSL_SELF_TEST_PHASE_PASS "Pass"
|
| 25 |
+
#define OSSL_SELF_TEST_PHASE_FAIL "Fail"
|
| 26 |
+
|
| 27 |
+
/* Test event categories */
|
| 28 |
+
#define OSSL_SELF_TEST_TYPE_NONE "None"
|
| 29 |
+
#define OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY "Module_Integrity"
|
| 30 |
+
#define OSSL_SELF_TEST_TYPE_INSTALL_INTEGRITY "Install_Integrity"
|
| 31 |
+
#define OSSL_SELF_TEST_TYPE_CRNG "Continuous_RNG_Test"
|
| 32 |
+
#define OSSL_SELF_TEST_TYPE_PCT "Conditional_PCT"
|
| 33 |
+
#define OSSL_SELF_TEST_TYPE_PCT_KAT "Conditional_KAT"
|
| 34 |
+
#define OSSL_SELF_TEST_TYPE_PCT_IMPORT "Import_PCT"
|
| 35 |
+
#define OSSL_SELF_TEST_TYPE_KAT_INTEGRITY "KAT_Integrity"
|
| 36 |
+
#define OSSL_SELF_TEST_TYPE_KAT_CIPHER "KAT_Cipher"
|
| 37 |
+
#define OSSL_SELF_TEST_TYPE_KAT_ASYM_CIPHER "KAT_AsymmetricCipher"
|
| 38 |
+
#define OSSL_SELF_TEST_TYPE_KAT_ASYM_KEYGEN "KAT_AsymmetricKeyGeneration"
|
| 39 |
+
#define OSSL_SELF_TEST_TYPE_KAT_KEM "KAT_KEM"
|
| 40 |
+
#define OSSL_SELF_TEST_TYPE_KAT_DIGEST "KAT_Digest"
|
| 41 |
+
#define OSSL_SELF_TEST_TYPE_KAT_SIGNATURE "KAT_Signature"
|
| 42 |
+
#define OSSL_SELF_TEST_TYPE_PCT_SIGNATURE "PCT_Signature"
|
| 43 |
+
#define OSSL_SELF_TEST_TYPE_KAT_KDF "KAT_KDF"
|
| 44 |
+
#define OSSL_SELF_TEST_TYPE_KAT_KA "KAT_KA"
|
| 45 |
+
#define OSSL_SELF_TEST_TYPE_DRBG "DRBG"
|
| 46 |
+
|
| 47 |
+
/* Test event sub categories */
|
| 48 |
+
#define OSSL_SELF_TEST_DESC_NONE "None"
|
| 49 |
+
#define OSSL_SELF_TEST_DESC_INTEGRITY_HMAC "HMAC"
|
| 50 |
+
#define OSSL_SELF_TEST_DESC_PCT_RSA "RSA"
|
| 51 |
+
#define OSSL_SELF_TEST_DESC_PCT_RSA_PKCS1 "RSA"
|
| 52 |
+
#define OSSL_SELF_TEST_DESC_PCT_ECDSA "ECDSA"
|
| 53 |
+
#define OSSL_SELF_TEST_DESC_PCT_EDDSA "EDDSA"
|
| 54 |
+
#define OSSL_SELF_TEST_DESC_PCT_DH "DH"
|
| 55 |
+
#define OSSL_SELF_TEST_DESC_PCT_DSA "DSA"
|
| 56 |
+
#define OSSL_SELF_TEST_DESC_PCT_ML_DSA "ML-DSA"
|
| 57 |
+
#define OSSL_SELF_TEST_DESC_PCT_ML_KEM "ML-KEM"
|
| 58 |
+
#define OSSL_SELF_TEST_DESC_PCT_SLH_DSA "SLH-DSA"
|
| 59 |
+
#define OSSL_SELF_TEST_DESC_CIPHER_AES_GCM "AES_GCM"
|
| 60 |
+
#define OSSL_SELF_TEST_DESC_CIPHER_AES_ECB "AES_ECB_Decrypt"
|
| 61 |
+
#define OSSL_SELF_TEST_DESC_CIPHER_TDES "TDES"
|
| 62 |
+
#define OSSL_SELF_TEST_DESC_ASYM_RSA_ENC "RSA_Encrypt"
|
| 63 |
+
#define OSSL_SELF_TEST_DESC_ASYM_RSA_DEC "RSA_Decrypt"
|
| 64 |
+
#define OSSL_SELF_TEST_DESC_MD_SHA1 "SHA1"
|
| 65 |
+
#define OSSL_SELF_TEST_DESC_MD_SHA2 "SHA2"
|
| 66 |
+
#define OSSL_SELF_TEST_DESC_MD_SHA3 "SHA3"
|
| 67 |
+
#define OSSL_SELF_TEST_DESC_SIGN_DSA "DSA"
|
| 68 |
+
#define OSSL_SELF_TEST_DESC_SIGN_RSA "RSA"
|
| 69 |
+
#define OSSL_SELF_TEST_DESC_SIGN_ECDSA "ECDSA"
|
| 70 |
+
#define OSSL_SELF_TEST_DESC_SIGN_DetECDSA "DetECDSA"
|
| 71 |
+
#define OSSL_SELF_TEST_DESC_SIGN_EDDSA "EDDSA"
|
| 72 |
+
#define OSSL_SELF_TEST_DESC_SIGN_LMS "LMS"
|
| 73 |
+
#define OSSL_SELF_TEST_DESC_SIGN_ML_DSA "ML-DSA"
|
| 74 |
+
#define OSSL_SELF_TEST_DESC_SIGN_SLH_DSA "SLH-DSA"
|
| 75 |
+
#define OSSL_SELF_TEST_DESC_KEM "KEM"
|
| 76 |
+
#define OSSL_SELF_TEST_DESC_DRBG_CTR "CTR"
|
| 77 |
+
#define OSSL_SELF_TEST_DESC_DRBG_HASH "HASH"
|
| 78 |
+
#define OSSL_SELF_TEST_DESC_DRBG_HMAC "HMAC"
|
| 79 |
+
#define OSSL_SELF_TEST_DESC_KA_DH "DH"
|
| 80 |
+
#define OSSL_SELF_TEST_DESC_KA_ECDH "ECDH"
|
| 81 |
+
#define OSSL_SELF_TEST_DESC_KDF_HKDF "HKDF"
|
| 82 |
+
#define OSSL_SELF_TEST_DESC_KDF_SSKDF "SSKDF"
|
| 83 |
+
#define OSSL_SELF_TEST_DESC_KDF_X963KDF "X963KDF"
|
| 84 |
+
#define OSSL_SELF_TEST_DESC_KDF_X942KDF "X942KDF"
|
| 85 |
+
#define OSSL_SELF_TEST_DESC_KDF_PBKDF2 "PBKDF2"
|
| 86 |
+
#define OSSL_SELF_TEST_DESC_KDF_SSHKDF "SSHKDF"
|
| 87 |
+
#define OSSL_SELF_TEST_DESC_KDF_TLS12_PRF "TLS12_PRF"
|
| 88 |
+
#define OSSL_SELF_TEST_DESC_KDF_KBKDF "KBKDF"
|
| 89 |
+
#define OSSL_SELF_TEST_DESC_KDF_KBKDF_KMAC "KBKDF_KMAC"
|
| 90 |
+
#define OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT "TLS13_KDF_EXTRACT"
|
| 91 |
+
#define OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND "TLS13_KDF_EXPAND"
|
| 92 |
+
#define OSSL_SELF_TEST_DESC_RNG "RNG"
|
| 93 |
+
#define OSSL_SELF_TEST_DESC_KEYGEN_ML_DSA "ML-DSA"
|
| 94 |
+
#define OSSL_SELF_TEST_DESC_KEYGEN_ML_KEM "ML-KEM"
|
| 95 |
+
#define OSSL_SELF_TEST_DESC_KEYGEN_SLH_DSA "SLH-DSA"
|
| 96 |
+
#define OSSL_SELF_TEST_DESC_ENCAP_KEM "KEM_Encap"
|
| 97 |
+
#define OSSL_SELF_TEST_DESC_DECAP_KEM "KEM_Decap"
|
| 98 |
+
#define OSSL_SELF_TEST_DESC_DECAP_KEM_FAIL "KEM_Decap_Reject"
|
| 99 |
+
|
| 100 |
+
void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK *cb,
|
| 101 |
+
void *cbarg);
|
| 102 |
+
void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb,
|
| 103 |
+
void **cbarg);
|
| 104 |
+
|
| 105 |
+
OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg);
|
| 106 |
+
void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st);
|
| 107 |
+
|
| 108 |
+
void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type,
|
| 109 |
+
const char *desc);
|
| 110 |
+
int OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes);
|
| 111 |
+
void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret);
|
| 112 |
+
|
| 113 |
+
#ifdef __cplusplus
|
| 114 |
+
}
|
| 115 |
+
#endif
|
| 116 |
+
#endif /* OPENSSL_SELF_TEST_H */
|
physworld_p1_20261018/envs/p1/include/openssl/sha.h
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_SHA_H
|
| 11 |
+
#define OPENSSL_SHA_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_SHA_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#include <openssl/e_os2.h>
|
| 20 |
+
#include <stddef.h>
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#define SHA_DIGEST_LENGTH 20
|
| 27 |
+
|
| 28 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 29 |
+
/*-
|
| 30 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 31 |
+
* ! SHA_LONG has to be at least 32 bits wide. !
|
| 32 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 33 |
+
*/
|
| 34 |
+
#define SHA_LONG unsigned int
|
| 35 |
+
|
| 36 |
+
#define SHA_LBLOCK 16
|
| 37 |
+
#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a \
|
| 38 |
+
* contiguous array of 32 bit wide \
|
| 39 |
+
* big-endian values. */
|
| 40 |
+
#define SHA_LAST_BLOCK (SHA_CBLOCK - 8)
|
| 41 |
+
|
| 42 |
+
typedef struct SHAstate_st {
|
| 43 |
+
SHA_LONG h0, h1, h2, h3, h4;
|
| 44 |
+
SHA_LONG Nl, Nh;
|
| 45 |
+
SHA_LONG data[SHA_LBLOCK];
|
| 46 |
+
unsigned int num;
|
| 47 |
+
} SHA_CTX;
|
| 48 |
+
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
|
| 56 |
+
|
| 57 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 58 |
+
#define SHA256_CBLOCK (SHA_LBLOCK * 4) /* SHA-256 treats input data as a \
|
| 59 |
+
* contiguous array of 32 bit wide \
|
| 60 |
+
* big-endian values. */
|
| 61 |
+
|
| 62 |
+
typedef struct SHA256state_st {
|
| 63 |
+
SHA_LONG h[8];
|
| 64 |
+
SHA_LONG Nl, Nh;
|
| 65 |
+
SHA_LONG data[SHA_LBLOCK];
|
| 66 |
+
unsigned int num, md_len;
|
| 67 |
+
} SHA256_CTX;
|
| 68 |
+
|
| 69 |
+
OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c);
|
| 70 |
+
OSSL_DEPRECATEDIN_3_0 int SHA224_Update(SHA256_CTX *c,
|
| 71 |
+
const void *data, size_t len);
|
| 72 |
+
OSSL_DEPRECATEDIN_3_0 int SHA224_Final(unsigned char *md, SHA256_CTX *c);
|
| 73 |
+
OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
|
| 74 |
+
OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
|
| 75 |
+
const void *data, size_t len);
|
| 76 |
+
OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
|
| 77 |
+
OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c,
|
| 78 |
+
const unsigned char *data);
|
| 79 |
+
#endif
|
| 80 |
+
|
| 81 |
+
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
|
| 82 |
+
unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
|
| 83 |
+
|
| 84 |
+
#define SHA256_192_DIGEST_LENGTH 24
|
| 85 |
+
#define SHA224_DIGEST_LENGTH 28
|
| 86 |
+
#define SHA256_DIGEST_LENGTH 32
|
| 87 |
+
#define SHA384_DIGEST_LENGTH 48
|
| 88 |
+
#define SHA512_DIGEST_LENGTH 64
|
| 89 |
+
|
| 90 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 91 |
+
/*
|
| 92 |
+
* Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
|
| 93 |
+
* being exactly 64-bit wide. See Implementation Notes in sha512.c
|
| 94 |
+
* for further details.
|
| 95 |
+
*/
|
| 96 |
+
/*
|
| 97 |
+
* SHA-512 treats input data as a
|
| 98 |
+
* contiguous array of 64 bit
|
| 99 |
+
* wide big-endian values.
|
| 100 |
+
*/
|
| 101 |
+
#define SHA512_CBLOCK (SHA_LBLOCK * 8)
|
| 102 |
+
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
|
| 103 |
+
#define SHA_LONG64 unsigned __int64
|
| 104 |
+
#elif defined(__arch64__)
|
| 105 |
+
#define SHA_LONG64 unsigned long
|
| 106 |
+
#else
|
| 107 |
+
#define SHA_LONG64 unsigned long long
|
| 108 |
+
#endif
|
| 109 |
+
|
| 110 |
+
typedef struct SHA512state_st {
|
| 111 |
+
SHA_LONG64 h[8];
|
| 112 |
+
SHA_LONG64 Nl, Nh;
|
| 113 |
+
union {
|
| 114 |
+
SHA_LONG64 d[SHA_LBLOCK];
|
| 115 |
+
unsigned char p[SHA512_CBLOCK];
|
| 116 |
+
} u;
|
| 117 |
+
unsigned int num, md_len;
|
| 118 |
+
} SHA512_CTX;
|
| 119 |
+
|
| 120 |
+
OSSL_DEPRECATEDIN_3_0 int SHA384_Init(SHA512_CTX *c);
|
| 121 |
+
OSSL_DEPRECATEDIN_3_0 int SHA384_Update(SHA512_CTX *c,
|
| 122 |
+
const void *data, size_t len);
|
| 123 |
+
OSSL_DEPRECATEDIN_3_0 int SHA384_Final(unsigned char *md, SHA512_CTX *c);
|
| 124 |
+
OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c);
|
| 125 |
+
OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c,
|
| 126 |
+
const void *data, size_t len);
|
| 127 |
+
OSSL_DEPRECATEDIN_3_0 int SHA512_Final(unsigned char *md, SHA512_CTX *c);
|
| 128 |
+
OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c,
|
| 129 |
+
const unsigned char *data);
|
| 130 |
+
#endif
|
| 131 |
+
|
| 132 |
+
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
|
| 133 |
+
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
|
| 134 |
+
|
| 135 |
+
#ifdef __cplusplus
|
| 136 |
+
}
|
| 137 |
+
#endif
|
| 138 |
+
|
| 139 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/srp.h
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/srp.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
| 7 |
+
*
|
| 8 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 9 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 10 |
+
* in the file LICENSE in the source distribution or at
|
| 11 |
+
* https://www.openssl.org/source/license.html
|
| 12 |
+
*
|
| 13 |
+
* Originally written by Christophe Renou and Peter Sylvester,
|
| 14 |
+
* for the EdelKey project.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/* clang-format off */
|
| 18 |
+
|
| 19 |
+
/* clang-format on */
|
| 20 |
+
|
| 21 |
+
#ifndef OPENSSL_SRP_H
|
| 22 |
+
#define OPENSSL_SRP_H
|
| 23 |
+
#pragma once
|
| 24 |
+
|
| 25 |
+
#include <openssl/macros.h>
|
| 26 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 27 |
+
#define HEADER_SRP_H
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
#include <openssl/opensslconf.h>
|
| 31 |
+
|
| 32 |
+
#ifndef OPENSSL_NO_SRP
|
| 33 |
+
#include <stdio.h>
|
| 34 |
+
#include <string.h>
|
| 35 |
+
#include <openssl/safestack.h>
|
| 36 |
+
#include <openssl/bn.h>
|
| 37 |
+
#include <openssl/crypto.h>
|
| 38 |
+
|
| 39 |
+
#ifdef __cplusplus
|
| 40 |
+
extern "C" {
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 44 |
+
|
| 45 |
+
typedef struct SRP_gN_cache_st {
|
| 46 |
+
char *b64_bn;
|
| 47 |
+
BIGNUM *bn;
|
| 48 |
+
} SRP_gN_cache;
|
| 49 |
+
/* clang-format off */
|
| 50 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN_cache, SRP_gN_cache, SRP_gN_cache)
|
| 51 |
+
#define sk_SRP_gN_cache_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 52 |
+
#define sk_SRP_gN_cache_value(sk, idx) ((SRP_gN_cache *)OPENSSL_sk_value(ossl_check_const_SRP_gN_cache_sk_type(sk), (idx)))
|
| 53 |
+
#define sk_SRP_gN_cache_new(cmp) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new(ossl_check_SRP_gN_cache_compfunc_type(cmp)))
|
| 54 |
+
#define sk_SRP_gN_cache_new_null() ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_null())
|
| 55 |
+
#define sk_SRP_gN_cache_new_reserve(cmp, n) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_cache_compfunc_type(cmp), (n)))
|
| 56 |
+
#define sk_SRP_gN_cache_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_cache_sk_type(sk), (n))
|
| 57 |
+
#define sk_SRP_gN_cache_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 58 |
+
#define sk_SRP_gN_cache_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 59 |
+
#define sk_SRP_gN_cache_delete(sk, i) ((SRP_gN_cache *)OPENSSL_sk_delete(ossl_check_SRP_gN_cache_sk_type(sk), (i)))
|
| 60 |
+
#define sk_SRP_gN_cache_delete_ptr(sk, ptr) ((SRP_gN_cache *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)))
|
| 61 |
+
#define sk_SRP_gN_cache_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 62 |
+
#define sk_SRP_gN_cache_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 63 |
+
#define sk_SRP_gN_cache_pop(sk) ((SRP_gN_cache *)OPENSSL_sk_pop(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 64 |
+
#define sk_SRP_gN_cache_shift(sk) ((SRP_gN_cache *)OPENSSL_sk_shift(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 65 |
+
#define sk_SRP_gN_cache_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_freefunc_type(freefunc))
|
| 66 |
+
#define sk_SRP_gN_cache_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), (idx))
|
| 67 |
+
#define sk_SRP_gN_cache_set(sk, idx, ptr) ((SRP_gN_cache *)OPENSSL_sk_set(ossl_check_SRP_gN_cache_sk_type(sk), (idx), ossl_check_SRP_gN_cache_type(ptr)))
|
| 68 |
+
#define sk_SRP_gN_cache_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 69 |
+
#define sk_SRP_gN_cache_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 70 |
+
#define sk_SRP_gN_cache_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), pnum)
|
| 71 |
+
#define sk_SRP_gN_cache_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 72 |
+
#define sk_SRP_gN_cache_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 73 |
+
#define sk_SRP_gN_cache_dup(sk) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_cache_sk_type(sk)))
|
| 74 |
+
#define sk_SRP_gN_cache_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_copyfunc_type(copyfunc), ossl_check_SRP_gN_cache_freefunc_type(freefunc)))
|
| 75 |
+
#define sk_SRP_gN_cache_set_cmp_func(sk, cmp) ((sk_SRP_gN_cache_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_compfunc_type(cmp)))
|
| 76 |
+
|
| 77 |
+
/* clang-format on */
|
| 78 |
+
|
| 79 |
+
typedef struct SRP_user_pwd_st {
|
| 80 |
+
/* Owned by us. */
|
| 81 |
+
char *id;
|
| 82 |
+
BIGNUM *s;
|
| 83 |
+
BIGNUM *v;
|
| 84 |
+
/* Not owned by us. */
|
| 85 |
+
const BIGNUM *g;
|
| 86 |
+
const BIGNUM *N;
|
| 87 |
+
/* Owned by us. */
|
| 88 |
+
char *info;
|
| 89 |
+
} SRP_user_pwd;
|
| 90 |
+
/* clang-format off */
|
| 91 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_user_pwd, SRP_user_pwd, SRP_user_pwd)
|
| 92 |
+
#define sk_SRP_user_pwd_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 93 |
+
#define sk_SRP_user_pwd_value(sk, idx) ((SRP_user_pwd *)OPENSSL_sk_value(ossl_check_const_SRP_user_pwd_sk_type(sk), (idx)))
|
| 94 |
+
#define sk_SRP_user_pwd_new(cmp) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new(ossl_check_SRP_user_pwd_compfunc_type(cmp)))
|
| 95 |
+
#define sk_SRP_user_pwd_new_null() ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_null())
|
| 96 |
+
#define sk_SRP_user_pwd_new_reserve(cmp, n) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_reserve(ossl_check_SRP_user_pwd_compfunc_type(cmp), (n)))
|
| 97 |
+
#define sk_SRP_user_pwd_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_user_pwd_sk_type(sk), (n))
|
| 98 |
+
#define sk_SRP_user_pwd_free(sk) OPENSSL_sk_free(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 99 |
+
#define sk_SRP_user_pwd_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 100 |
+
#define sk_SRP_user_pwd_delete(sk, i) ((SRP_user_pwd *)OPENSSL_sk_delete(ossl_check_SRP_user_pwd_sk_type(sk), (i)))
|
| 101 |
+
#define sk_SRP_user_pwd_delete_ptr(sk, ptr) ((SRP_user_pwd *)OPENSSL_sk_delete_ptr(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)))
|
| 102 |
+
#define sk_SRP_user_pwd_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 103 |
+
#define sk_SRP_user_pwd_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 104 |
+
#define sk_SRP_user_pwd_pop(sk) ((SRP_user_pwd *)OPENSSL_sk_pop(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 105 |
+
#define sk_SRP_user_pwd_shift(sk) ((SRP_user_pwd *)OPENSSL_sk_shift(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 106 |
+
#define sk_SRP_user_pwd_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_freefunc_type(freefunc))
|
| 107 |
+
#define sk_SRP_user_pwd_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), (idx))
|
| 108 |
+
#define sk_SRP_user_pwd_set(sk, idx, ptr) ((SRP_user_pwd *)OPENSSL_sk_set(ossl_check_SRP_user_pwd_sk_type(sk), (idx), ossl_check_SRP_user_pwd_type(ptr)))
|
| 109 |
+
#define sk_SRP_user_pwd_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 110 |
+
#define sk_SRP_user_pwd_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 111 |
+
#define sk_SRP_user_pwd_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), pnum)
|
| 112 |
+
#define sk_SRP_user_pwd_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 113 |
+
#define sk_SRP_user_pwd_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 114 |
+
#define sk_SRP_user_pwd_dup(sk) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_dup(ossl_check_const_SRP_user_pwd_sk_type(sk)))
|
| 115 |
+
#define sk_SRP_user_pwd_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_copyfunc_type(copyfunc), ossl_check_SRP_user_pwd_freefunc_type(freefunc)))
|
| 116 |
+
#define sk_SRP_user_pwd_set_cmp_func(sk, cmp) ((sk_SRP_user_pwd_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_compfunc_type(cmp)))
|
| 117 |
+
|
| 118 |
+
/* clang-format on */
|
| 119 |
+
|
| 120 |
+
OSSL_DEPRECATEDIN_3_0
|
| 121 |
+
SRP_user_pwd *SRP_user_pwd_new(void);
|
| 122 |
+
OSSL_DEPRECATEDIN_3_0
|
| 123 |
+
void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
|
| 124 |
+
|
| 125 |
+
OSSL_DEPRECATEDIN_3_0
|
| 126 |
+
void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g,
|
| 127 |
+
const BIGNUM *N);
|
| 128 |
+
OSSL_DEPRECATEDIN_3_0
|
| 129 |
+
int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id,
|
| 130 |
+
const char *info);
|
| 131 |
+
OSSL_DEPRECATEDIN_3_0
|
| 132 |
+
int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
|
| 133 |
+
|
| 134 |
+
typedef struct SRP_VBASE_st {
|
| 135 |
+
STACK_OF(SRP_user_pwd) *users_pwd;
|
| 136 |
+
STACK_OF(SRP_gN_cache) *gN_cache;
|
| 137 |
+
/* to simulate a user */
|
| 138 |
+
char *seed_key;
|
| 139 |
+
const BIGNUM *default_g;
|
| 140 |
+
const BIGNUM *default_N;
|
| 141 |
+
} SRP_VBASE;
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* Internal structure storing N and g pair
|
| 145 |
+
*/
|
| 146 |
+
typedef struct SRP_gN_st {
|
| 147 |
+
char *id;
|
| 148 |
+
const BIGNUM *g;
|
| 149 |
+
const BIGNUM *N;
|
| 150 |
+
} SRP_gN;
|
| 151 |
+
/* clang-format off */
|
| 152 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN, SRP_gN, SRP_gN)
|
| 153 |
+
#define sk_SRP_gN_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_sk_type(sk))
|
| 154 |
+
#define sk_SRP_gN_value(sk, idx) ((SRP_gN *)OPENSSL_sk_value(ossl_check_const_SRP_gN_sk_type(sk), (idx)))
|
| 155 |
+
#define sk_SRP_gN_new(cmp) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new(ossl_check_SRP_gN_compfunc_type(cmp)))
|
| 156 |
+
#define sk_SRP_gN_new_null() ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_null())
|
| 157 |
+
#define sk_SRP_gN_new_reserve(cmp, n) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_compfunc_type(cmp), (n)))
|
| 158 |
+
#define sk_SRP_gN_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_sk_type(sk), (n))
|
| 159 |
+
#define sk_SRP_gN_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_sk_type(sk))
|
| 160 |
+
#define sk_SRP_gN_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_sk_type(sk))
|
| 161 |
+
#define sk_SRP_gN_delete(sk, i) ((SRP_gN *)OPENSSL_sk_delete(ossl_check_SRP_gN_sk_type(sk), (i)))
|
| 162 |
+
#define sk_SRP_gN_delete_ptr(sk, ptr) ((SRP_gN *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)))
|
| 163 |
+
#define sk_SRP_gN_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 164 |
+
#define sk_SRP_gN_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 165 |
+
#define sk_SRP_gN_pop(sk) ((SRP_gN *)OPENSSL_sk_pop(ossl_check_SRP_gN_sk_type(sk)))
|
| 166 |
+
#define sk_SRP_gN_shift(sk) ((SRP_gN *)OPENSSL_sk_shift(ossl_check_SRP_gN_sk_type(sk)))
|
| 167 |
+
#define sk_SRP_gN_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_freefunc_type(freefunc))
|
| 168 |
+
#define sk_SRP_gN_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), (idx))
|
| 169 |
+
#define sk_SRP_gN_set(sk, idx, ptr) ((SRP_gN *)OPENSSL_sk_set(ossl_check_SRP_gN_sk_type(sk), (idx), ossl_check_SRP_gN_type(ptr)))
|
| 170 |
+
#define sk_SRP_gN_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 171 |
+
#define sk_SRP_gN_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 172 |
+
#define sk_SRP_gN_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), pnum)
|
| 173 |
+
#define sk_SRP_gN_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_sk_type(sk))
|
| 174 |
+
#define sk_SRP_gN_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_sk_type(sk))
|
| 175 |
+
#define sk_SRP_gN_dup(sk) ((STACK_OF(SRP_gN) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_sk_type(sk)))
|
| 176 |
+
#define sk_SRP_gN_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_sk_type(sk), ossl_check_SRP_gN_copyfunc_type(copyfunc), ossl_check_SRP_gN_freefunc_type(freefunc)))
|
| 177 |
+
#define sk_SRP_gN_set_cmp_func(sk, cmp) ((sk_SRP_gN_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_compfunc_type(cmp)))
|
| 178 |
+
|
| 179 |
+
/* clang-format on */
|
| 180 |
+
|
| 181 |
+
OSSL_DEPRECATEDIN_3_0
|
| 182 |
+
SRP_VBASE *SRP_VBASE_new(char *seed_key);
|
| 183 |
+
OSSL_DEPRECATEDIN_3_0
|
| 184 |
+
void SRP_VBASE_free(SRP_VBASE *vb);
|
| 185 |
+
OSSL_DEPRECATEDIN_3_0
|
| 186 |
+
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
|
| 187 |
+
|
| 188 |
+
OSSL_DEPRECATEDIN_3_0
|
| 189 |
+
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
|
| 190 |
+
|
| 191 |
+
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
|
| 192 |
+
OSSL_DEPRECATEDIN_3_0
|
| 193 |
+
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
|
| 194 |
+
|
| 195 |
+
OSSL_DEPRECATEDIN_3_0
|
| 196 |
+
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
|
| 197 |
+
char **verifier, const char *N, const char *g,
|
| 198 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 199 |
+
OSSL_DEPRECATEDIN_3_0
|
| 200 |
+
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
|
| 201 |
+
char **verifier, const char *N, const char *g);
|
| 202 |
+
OSSL_DEPRECATEDIN_3_0
|
| 203 |
+
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
|
| 204 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 205 |
+
const BIGNUM *g, OSSL_LIB_CTX *libctx,
|
| 206 |
+
const char *propq);
|
| 207 |
+
OSSL_DEPRECATEDIN_3_0
|
| 208 |
+
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
|
| 209 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 210 |
+
const BIGNUM *g);
|
| 211 |
+
|
| 212 |
+
#define SRP_NO_ERROR 0
|
| 213 |
+
#define SRP_ERR_VBASE_INCOMPLETE_FILE 1
|
| 214 |
+
#define SRP_ERR_VBASE_BN_LIB 2
|
| 215 |
+
#define SRP_ERR_OPEN_FILE 3
|
| 216 |
+
#define SRP_ERR_MEMORY 4
|
| 217 |
+
|
| 218 |
+
#define DB_srptype 0
|
| 219 |
+
#define DB_srpverifier 1
|
| 220 |
+
#define DB_srpsalt 2
|
| 221 |
+
#define DB_srpid 3
|
| 222 |
+
#define DB_srpgN 4
|
| 223 |
+
#define DB_srpinfo 5
|
| 224 |
+
#undef DB_NUMBER
|
| 225 |
+
#define DB_NUMBER 6
|
| 226 |
+
|
| 227 |
+
#define DB_SRP_INDEX 'I'
|
| 228 |
+
#define DB_SRP_VALID 'V'
|
| 229 |
+
#define DB_SRP_REVOKED 'R'
|
| 230 |
+
#define DB_SRP_MODIF 'v'
|
| 231 |
+
|
| 232 |
+
/* see srp.c */
|
| 233 |
+
OSSL_DEPRECATEDIN_3_0
|
| 234 |
+
char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
|
| 235 |
+
OSSL_DEPRECATEDIN_3_0
|
| 236 |
+
SRP_gN *SRP_get_default_gN(const char *id);
|
| 237 |
+
|
| 238 |
+
/* server side .... */
|
| 239 |
+
OSSL_DEPRECATEDIN_3_0
|
| 240 |
+
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
|
| 241 |
+
const BIGNUM *b, const BIGNUM *N);
|
| 242 |
+
OSSL_DEPRECATEDIN_3_0
|
| 243 |
+
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 244 |
+
const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
|
| 245 |
+
OSSL_DEPRECATEDIN_3_0
|
| 246 |
+
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 247 |
+
const BIGNUM *v);
|
| 248 |
+
|
| 249 |
+
OSSL_DEPRECATEDIN_3_0
|
| 250 |
+
int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
|
| 251 |
+
OSSL_DEPRECATEDIN_3_0
|
| 252 |
+
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
|
| 253 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 254 |
+
OSSL_DEPRECATEDIN_3_0
|
| 255 |
+
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
|
| 256 |
+
|
| 257 |
+
/* client side .... */
|
| 258 |
+
|
| 259 |
+
OSSL_DEPRECATEDIN_3_0
|
| 260 |
+
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
|
| 261 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 262 |
+
OSSL_DEPRECATEDIN_3_0
|
| 263 |
+
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
|
| 264 |
+
OSSL_DEPRECATEDIN_3_0
|
| 265 |
+
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
|
| 266 |
+
OSSL_DEPRECATEDIN_3_0
|
| 267 |
+
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 268 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
|
| 269 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 270 |
+
OSSL_DEPRECATEDIN_3_0
|
| 271 |
+
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 272 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
|
| 273 |
+
OSSL_DEPRECATEDIN_3_0
|
| 274 |
+
int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
|
| 275 |
+
|
| 276 |
+
#define SRP_MINIMAL_N 1024
|
| 277 |
+
|
| 278 |
+
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 279 |
+
|
| 280 |
+
/* This method ignores the configured seed and fails for an unknown user. */
|
| 281 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 282 |
+
OSSL_DEPRECATEDIN_1_1_0
|
| 283 |
+
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
|
| 284 |
+
#endif
|
| 285 |
+
|
| 286 |
+
#ifdef __cplusplus
|
| 287 |
+
}
|
| 288 |
+
#endif
|
| 289 |
+
#endif
|
| 290 |
+
|
| 291 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/srtp.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* DTLS code by Eric Rescorla <ekr@rtfm.com>
|
| 12 |
+
*
|
| 13 |
+
* Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef OPENSSL_SRTP_H
|
| 17 |
+
#define OPENSSL_SRTP_H
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <openssl/macros.h>
|
| 21 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
#define HEADER_D1_SRTP_H
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#include <openssl/ssl.h>
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
#define SRTP_AES128_CM_SHA1_80 0x0001
|
| 32 |
+
#define SRTP_AES128_CM_SHA1_32 0x0002
|
| 33 |
+
#define SRTP_AES128_F8_SHA1_80 0x0003
|
| 34 |
+
#define SRTP_AES128_F8_SHA1_32 0x0004
|
| 35 |
+
#define SRTP_NULL_SHA1_80 0x0005
|
| 36 |
+
#define SRTP_NULL_SHA1_32 0x0006
|
| 37 |
+
|
| 38 |
+
/* AEAD SRTP protection profiles from RFC 7714 */
|
| 39 |
+
#define SRTP_AEAD_AES_128_GCM 0x0007
|
| 40 |
+
#define SRTP_AEAD_AES_256_GCM 0x0008
|
| 41 |
+
|
| 42 |
+
/* DOUBLE AEAD SRTP protection profiles from RFC 8723 */
|
| 43 |
+
#define SRTP_DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM 0x0009
|
| 44 |
+
#define SRTP_DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM 0x000A
|
| 45 |
+
|
| 46 |
+
/* ARIA SRTP protection profiles from RFC 8269 */
|
| 47 |
+
#define SRTP_ARIA_128_CTR_HMAC_SHA1_80 0x000B
|
| 48 |
+
#define SRTP_ARIA_128_CTR_HMAC_SHA1_32 0x000C
|
| 49 |
+
#define SRTP_ARIA_256_CTR_HMAC_SHA1_80 0x000D
|
| 50 |
+
#define SRTP_ARIA_256_CTR_HMAC_SHA1_32 0x000E
|
| 51 |
+
#define SRTP_AEAD_ARIA_128_GCM 0x000F
|
| 52 |
+
#define SRTP_AEAD_ARIA_256_GCM 0x0010
|
| 53 |
+
|
| 54 |
+
#ifndef OPENSSL_NO_SRTP
|
| 55 |
+
|
| 56 |
+
__owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
|
| 57 |
+
__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
|
| 58 |
+
|
| 59 |
+
__owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
|
| 60 |
+
__owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
|
| 61 |
+
|
| 62 |
+
#endif
|
| 63 |
+
|
| 64 |
+
#ifdef __cplusplus
|
| 65 |
+
}
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ssl.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
physworld_p1_20261018/envs/p1/include/openssl/ssl2.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_SSL2_H
|
| 11 |
+
#define OPENSSL_SSL2_H
|
| 12 |
+
#pragma once
|
| 13 |
+
|
| 14 |
+
#include <openssl/macros.h>
|
| 15 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
#define HEADER_SSL2_H
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
#define SSL2_VERSION 0x0002
|
| 24 |
+
|
| 25 |
+
#define SSL2_MT_CLIENT_HELLO 1
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
}
|
| 29 |
+
#endif
|
| 30 |
+
#endif
|
physworld_p1_20261018/envs/p1/include/openssl/ssl3.h
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_SSL3_H
|
| 12 |
+
#define OPENSSL_SSL3_H
|
| 13 |
+
#pragma once
|
| 14 |
+
|
| 15 |
+
#include <openssl/macros.h>
|
| 16 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 17 |
+
#define HEADER_SSL3_H
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
#include <openssl/comp.h>
|
| 21 |
+
#include <openssl/buffer.h>
|
| 22 |
+
#include <openssl/evp.h>
|
| 23 |
+
#include <openssl/ssl.h>
|
| 24 |
+
|
| 25 |
+
#ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Signalling cipher suite value from RFC 5746
|
| 31 |
+
* (TLS_EMPTY_RENEGOTIATION_INFO_SCSV)
|
| 32 |
+
*/
|
| 33 |
+
#define SSL3_CK_SCSV 0x030000FF
|
| 34 |
+
|
| 35 |
+
/*
|
| 36 |
+
* Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
|
| 37 |
+
* (TLS_FALLBACK_SCSV)
|
| 38 |
+
*/
|
| 39 |
+
#define SSL3_CK_FALLBACK_SCSV 0x03005600
|
| 40 |
+
|
| 41 |
+
#define SSL3_CK_RSA_NULL_MD5 0x03000001
|
| 42 |
+
#define SSL3_CK_RSA_NULL_SHA 0x03000002
|
| 43 |
+
#define SSL3_CK_RSA_RC4_40_MD5 0x03000003
|
| 44 |
+
#define SSL3_CK_RSA_RC4_128_MD5 0x03000004
|
| 45 |
+
#define SSL3_CK_RSA_RC4_128_SHA 0x03000005
|
| 46 |
+
#define SSL3_CK_RSA_RC2_40_MD5 0x03000006
|
| 47 |
+
#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
|
| 48 |
+
#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
|
| 49 |
+
#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
|
| 50 |
+
#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
|
| 51 |
+
|
| 52 |
+
#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
|
| 53 |
+
#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
|
| 54 |
+
#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
|
| 55 |
+
#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
|
| 56 |
+
#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
|
| 57 |
+
#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
|
| 58 |
+
|
| 59 |
+
#define SSL3_CK_DHE_DSS_DES_40_CBC_SHA 0x03000011
|
| 60 |
+
#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA SSL3_CK_DHE_DSS_DES_40_CBC_SHA
|
| 61 |
+
#define SSL3_CK_DHE_DSS_DES_64_CBC_SHA 0x03000012
|
| 62 |
+
#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA SSL3_CK_DHE_DSS_DES_64_CBC_SHA
|
| 63 |
+
#define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA 0x03000013
|
| 64 |
+
#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA SSL3_CK_DHE_DSS_DES_192_CBC3_SHA
|
| 65 |
+
#define SSL3_CK_DHE_RSA_DES_40_CBC_SHA 0x03000014
|
| 66 |
+
#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA SSL3_CK_DHE_RSA_DES_40_CBC_SHA
|
| 67 |
+
#define SSL3_CK_DHE_RSA_DES_64_CBC_SHA 0x03000015
|
| 68 |
+
#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA SSL3_CK_DHE_RSA_DES_64_CBC_SHA
|
| 69 |
+
#define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA 0x03000016
|
| 70 |
+
#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA SSL3_CK_DHE_RSA_DES_192_CBC3_SHA
|
| 71 |
+
|
| 72 |
+
#define SSL3_CK_ADH_RC4_40_MD5 0x03000017
|
| 73 |
+
#define SSL3_CK_ADH_RC4_128_MD5 0x03000018
|
| 74 |
+
#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
|
| 75 |
+
#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
|
| 76 |
+
#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
|
| 77 |
+
|
| 78 |
+
/* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] */
|
| 79 |
+
#define SSL3_RFC_RSA_NULL_MD5 "TLS_RSA_WITH_NULL_MD5"
|
| 80 |
+
#define SSL3_RFC_RSA_NULL_SHA "TLS_RSA_WITH_NULL_SHA"
|
| 81 |
+
#define SSL3_RFC_RSA_DES_192_CBC3_SHA "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
|
| 82 |
+
#define SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
|
| 83 |
+
#define SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"
|
| 84 |
+
#define SSL3_RFC_ADH_DES_192_CBC_SHA "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"
|
| 85 |
+
#define SSL3_RFC_RSA_IDEA_128_SHA "TLS_RSA_WITH_IDEA_CBC_SHA"
|
| 86 |
+
#define SSL3_RFC_RSA_RC4_128_MD5 "TLS_RSA_WITH_RC4_128_MD5"
|
| 87 |
+
#define SSL3_RFC_RSA_RC4_128_SHA "TLS_RSA_WITH_RC4_128_SHA"
|
| 88 |
+
#define SSL3_RFC_ADH_RC4_128_MD5 "TLS_DH_anon_WITH_RC4_128_MD5"
|
| 89 |
+
|
| 90 |
+
#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
|
| 91 |
+
#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
|
| 92 |
+
#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
|
| 93 |
+
#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
|
| 94 |
+
#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
|
| 95 |
+
#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
|
| 96 |
+
#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
|
| 97 |
+
#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
|
| 98 |
+
#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
|
| 99 |
+
#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
|
| 100 |
+
|
| 101 |
+
#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
|
| 102 |
+
#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
|
| 103 |
+
#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
|
| 104 |
+
#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
|
| 105 |
+
#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
|
| 106 |
+
#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
|
| 107 |
+
|
| 108 |
+
#define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA"
|
| 109 |
+
#define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA"
|
| 110 |
+
#define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA"
|
| 111 |
+
#define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA"
|
| 112 |
+
#define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA"
|
| 113 |
+
#define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA"
|
| 114 |
+
|
| 115 |
+
/*
|
| 116 |
+
* This next block of six "EDH" labels is for backward compatibility with
|
| 117 |
+
* older versions of OpenSSL. New code should use the six "DHE" labels above
|
| 118 |
+
* instead:
|
| 119 |
+
*/
|
| 120 |
+
#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
|
| 121 |
+
#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
|
| 122 |
+
#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
|
| 123 |
+
#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
|
| 124 |
+
#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
|
| 125 |
+
#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
|
| 126 |
+
|
| 127 |
+
#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
|
| 128 |
+
#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
|
| 129 |
+
#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
|
| 130 |
+
#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
|
| 131 |
+
#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
|
| 132 |
+
|
| 133 |
+
#define SSL3_SSL_SESSION_ID_LENGTH 32
|
| 134 |
+
#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
|
| 135 |
+
|
| 136 |
+
#define SSL3_MASTER_SECRET_SIZE 48
|
| 137 |
+
#define SSL3_RANDOM_SIZE 32
|
| 138 |
+
#define SSL3_SESSION_ID_SIZE 32
|
| 139 |
+
#define SSL3_RT_HEADER_LENGTH 5
|
| 140 |
+
|
| 141 |
+
#define SSL3_HM_HEADER_LENGTH 4
|
| 142 |
+
|
| 143 |
+
#ifndef SSL3_ALIGN_PAYLOAD
|
| 144 |
+
/*
|
| 145 |
+
* Some will argue that this increases memory footprint, but it's not
|
| 146 |
+
* actually true. Point is that malloc has to return at least 64-bit aligned
|
| 147 |
+
* pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
|
| 148 |
+
* Suggested pre-gaping simply moves these wasted bytes from the end of
|
| 149 |
+
* allocated region to its front, but makes data payload aligned, which
|
| 150 |
+
* improves performance:-)
|
| 151 |
+
*/
|
| 152 |
+
#define SSL3_ALIGN_PAYLOAD 8
|
| 153 |
+
#else
|
| 154 |
+
#if (SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) != 0
|
| 155 |
+
#error "insane SSL3_ALIGN_PAYLOAD"
|
| 156 |
+
#undef SSL3_ALIGN_PAYLOAD
|
| 157 |
+
#endif
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
/*
|
| 161 |
+
* This is the maximum MAC (digest) size used by the SSL library. Currently
|
| 162 |
+
* maximum of 20 is used by SHA1, but we reserve for future extension for
|
| 163 |
+
* 512-bit hashes.
|
| 164 |
+
*/
|
| 165 |
+
|
| 166 |
+
#define SSL3_RT_MAX_MD_SIZE 64
|
| 167 |
+
|
| 168 |
+
/*
|
| 169 |
+
* Maximum block size used in all ciphersuites. Currently 16 for AES.
|
| 170 |
+
*/
|
| 171 |
+
|
| 172 |
+
#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
|
| 173 |
+
|
| 174 |
+
#define SSL3_RT_MAX_EXTRA (16384)
|
| 175 |
+
|
| 176 |
+
/* Maximum plaintext length: defined by SSL/TLS standards */
|
| 177 |
+
#define SSL3_RT_MAX_PLAIN_LENGTH 16384
|
| 178 |
+
/* Maximum compression overhead: defined by SSL/TLS standards */
|
| 179 |
+
#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
|
| 180 |
+
|
| 181 |
+
/*
|
| 182 |
+
* The standards give a maximum encryption overhead of 1024 bytes. In
|
| 183 |
+
* practice the value is lower than this. The overhead is the maximum number
|
| 184 |
+
* of padding bytes (256) plus the mac size.
|
| 185 |
+
*/
|
| 186 |
+
#define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE)
|
| 187 |
+
#define SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD 256
|
| 188 |
+
|
| 189 |
+
/*
|
| 190 |
+
* OpenSSL currently only uses a padding length of at most one block so the
|
| 191 |
+
* send overhead is smaller.
|
| 192 |
+
*/
|
| 193 |
+
|
| 194 |
+
#define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \
|
| 195 |
+
(SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
|
| 196 |
+
|
| 197 |
+
/* If compression isn't used don't include the compression overhead */
|
| 198 |
+
|
| 199 |
+
#ifdef OPENSSL_NO_COMP
|
| 200 |
+
#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
|
| 201 |
+
#else
|
| 202 |
+
#define SSL3_RT_MAX_COMPRESSED_LENGTH \
|
| 203 |
+
(SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD)
|
| 204 |
+
#endif
|
| 205 |
+
#define SSL3_RT_MAX_ENCRYPTED_LENGTH \
|
| 206 |
+
(SSL3_RT_MAX_ENCRYPTED_OVERHEAD + SSL3_RT_MAX_COMPRESSED_LENGTH)
|
| 207 |
+
#define SSL3_RT_MAX_TLS13_ENCRYPTED_LENGTH \
|
| 208 |
+
(SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD)
|
| 209 |
+
#define SSL3_RT_MAX_PACKET_SIZE \
|
| 210 |
+
(SSL3_RT_MAX_ENCRYPTED_LENGTH + SSL3_RT_HEADER_LENGTH)
|
| 211 |
+
|
| 212 |
+
#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
|
| 213 |
+
#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
|
| 214 |
+
|
| 215 |
+
/* SSL3_VERSION is defined in prov_ssl.h */
|
| 216 |
+
#define SSL3_VERSION_MAJOR 0x03
|
| 217 |
+
#define SSL3_VERSION_MINOR 0x00
|
| 218 |
+
|
| 219 |
+
#define SSL3_RT_CHANGE_CIPHER_SPEC 20
|
| 220 |
+
#define SSL3_RT_ALERT 21
|
| 221 |
+
#define SSL3_RT_HANDSHAKE 22
|
| 222 |
+
#define SSL3_RT_APPLICATION_DATA 23
|
| 223 |
+
|
| 224 |
+
/* Pseudo content types to indicate additional parameters */
|
| 225 |
+
#define TLS1_RT_CRYPTO 0x1000
|
| 226 |
+
#define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1)
|
| 227 |
+
#define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2)
|
| 228 |
+
#define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3)
|
| 229 |
+
#define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4)
|
| 230 |
+
|
| 231 |
+
#define TLS1_RT_CRYPTO_READ 0x0000
|
| 232 |
+
#define TLS1_RT_CRYPTO_WRITE 0x0100
|
| 233 |
+
#define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5)
|
| 234 |
+
#define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6)
|
| 235 |
+
#define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7)
|
| 236 |
+
#define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8)
|
| 237 |
+
|
| 238 |
+
/* Pseudo content types for SSL/TLS header info */
|
| 239 |
+
#define SSL3_RT_HEADER 0x100
|
| 240 |
+
#define SSL3_RT_INNER_CONTENT_TYPE 0x101
|
| 241 |
+
|
| 242 |
+
/* Pseudo content types for QUIC */
|
| 243 |
+
#define SSL3_RT_QUIC_DATAGRAM 0x200
|
| 244 |
+
#define SSL3_RT_QUIC_PACKET 0x201
|
| 245 |
+
#define SSL3_RT_QUIC_FRAME_FULL 0x202
|
| 246 |
+
#define SSL3_RT_QUIC_FRAME_HEADER 0x203
|
| 247 |
+
#define SSL3_RT_QUIC_FRAME_PADDING 0x204
|
| 248 |
+
|
| 249 |
+
#define SSL3_AL_WARNING 1
|
| 250 |
+
#define SSL3_AL_FATAL 2
|
| 251 |
+
|
| 252 |
+
#define SSL3_AD_CLOSE_NOTIFY 0
|
| 253 |
+
#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */
|
| 254 |
+
#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */
|
| 255 |
+
#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */
|
| 256 |
+
#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
|
| 257 |
+
#define SSL3_AD_NO_CERTIFICATE 41
|
| 258 |
+
#define SSL3_AD_BAD_CERTIFICATE 42
|
| 259 |
+
#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
|
| 260 |
+
#define SSL3_AD_CERTIFICATE_REVOKED 44
|
| 261 |
+
#define SSL3_AD_CERTIFICATE_EXPIRED 45
|
| 262 |
+
#define SSL3_AD_CERTIFICATE_UNKNOWN 46
|
| 263 |
+
#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
|
| 264 |
+
|
| 265 |
+
#define TLS1_HB_REQUEST 1
|
| 266 |
+
#define TLS1_HB_RESPONSE 2
|
| 267 |
+
|
| 268 |
+
#define SSL3_CT_RSA_SIGN 1
|
| 269 |
+
#define SSL3_CT_DSS_SIGN 2
|
| 270 |
+
#define SSL3_CT_RSA_FIXED_DH 3
|
| 271 |
+
#define SSL3_CT_DSS_FIXED_DH 4
|
| 272 |
+
#define SSL3_CT_RSA_EPHEMERAL_DH 5
|
| 273 |
+
#define SSL3_CT_DSS_EPHEMERAL_DH 6
|
| 274 |
+
#define SSL3_CT_FORTEZZA_DMS 20
|
| 275 |
+
/*
|
| 276 |
+
* SSL3_CT_NUMBER is used to size arrays and it must be large enough to
|
| 277 |
+
* contain all of the cert types defined for *either* SSLv3 and TLSv1.
|
| 278 |
+
*/
|
| 279 |
+
#define SSL3_CT_NUMBER 12
|
| 280 |
+
|
| 281 |
+
#if defined(TLS_CT_NUMBER)
|
| 282 |
+
#if TLS_CT_NUMBER != SSL3_CT_NUMBER
|
| 283 |
+
#error "SSL/TLS CT_NUMBER values do not match"
|
| 284 |
+
#endif
|
| 285 |
+
#endif
|
| 286 |
+
|
| 287 |
+
/* No longer used as of OpenSSL 1.1.1 */
|
| 288 |
+
#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
|
| 289 |
+
|
| 290 |
+
/* Removed from OpenSSL 1.1.0 */
|
| 291 |
+
#define TLS1_FLAGS_TLS_PADDING_BUG 0x0
|
| 292 |
+
|
| 293 |
+
#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
|
| 294 |
+
|
| 295 |
+
/* Set if we encrypt then mac instead of usual mac then encrypt */
|
| 296 |
+
#define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100
|
| 297 |
+
#define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ
|
| 298 |
+
|
| 299 |
+
/* Set if extended master secret extension received from peer */
|
| 300 |
+
#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
|
| 301 |
+
|
| 302 |
+
#define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400
|
| 303 |
+
|
| 304 |
+
#define TLS1_FLAGS_STATELESS 0x0800
|
| 305 |
+
|
| 306 |
+
/* Set if extended master secret extension required on renegotiation */
|
| 307 |
+
#define TLS1_FLAGS_REQUIRED_EXTMS 0x1000
|
| 308 |
+
|
| 309 |
+
/* 0x2000 is reserved for TLS1_FLAGS_QUIC (internal) */
|
| 310 |
+
/* 0x4000 is reserved for TLS1_FLAGS_QUIC_INTERNAL (internal) */
|
| 311 |
+
|
| 312 |
+
#define SSL3_MT_HELLO_REQUEST 0
|
| 313 |
+
#define SSL3_MT_CLIENT_HELLO 1
|
| 314 |
+
#define SSL3_MT_SERVER_HELLO 2
|
| 315 |
+
#define SSL3_MT_NEWSESSION_TICKET 4
|
| 316 |
+
#define SSL3_MT_END_OF_EARLY_DATA 5
|
| 317 |
+
#define SSL3_MT_ENCRYPTED_EXTENSIONS 8
|
| 318 |
+
#define SSL3_MT_CERTIFICATE 11
|
| 319 |
+
#define SSL3_MT_SERVER_KEY_EXCHANGE 12
|
| 320 |
+
#define SSL3_MT_CERTIFICATE_REQUEST 13
|
| 321 |
+
#define SSL3_MT_SERVER_DONE 14
|
| 322 |
+
#define SSL3_MT_CERTIFICATE_VERIFY 15
|
| 323 |
+
#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
|
| 324 |
+
#define SSL3_MT_FINISHED 20
|
| 325 |
+
#define SSL3_MT_CERTIFICATE_URL 21
|
| 326 |
+
#define SSL3_MT_CERTIFICATE_STATUS 22
|
| 327 |
+
#define SSL3_MT_SUPPLEMENTAL_DATA 23
|
| 328 |
+
#define SSL3_MT_KEY_UPDATE 24
|
| 329 |
+
#define SSL3_MT_COMPRESSED_CERTIFICATE 25
|
| 330 |
+
#ifndef OPENSSL_NO_NEXTPROTONEG
|
| 331 |
+
#define SSL3_MT_NEXT_PROTO 67
|
| 332 |
+
#endif
|
| 333 |
+
#define SSL3_MT_MESSAGE_HASH 254
|
| 334 |
+
#define DTLS1_MT_HELLO_VERIFY_REQUEST 3
|
| 335 |
+
|
| 336 |
+
/* Dummy message type for handling CCS like a normal handshake message */
|
| 337 |
+
#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
|
| 338 |
+
|
| 339 |
+
#define SSL3_MT_CCS 1
|
| 340 |
+
|
| 341 |
+
/* These are used when changing over to a new cipher */
|
| 342 |
+
#define SSL3_CC_READ 0x001
|
| 343 |
+
#define SSL3_CC_WRITE 0x002
|
| 344 |
+
#define SSL3_CC_CLIENT 0x010
|
| 345 |
+
#define SSL3_CC_SERVER 0x020
|
| 346 |
+
#define SSL3_CC_EARLY 0x040
|
| 347 |
+
#define SSL3_CC_HANDSHAKE 0x080
|
| 348 |
+
#define SSL3_CC_APPLICATION 0x100
|
| 349 |
+
#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
|
| 350 |
+
#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER | SSL3_CC_READ)
|
| 351 |
+
#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
|
| 352 |
+
#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER | SSL3_CC_WRITE)
|
| 353 |
+
|
| 354 |
+
#ifdef __cplusplus
|
| 355 |
+
}
|
| 356 |
+
#endif
|
| 357 |
+
#endif
|