Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- llava_next/include/openssl/aes.h +111 -0
- llava_next/include/openssl/asyncerr.h +29 -0
- llava_next/include/openssl/bio.h +887 -0
- llava_next/include/openssl/bioerr.h +65 -0
- llava_next/include/openssl/buffer.h +62 -0
- llava_next/include/openssl/cast.h +71 -0
- llava_next/include/openssl/cmac.h +52 -0
- llava_next/include/openssl/cmp_util.h +56 -0
- llava_next/include/openssl/cms.h +493 -0
- llava_next/include/openssl/cmserr.h +125 -0
- llava_next/include/openssl/comp.h +59 -0
- llava_next/include/openssl/conf.h +211 -0
- llava_next/include/openssl/conftypes.h +44 -0
- llava_next/include/openssl/core.h +233 -0
- llava_next/include/openssl/core_dispatch.h +943 -0
- llava_next/include/openssl/crmferr.h +50 -0
- llava_next/include/openssl/ct.h +573 -0
- llava_next/include/openssl/decodererr.h +28 -0
- llava_next/include/openssl/dherr.h +58 -0
- llava_next/include/openssl/encoder.h +124 -0
- llava_next/include/openssl/encodererr.h +28 -0
- llava_next/include/openssl/err.h +504 -0
- llava_next/include/openssl/fipskey.h +36 -0
- llava_next/include/openssl/http.h +110 -0
- llava_next/include/openssl/objectserr.h +28 -0
- llava_next/include/openssl/opensslconf.h +17 -0
- llava_next/include/openssl/pem.h +538 -0
- llava_next/include/openssl/pemerr.h +58 -0
- llava_next/include/openssl/pkcs12.h +350 -0
- llava_next/include/openssl/proverr.h +148 -0
- llava_next/include/openssl/rc2.h +68 -0
- llava_next/include/openssl/rc4.h +47 -0
- llava_next/include/openssl/safestack.h +297 -0
- llava_next/include/openssl/srp.h +285 -0
- llava_next/include/openssl/srtp.h +56 -0
- llava_next/include/openssl/ssl.h +0 -0
- llava_next/include/openssl/sslerr.h +346 -0
- llava_next/include/openssl/symhacks.h +39 -0
- llava_next/include/openssl/tserr.h +67 -0
- llava_next/include/openssl/x509.h +1276 -0
- llava_next/include/openssl/x509err.h +69 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/ApproximateClock.h +115 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/Array.h +18 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/ArrayRef.h +380 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/BFloat16.h +126 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/DeadlockDetection.h +48 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/ExclusivelyOwnedTensorTraits.h +75 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e4m3fn-inl.h +274 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e4m3fnuz-inl.h +279 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e5m2fnuz-inl.h +280 -0
llava_next/include/openssl/aes.h
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2002-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_AES_H
|
| 11 |
+
# define OPENSSL_AES_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_AES_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# include <stddef.h>
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
# define AES_BLOCK_SIZE 16
|
| 27 |
+
|
| 28 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 29 |
+
|
| 30 |
+
# define AES_ENCRYPT 1
|
| 31 |
+
# define AES_DECRYPT 0
|
| 32 |
+
|
| 33 |
+
# define AES_MAXNR 14
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
/* This should be a hidden type, but EVP requires that the size be known */
|
| 37 |
+
struct aes_key_st {
|
| 38 |
+
# ifdef AES_LONG
|
| 39 |
+
unsigned long rd_key[4 * (AES_MAXNR + 1)];
|
| 40 |
+
# else
|
| 41 |
+
unsigned int rd_key[4 * (AES_MAXNR + 1)];
|
| 42 |
+
# endif
|
| 43 |
+
int rounds;
|
| 44 |
+
};
|
| 45 |
+
typedef struct aes_key_st AES_KEY;
|
| 46 |
+
|
| 47 |
+
# endif
|
| 48 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0
|
| 51 |
+
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
| 52 |
+
AES_KEY *key);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0
|
| 54 |
+
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
| 55 |
+
AES_KEY *key);
|
| 56 |
+
OSSL_DEPRECATEDIN_3_0
|
| 57 |
+
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
| 58 |
+
const AES_KEY *key);
|
| 59 |
+
OSSL_DEPRECATEDIN_3_0
|
| 60 |
+
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
| 61 |
+
const AES_KEY *key);
|
| 62 |
+
OSSL_DEPRECATEDIN_3_0
|
| 63 |
+
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
| 64 |
+
const AES_KEY *key, const int enc);
|
| 65 |
+
OSSL_DEPRECATEDIN_3_0
|
| 66 |
+
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
| 67 |
+
size_t length, const AES_KEY *key,
|
| 68 |
+
unsigned char *ivec, const int enc);
|
| 69 |
+
OSSL_DEPRECATEDIN_3_0
|
| 70 |
+
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 71 |
+
size_t length, const AES_KEY *key,
|
| 72 |
+
unsigned char *ivec, int *num, const int enc);
|
| 73 |
+
OSSL_DEPRECATEDIN_3_0
|
| 74 |
+
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
| 75 |
+
size_t length, const AES_KEY *key,
|
| 76 |
+
unsigned char *ivec, int *num, const int enc);
|
| 77 |
+
OSSL_DEPRECATEDIN_3_0
|
| 78 |
+
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
| 79 |
+
size_t length, const AES_KEY *key,
|
| 80 |
+
unsigned char *ivec, int *num, const int enc);
|
| 81 |
+
OSSL_DEPRECATEDIN_3_0
|
| 82 |
+
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 83 |
+
size_t length, const AES_KEY *key,
|
| 84 |
+
unsigned char *ivec, int *num);
|
| 85 |
+
|
| 86 |
+
/* NB: the IV is _two_ blocks long */
|
| 87 |
+
OSSL_DEPRECATEDIN_3_0
|
| 88 |
+
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
| 89 |
+
size_t length, const AES_KEY *key,
|
| 90 |
+
unsigned char *ivec, const int enc);
|
| 91 |
+
/* NB: the IV is _four_ blocks long */
|
| 92 |
+
OSSL_DEPRECATEDIN_3_0
|
| 93 |
+
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
| 94 |
+
size_t length, const AES_KEY *key, const AES_KEY *key2,
|
| 95 |
+
const unsigned char *ivec, const int enc);
|
| 96 |
+
OSSL_DEPRECATEDIN_3_0
|
| 97 |
+
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
| 98 |
+
unsigned char *out, const unsigned char *in,
|
| 99 |
+
unsigned int inlen);
|
| 100 |
+
OSSL_DEPRECATEDIN_3_0
|
| 101 |
+
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
| 102 |
+
unsigned char *out, const unsigned char *in,
|
| 103 |
+
unsigned int inlen);
|
| 104 |
+
# endif
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
# ifdef __cplusplus
|
| 108 |
+
}
|
| 109 |
+
# endif
|
| 110 |
+
|
| 111 |
+
#endif
|
llava_next/include/openssl/asyncerr.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_ASYNCERR_H
|
| 12 |
+
# define OPENSSL_ASYNCERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* ASYNC reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define ASYNC_R_FAILED_TO_SET_POOL 101
|
| 25 |
+
# define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102
|
| 26 |
+
# define ASYNC_R_INIT_FAILED 105
|
| 27 |
+
# define ASYNC_R_INVALID_POOL_SIZE 103
|
| 28 |
+
|
| 29 |
+
#endif
|
llava_next/include/openssl/bio.h
ADDED
|
@@ -0,0 +1,887 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/bio.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2022 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 |
+
|
| 14 |
+
#ifndef OPENSSL_BIO_H
|
| 15 |
+
# define OPENSSL_BIO_H
|
| 16 |
+
# pragma once
|
| 17 |
+
|
| 18 |
+
# include <openssl/macros.h>
|
| 19 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 20 |
+
# define HEADER_BIO_H
|
| 21 |
+
# endif
|
| 22 |
+
|
| 23 |
+
# include <openssl/e_os2.h>
|
| 24 |
+
|
| 25 |
+
# ifndef OPENSSL_NO_STDIO
|
| 26 |
+
# include <stdio.h>
|
| 27 |
+
# endif
|
| 28 |
+
# include <stdarg.h>
|
| 29 |
+
|
| 30 |
+
# include <openssl/crypto.h>
|
| 31 |
+
# include <openssl/bioerr.h>
|
| 32 |
+
# include <openssl/core.h>
|
| 33 |
+
|
| 34 |
+
#ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
/* There are the classes of BIOs */
|
| 39 |
+
# define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
|
| 40 |
+
# define BIO_TYPE_FILTER 0x0200
|
| 41 |
+
# define BIO_TYPE_SOURCE_SINK 0x0400
|
| 42 |
+
|
| 43 |
+
/* These are the 'types' of BIOs */
|
| 44 |
+
# define BIO_TYPE_NONE 0
|
| 45 |
+
# define BIO_TYPE_MEM ( 1|BIO_TYPE_SOURCE_SINK)
|
| 46 |
+
# define BIO_TYPE_FILE ( 2|BIO_TYPE_SOURCE_SINK)
|
| 47 |
+
|
| 48 |
+
# define BIO_TYPE_FD ( 4|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 49 |
+
# define BIO_TYPE_SOCKET ( 5|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 50 |
+
# define BIO_TYPE_NULL ( 6|BIO_TYPE_SOURCE_SINK)
|
| 51 |
+
# define BIO_TYPE_SSL ( 7|BIO_TYPE_FILTER)
|
| 52 |
+
# define BIO_TYPE_MD ( 8|BIO_TYPE_FILTER)
|
| 53 |
+
# define BIO_TYPE_BUFFER ( 9|BIO_TYPE_FILTER)
|
| 54 |
+
# define BIO_TYPE_CIPHER (10|BIO_TYPE_FILTER)
|
| 55 |
+
# define BIO_TYPE_BASE64 (11|BIO_TYPE_FILTER)
|
| 56 |
+
# define BIO_TYPE_CONNECT (12|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 57 |
+
# define BIO_TYPE_ACCEPT (13|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 58 |
+
|
| 59 |
+
# define BIO_TYPE_NBIO_TEST (16|BIO_TYPE_FILTER)/* server proxy BIO */
|
| 60 |
+
# define BIO_TYPE_NULL_FILTER (17|BIO_TYPE_FILTER)
|
| 61 |
+
# define BIO_TYPE_BIO (19|BIO_TYPE_SOURCE_SINK)/* half a BIO pair */
|
| 62 |
+
# define BIO_TYPE_LINEBUFFER (20|BIO_TYPE_FILTER)
|
| 63 |
+
# define BIO_TYPE_DGRAM (21|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 64 |
+
# define BIO_TYPE_ASN1 (22|BIO_TYPE_FILTER)
|
| 65 |
+
# define BIO_TYPE_COMP (23|BIO_TYPE_FILTER)
|
| 66 |
+
# ifndef OPENSSL_NO_SCTP
|
| 67 |
+
# define BIO_TYPE_DGRAM_SCTP (24|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
|
| 68 |
+
# endif
|
| 69 |
+
# define BIO_TYPE_CORE_TO_PROV (25|BIO_TYPE_SOURCE_SINK)
|
| 70 |
+
|
| 71 |
+
#define BIO_TYPE_START 128
|
| 72 |
+
|
| 73 |
+
/*
|
| 74 |
+
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
|
| 75 |
+
* BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
| 76 |
+
*/
|
| 77 |
+
# define BIO_NOCLOSE 0x00
|
| 78 |
+
# define BIO_CLOSE 0x01
|
| 79 |
+
|
| 80 |
+
/*
|
| 81 |
+
* These are used in the following macros and are passed to BIO_ctrl()
|
| 82 |
+
*/
|
| 83 |
+
# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */
|
| 84 |
+
# define BIO_CTRL_EOF 2/* opt - are we at the eof */
|
| 85 |
+
# define BIO_CTRL_INFO 3/* opt - extra tit-bits */
|
| 86 |
+
# define BIO_CTRL_SET 4/* man - set the 'IO' type */
|
| 87 |
+
# define BIO_CTRL_GET 5/* man - get the 'IO' type */
|
| 88 |
+
# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */
|
| 89 |
+
# define BIO_CTRL_POP 7/* opt - internal, used to signify change */
|
| 90 |
+
# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */
|
| 91 |
+
# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */
|
| 92 |
+
# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */
|
| 93 |
+
# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */
|
| 94 |
+
# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */
|
| 95 |
+
# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */
|
| 96 |
+
# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */
|
| 97 |
+
# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */
|
| 98 |
+
|
| 99 |
+
# define BIO_CTRL_PEEK 29/* BIO_f_buffer special */
|
| 100 |
+
# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */
|
| 101 |
+
|
| 102 |
+
/* dgram BIO stuff */
|
| 103 |
+
# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */
|
| 104 |
+
# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
|
| 105 |
+
* socket to be passed in */
|
| 106 |
+
# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */
|
| 107 |
+
# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */
|
| 108 |
+
# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */
|
| 109 |
+
# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */
|
| 110 |
+
|
| 111 |
+
# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */
|
| 112 |
+
# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation timed out */
|
| 113 |
+
|
| 114 |
+
/* #ifdef IP_MTU_DISCOVER */
|
| 115 |
+
# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */
|
| 116 |
+
/* #endif */
|
| 117 |
+
|
| 118 |
+
# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */
|
| 119 |
+
# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
|
| 120 |
+
# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */
|
| 121 |
+
# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
|
| 122 |
+
* want to use this if asking
|
| 123 |
+
* the kernel fails */
|
| 124 |
+
|
| 125 |
+
# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
|
| 126 |
+
* exceed in the previous write
|
| 127 |
+
* operation */
|
| 128 |
+
|
| 129 |
+
# define BIO_CTRL_DGRAM_GET_PEER 46
|
| 130 |
+
# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */
|
| 131 |
+
|
| 132 |
+
# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
|
| 133 |
+
* to adjust socket timeouts */
|
| 134 |
+
# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
|
| 135 |
+
|
| 136 |
+
# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
|
| 137 |
+
|
| 138 |
+
/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */
|
| 139 |
+
# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
|
| 140 |
+
# ifndef OPENSSL_NO_SCTP
|
| 141 |
+
/* SCTP stuff */
|
| 142 |
+
# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
|
| 143 |
+
# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
|
| 144 |
+
# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
|
| 145 |
+
# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
|
| 146 |
+
# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
|
| 147 |
+
# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
|
| 148 |
+
# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
|
| 149 |
+
# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
|
| 150 |
+
# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
|
| 151 |
+
# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
|
| 152 |
+
# endif
|
| 153 |
+
|
| 154 |
+
# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71
|
| 155 |
+
|
| 156 |
+
/*
|
| 157 |
+
* internal BIO:
|
| 158 |
+
* # define BIO_CTRL_SET_KTLS_SEND 72
|
| 159 |
+
* # define BIO_CTRL_SET_KTLS_SEND_CTRL_MSG 74
|
| 160 |
+
* # define BIO_CTRL_CLEAR_KTLS_CTRL_MSG 75
|
| 161 |
+
*/
|
| 162 |
+
|
| 163 |
+
# define BIO_CTRL_GET_KTLS_SEND 73
|
| 164 |
+
# define BIO_CTRL_GET_KTLS_RECV 76
|
| 165 |
+
|
| 166 |
+
# define BIO_CTRL_DGRAM_SCTP_WAIT_FOR_DRY 77
|
| 167 |
+
# define BIO_CTRL_DGRAM_SCTP_MSG_WAITING 78
|
| 168 |
+
|
| 169 |
+
/* BIO_f_prefix controls */
|
| 170 |
+
# define BIO_CTRL_SET_PREFIX 79
|
| 171 |
+
# define BIO_CTRL_SET_INDENT 80
|
| 172 |
+
# define BIO_CTRL_GET_INDENT 81
|
| 173 |
+
|
| 174 |
+
# ifndef OPENSSL_NO_KTLS
|
| 175 |
+
# define BIO_get_ktls_send(b) \
|
| 176 |
+
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) > 0)
|
| 177 |
+
# define BIO_get_ktls_recv(b) \
|
| 178 |
+
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0)
|
| 179 |
+
# else
|
| 180 |
+
# define BIO_get_ktls_send(b) (0)
|
| 181 |
+
# define BIO_get_ktls_recv(b) (0)
|
| 182 |
+
# endif
|
| 183 |
+
|
| 184 |
+
/* modifiers */
|
| 185 |
+
# define BIO_FP_READ 0x02
|
| 186 |
+
# define BIO_FP_WRITE 0x04
|
| 187 |
+
# define BIO_FP_APPEND 0x08
|
| 188 |
+
# define BIO_FP_TEXT 0x10
|
| 189 |
+
|
| 190 |
+
# define BIO_FLAGS_READ 0x01
|
| 191 |
+
# define BIO_FLAGS_WRITE 0x02
|
| 192 |
+
# define BIO_FLAGS_IO_SPECIAL 0x04
|
| 193 |
+
# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
|
| 194 |
+
# define BIO_FLAGS_SHOULD_RETRY 0x08
|
| 195 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 196 |
+
/* This #define was replaced by an internal constant and should not be used. */
|
| 197 |
+
# define BIO_FLAGS_UPLINK 0
|
| 198 |
+
# endif
|
| 199 |
+
|
| 200 |
+
# define BIO_FLAGS_BASE64_NO_NL 0x100
|
| 201 |
+
|
| 202 |
+
/*
|
| 203 |
+
* This is used with memory BIOs:
|
| 204 |
+
* BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way;
|
| 205 |
+
* BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset.
|
| 206 |
+
*/
|
| 207 |
+
# define BIO_FLAGS_MEM_RDONLY 0x200
|
| 208 |
+
# define BIO_FLAGS_NONCLEAR_RST 0x400
|
| 209 |
+
# define BIO_FLAGS_IN_EOF 0x800
|
| 210 |
+
|
| 211 |
+
/* the BIO FLAGS values 0x1000 to 0x4000 are reserved for internal KTLS flags */
|
| 212 |
+
|
| 213 |
+
typedef union bio_addr_st BIO_ADDR;
|
| 214 |
+
typedef struct bio_addrinfo_st BIO_ADDRINFO;
|
| 215 |
+
|
| 216 |
+
int BIO_get_new_index(void);
|
| 217 |
+
void BIO_set_flags(BIO *b, int flags);
|
| 218 |
+
int BIO_test_flags(const BIO *b, int flags);
|
| 219 |
+
void BIO_clear_flags(BIO *b, int flags);
|
| 220 |
+
|
| 221 |
+
# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
|
| 222 |
+
# define BIO_set_retry_special(b) \
|
| 223 |
+
BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
|
| 224 |
+
# define BIO_set_retry_read(b) \
|
| 225 |
+
BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
|
| 226 |
+
# define BIO_set_retry_write(b) \
|
| 227 |
+
BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
|
| 228 |
+
|
| 229 |
+
/* These are normally used internally in BIOs */
|
| 230 |
+
# define BIO_clear_retry_flags(b) \
|
| 231 |
+
BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
| 232 |
+
# define BIO_get_retry_flags(b) \
|
| 233 |
+
BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
| 234 |
+
|
| 235 |
+
/* These should be used by the application to tell why we should retry */
|
| 236 |
+
# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
|
| 237 |
+
# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
|
| 238 |
+
# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
|
| 239 |
+
# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
|
| 240 |
+
# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
|
| 241 |
+
|
| 242 |
+
/*
|
| 243 |
+
* The next three are used in conjunction with the BIO_should_io_special()
|
| 244 |
+
* condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int
|
| 245 |
+
* *reason); will walk the BIO stack and return the 'reason' for the special
|
| 246 |
+
* and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return
|
| 247 |
+
* the code.
|
| 248 |
+
*/
|
| 249 |
+
/*
|
| 250 |
+
* Returned from the SSL bio when the certificate retrieval code had an error
|
| 251 |
+
*/
|
| 252 |
+
# define BIO_RR_SSL_X509_LOOKUP 0x01
|
| 253 |
+
/* Returned from the connect BIO when a connect would have blocked */
|
| 254 |
+
# define BIO_RR_CONNECT 0x02
|
| 255 |
+
/* Returned from the accept BIO when an accept would have blocked */
|
| 256 |
+
# define BIO_RR_ACCEPT 0x03
|
| 257 |
+
|
| 258 |
+
/* These are passed by the BIO callback */
|
| 259 |
+
# define BIO_CB_FREE 0x01
|
| 260 |
+
# define BIO_CB_READ 0x02
|
| 261 |
+
# define BIO_CB_WRITE 0x03
|
| 262 |
+
# define BIO_CB_PUTS 0x04
|
| 263 |
+
# define BIO_CB_GETS 0x05
|
| 264 |
+
# define BIO_CB_CTRL 0x06
|
| 265 |
+
|
| 266 |
+
/*
|
| 267 |
+
* The callback is called before and after the underling operation, The
|
| 268 |
+
* BIO_CB_RETURN flag indicates if it is after the call
|
| 269 |
+
*/
|
| 270 |
+
# define BIO_CB_RETURN 0x80
|
| 271 |
+
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
| 272 |
+
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
| 273 |
+
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
| 274 |
+
|
| 275 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 276 |
+
typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi,
|
| 277 |
+
long argl, long ret);
|
| 278 |
+
OSSL_DEPRECATEDIN_3_0 BIO_callback_fn BIO_get_callback(const BIO *b);
|
| 279 |
+
OSSL_DEPRECATEDIN_3_0 void BIO_set_callback(BIO *b, BIO_callback_fn callback);
|
| 280 |
+
OSSL_DEPRECATEDIN_3_0 long BIO_debug_callback(BIO *bio, int cmd,
|
| 281 |
+
const char *argp, int argi,
|
| 282 |
+
long argl, long ret);
|
| 283 |
+
# endif
|
| 284 |
+
|
| 285 |
+
typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp,
|
| 286 |
+
size_t len, int argi,
|
| 287 |
+
long argl, int ret, size_t *processed);
|
| 288 |
+
BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b);
|
| 289 |
+
void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback);
|
| 290 |
+
long BIO_debug_callback_ex(BIO *bio, int oper, const char *argp, size_t len,
|
| 291 |
+
int argi, long argl, int ret, size_t *processed);
|
| 292 |
+
|
| 293 |
+
char *BIO_get_callback_arg(const BIO *b);
|
| 294 |
+
void BIO_set_callback_arg(BIO *b, char *arg);
|
| 295 |
+
|
| 296 |
+
typedef struct bio_method_st BIO_METHOD;
|
| 297 |
+
|
| 298 |
+
const char *BIO_method_name(const BIO *b);
|
| 299 |
+
int BIO_method_type(const BIO *b);
|
| 300 |
+
|
| 301 |
+
typedef int BIO_info_cb(BIO *, int, int);
|
| 302 |
+
typedef BIO_info_cb bio_info_cb; /* backward compatibility */
|
| 303 |
+
|
| 304 |
+
SKM_DEFINE_STACK_OF_INTERNAL(BIO, BIO, BIO)
|
| 305 |
+
#define sk_BIO_num(sk) OPENSSL_sk_num(ossl_check_const_BIO_sk_type(sk))
|
| 306 |
+
#define sk_BIO_value(sk, idx) ((BIO *)OPENSSL_sk_value(ossl_check_const_BIO_sk_type(sk), (idx)))
|
| 307 |
+
#define sk_BIO_new(cmp) ((STACK_OF(BIO) *)OPENSSL_sk_new(ossl_check_BIO_compfunc_type(cmp)))
|
| 308 |
+
#define sk_BIO_new_null() ((STACK_OF(BIO) *)OPENSSL_sk_new_null())
|
| 309 |
+
#define sk_BIO_new_reserve(cmp, n) ((STACK_OF(BIO) *)OPENSSL_sk_new_reserve(ossl_check_BIO_compfunc_type(cmp), (n)))
|
| 310 |
+
#define sk_BIO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_BIO_sk_type(sk), (n))
|
| 311 |
+
#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk))
|
| 312 |
+
#define sk_BIO_zero(sk) OPENSSL_sk_zero(ossl_check_BIO_sk_type(sk))
|
| 313 |
+
#define sk_BIO_delete(sk, i) ((BIO *)OPENSSL_sk_delete(ossl_check_BIO_sk_type(sk), (i)))
|
| 314 |
+
#define sk_BIO_delete_ptr(sk, ptr) ((BIO *)OPENSSL_sk_delete_ptr(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)))
|
| 315 |
+
#define sk_BIO_push(sk, ptr) OPENSSL_sk_push(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
| 316 |
+
#define sk_BIO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
| 317 |
+
#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk)))
|
| 318 |
+
#define sk_BIO_shift(sk) ((BIO *)OPENSSL_sk_shift(ossl_check_BIO_sk_type(sk)))
|
| 319 |
+
#define sk_BIO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_BIO_sk_type(sk),ossl_check_BIO_freefunc_type(freefunc))
|
| 320 |
+
#define sk_BIO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), (idx))
|
| 321 |
+
#define sk_BIO_set(sk, idx, ptr) ((BIO *)OPENSSL_sk_set(ossl_check_BIO_sk_type(sk), (idx), ossl_check_BIO_type(ptr)))
|
| 322 |
+
#define sk_BIO_find(sk, ptr) OPENSSL_sk_find(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
| 323 |
+
#define sk_BIO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
| 324 |
+
#define sk_BIO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), pnum)
|
| 325 |
+
#define sk_BIO_sort(sk) OPENSSL_sk_sort(ossl_check_BIO_sk_type(sk))
|
| 326 |
+
#define sk_BIO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_BIO_sk_type(sk))
|
| 327 |
+
#define sk_BIO_dup(sk) ((STACK_OF(BIO) *)OPENSSL_sk_dup(ossl_check_const_BIO_sk_type(sk)))
|
| 328 |
+
#define sk_BIO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(BIO) *)OPENSSL_sk_deep_copy(ossl_check_const_BIO_sk_type(sk), ossl_check_BIO_copyfunc_type(copyfunc), ossl_check_BIO_freefunc_type(freefunc)))
|
| 329 |
+
#define sk_BIO_set_cmp_func(sk, cmp) ((sk_BIO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_BIO_sk_type(sk), ossl_check_BIO_compfunc_type(cmp)))
|
| 330 |
+
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
/* Prefix and suffix callback in ASN1 BIO */
|
| 334 |
+
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
|
| 335 |
+
void *parg);
|
| 336 |
+
|
| 337 |
+
typedef void (*BIO_dgram_sctp_notification_handler_fn) (BIO *b,
|
| 338 |
+
void *context,
|
| 339 |
+
void *buf);
|
| 340 |
+
# ifndef OPENSSL_NO_SCTP
|
| 341 |
+
/* SCTP parameter structs */
|
| 342 |
+
struct bio_dgram_sctp_sndinfo {
|
| 343 |
+
uint16_t snd_sid;
|
| 344 |
+
uint16_t snd_flags;
|
| 345 |
+
uint32_t snd_ppid;
|
| 346 |
+
uint32_t snd_context;
|
| 347 |
+
};
|
| 348 |
+
|
| 349 |
+
struct bio_dgram_sctp_rcvinfo {
|
| 350 |
+
uint16_t rcv_sid;
|
| 351 |
+
uint16_t rcv_ssn;
|
| 352 |
+
uint16_t rcv_flags;
|
| 353 |
+
uint32_t rcv_ppid;
|
| 354 |
+
uint32_t rcv_tsn;
|
| 355 |
+
uint32_t rcv_cumtsn;
|
| 356 |
+
uint32_t rcv_context;
|
| 357 |
+
};
|
| 358 |
+
|
| 359 |
+
struct bio_dgram_sctp_prinfo {
|
| 360 |
+
uint16_t pr_policy;
|
| 361 |
+
uint32_t pr_value;
|
| 362 |
+
};
|
| 363 |
+
# endif
|
| 364 |
+
|
| 365 |
+
/*
|
| 366 |
+
* #define BIO_CONN_get_param_hostname BIO_ctrl
|
| 367 |
+
*/
|
| 368 |
+
|
| 369 |
+
# define BIO_C_SET_CONNECT 100
|
| 370 |
+
# define BIO_C_DO_STATE_MACHINE 101
|
| 371 |
+
# define BIO_C_SET_NBIO 102
|
| 372 |
+
/* # define BIO_C_SET_PROXY_PARAM 103 */
|
| 373 |
+
# define BIO_C_SET_FD 104
|
| 374 |
+
# define BIO_C_GET_FD 105
|
| 375 |
+
# define BIO_C_SET_FILE_PTR 106
|
| 376 |
+
# define BIO_C_GET_FILE_PTR 107
|
| 377 |
+
# define BIO_C_SET_FILENAME 108
|
| 378 |
+
# define BIO_C_SET_SSL 109
|
| 379 |
+
# define BIO_C_GET_SSL 110
|
| 380 |
+
# define BIO_C_SET_MD 111
|
| 381 |
+
# define BIO_C_GET_MD 112
|
| 382 |
+
# define BIO_C_GET_CIPHER_STATUS 113
|
| 383 |
+
# define BIO_C_SET_BUF_MEM 114
|
| 384 |
+
# define BIO_C_GET_BUF_MEM_PTR 115
|
| 385 |
+
# define BIO_C_GET_BUFF_NUM_LINES 116
|
| 386 |
+
# define BIO_C_SET_BUFF_SIZE 117
|
| 387 |
+
# define BIO_C_SET_ACCEPT 118
|
| 388 |
+
# define BIO_C_SSL_MODE 119
|
| 389 |
+
# define BIO_C_GET_MD_CTX 120
|
| 390 |
+
/* # define BIO_C_GET_PROXY_PARAM 121 */
|
| 391 |
+
# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
|
| 392 |
+
# define BIO_C_GET_CONNECT 123
|
| 393 |
+
# define BIO_C_GET_ACCEPT 124
|
| 394 |
+
# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
|
| 395 |
+
# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
|
| 396 |
+
# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
|
| 397 |
+
# define BIO_C_FILE_SEEK 128
|
| 398 |
+
# define BIO_C_GET_CIPHER_CTX 129
|
| 399 |
+
# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
|
| 400 |
+
* value */
|
| 401 |
+
# define BIO_C_SET_BIND_MODE 131
|
| 402 |
+
# define BIO_C_GET_BIND_MODE 132
|
| 403 |
+
# define BIO_C_FILE_TELL 133
|
| 404 |
+
# define BIO_C_GET_SOCKS 134
|
| 405 |
+
# define BIO_C_SET_SOCKS 135
|
| 406 |
+
|
| 407 |
+
# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
|
| 408 |
+
# define BIO_C_GET_WRITE_BUF_SIZE 137
|
| 409 |
+
# define BIO_C_MAKE_BIO_PAIR 138
|
| 410 |
+
# define BIO_C_DESTROY_BIO_PAIR 139
|
| 411 |
+
# define BIO_C_GET_WRITE_GUARANTEE 140
|
| 412 |
+
# define BIO_C_GET_READ_REQUEST 141
|
| 413 |
+
# define BIO_C_SHUTDOWN_WR 142
|
| 414 |
+
# define BIO_C_NREAD0 143
|
| 415 |
+
# define BIO_C_NREAD 144
|
| 416 |
+
# define BIO_C_NWRITE0 145
|
| 417 |
+
# define BIO_C_NWRITE 146
|
| 418 |
+
# define BIO_C_RESET_READ_REQUEST 147
|
| 419 |
+
# define BIO_C_SET_MD_CTX 148
|
| 420 |
+
|
| 421 |
+
# define BIO_C_SET_PREFIX 149
|
| 422 |
+
# define BIO_C_GET_PREFIX 150
|
| 423 |
+
# define BIO_C_SET_SUFFIX 151
|
| 424 |
+
# define BIO_C_GET_SUFFIX 152
|
| 425 |
+
|
| 426 |
+
# define BIO_C_SET_EX_ARG 153
|
| 427 |
+
# define BIO_C_GET_EX_ARG 154
|
| 428 |
+
|
| 429 |
+
# define BIO_C_SET_CONNECT_MODE 155
|
| 430 |
+
|
| 431 |
+
# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
|
| 432 |
+
# define BIO_get_app_data(s) BIO_get_ex_data(s,0)
|
| 433 |
+
|
| 434 |
+
# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
|
| 435 |
+
|
| 436 |
+
# ifndef OPENSSL_NO_SOCK
|
| 437 |
+
/* IP families we support, for BIO_s_connect() and BIO_s_accept() */
|
| 438 |
+
/* Note: the underlying operating system may not support some of them */
|
| 439 |
+
# define BIO_FAMILY_IPV4 4
|
| 440 |
+
# define BIO_FAMILY_IPV6 6
|
| 441 |
+
# define BIO_FAMILY_IPANY 256
|
| 442 |
+
|
| 443 |
+
/* BIO_s_connect() */
|
| 444 |
+
# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0, \
|
| 445 |
+
(char *)(name))
|
| 446 |
+
# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1, \
|
| 447 |
+
(char *)(port))
|
| 448 |
+
# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2, \
|
| 449 |
+
(char *)(addr))
|
| 450 |
+
# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)
|
| 451 |
+
# define BIO_get_conn_hostname(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))
|
| 452 |
+
# define BIO_get_conn_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))
|
| 453 |
+
# define BIO_get_conn_address(b) ((const BIO_ADDR *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))
|
| 454 |
+
# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
|
| 455 |
+
# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)
|
| 456 |
+
|
| 457 |
+
/* BIO_s_accept() */
|
| 458 |
+
# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0, \
|
| 459 |
+
(char *)(name))
|
| 460 |
+
# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1, \
|
| 461 |
+
(char *)(port))
|
| 462 |
+
# define BIO_get_accept_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))
|
| 463 |
+
# define BIO_get_accept_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))
|
| 464 |
+
# define BIO_get_peer_name(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))
|
| 465 |
+
# define BIO_get_peer_port(b) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))
|
| 466 |
+
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
|
| 467 |
+
# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(void *)"a":NULL)
|
| 468 |
+
# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,3, \
|
| 469 |
+
(char *)(bio))
|
| 470 |
+
# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)
|
| 471 |
+
# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)
|
| 472 |
+
|
| 473 |
+
/* Aliases kept for backward compatibility */
|
| 474 |
+
# define BIO_BIND_NORMAL 0
|
| 475 |
+
# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR
|
| 476 |
+
# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR
|
| 477 |
+
# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
|
| 478 |
+
# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
|
| 479 |
+
# endif /* OPENSSL_NO_SOCK */
|
| 480 |
+
|
| 481 |
+
# define BIO_do_connect(b) BIO_do_handshake(b)
|
| 482 |
+
# define BIO_do_accept(b) BIO_do_handshake(b)
|
| 483 |
+
|
| 484 |
+
# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
|
| 485 |
+
|
| 486 |
+
/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */
|
| 487 |
+
# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
|
| 488 |
+
# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)(c))
|
| 489 |
+
|
| 490 |
+
/* BIO_s_file() */
|
| 491 |
+
# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
|
| 492 |
+
# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)(fpp))
|
| 493 |
+
|
| 494 |
+
/* BIO_s_fd() and BIO_s_file() */
|
| 495 |
+
# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
|
| 496 |
+
# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
|
| 497 |
+
|
| 498 |
+
/*
|
| 499 |
+
* name is cast to lose const, but might be better to route through a
|
| 500 |
+
* function so we can do it safely
|
| 501 |
+
*/
|
| 502 |
+
# ifdef CONST_STRICT
|
| 503 |
+
/*
|
| 504 |
+
* If you are wondering why this isn't defined, its because CONST_STRICT is
|
| 505 |
+
* purely a compile-time kludge to allow const to be checked.
|
| 506 |
+
*/
|
| 507 |
+
int BIO_read_filename(BIO *b, const char *name);
|
| 508 |
+
# else
|
| 509 |
+
# define BIO_read_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
| 510 |
+
BIO_CLOSE|BIO_FP_READ,(char *)(name))
|
| 511 |
+
# endif
|
| 512 |
+
# define BIO_write_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
| 513 |
+
BIO_CLOSE|BIO_FP_WRITE,name)
|
| 514 |
+
# define BIO_append_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
| 515 |
+
BIO_CLOSE|BIO_FP_APPEND,name)
|
| 516 |
+
# define BIO_rw_filename(b,name) (int)BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
| 517 |
+
BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
|
| 518 |
+
|
| 519 |
+
/*
|
| 520 |
+
* WARNING WARNING, this ups the reference count on the read bio of the SSL
|
| 521 |
+
* structure. This is because the ssl read BIO is now pointed to by the
|
| 522 |
+
* next_bio field in the bio. So when you free the BIO, make sure you are
|
| 523 |
+
* doing a BIO_free_all() to catch the underlying BIO.
|
| 524 |
+
*/
|
| 525 |
+
# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)(ssl))
|
| 526 |
+
# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)(sslp))
|
| 527 |
+
# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
|
| 528 |
+
# define BIO_set_ssl_renegotiate_bytes(b,num) \
|
| 529 |
+
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
|
| 530 |
+
# define BIO_get_num_renegotiates(b) \
|
| 531 |
+
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
|
| 532 |
+
# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
|
| 533 |
+
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
|
| 534 |
+
|
| 535 |
+
/* defined in evp.h */
|
| 536 |
+
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)(md)) */
|
| 537 |
+
|
| 538 |
+
# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
|
| 539 |
+
# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)(bm))
|
| 540 |
+
# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
|
| 541 |
+
(char *)(pp))
|
| 542 |
+
# define BIO_set_mem_eof_return(b,v) \
|
| 543 |
+
BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
|
| 544 |
+
|
| 545 |
+
/* For the BIO_f_buffer() type */
|
| 546 |
+
# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
|
| 547 |
+
# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
|
| 548 |
+
# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
|
| 549 |
+
# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
|
| 550 |
+
# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
|
| 551 |
+
|
| 552 |
+
/* Don't use the next one unless you know what you are doing :-) */
|
| 553 |
+
# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
|
| 554 |
+
|
| 555 |
+
# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
|
| 556 |
+
# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
|
| 557 |
+
# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
|
| 558 |
+
# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
|
| 559 |
+
# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
|
| 560 |
+
# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
|
| 561 |
+
/* ...pending macros have inappropriate return type */
|
| 562 |
+
size_t BIO_ctrl_pending(BIO *b);
|
| 563 |
+
size_t BIO_ctrl_wpending(BIO *b);
|
| 564 |
+
# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
|
| 565 |
+
# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
|
| 566 |
+
cbp)
|
| 567 |
+
# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
|
| 568 |
+
|
| 569 |
+
/* For the BIO_f_buffer() type */
|
| 570 |
+
# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
|
| 571 |
+
# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))
|
| 572 |
+
|
| 573 |
+
/* For BIO_s_bio() */
|
| 574 |
+
# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
|
| 575 |
+
# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
|
| 576 |
+
# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
|
| 577 |
+
# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
|
| 578 |
+
# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
|
| 579 |
+
/* macros with inappropriate type -- but ...pending macros use int too: */
|
| 580 |
+
# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
|
| 581 |
+
# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
|
| 582 |
+
size_t BIO_ctrl_get_write_guarantee(BIO *b);
|
| 583 |
+
size_t BIO_ctrl_get_read_request(BIO *b);
|
| 584 |
+
int BIO_ctrl_reset_read_request(BIO *b);
|
| 585 |
+
|
| 586 |
+
/* ctrl macros for dgram */
|
| 587 |
+
# define BIO_ctrl_dgram_connect(b,peer) \
|
| 588 |
+
(int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)(peer))
|
| 589 |
+
# define BIO_ctrl_set_connected(b,peer) \
|
| 590 |
+
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char *)(peer))
|
| 591 |
+
# define BIO_dgram_recv_timedout(b) \
|
| 592 |
+
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
|
| 593 |
+
# define BIO_dgram_send_timedout(b) \
|
| 594 |
+
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
|
| 595 |
+
# define BIO_dgram_get_peer(b,peer) \
|
| 596 |
+
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)(peer))
|
| 597 |
+
# define BIO_dgram_set_peer(b,peer) \
|
| 598 |
+
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)(peer))
|
| 599 |
+
# define BIO_dgram_get_mtu_overhead(b) \
|
| 600 |
+
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
|
| 601 |
+
|
| 602 |
+
/* ctrl macros for BIO_f_prefix */
|
| 603 |
+
# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
|
| 604 |
+
# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
|
| 605 |
+
# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
|
| 606 |
+
|
| 607 |
+
#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 608 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef)
|
| 609 |
+
int BIO_set_ex_data(BIO *bio, int idx, void *data);
|
| 610 |
+
void *BIO_get_ex_data(const BIO *bio, int idx);
|
| 611 |
+
uint64_t BIO_number_read(BIO *bio);
|
| 612 |
+
uint64_t BIO_number_written(BIO *bio);
|
| 613 |
+
|
| 614 |
+
/* For BIO_f_asn1() */
|
| 615 |
+
int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
|
| 616 |
+
asn1_ps_func *prefix_free);
|
| 617 |
+
int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
|
| 618 |
+
asn1_ps_func **pprefix_free);
|
| 619 |
+
int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
|
| 620 |
+
asn1_ps_func *suffix_free);
|
| 621 |
+
int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
|
| 622 |
+
asn1_ps_func **psuffix_free);
|
| 623 |
+
|
| 624 |
+
const BIO_METHOD *BIO_s_file(void);
|
| 625 |
+
BIO *BIO_new_file(const char *filename, const char *mode);
|
| 626 |
+
BIO *BIO_new_from_core_bio(OSSL_LIB_CTX *libctx, OSSL_CORE_BIO *corebio);
|
| 627 |
+
# ifndef OPENSSL_NO_STDIO
|
| 628 |
+
BIO *BIO_new_fp(FILE *stream, int close_flag);
|
| 629 |
+
# endif
|
| 630 |
+
BIO *BIO_new_ex(OSSL_LIB_CTX *libctx, const BIO_METHOD *method);
|
| 631 |
+
BIO *BIO_new(const BIO_METHOD *type);
|
| 632 |
+
int BIO_free(BIO *a);
|
| 633 |
+
void BIO_set_data(BIO *a, void *ptr);
|
| 634 |
+
void *BIO_get_data(BIO *a);
|
| 635 |
+
void BIO_set_init(BIO *a, int init);
|
| 636 |
+
int BIO_get_init(BIO *a);
|
| 637 |
+
void BIO_set_shutdown(BIO *a, int shut);
|
| 638 |
+
int BIO_get_shutdown(BIO *a);
|
| 639 |
+
void BIO_vfree(BIO *a);
|
| 640 |
+
int BIO_up_ref(BIO *a);
|
| 641 |
+
int BIO_read(BIO *b, void *data, int dlen);
|
| 642 |
+
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
|
| 643 |
+
int BIO_gets(BIO *bp, char *buf, int size);
|
| 644 |
+
int BIO_get_line(BIO *bio, char *buf, int size);
|
| 645 |
+
int BIO_write(BIO *b, const void *data, int dlen);
|
| 646 |
+
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
|
| 647 |
+
int BIO_puts(BIO *bp, const char *buf);
|
| 648 |
+
int BIO_indent(BIO *b, int indent, int max);
|
| 649 |
+
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
|
| 650 |
+
long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
|
| 651 |
+
void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
|
| 652 |
+
long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
|
| 653 |
+
BIO *BIO_push(BIO *b, BIO *append);
|
| 654 |
+
BIO *BIO_pop(BIO *b);
|
| 655 |
+
void BIO_free_all(BIO *a);
|
| 656 |
+
BIO *BIO_find_type(BIO *b, int bio_type);
|
| 657 |
+
BIO *BIO_next(BIO *b);
|
| 658 |
+
void BIO_set_next(BIO *b, BIO *next);
|
| 659 |
+
BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
|
| 660 |
+
int BIO_get_retry_reason(BIO *bio);
|
| 661 |
+
void BIO_set_retry_reason(BIO *bio, int reason);
|
| 662 |
+
BIO *BIO_dup_chain(BIO *in);
|
| 663 |
+
|
| 664 |
+
int BIO_nread0(BIO *bio, char **buf);
|
| 665 |
+
int BIO_nread(BIO *bio, char **buf, int num);
|
| 666 |
+
int BIO_nwrite0(BIO *bio, char **buf);
|
| 667 |
+
int BIO_nwrite(BIO *bio, char **buf, int num);
|
| 668 |
+
|
| 669 |
+
const BIO_METHOD *BIO_s_mem(void);
|
| 670 |
+
const BIO_METHOD *BIO_s_secmem(void);
|
| 671 |
+
BIO *BIO_new_mem_buf(const void *buf, int len);
|
| 672 |
+
# ifndef OPENSSL_NO_SOCK
|
| 673 |
+
const BIO_METHOD *BIO_s_socket(void);
|
| 674 |
+
const BIO_METHOD *BIO_s_connect(void);
|
| 675 |
+
const BIO_METHOD *BIO_s_accept(void);
|
| 676 |
+
# endif
|
| 677 |
+
const BIO_METHOD *BIO_s_fd(void);
|
| 678 |
+
const BIO_METHOD *BIO_s_log(void);
|
| 679 |
+
const BIO_METHOD *BIO_s_bio(void);
|
| 680 |
+
const BIO_METHOD *BIO_s_null(void);
|
| 681 |
+
const BIO_METHOD *BIO_f_null(void);
|
| 682 |
+
const BIO_METHOD *BIO_f_buffer(void);
|
| 683 |
+
const BIO_METHOD *BIO_f_readbuffer(void);
|
| 684 |
+
const BIO_METHOD *BIO_f_linebuffer(void);
|
| 685 |
+
const BIO_METHOD *BIO_f_nbio_test(void);
|
| 686 |
+
const BIO_METHOD *BIO_f_prefix(void);
|
| 687 |
+
const BIO_METHOD *BIO_s_core(void);
|
| 688 |
+
# ifndef OPENSSL_NO_DGRAM
|
| 689 |
+
const BIO_METHOD *BIO_s_datagram(void);
|
| 690 |
+
int BIO_dgram_non_fatal_error(int error);
|
| 691 |
+
BIO *BIO_new_dgram(int fd, int close_flag);
|
| 692 |
+
# ifndef OPENSSL_NO_SCTP
|
| 693 |
+
const BIO_METHOD *BIO_s_datagram_sctp(void);
|
| 694 |
+
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
|
| 695 |
+
int BIO_dgram_is_sctp(BIO *bio);
|
| 696 |
+
int BIO_dgram_sctp_notification_cb(BIO *b,
|
| 697 |
+
BIO_dgram_sctp_notification_handler_fn handle_notifications,
|
| 698 |
+
void *context);
|
| 699 |
+
int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
| 700 |
+
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
| 701 |
+
# endif
|
| 702 |
+
# endif
|
| 703 |
+
|
| 704 |
+
# ifndef OPENSSL_NO_SOCK
|
| 705 |
+
int BIO_sock_should_retry(int i);
|
| 706 |
+
int BIO_sock_non_fatal_error(int error);
|
| 707 |
+
int BIO_socket_wait(int fd, int for_read, time_t max_time);
|
| 708 |
+
# endif
|
| 709 |
+
int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds);
|
| 710 |
+
int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds);
|
| 711 |
+
|
| 712 |
+
int BIO_fd_should_retry(int i);
|
| 713 |
+
int BIO_fd_non_fatal_error(int error);
|
| 714 |
+
int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
|
| 715 |
+
void *u, const void *s, int len);
|
| 716 |
+
int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
| 717 |
+
void *u, const void *s, int len, int indent);
|
| 718 |
+
int BIO_dump(BIO *b, const void *bytes, int len);
|
| 719 |
+
int BIO_dump_indent(BIO *b, const void *bytes, int len, int indent);
|
| 720 |
+
# ifndef OPENSSL_NO_STDIO
|
| 721 |
+
int BIO_dump_fp(FILE *fp, const void *s, int len);
|
| 722 |
+
int BIO_dump_indent_fp(FILE *fp, const void *s, int len, int indent);
|
| 723 |
+
# endif
|
| 724 |
+
int BIO_hex_string(BIO *out, int indent, int width, const void *data,
|
| 725 |
+
int datalen);
|
| 726 |
+
|
| 727 |
+
# ifndef OPENSSL_NO_SOCK
|
| 728 |
+
BIO_ADDR *BIO_ADDR_new(void);
|
| 729 |
+
int BIO_ADDR_rawmake(BIO_ADDR *ap, int family,
|
| 730 |
+
const void *where, size_t wherelen, unsigned short port);
|
| 731 |
+
void BIO_ADDR_free(BIO_ADDR *);
|
| 732 |
+
void BIO_ADDR_clear(BIO_ADDR *ap);
|
| 733 |
+
int BIO_ADDR_family(const BIO_ADDR *ap);
|
| 734 |
+
int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l);
|
| 735 |
+
unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap);
|
| 736 |
+
char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric);
|
| 737 |
+
char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric);
|
| 738 |
+
char *BIO_ADDR_path_string(const BIO_ADDR *ap);
|
| 739 |
+
|
| 740 |
+
const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai);
|
| 741 |
+
int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai);
|
| 742 |
+
int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai);
|
| 743 |
+
int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai);
|
| 744 |
+
const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
|
| 745 |
+
void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
|
| 746 |
+
|
| 747 |
+
enum BIO_hostserv_priorities {
|
| 748 |
+
BIO_PARSE_PRIO_HOST, BIO_PARSE_PRIO_SERV
|
| 749 |
+
};
|
| 750 |
+
int BIO_parse_hostserv(const char *hostserv, char **host, char **service,
|
| 751 |
+
enum BIO_hostserv_priorities hostserv_prio);
|
| 752 |
+
enum BIO_lookup_type {
|
| 753 |
+
BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
|
| 754 |
+
};
|
| 755 |
+
int BIO_lookup(const char *host, const char *service,
|
| 756 |
+
enum BIO_lookup_type lookup_type,
|
| 757 |
+
int family, int socktype, BIO_ADDRINFO **res);
|
| 758 |
+
int BIO_lookup_ex(const char *host, const char *service,
|
| 759 |
+
int lookup_type, int family, int socktype, int protocol,
|
| 760 |
+
BIO_ADDRINFO **res);
|
| 761 |
+
int BIO_sock_error(int sock);
|
| 762 |
+
int BIO_socket_ioctl(int fd, long type, void *arg);
|
| 763 |
+
int BIO_socket_nbio(int fd, int mode);
|
| 764 |
+
int BIO_sock_init(void);
|
| 765 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 766 |
+
# define BIO_sock_cleanup() while(0) continue
|
| 767 |
+
# endif
|
| 768 |
+
int BIO_set_tcp_ndelay(int sock, int turn_on);
|
| 769 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 770 |
+
OSSL_DEPRECATEDIN_1_1_0 struct hostent *BIO_gethostbyname(const char *name);
|
| 771 |
+
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_port(const char *str, unsigned short *port_ptr);
|
| 772 |
+
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_host_ip(const char *str, unsigned char *ip);
|
| 773 |
+
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_accept_socket(char *host_port, int mode);
|
| 774 |
+
OSSL_DEPRECATEDIN_1_1_0 int BIO_accept(int sock, char **ip_port);
|
| 775 |
+
# endif
|
| 776 |
+
|
| 777 |
+
union BIO_sock_info_u {
|
| 778 |
+
BIO_ADDR *addr;
|
| 779 |
+
};
|
| 780 |
+
enum BIO_sock_info_type {
|
| 781 |
+
BIO_SOCK_INFO_ADDRESS
|
| 782 |
+
};
|
| 783 |
+
int BIO_sock_info(int sock,
|
| 784 |
+
enum BIO_sock_info_type type, union BIO_sock_info_u *info);
|
| 785 |
+
|
| 786 |
+
# define BIO_SOCK_REUSEADDR 0x01
|
| 787 |
+
# define BIO_SOCK_V6_ONLY 0x02
|
| 788 |
+
# define BIO_SOCK_KEEPALIVE 0x04
|
| 789 |
+
# define BIO_SOCK_NONBLOCK 0x08
|
| 790 |
+
# define BIO_SOCK_NODELAY 0x10
|
| 791 |
+
|
| 792 |
+
int BIO_socket(int domain, int socktype, int protocol, int options);
|
| 793 |
+
int BIO_connect(int sock, const BIO_ADDR *addr, int options);
|
| 794 |
+
int BIO_bind(int sock, const BIO_ADDR *addr, int options);
|
| 795 |
+
int BIO_listen(int sock, const BIO_ADDR *addr, int options);
|
| 796 |
+
int BIO_accept_ex(int accept_sock, BIO_ADDR *addr, int options);
|
| 797 |
+
int BIO_closesocket(int sock);
|
| 798 |
+
|
| 799 |
+
BIO *BIO_new_socket(int sock, int close_flag);
|
| 800 |
+
BIO *BIO_new_connect(const char *host_port);
|
| 801 |
+
BIO *BIO_new_accept(const char *host_port);
|
| 802 |
+
# endif /* OPENSSL_NO_SOCK*/
|
| 803 |
+
|
| 804 |
+
BIO *BIO_new_fd(int fd, int close_flag);
|
| 805 |
+
|
| 806 |
+
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
| 807 |
+
BIO **bio2, size_t writebuf2);
|
| 808 |
+
/*
|
| 809 |
+
* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
|
| 810 |
+
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
|
| 811 |
+
* value.
|
| 812 |
+
*/
|
| 813 |
+
|
| 814 |
+
void BIO_copy_next_retry(BIO *b);
|
| 815 |
+
|
| 816 |
+
/*
|
| 817 |
+
* long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
|
| 818 |
+
*/
|
| 819 |
+
|
| 820 |
+
# define ossl_bio__attr__(x)
|
| 821 |
+
# if defined(__GNUC__) && defined(__STDC_VERSION__) \
|
| 822 |
+
&& !defined(__MINGW32__) && !defined(__MINGW64__) \
|
| 823 |
+
&& !defined(__APPLE__)
|
| 824 |
+
/*
|
| 825 |
+
* Because we support the 'z' modifier, which made its appearance in C99,
|
| 826 |
+
* we can't use __attribute__ with pre C99 dialects.
|
| 827 |
+
*/
|
| 828 |
+
# if __STDC_VERSION__ >= 199901L
|
| 829 |
+
# undef ossl_bio__attr__
|
| 830 |
+
# define ossl_bio__attr__ __attribute__
|
| 831 |
+
# if __GNUC__*10 + __GNUC_MINOR__ >= 44
|
| 832 |
+
# define ossl_bio__printf__ __gnu_printf__
|
| 833 |
+
# else
|
| 834 |
+
# define ossl_bio__printf__ __printf__
|
| 835 |
+
# endif
|
| 836 |
+
# endif
|
| 837 |
+
# endif
|
| 838 |
+
int BIO_printf(BIO *bio, const char *format, ...)
|
| 839 |
+
ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 3)));
|
| 840 |
+
int BIO_vprintf(BIO *bio, const char *format, va_list args)
|
| 841 |
+
ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 0)));
|
| 842 |
+
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
|
| 843 |
+
ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 4)));
|
| 844 |
+
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
|
| 845 |
+
ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 0)));
|
| 846 |
+
# undef ossl_bio__attr__
|
| 847 |
+
# undef ossl_bio__printf__
|
| 848 |
+
|
| 849 |
+
|
| 850 |
+
BIO_METHOD *BIO_meth_new(int type, const char *name);
|
| 851 |
+
void BIO_meth_free(BIO_METHOD *biom);
|
| 852 |
+
int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int);
|
| 853 |
+
int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, size_t,
|
| 854 |
+
size_t *);
|
| 855 |
+
int BIO_meth_set_write(BIO_METHOD *biom,
|
| 856 |
+
int (*write) (BIO *, const char *, int));
|
| 857 |
+
int BIO_meth_set_write_ex(BIO_METHOD *biom,
|
| 858 |
+
int (*bwrite) (BIO *, const char *, size_t, size_t *));
|
| 859 |
+
int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int);
|
| 860 |
+
int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *);
|
| 861 |
+
int BIO_meth_set_read(BIO_METHOD *biom,
|
| 862 |
+
int (*read) (BIO *, char *, int));
|
| 863 |
+
int BIO_meth_set_read_ex(BIO_METHOD *biom,
|
| 864 |
+
int (*bread) (BIO *, char *, size_t, size_t *));
|
| 865 |
+
int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *);
|
| 866 |
+
int BIO_meth_set_puts(BIO_METHOD *biom,
|
| 867 |
+
int (*puts) (BIO *, const char *));
|
| 868 |
+
int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int);
|
| 869 |
+
int BIO_meth_set_gets(BIO_METHOD *biom,
|
| 870 |
+
int (*ossl_gets) (BIO *, char *, int));
|
| 871 |
+
long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *);
|
| 872 |
+
int BIO_meth_set_ctrl(BIO_METHOD *biom,
|
| 873 |
+
long (*ctrl) (BIO *, int, long, void *));
|
| 874 |
+
int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *);
|
| 875 |
+
int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *));
|
| 876 |
+
int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *);
|
| 877 |
+
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *));
|
| 878 |
+
long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))
|
| 879 |
+
(BIO *, int, BIO_info_cb *);
|
| 880 |
+
int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
|
| 881 |
+
long (*callback_ctrl) (BIO *, int,
|
| 882 |
+
BIO_info_cb *));
|
| 883 |
+
|
| 884 |
+
# ifdef __cplusplus
|
| 885 |
+
}
|
| 886 |
+
# endif
|
| 887 |
+
#endif
|
llava_next/include/openssl/bioerr.h
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_BIOERR_H
|
| 12 |
+
# define OPENSSL_BIOERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* BIO reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define BIO_R_ACCEPT_ERROR 100
|
| 25 |
+
# define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141
|
| 26 |
+
# define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129
|
| 27 |
+
# define BIO_R_BAD_FOPEN_MODE 101
|
| 28 |
+
# define BIO_R_BROKEN_PIPE 124
|
| 29 |
+
# define BIO_R_CONNECT_ERROR 103
|
| 30 |
+
# define BIO_R_CONNECT_TIMEOUT 147
|
| 31 |
+
# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
|
| 32 |
+
# define BIO_R_GETSOCKNAME_ERROR 132
|
| 33 |
+
# define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
|
| 34 |
+
# define BIO_R_GETTING_SOCKTYPE 134
|
| 35 |
+
# define BIO_R_INVALID_ARGUMENT 125
|
| 36 |
+
# define BIO_R_INVALID_SOCKET 135
|
| 37 |
+
# define BIO_R_IN_USE 123
|
| 38 |
+
# define BIO_R_LENGTH_TOO_LONG 102
|
| 39 |
+
# define BIO_R_LISTEN_V6_ONLY 136
|
| 40 |
+
# define BIO_R_LOOKUP_RETURNED_NOTHING 142
|
| 41 |
+
# define BIO_R_MALFORMED_HOST_OR_SERVICE 130
|
| 42 |
+
# define BIO_R_NBIO_CONNECT_ERROR 110
|
| 43 |
+
# define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
|
| 44 |
+
# define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
|
| 45 |
+
# define BIO_R_NO_PORT_DEFINED 113
|
| 46 |
+
# define BIO_R_NO_SUCH_FILE 128
|
| 47 |
+
# define BIO_R_NULL_PARAMETER 115 /* unused */
|
| 48 |
+
# define BIO_R_TRANSFER_ERROR 104
|
| 49 |
+
# define BIO_R_TRANSFER_TIMEOUT 105
|
| 50 |
+
# define BIO_R_UNABLE_TO_BIND_SOCKET 117
|
| 51 |
+
# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
|
| 52 |
+
# define BIO_R_UNABLE_TO_KEEPALIVE 137
|
| 53 |
+
# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
|
| 54 |
+
# define BIO_R_UNABLE_TO_NODELAY 138
|
| 55 |
+
# define BIO_R_UNABLE_TO_REUSEADDR 139
|
| 56 |
+
# define BIO_R_UNAVAILABLE_IP_FAMILY 145
|
| 57 |
+
# define BIO_R_UNINITIALIZED 120
|
| 58 |
+
# define BIO_R_UNKNOWN_INFO_TYPE 140
|
| 59 |
+
# define BIO_R_UNSUPPORTED_IP_FAMILY 146
|
| 60 |
+
# define BIO_R_UNSUPPORTED_METHOD 121
|
| 61 |
+
# define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
|
| 62 |
+
# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
|
| 63 |
+
# define BIO_R_WSASTARTUP 122
|
| 64 |
+
|
| 65 |
+
#endif
|
llava_next/include/openssl/buffer.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-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_BUFFER_H
|
| 11 |
+
# define OPENSSL_BUFFER_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_BUFFER_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/types.h>
|
| 20 |
+
# ifndef OPENSSL_CRYPTO_H
|
| 21 |
+
# include <openssl/crypto.h>
|
| 22 |
+
# endif
|
| 23 |
+
# include <openssl/buffererr.h>
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
# include <stddef.h>
|
| 31 |
+
# include <sys/types.h>
|
| 32 |
+
|
| 33 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 34 |
+
# define BUF_strdup(s) OPENSSL_strdup(s)
|
| 35 |
+
# define BUF_strndup(s, size) OPENSSL_strndup(s, size)
|
| 36 |
+
# define BUF_memdup(data, size) OPENSSL_memdup(data, size)
|
| 37 |
+
# define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
|
| 38 |
+
# define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
|
| 39 |
+
# define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
|
| 40 |
+
# endif
|
| 41 |
+
|
| 42 |
+
struct buf_mem_st {
|
| 43 |
+
size_t length; /* current number of bytes */
|
| 44 |
+
char *data;
|
| 45 |
+
size_t max; /* size of buffer */
|
| 46 |
+
unsigned long flags;
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
# define BUF_MEM_FLAG_SECURE 0x01
|
| 50 |
+
|
| 51 |
+
BUF_MEM *BUF_MEM_new(void);
|
| 52 |
+
BUF_MEM *BUF_MEM_new_ex(unsigned long flags);
|
| 53 |
+
void BUF_MEM_free(BUF_MEM *a);
|
| 54 |
+
size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
|
| 55 |
+
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
| 56 |
+
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
# ifdef __cplusplus
|
| 60 |
+
}
|
| 61 |
+
# endif
|
| 62 |
+
#endif
|
llava_next/include/openssl/cast.h
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CAST_H
|
| 11 |
+
# define OPENSSL_CAST_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_CAST_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_CAST
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
# define CAST_BLOCK 8
|
| 27 |
+
# define CAST_KEY_LENGTH 16
|
| 28 |
+
|
| 29 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 30 |
+
|
| 31 |
+
# define CAST_ENCRYPT 1
|
| 32 |
+
# define CAST_DECRYPT 0
|
| 33 |
+
|
| 34 |
+
# define CAST_LONG unsigned int
|
| 35 |
+
|
| 36 |
+
typedef struct cast_key_st {
|
| 37 |
+
CAST_LONG data[32];
|
| 38 |
+
int short_key; /* Use reduced rounds for short key */
|
| 39 |
+
} CAST_KEY;
|
| 40 |
+
|
| 41 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 42 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 43 |
+
OSSL_DEPRECATEDIN_3_0
|
| 44 |
+
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0
|
| 46 |
+
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
| 47 |
+
const CAST_KEY *key, int enc);
|
| 48 |
+
OSSL_DEPRECATEDIN_3_0
|
| 49 |
+
void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0
|
| 51 |
+
void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0
|
| 53 |
+
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
| 54 |
+
long length, const CAST_KEY *ks, unsigned char *iv,
|
| 55 |
+
int enc);
|
| 56 |
+
OSSL_DEPRECATEDIN_3_0
|
| 57 |
+
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
| 58 |
+
long length, const CAST_KEY *schedule,
|
| 59 |
+
unsigned char *ivec, int *num, int enc);
|
| 60 |
+
OSSL_DEPRECATEDIN_3_0
|
| 61 |
+
void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
| 62 |
+
long length, const CAST_KEY *schedule,
|
| 63 |
+
unsigned char *ivec, int *num);
|
| 64 |
+
# endif
|
| 65 |
+
|
| 66 |
+
# ifdef __cplusplus
|
| 67 |
+
}
|
| 68 |
+
# endif
|
| 69 |
+
# endif
|
| 70 |
+
|
| 71 |
+
#endif
|
llava_next/include/openssl/cmac.h
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2010-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_CMAC_H
|
| 11 |
+
# define OPENSSL_CMAC_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_CMAC_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# ifndef OPENSSL_NO_CMAC
|
| 20 |
+
|
| 21 |
+
# ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <openssl/evp.h>
|
| 26 |
+
|
| 27 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 28 |
+
/* Opaque */
|
| 29 |
+
typedef struct CMAC_CTX_st CMAC_CTX;
|
| 30 |
+
# endif
|
| 31 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 32 |
+
OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void);
|
| 33 |
+
OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_cleanup(CMAC_CTX *ctx);
|
| 34 |
+
OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_free(CMAC_CTX *ctx);
|
| 35 |
+
OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
|
| 36 |
+
OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
|
| 37 |
+
OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
|
| 38 |
+
const void *key, size_t keylen,
|
| 39 |
+
const EVP_CIPHER *cipher, ENGINE *impl);
|
| 40 |
+
OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
|
| 41 |
+
const void *data, size_t dlen);
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
|
| 43 |
+
unsigned char *out, size_t *poutlen);
|
| 44 |
+
OSSL_DEPRECATEDIN_3_0 int CMAC_resume(CMAC_CTX *ctx);
|
| 45 |
+
# endif
|
| 46 |
+
|
| 47 |
+
# ifdef __cplusplus
|
| 48 |
+
}
|
| 49 |
+
# endif
|
| 50 |
+
|
| 51 |
+
# endif
|
| 52 |
+
#endif
|
llava_next/include/openssl/cmp_util.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright Nokia 2007-2019
|
| 4 |
+
* Copyright Siemens AG 2015-2019
|
| 5 |
+
*
|
| 6 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 7 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 8 |
+
* in the file LICENSE in the source distribution or at
|
| 9 |
+
* https://www.openssl.org/source/license.html
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef OPENSSL_CMP_UTIL_H
|
| 13 |
+
# define OPENSSL_CMP_UTIL_H
|
| 14 |
+
# pragma once
|
| 15 |
+
|
| 16 |
+
# include <openssl/opensslconf.h>
|
| 17 |
+
# ifndef OPENSSL_NO_CMP
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# include <openssl/trace.h>
|
| 21 |
+
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
int OSSL_CMP_log_open(void);
|
| 27 |
+
void OSSL_CMP_log_close(void);
|
| 28 |
+
# define OSSL_CMP_LOG_PREFIX "CMP "
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
* generalized logging/error callback mirroring the severity levels of syslog.h
|
| 32 |
+
*/
|
| 33 |
+
typedef int OSSL_CMP_severity;
|
| 34 |
+
# define OSSL_CMP_LOG_EMERG 0
|
| 35 |
+
# define OSSL_CMP_LOG_ALERT 1
|
| 36 |
+
# define OSSL_CMP_LOG_CRIT 2
|
| 37 |
+
# define OSSL_CMP_LOG_ERR 3
|
| 38 |
+
# define OSSL_CMP_LOG_WARNING 4
|
| 39 |
+
# define OSSL_CMP_LOG_NOTICE 5
|
| 40 |
+
# define OSSL_CMP_LOG_INFO 6
|
| 41 |
+
# define OSSL_CMP_LOG_DEBUG 7
|
| 42 |
+
# define OSSL_CMP_LOG_TRACE 8
|
| 43 |
+
# define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE
|
| 44 |
+
typedef int (*OSSL_CMP_log_cb_t)(const char *func, const char *file, int line,
|
| 45 |
+
OSSL_CMP_severity level, const char *msg);
|
| 46 |
+
|
| 47 |
+
int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file,
|
| 48 |
+
int line, OSSL_CMP_severity level, const char *msg);
|
| 49 |
+
/* use of the logging callback for outputting error queue */
|
| 50 |
+
void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn);
|
| 51 |
+
|
| 52 |
+
# ifdef __cplusplus
|
| 53 |
+
}
|
| 54 |
+
# endif
|
| 55 |
+
# endif /* !defined(OPENSSL_NO_CMP) */
|
| 56 |
+
#endif /* !defined(OPENSSL_CMP_UTIL_H) */
|
llava_next/include/openssl/cms.h
ADDED
|
@@ -0,0 +1,493 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/cms.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2008-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 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CMS_H
|
| 16 |
+
# define OPENSSL_CMS_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CMS_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
|
| 26 |
+
# ifndef OPENSSL_NO_CMS
|
| 27 |
+
# include <openssl/x509.h>
|
| 28 |
+
# include <openssl/x509v3.h>
|
| 29 |
+
# include <openssl/cmserr.h>
|
| 30 |
+
# ifdef __cplusplus
|
| 31 |
+
extern "C" {
|
| 32 |
+
# endif
|
| 33 |
+
|
| 34 |
+
typedef struct CMS_ContentInfo_st CMS_ContentInfo;
|
| 35 |
+
typedef struct CMS_SignerInfo_st CMS_SignerInfo;
|
| 36 |
+
typedef struct CMS_CertificateChoices CMS_CertificateChoices;
|
| 37 |
+
typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
|
| 38 |
+
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
|
| 39 |
+
typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
|
| 40 |
+
typedef struct CMS_Receipt_st CMS_Receipt;
|
| 41 |
+
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
|
| 42 |
+
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
|
| 43 |
+
|
| 44 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_SignerInfo, CMS_SignerInfo, CMS_SignerInfo)
|
| 45 |
+
#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
| 46 |
+
#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
|
| 47 |
+
#define sk_CMS_SignerInfo_new(cmp) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new(ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
|
| 48 |
+
#define sk_CMS_SignerInfo_new_null() ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_null())
|
| 49 |
+
#define sk_CMS_SignerInfo_new_reserve(cmp, n) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_SignerInfo_compfunc_type(cmp), (n)))
|
| 50 |
+
#define sk_CMS_SignerInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_SignerInfo_sk_type(sk), (n))
|
| 51 |
+
#define sk_CMS_SignerInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 52 |
+
#define sk_CMS_SignerInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 53 |
+
#define sk_CMS_SignerInfo_delete(sk, i) ((CMS_SignerInfo *)OPENSSL_sk_delete(ossl_check_CMS_SignerInfo_sk_type(sk), (i)))
|
| 54 |
+
#define sk_CMS_SignerInfo_delete_ptr(sk, ptr) ((CMS_SignerInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)))
|
| 55 |
+
#define sk_CMS_SignerInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 56 |
+
#define sk_CMS_SignerInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 57 |
+
#define sk_CMS_SignerInfo_pop(sk) ((CMS_SignerInfo *)OPENSSL_sk_pop(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
| 58 |
+
#define sk_CMS_SignerInfo_shift(sk) ((CMS_SignerInfo *)OPENSSL_sk_shift(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
| 59 |
+
#define sk_CMS_SignerInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_SignerInfo_sk_type(sk),ossl_check_CMS_SignerInfo_freefunc_type(freefunc))
|
| 60 |
+
#define sk_CMS_SignerInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), (idx))
|
| 61 |
+
#define sk_CMS_SignerInfo_set(sk, idx, ptr) ((CMS_SignerInfo *)OPENSSL_sk_set(ossl_check_CMS_SignerInfo_sk_type(sk), (idx), ossl_check_CMS_SignerInfo_type(ptr)))
|
| 62 |
+
#define sk_CMS_SignerInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 63 |
+
#define sk_CMS_SignerInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 64 |
+
#define sk_CMS_SignerInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), pnum)
|
| 65 |
+
#define sk_CMS_SignerInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 66 |
+
#define sk_CMS_SignerInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
| 67 |
+
#define sk_CMS_SignerInfo_dup(sk) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_SignerInfo_sk_type(sk)))
|
| 68 |
+
#define sk_CMS_SignerInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_copyfunc_type(copyfunc), ossl_check_CMS_SignerInfo_freefunc_type(freefunc)))
|
| 69 |
+
#define sk_CMS_SignerInfo_set_cmp_func(sk, cmp) ((sk_CMS_SignerInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
|
| 70 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey)
|
| 71 |
+
#define sk_CMS_RecipientEncryptedKey_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 72 |
+
#define sk_CMS_RecipientEncryptedKey_value(sk, idx) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), (idx)))
|
| 73 |
+
#define sk_CMS_RecipientEncryptedKey_new(cmp) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
|
| 74 |
+
#define sk_CMS_RecipientEncryptedKey_new_null() ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_null())
|
| 75 |
+
#define sk_CMS_RecipientEncryptedKey_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp), (n)))
|
| 76 |
+
#define sk_CMS_RecipientEncryptedKey_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (n))
|
| 77 |
+
#define sk_CMS_RecipientEncryptedKey_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 78 |
+
#define sk_CMS_RecipientEncryptedKey_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 79 |
+
#define sk_CMS_RecipientEncryptedKey_delete(sk, i) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (i)))
|
| 80 |
+
#define sk_CMS_RecipientEncryptedKey_delete_ptr(sk, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
| 81 |
+
#define sk_CMS_RecipientEncryptedKey_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 82 |
+
#define sk_CMS_RecipientEncryptedKey_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 83 |
+
#define sk_CMS_RecipientEncryptedKey_pop(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_pop(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 84 |
+
#define sk_CMS_RecipientEncryptedKey_shift(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_shift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 85 |
+
#define sk_CMS_RecipientEncryptedKey_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk),ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc))
|
| 86 |
+
#define sk_CMS_RecipientEncryptedKey_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), (idx))
|
| 87 |
+
#define sk_CMS_RecipientEncryptedKey_set(sk, idx, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_set(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (idx), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
| 88 |
+
#define sk_CMS_RecipientEncryptedKey_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 89 |
+
#define sk_CMS_RecipientEncryptedKey_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 90 |
+
#define sk_CMS_RecipientEncryptedKey_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), pnum)
|
| 91 |
+
#define sk_CMS_RecipientEncryptedKey_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 92 |
+
#define sk_CMS_RecipientEncryptedKey_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 93 |
+
#define sk_CMS_RecipientEncryptedKey_dup(sk) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 94 |
+
#define sk_CMS_RecipientEncryptedKey_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_copyfunc_type(copyfunc), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc)))
|
| 95 |
+
#define sk_CMS_RecipientEncryptedKey_set_cmp_func(sk, cmp) ((sk_CMS_RecipientEncryptedKey_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
|
| 96 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientInfo, CMS_RecipientInfo, CMS_RecipientInfo)
|
| 97 |
+
#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
| 98 |
+
#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
|
| 99 |
+
#define sk_CMS_RecipientInfo_new(cmp) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new(ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
|
| 100 |
+
#define sk_CMS_RecipientInfo_new_null() ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_null())
|
| 101 |
+
#define sk_CMS_RecipientInfo_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientInfo_compfunc_type(cmp), (n)))
|
| 102 |
+
#define sk_CMS_RecipientInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientInfo_sk_type(sk), (n))
|
| 103 |
+
#define sk_CMS_RecipientInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 104 |
+
#define sk_CMS_RecipientInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 105 |
+
#define sk_CMS_RecipientInfo_delete(sk, i) ((CMS_RecipientInfo *)OPENSSL_sk_delete(ossl_check_CMS_RecipientInfo_sk_type(sk), (i)))
|
| 106 |
+
#define sk_CMS_RecipientInfo_delete_ptr(sk, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)))
|
| 107 |
+
#define sk_CMS_RecipientInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 108 |
+
#define sk_CMS_RecipientInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 109 |
+
#define sk_CMS_RecipientInfo_pop(sk) ((CMS_RecipientInfo *)OPENSSL_sk_pop(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
| 110 |
+
#define sk_CMS_RecipientInfo_shift(sk) ((CMS_RecipientInfo *)OPENSSL_sk_shift(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
| 111 |
+
#define sk_CMS_RecipientInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientInfo_sk_type(sk),ossl_check_CMS_RecipientInfo_freefunc_type(freefunc))
|
| 112 |
+
#define sk_CMS_RecipientInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), (idx))
|
| 113 |
+
#define sk_CMS_RecipientInfo_set(sk, idx, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_set(ossl_check_CMS_RecipientInfo_sk_type(sk), (idx), ossl_check_CMS_RecipientInfo_type(ptr)))
|
| 114 |
+
#define sk_CMS_RecipientInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 115 |
+
#define sk_CMS_RecipientInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 116 |
+
#define sk_CMS_RecipientInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), pnum)
|
| 117 |
+
#define sk_CMS_RecipientInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 118 |
+
#define sk_CMS_RecipientInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
| 119 |
+
#define sk_CMS_RecipientInfo_dup(sk) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientInfo_sk_type(sk)))
|
| 120 |
+
#define sk_CMS_RecipientInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_copyfunc_type(copyfunc), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc)))
|
| 121 |
+
#define sk_CMS_RecipientInfo_set_cmp_func(sk, cmp) ((sk_CMS_RecipientInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
|
| 122 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RevocationInfoChoice, CMS_RevocationInfoChoice, CMS_RevocationInfoChoice)
|
| 123 |
+
#define sk_CMS_RevocationInfoChoice_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
| 124 |
+
#define sk_CMS_RevocationInfoChoice_value(sk, idx) ((CMS_RevocationInfoChoice *)OPENSSL_sk_value(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), (idx)))
|
| 125 |
+
#define sk_CMS_RevocationInfoChoice_new(cmp) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
|
| 126 |
+
#define sk_CMS_RevocationInfoChoice_new_null() ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_null())
|
| 127 |
+
#define sk_CMS_RevocationInfoChoice_new_reserve(cmp, n) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp), (n)))
|
| 128 |
+
#define sk_CMS_RevocationInfoChoice_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (n))
|
| 129 |
+
#define sk_CMS_RevocationInfoChoice_free(sk) OPENSSL_sk_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 130 |
+
#define sk_CMS_RevocationInfoChoice_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 131 |
+
#define sk_CMS_RevocationInfoChoice_delete(sk, i) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (i)))
|
| 132 |
+
#define sk_CMS_RevocationInfoChoice_delete_ptr(sk, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
| 133 |
+
#define sk_CMS_RevocationInfoChoice_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 134 |
+
#define sk_CMS_RevocationInfoChoice_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 135 |
+
#define sk_CMS_RevocationInfoChoice_pop(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_pop(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 136 |
+
#define sk_CMS_RevocationInfoChoice_shift(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_shift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 137 |
+
#define sk_CMS_RevocationInfoChoice_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk),ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc))
|
| 138 |
+
#define sk_CMS_RevocationInfoChoice_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), (idx))
|
| 139 |
+
#define sk_CMS_RevocationInfoChoice_set(sk, idx, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_set(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (idx), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
| 140 |
+
#define sk_CMS_RevocationInfoChoice_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 141 |
+
#define sk_CMS_RevocationInfoChoice_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 142 |
+
#define sk_CMS_RevocationInfoChoice_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), pnum)
|
| 143 |
+
#define sk_CMS_RevocationInfoChoice_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 144 |
+
#define sk_CMS_RevocationInfoChoice_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
| 145 |
+
#define sk_CMS_RevocationInfoChoice_dup(sk) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_dup(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 146 |
+
#define sk_CMS_RevocationInfoChoice_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_copyfunc_type(copyfunc), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc)))
|
| 147 |
+
#define sk_CMS_RevocationInfoChoice_set_cmp_func(sk, cmp) ((sk_CMS_RevocationInfoChoice_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
|
| 151 |
+
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
|
| 152 |
+
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
| 153 |
+
|
| 154 |
+
CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 155 |
+
|
| 156 |
+
# define CMS_SIGNERINFO_ISSUER_SERIAL 0
|
| 157 |
+
# define CMS_SIGNERINFO_KEYIDENTIFIER 1
|
| 158 |
+
|
| 159 |
+
# define CMS_RECIPINFO_NONE -1
|
| 160 |
+
# define CMS_RECIPINFO_TRANS 0
|
| 161 |
+
# define CMS_RECIPINFO_AGREE 1
|
| 162 |
+
# define CMS_RECIPINFO_KEK 2
|
| 163 |
+
# define CMS_RECIPINFO_PASS 3
|
| 164 |
+
# define CMS_RECIPINFO_OTHER 4
|
| 165 |
+
|
| 166 |
+
/* S/MIME related flags */
|
| 167 |
+
|
| 168 |
+
# define CMS_TEXT 0x1
|
| 169 |
+
# define CMS_NOCERTS 0x2
|
| 170 |
+
# define CMS_NO_CONTENT_VERIFY 0x4
|
| 171 |
+
# define CMS_NO_ATTR_VERIFY 0x8
|
| 172 |
+
# define CMS_NOSIGS \
|
| 173 |
+
(CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
|
| 174 |
+
# define CMS_NOINTERN 0x10
|
| 175 |
+
# define CMS_NO_SIGNER_CERT_VERIFY 0x20
|
| 176 |
+
# define CMS_NOVERIFY 0x20
|
| 177 |
+
# define CMS_DETACHED 0x40
|
| 178 |
+
# define CMS_BINARY 0x80
|
| 179 |
+
# define CMS_NOATTR 0x100
|
| 180 |
+
# define CMS_NOSMIMECAP 0x200
|
| 181 |
+
# define CMS_NOOLDMIMETYPE 0x400
|
| 182 |
+
# define CMS_CRLFEOL 0x800
|
| 183 |
+
# define CMS_STREAM 0x1000
|
| 184 |
+
# define CMS_NOCRL 0x2000
|
| 185 |
+
# define CMS_PARTIAL 0x4000
|
| 186 |
+
# define CMS_REUSE_DIGEST 0x8000
|
| 187 |
+
# define CMS_USE_KEYID 0x10000
|
| 188 |
+
# define CMS_DEBUG_DECRYPT 0x20000
|
| 189 |
+
# define CMS_KEY_PARAM 0x40000
|
| 190 |
+
# define CMS_ASCIICRLF 0x80000
|
| 191 |
+
# define CMS_CADES 0x100000
|
| 192 |
+
# define CMS_USE_ORIGINATOR_KEYID 0x200000
|
| 193 |
+
|
| 194 |
+
const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
|
| 195 |
+
|
| 196 |
+
BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
|
| 197 |
+
int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
|
| 198 |
+
|
| 199 |
+
ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
|
| 200 |
+
int CMS_is_detached(CMS_ContentInfo *cms);
|
| 201 |
+
int CMS_set_detached(CMS_ContentInfo *cms, int detached);
|
| 202 |
+
|
| 203 |
+
# ifdef OPENSSL_PEM_H
|
| 204 |
+
DECLARE_PEM_rw(CMS, CMS_ContentInfo)
|
| 205 |
+
# endif
|
| 206 |
+
int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
|
| 207 |
+
CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
|
| 208 |
+
int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
|
| 209 |
+
|
| 210 |
+
BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
|
| 211 |
+
int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
|
| 212 |
+
int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
|
| 213 |
+
int flags);
|
| 214 |
+
CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
|
| 215 |
+
CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci);
|
| 216 |
+
int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
|
| 217 |
+
|
| 218 |
+
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
|
| 219 |
+
unsigned int flags);
|
| 220 |
+
|
| 221 |
+
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
|
| 222 |
+
STACK_OF(X509) *certs, BIO *data,
|
| 223 |
+
unsigned int flags);
|
| 224 |
+
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
|
| 225 |
+
STACK_OF(X509) *certs, BIO *data,
|
| 226 |
+
unsigned int flags, OSSL_LIB_CTX *ctx,
|
| 227 |
+
const char *propq);
|
| 228 |
+
|
| 229 |
+
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
|
| 230 |
+
X509 *signcert, EVP_PKEY *pkey,
|
| 231 |
+
STACK_OF(X509) *certs, unsigned int flags);
|
| 232 |
+
|
| 233 |
+
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
|
| 234 |
+
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
|
| 235 |
+
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
|
| 236 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 237 |
+
|
| 238 |
+
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
| 239 |
+
unsigned int flags);
|
| 240 |
+
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
|
| 241 |
+
unsigned int flags);
|
| 242 |
+
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
|
| 243 |
+
unsigned int flags, OSSL_LIB_CTX *ctx,
|
| 244 |
+
const char *propq);
|
| 245 |
+
|
| 246 |
+
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
|
| 247 |
+
const unsigned char *key, size_t keylen,
|
| 248 |
+
BIO *dcont, BIO *out, unsigned int flags);
|
| 249 |
+
|
| 250 |
+
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
|
| 251 |
+
const unsigned char *key,
|
| 252 |
+
size_t keylen, unsigned int flags);
|
| 253 |
+
CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
|
| 254 |
+
const unsigned char *key,
|
| 255 |
+
size_t keylen, unsigned int flags,
|
| 256 |
+
OSSL_LIB_CTX *ctx,
|
| 257 |
+
const char *propq);
|
| 258 |
+
|
| 259 |
+
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
|
| 260 |
+
const unsigned char *key, size_t keylen);
|
| 261 |
+
|
| 262 |
+
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
| 263 |
+
X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
|
| 264 |
+
|
| 265 |
+
int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
|
| 266 |
+
STACK_OF(X509) *certs,
|
| 267 |
+
X509_STORE *store, unsigned int flags);
|
| 268 |
+
|
| 269 |
+
STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
|
| 270 |
+
|
| 271 |
+
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
|
| 272 |
+
const EVP_CIPHER *cipher, unsigned int flags);
|
| 273 |
+
CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
| 274 |
+
const EVP_CIPHER *cipher, unsigned int flags,
|
| 275 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 276 |
+
|
| 277 |
+
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
|
| 278 |
+
BIO *dcont, BIO *out, unsigned int flags);
|
| 279 |
+
|
| 280 |
+
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
|
| 281 |
+
int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
|
| 282 |
+
X509 *cert, X509 *peer);
|
| 283 |
+
int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
|
| 284 |
+
unsigned char *key, size_t keylen,
|
| 285 |
+
const unsigned char *id, size_t idlen);
|
| 286 |
+
int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
|
| 287 |
+
unsigned char *pass, ossl_ssize_t passlen);
|
| 288 |
+
|
| 289 |
+
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
|
| 290 |
+
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
|
| 291 |
+
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
|
| 292 |
+
CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
|
| 293 |
+
CMS_ContentInfo *
|
| 294 |
+
CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *ctx,
|
| 295 |
+
const char *propq);
|
| 296 |
+
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
|
| 297 |
+
CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
|
| 298 |
+
OSSL_LIB_CTX *ctx,
|
| 299 |
+
const char *propq);
|
| 300 |
+
|
| 301 |
+
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
| 302 |
+
X509 *recip, unsigned int flags);
|
| 303 |
+
CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
|
| 304 |
+
EVP_PKEY *originatorPrivKey, X509 * originator, unsigned int flags);
|
| 305 |
+
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
|
| 306 |
+
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
| 307 |
+
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
|
| 308 |
+
EVP_PKEY **pk, X509 **recip,
|
| 309 |
+
X509_ALGOR **palg);
|
| 310 |
+
int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
|
| 311 |
+
ASN1_OCTET_STRING **keyid,
|
| 312 |
+
X509_NAME **issuer,
|
| 313 |
+
ASN1_INTEGER **sno);
|
| 314 |
+
|
| 315 |
+
CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
|
| 316 |
+
unsigned char *key, size_t keylen,
|
| 317 |
+
unsigned char *id, size_t idlen,
|
| 318 |
+
ASN1_GENERALIZEDTIME *date,
|
| 319 |
+
ASN1_OBJECT *otherTypeId,
|
| 320 |
+
ASN1_TYPE *otherType);
|
| 321 |
+
|
| 322 |
+
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
|
| 323 |
+
X509_ALGOR **palg,
|
| 324 |
+
ASN1_OCTET_STRING **pid,
|
| 325 |
+
ASN1_GENERALIZEDTIME **pdate,
|
| 326 |
+
ASN1_OBJECT **potherid,
|
| 327 |
+
ASN1_TYPE **pothertype);
|
| 328 |
+
|
| 329 |
+
int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
|
| 330 |
+
unsigned char *key, size_t keylen);
|
| 331 |
+
|
| 332 |
+
int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
|
| 333 |
+
const unsigned char *id, size_t idlen);
|
| 334 |
+
|
| 335 |
+
int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
|
| 336 |
+
unsigned char *pass,
|
| 337 |
+
ossl_ssize_t passlen);
|
| 338 |
+
|
| 339 |
+
CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
| 340 |
+
int iter, int wrap_nid,
|
| 341 |
+
int pbe_nid,
|
| 342 |
+
unsigned char *pass,
|
| 343 |
+
ossl_ssize_t passlen,
|
| 344 |
+
const EVP_CIPHER *kekciph);
|
| 345 |
+
|
| 346 |
+
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
| 347 |
+
int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
| 348 |
+
|
| 349 |
+
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
| 350 |
+
unsigned int flags);
|
| 351 |
+
CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
|
| 352 |
+
|
| 353 |
+
int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
|
| 354 |
+
const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
|
| 355 |
+
|
| 356 |
+
CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
|
| 357 |
+
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
|
| 358 |
+
int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
|
| 359 |
+
STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
|
| 360 |
+
|
| 361 |
+
CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
|
| 362 |
+
int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
| 363 |
+
int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
| 364 |
+
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
|
| 365 |
+
|
| 366 |
+
int CMS_SignedData_init(CMS_ContentInfo *cms);
|
| 367 |
+
CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
|
| 368 |
+
X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
|
| 369 |
+
unsigned int flags);
|
| 370 |
+
EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
|
| 371 |
+
EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
|
| 372 |
+
STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
|
| 373 |
+
|
| 374 |
+
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
|
| 375 |
+
int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
|
| 376 |
+
ASN1_OCTET_STRING **keyid,
|
| 377 |
+
X509_NAME **issuer, ASN1_INTEGER **sno);
|
| 378 |
+
int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
|
| 379 |
+
int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
| 380 |
+
unsigned int flags);
|
| 381 |
+
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
|
| 382 |
+
X509 **signer, X509_ALGOR **pdig,
|
| 383 |
+
X509_ALGOR **psig);
|
| 384 |
+
ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
|
| 385 |
+
int CMS_SignerInfo_sign(CMS_SignerInfo *si);
|
| 386 |
+
int CMS_SignerInfo_verify(CMS_SignerInfo *si);
|
| 387 |
+
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
|
| 388 |
+
|
| 389 |
+
int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
|
| 390 |
+
int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
|
| 391 |
+
int algnid, int keysize);
|
| 392 |
+
int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
|
| 393 |
+
|
| 394 |
+
int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
|
| 395 |
+
int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
|
| 396 |
+
int lastpos);
|
| 397 |
+
int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
|
| 398 |
+
int lastpos);
|
| 399 |
+
X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
|
| 400 |
+
X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
|
| 401 |
+
int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
|
| 402 |
+
int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
|
| 403 |
+
const ASN1_OBJECT *obj, int type,
|
| 404 |
+
const void *bytes, int len);
|
| 405 |
+
int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
|
| 406 |
+
int nid, int type,
|
| 407 |
+
const void *bytes, int len);
|
| 408 |
+
int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
|
| 409 |
+
const char *attrname, int type,
|
| 410 |
+
const void *bytes, int len);
|
| 411 |
+
void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
|
| 412 |
+
const ASN1_OBJECT *oid,
|
| 413 |
+
int lastpos, int type);
|
| 414 |
+
|
| 415 |
+
int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
|
| 416 |
+
int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
|
| 417 |
+
int lastpos);
|
| 418 |
+
int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
|
| 419 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 420 |
+
X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
|
| 421 |
+
X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
|
| 422 |
+
int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
|
| 423 |
+
int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
|
| 424 |
+
const ASN1_OBJECT *obj, int type,
|
| 425 |
+
const void *bytes, int len);
|
| 426 |
+
int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
|
| 427 |
+
int nid, int type,
|
| 428 |
+
const void *bytes, int len);
|
| 429 |
+
int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
|
| 430 |
+
const char *attrname, int type,
|
| 431 |
+
const void *bytes, int len);
|
| 432 |
+
void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
|
| 433 |
+
int lastpos, int type);
|
| 434 |
+
|
| 435 |
+
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
|
| 436 |
+
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
|
| 437 |
+
unsigned char *id, int idlen, int allorfirst,
|
| 438 |
+
STACK_OF(GENERAL_NAMES) *receiptList,
|
| 439 |
+
STACK_OF(GENERAL_NAMES) *receiptsTo);
|
| 440 |
+
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
|
| 441 |
+
unsigned char *id, int idlen, int allorfirst,
|
| 442 |
+
STACK_OF(GENERAL_NAMES) *receiptList,
|
| 443 |
+
STACK_OF(GENERAL_NAMES) *receiptsTo,
|
| 444 |
+
OSSL_LIB_CTX *ctx);
|
| 445 |
+
|
| 446 |
+
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
|
| 447 |
+
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
|
| 448 |
+
ASN1_STRING **pcid,
|
| 449 |
+
int *pallorfirst,
|
| 450 |
+
STACK_OF(GENERAL_NAMES) **plist,
|
| 451 |
+
STACK_OF(GENERAL_NAMES) **prto);
|
| 452 |
+
int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
|
| 453 |
+
X509_ALGOR **palg,
|
| 454 |
+
ASN1_OCTET_STRING **pukm);
|
| 455 |
+
STACK_OF(CMS_RecipientEncryptedKey)
|
| 456 |
+
*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
|
| 457 |
+
|
| 458 |
+
int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
|
| 459 |
+
X509_ALGOR **pubalg,
|
| 460 |
+
ASN1_BIT_STRING **pubkey,
|
| 461 |
+
ASN1_OCTET_STRING **keyid,
|
| 462 |
+
X509_NAME **issuer,
|
| 463 |
+
ASN1_INTEGER **sno);
|
| 464 |
+
|
| 465 |
+
int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
| 466 |
+
|
| 467 |
+
int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
|
| 468 |
+
ASN1_OCTET_STRING **keyid,
|
| 469 |
+
ASN1_GENERALIZEDTIME **tm,
|
| 470 |
+
CMS_OtherKeyAttribute **other,
|
| 471 |
+
X509_NAME **issuer, ASN1_INTEGER **sno);
|
| 472 |
+
int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
|
| 473 |
+
X509 *cert);
|
| 474 |
+
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
| 475 |
+
int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer);
|
| 476 |
+
EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
|
| 477 |
+
int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
|
| 478 |
+
CMS_RecipientInfo *ri,
|
| 479 |
+
CMS_RecipientEncryptedKey *rek);
|
| 480 |
+
|
| 481 |
+
int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
|
| 482 |
+
ASN1_OCTET_STRING *ukm, int keylen);
|
| 483 |
+
|
| 484 |
+
/* Backward compatibility for spelling errors. */
|
| 485 |
+
# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
|
| 486 |
+
# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
|
| 487 |
+
CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
|
| 488 |
+
|
| 489 |
+
# ifdef __cplusplus
|
| 490 |
+
}
|
| 491 |
+
# endif
|
| 492 |
+
# endif
|
| 493 |
+
#endif
|
llava_next/include/openssl/cmserr.h
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CMSERR_H
|
| 12 |
+
# define OPENSSL_CMSERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# ifndef OPENSSL_NO_CMS
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* CMS reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define CMS_R_ADD_SIGNER_ERROR 99
|
| 27 |
+
# define CMS_R_ATTRIBUTE_ERROR 161
|
| 28 |
+
# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
|
| 29 |
+
# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
|
| 30 |
+
# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
|
| 31 |
+
# define CMS_R_CIPHER_AEAD_SET_TAG_ERROR 184
|
| 32 |
+
# define CMS_R_CIPHER_GET_TAG 185
|
| 33 |
+
# define CMS_R_CIPHER_INITIALISATION_ERROR 101
|
| 34 |
+
# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
|
| 35 |
+
# define CMS_R_CMS_DATAFINAL_ERROR 103
|
| 36 |
+
# define CMS_R_CMS_LIB 104
|
| 37 |
+
# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
|
| 38 |
+
# define CMS_R_CONTENT_NOT_FOUND 105
|
| 39 |
+
# define CMS_R_CONTENT_TYPE_MISMATCH 171
|
| 40 |
+
# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
|
| 41 |
+
# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
|
| 42 |
+
# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
|
| 43 |
+
# define CMS_R_CONTENT_VERIFY_ERROR 109
|
| 44 |
+
# define CMS_R_CTRL_ERROR 110
|
| 45 |
+
# define CMS_R_CTRL_FAILURE 111
|
| 46 |
+
# define CMS_R_DECODE_ERROR 187
|
| 47 |
+
# define CMS_R_DECRYPT_ERROR 112
|
| 48 |
+
# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
|
| 49 |
+
# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
|
| 50 |
+
# define CMS_R_ERROR_SETTING_KEY 115
|
| 51 |
+
# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
|
| 52 |
+
# define CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT 196
|
| 53 |
+
# define CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR 183
|
| 54 |
+
# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
|
| 55 |
+
# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
|
| 56 |
+
# define CMS_R_INVALID_KEY_LENGTH 118
|
| 57 |
+
# define CMS_R_INVALID_LABEL 190
|
| 58 |
+
# define CMS_R_INVALID_OAEP_PARAMETERS 191
|
| 59 |
+
# define CMS_R_KDF_PARAMETER_ERROR 186
|
| 60 |
+
# define CMS_R_MD_BIO_INIT_ERROR 119
|
| 61 |
+
# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
|
| 62 |
+
# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
|
| 63 |
+
# define CMS_R_MSGSIGDIGEST_ERROR 172
|
| 64 |
+
# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
|
| 65 |
+
# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
|
| 66 |
+
# define CMS_R_NEED_ONE_SIGNER 164
|
| 67 |
+
# define CMS_R_NOT_A_SIGNED_RECEIPT 165
|
| 68 |
+
# define CMS_R_NOT_ENCRYPTED_DATA 122
|
| 69 |
+
# define CMS_R_NOT_KEK 123
|
| 70 |
+
# define CMS_R_NOT_KEY_AGREEMENT 181
|
| 71 |
+
# define CMS_R_NOT_KEY_TRANSPORT 124
|
| 72 |
+
# define CMS_R_NOT_PWRI 177
|
| 73 |
+
# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
|
| 74 |
+
# define CMS_R_NO_CIPHER 126
|
| 75 |
+
# define CMS_R_NO_CONTENT 127
|
| 76 |
+
# define CMS_R_NO_CONTENT_TYPE 173
|
| 77 |
+
# define CMS_R_NO_DEFAULT_DIGEST 128
|
| 78 |
+
# define CMS_R_NO_DIGEST_SET 129
|
| 79 |
+
# define CMS_R_NO_KEY 130
|
| 80 |
+
# define CMS_R_NO_KEY_OR_CERT 174
|
| 81 |
+
# define CMS_R_NO_MATCHING_DIGEST 131
|
| 82 |
+
# define CMS_R_NO_MATCHING_RECIPIENT 132
|
| 83 |
+
# define CMS_R_NO_MATCHING_SIGNATURE 166
|
| 84 |
+
# define CMS_R_NO_MSGSIGDIGEST 167
|
| 85 |
+
# define CMS_R_NO_PASSWORD 178
|
| 86 |
+
# define CMS_R_NO_PRIVATE_KEY 133
|
| 87 |
+
# define CMS_R_NO_PUBLIC_KEY 134
|
| 88 |
+
# define CMS_R_NO_RECEIPT_REQUEST 168
|
| 89 |
+
# define CMS_R_NO_SIGNERS 135
|
| 90 |
+
# define CMS_R_PEER_KEY_ERROR 188
|
| 91 |
+
# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
|
| 92 |
+
# define CMS_R_RECEIPT_DECODE_ERROR 169
|
| 93 |
+
# define CMS_R_RECIPIENT_ERROR 137
|
| 94 |
+
# define CMS_R_SHARED_INFO_ERROR 189
|
| 95 |
+
# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
|
| 96 |
+
# define CMS_R_SIGNFINAL_ERROR 139
|
| 97 |
+
# define CMS_R_SMIME_TEXT_ERROR 140
|
| 98 |
+
# define CMS_R_STORE_INIT_ERROR 141
|
| 99 |
+
# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
|
| 100 |
+
# define CMS_R_TYPE_NOT_DATA 143
|
| 101 |
+
# define CMS_R_TYPE_NOT_DIGESTED_DATA 144
|
| 102 |
+
# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
|
| 103 |
+
# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
|
| 104 |
+
# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
|
| 105 |
+
# define CMS_R_UNKNOWN_CIPHER 148
|
| 106 |
+
# define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149
|
| 107 |
+
# define CMS_R_UNKNOWN_ID 150
|
| 108 |
+
# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
|
| 109 |
+
# define CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM 194
|
| 110 |
+
# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
|
| 111 |
+
# define CMS_R_UNSUPPORTED_ENCRYPTION_TYPE 192
|
| 112 |
+
# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
|
| 113 |
+
# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
|
| 114 |
+
# define CMS_R_UNSUPPORTED_LABEL_SOURCE 193
|
| 115 |
+
# define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155
|
| 116 |
+
# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
|
| 117 |
+
# define CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM 195
|
| 118 |
+
# define CMS_R_UNSUPPORTED_TYPE 156
|
| 119 |
+
# define CMS_R_UNWRAP_ERROR 157
|
| 120 |
+
# define CMS_R_UNWRAP_FAILURE 180
|
| 121 |
+
# define CMS_R_VERIFICATION_FAILURE 158
|
| 122 |
+
# define CMS_R_WRAP_ERROR 159
|
| 123 |
+
|
| 124 |
+
# endif
|
| 125 |
+
#endif
|
llava_next/include/openssl/comp.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2015-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_COMP_H
|
| 11 |
+
# define OPENSSL_COMP_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_COMP_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_COMP
|
| 22 |
+
# include <openssl/crypto.h>
|
| 23 |
+
# include <openssl/comperr.h>
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
|
| 31 |
+
const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
|
| 32 |
+
int COMP_CTX_get_type(const COMP_CTX* comp);
|
| 33 |
+
int COMP_get_type(const COMP_METHOD *meth);
|
| 34 |
+
const char *COMP_get_name(const COMP_METHOD *meth);
|
| 35 |
+
void COMP_CTX_free(COMP_CTX *ctx);
|
| 36 |
+
|
| 37 |
+
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
| 38 |
+
unsigned char *in, int ilen);
|
| 39 |
+
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
| 40 |
+
unsigned char *in, int ilen);
|
| 41 |
+
|
| 42 |
+
COMP_METHOD *COMP_zlib(void);
|
| 43 |
+
|
| 44 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 45 |
+
# define COMP_zlib_cleanup() while(0) continue
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
# ifdef OPENSSL_BIO_H
|
| 49 |
+
# ifdef ZLIB
|
| 50 |
+
const BIO_METHOD *BIO_f_zlib(void);
|
| 51 |
+
# endif
|
| 52 |
+
# endif
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
# ifdef __cplusplus
|
| 56 |
+
}
|
| 57 |
+
# endif
|
| 58 |
+
# endif
|
| 59 |
+
#endif
|
llava_next/include/openssl/conf.h
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/conf.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 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CONF_H
|
| 16 |
+
# define OPENSSL_CONF_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CONF_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/bio.h>
|
| 25 |
+
# include <openssl/lhash.h>
|
| 26 |
+
# include <openssl/safestack.h>
|
| 27 |
+
# include <openssl/e_os2.h>
|
| 28 |
+
# include <openssl/types.h>
|
| 29 |
+
# include <openssl/conferr.h>
|
| 30 |
+
|
| 31 |
+
#ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
typedef struct {
|
| 36 |
+
char *section;
|
| 37 |
+
char *name;
|
| 38 |
+
char *value;
|
| 39 |
+
} CONF_VALUE;
|
| 40 |
+
|
| 41 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE)
|
| 42 |
+
#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
|
| 43 |
+
#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
|
| 44 |
+
#define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
| 45 |
+
#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
|
| 46 |
+
#define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n)))
|
| 47 |
+
#define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n))
|
| 48 |
+
#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
|
| 49 |
+
#define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk))
|
| 50 |
+
#define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i)))
|
| 51 |
+
#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
|
| 52 |
+
#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 53 |
+
#define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 54 |
+
#define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk)))
|
| 55 |
+
#define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk)))
|
| 56 |
+
#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc))
|
| 57 |
+
#define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx))
|
| 58 |
+
#define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr)))
|
| 59 |
+
#define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 60 |
+
#define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 61 |
+
#define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum)
|
| 62 |
+
#define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk))
|
| 63 |
+
#define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk))
|
| 64 |
+
#define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk)))
|
| 65 |
+
#define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc)))
|
| 66 |
+
#define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
| 67 |
+
DEFINE_LHASH_OF_INTERNAL(CONF_VALUE);
|
| 68 |
+
#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)))
|
| 69 |
+
#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
|
| 70 |
+
#define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh))
|
| 71 |
+
#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
|
| 72 |
+
#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
| 73 |
+
#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
| 74 |
+
#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
|
| 75 |
+
#define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh))
|
| 76 |
+
#define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 77 |
+
#define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 78 |
+
#define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 79 |
+
#define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh))
|
| 80 |
+
#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
|
| 81 |
+
#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
struct conf_st;
|
| 85 |
+
struct conf_method_st;
|
| 86 |
+
typedef struct conf_method_st CONF_METHOD;
|
| 87 |
+
|
| 88 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 89 |
+
# include <openssl/conftypes.h>
|
| 90 |
+
# endif
|
| 91 |
+
|
| 92 |
+
/* Module definitions */
|
| 93 |
+
typedef struct conf_imodule_st CONF_IMODULE;
|
| 94 |
+
typedef struct conf_module_st CONF_MODULE;
|
| 95 |
+
|
| 96 |
+
STACK_OF(CONF_MODULE);
|
| 97 |
+
STACK_OF(CONF_IMODULE);
|
| 98 |
+
|
| 99 |
+
/* DSO module function typedefs */
|
| 100 |
+
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
|
| 101 |
+
typedef void conf_finish_func (CONF_IMODULE *md);
|
| 102 |
+
|
| 103 |
+
# define CONF_MFLAGS_IGNORE_ERRORS 0x1
|
| 104 |
+
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
|
| 105 |
+
# define CONF_MFLAGS_SILENT 0x4
|
| 106 |
+
# define CONF_MFLAGS_NO_DSO 0x8
|
| 107 |
+
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
|
| 108 |
+
# define CONF_MFLAGS_DEFAULT_SECTION 0x20
|
| 109 |
+
|
| 110 |
+
int CONF_set_default_method(CONF_METHOD *meth);
|
| 111 |
+
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
|
| 112 |
+
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
|
| 113 |
+
long *eline);
|
| 114 |
+
# ifndef OPENSSL_NO_STDIO
|
| 115 |
+
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
|
| 116 |
+
long *eline);
|
| 117 |
+
# endif
|
| 118 |
+
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
|
| 119 |
+
long *eline);
|
| 120 |
+
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
|
| 121 |
+
const char *section);
|
| 122 |
+
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
| 123 |
+
const char *name);
|
| 124 |
+
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
| 125 |
+
const char *name);
|
| 126 |
+
void CONF_free(LHASH_OF(CONF_VALUE) *conf);
|
| 127 |
+
#ifndef OPENSSL_NO_STDIO
|
| 128 |
+
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
|
| 129 |
+
#endif
|
| 130 |
+
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
|
| 131 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 132 |
+
OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
|
| 133 |
+
#endif
|
| 134 |
+
|
| 135 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 136 |
+
# define OPENSSL_no_config() \
|
| 137 |
+
OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
|
| 138 |
+
#endif
|
| 139 |
+
|
| 140 |
+
/*
|
| 141 |
+
* New conf code. The semantics are different from the functions above. If
|
| 142 |
+
* that wasn't the case, the above functions would have been replaced
|
| 143 |
+
*/
|
| 144 |
+
|
| 145 |
+
CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
|
| 146 |
+
OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
|
| 147 |
+
CONF *NCONF_new(CONF_METHOD *meth);
|
| 148 |
+
CONF_METHOD *NCONF_default(void);
|
| 149 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 150 |
+
OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
|
| 151 |
+
#endif
|
| 152 |
+
void NCONF_free(CONF *conf);
|
| 153 |
+
void NCONF_free_data(CONF *conf);
|
| 154 |
+
|
| 155 |
+
int NCONF_load(CONF *conf, const char *file, long *eline);
|
| 156 |
+
# ifndef OPENSSL_NO_STDIO
|
| 157 |
+
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
|
| 158 |
+
# endif
|
| 159 |
+
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
|
| 160 |
+
STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
|
| 161 |
+
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
|
| 162 |
+
const char *section);
|
| 163 |
+
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
|
| 164 |
+
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
|
| 165 |
+
long *result);
|
| 166 |
+
#ifndef OPENSSL_NO_STDIO
|
| 167 |
+
int NCONF_dump_fp(const CONF *conf, FILE *out);
|
| 168 |
+
#endif
|
| 169 |
+
int NCONF_dump_bio(const CONF *conf, BIO *out);
|
| 170 |
+
|
| 171 |
+
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
|
| 172 |
+
|
| 173 |
+
/* Module functions */
|
| 174 |
+
|
| 175 |
+
int CONF_modules_load(const CONF *cnf, const char *appname,
|
| 176 |
+
unsigned long flags);
|
| 177 |
+
int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
| 178 |
+
const char *appname, unsigned long flags);
|
| 179 |
+
int CONF_modules_load_file(const char *filename, const char *appname,
|
| 180 |
+
unsigned long flags);
|
| 181 |
+
void CONF_modules_unload(int all);
|
| 182 |
+
void CONF_modules_finish(void);
|
| 183 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 184 |
+
# define CONF_modules_free() while(0) continue
|
| 185 |
+
#endif
|
| 186 |
+
int CONF_module_add(const char *name, conf_init_func *ifunc,
|
| 187 |
+
conf_finish_func *ffunc);
|
| 188 |
+
|
| 189 |
+
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
|
| 190 |
+
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
|
| 191 |
+
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
|
| 192 |
+
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
|
| 193 |
+
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
|
| 194 |
+
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
|
| 195 |
+
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
|
| 196 |
+
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
|
| 197 |
+
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
|
| 198 |
+
|
| 199 |
+
char *CONF_get1_default_config_file(void);
|
| 200 |
+
|
| 201 |
+
int CONF_parse_list(const char *list, int sep, int nospc,
|
| 202 |
+
int (*list_cb) (const char *elem, int len, void *usr),
|
| 203 |
+
void *arg);
|
| 204 |
+
|
| 205 |
+
void OPENSSL_load_builtin_modules(void);
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
# ifdef __cplusplus
|
| 209 |
+
}
|
| 210 |
+
# endif
|
| 211 |
+
#endif
|
llava_next/include/openssl/conftypes.h
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-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_CONFTYPES_H
|
| 11 |
+
# define OPENSSL_CONFTYPES_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
#ifndef OPENSSL_CONF_H
|
| 15 |
+
# include <openssl/conf.h>
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* The contents of this file are deprecated and will be made opaque
|
| 20 |
+
*/
|
| 21 |
+
struct conf_method_st {
|
| 22 |
+
const char *name;
|
| 23 |
+
CONF *(*create) (CONF_METHOD *meth);
|
| 24 |
+
int (*init) (CONF *conf);
|
| 25 |
+
int (*destroy) (CONF *conf);
|
| 26 |
+
int (*destroy_data) (CONF *conf);
|
| 27 |
+
int (*load_bio) (CONF *conf, BIO *bp, long *eline);
|
| 28 |
+
int (*dump) (const CONF *conf, BIO *bp);
|
| 29 |
+
int (*is_number) (const CONF *conf, char c);
|
| 30 |
+
int (*to_int) (const CONF *conf, char c);
|
| 31 |
+
int (*load) (CONF *conf, const char *name, long *eline);
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
struct conf_st {
|
| 35 |
+
CONF_METHOD *meth;
|
| 36 |
+
void *meth_data;
|
| 37 |
+
LHASH_OF(CONF_VALUE) *data;
|
| 38 |
+
int flag_dollarid;
|
| 39 |
+
int flag_abspath;
|
| 40 |
+
char *includedir;
|
| 41 |
+
OSSL_LIB_CTX *libctx;
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
#endif
|
llava_next/include/openssl/core.h
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CORE_H
|
| 11 |
+
# define OPENSSL_CORE_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <stddef.h>
|
| 15 |
+
# include <openssl/types.h>
|
| 16 |
+
|
| 17 |
+
# ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
/*-
|
| 22 |
+
* Base types
|
| 23 |
+
* ----------
|
| 24 |
+
*
|
| 25 |
+
* These are the types that the OpenSSL core and providers have in common
|
| 26 |
+
* to communicate data between them.
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
/* Opaque handles to be used with core upcall functions from providers */
|
| 30 |
+
typedef struct ossl_core_handle_st OSSL_CORE_HANDLE;
|
| 31 |
+
typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX;
|
| 32 |
+
typedef struct ossl_core_bio_st OSSL_CORE_BIO;
|
| 33 |
+
|
| 34 |
+
/*
|
| 35 |
+
* Dispatch table element. function_id numbers and the functions are defined
|
| 36 |
+
* in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names.
|
| 37 |
+
*
|
| 38 |
+
* An array of these is always terminated by function_id == 0
|
| 39 |
+
*/
|
| 40 |
+
struct ossl_dispatch_st {
|
| 41 |
+
int function_id;
|
| 42 |
+
void (*function)(void);
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
/*
|
| 46 |
+
* Other items, essentially an int<->pointer map element.
|
| 47 |
+
*
|
| 48 |
+
* We make this type distinct from OSSL_DISPATCH to ensure that dispatch
|
| 49 |
+
* tables remain tables with function pointers only.
|
| 50 |
+
*
|
| 51 |
+
* This is used whenever we need to pass things like a table of error reason
|
| 52 |
+
* codes <-> reason string maps, ...
|
| 53 |
+
*
|
| 54 |
+
* Usage determines which field works as key if any, rather than field order.
|
| 55 |
+
*
|
| 56 |
+
* An array of these is always terminated by id == 0 && ptr == NULL
|
| 57 |
+
*/
|
| 58 |
+
struct ossl_item_st {
|
| 59 |
+
unsigned int id;
|
| 60 |
+
void *ptr;
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Type to tie together algorithm names, property definition string and
|
| 65 |
+
* the algorithm implementation in the form of a dispatch table.
|
| 66 |
+
*
|
| 67 |
+
* An array of these is always terminated by algorithm_names == NULL
|
| 68 |
+
*/
|
| 69 |
+
struct ossl_algorithm_st {
|
| 70 |
+
const char *algorithm_names; /* key */
|
| 71 |
+
const char *property_definition; /* key */
|
| 72 |
+
const OSSL_DISPATCH *implementation;
|
| 73 |
+
const char *algorithm_description;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
/*
|
| 77 |
+
* Type to pass object data in a uniform way, without exposing the object
|
| 78 |
+
* structure.
|
| 79 |
+
*
|
| 80 |
+
* An array of these is always terminated by key == NULL
|
| 81 |
+
*/
|
| 82 |
+
struct ossl_param_st {
|
| 83 |
+
const char *key; /* the name of the parameter */
|
| 84 |
+
unsigned int data_type; /* declare what kind of content is in buffer */
|
| 85 |
+
void *data; /* value being passed in or out */
|
| 86 |
+
size_t data_size; /* data size */
|
| 87 |
+
size_t return_size; /* returned content size */
|
| 88 |
+
};
|
| 89 |
+
|
| 90 |
+
/* Currently supported OSSL_PARAM data types */
|
| 91 |
+
/*
|
| 92 |
+
* OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER
|
| 93 |
+
* are arbitrary length and therefore require an arbitrarily sized buffer,
|
| 94 |
+
* since they may be used to pass numbers larger than what is natively
|
| 95 |
+
* available.
|
| 96 |
+
*
|
| 97 |
+
* The number must be buffered in native form, i.e. MSB first on B_ENDIAN
|
| 98 |
+
* systems and LSB first on L_ENDIAN systems. This means that arbitrary
|
| 99 |
+
* native integers can be stored in the buffer, just make sure that the
|
| 100 |
+
* buffer size is correct and the buffer itself is properly aligned (for
|
| 101 |
+
* example by having the buffer field point at a C integer).
|
| 102 |
+
*/
|
| 103 |
+
# define OSSL_PARAM_INTEGER 1
|
| 104 |
+
# define OSSL_PARAM_UNSIGNED_INTEGER 2
|
| 105 |
+
/*-
|
| 106 |
+
* OSSL_PARAM_REAL
|
| 107 |
+
* is a C binary floating point values in native form and alignment.
|
| 108 |
+
*/
|
| 109 |
+
# define OSSL_PARAM_REAL 3
|
| 110 |
+
/*-
|
| 111 |
+
* OSSL_PARAM_UTF8_STRING
|
| 112 |
+
* is a printable string. It is expected to be printed as it is.
|
| 113 |
+
*/
|
| 114 |
+
# define OSSL_PARAM_UTF8_STRING 4
|
| 115 |
+
/*-
|
| 116 |
+
* OSSL_PARAM_OCTET_STRING
|
| 117 |
+
* is a string of bytes with no further specification. It is expected to be
|
| 118 |
+
* printed as a hexdump.
|
| 119 |
+
*/
|
| 120 |
+
# define OSSL_PARAM_OCTET_STRING 5
|
| 121 |
+
/*-
|
| 122 |
+
* OSSL_PARAM_UTF8_PTR
|
| 123 |
+
* is a pointer to a printable string. It is expected to be printed as it is.
|
| 124 |
+
*
|
| 125 |
+
* The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers
|
| 126 |
+
* are manipulated for this type.
|
| 127 |
+
*
|
| 128 |
+
* This is more relevant for parameter requests, where the responding
|
| 129 |
+
* function doesn't need to copy the data to the provided buffer, but
|
| 130 |
+
* sets the provided buffer to point at the actual data instead.
|
| 131 |
+
*
|
| 132 |
+
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
| 133 |
+
* data and its location are constant.
|
| 134 |
+
*
|
| 135 |
+
* EXTRA WARNING! If you are not completely sure you most likely want
|
| 136 |
+
* to use the OSSL_PARAM_UTF8_STRING type.
|
| 137 |
+
*/
|
| 138 |
+
# define OSSL_PARAM_UTF8_PTR 6
|
| 139 |
+
/*-
|
| 140 |
+
* OSSL_PARAM_OCTET_PTR
|
| 141 |
+
* is a pointer to a string of bytes with no further specification. It is
|
| 142 |
+
* expected to be printed as a hexdump.
|
| 143 |
+
*
|
| 144 |
+
* The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers
|
| 145 |
+
* are manipulated for this type.
|
| 146 |
+
*
|
| 147 |
+
* This is more relevant for parameter requests, where the responding
|
| 148 |
+
* function doesn't need to copy the data to the provided buffer, but
|
| 149 |
+
* sets the provided buffer to point at the actual data instead.
|
| 150 |
+
*
|
| 151 |
+
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
| 152 |
+
* data and its location are constant.
|
| 153 |
+
*
|
| 154 |
+
* EXTRA WARNING! If you are not completely sure you most likely want
|
| 155 |
+
* to use the OSSL_PARAM_OCTET_STRING type.
|
| 156 |
+
*/
|
| 157 |
+
# define OSSL_PARAM_OCTET_PTR 7
|
| 158 |
+
|
| 159 |
+
/*
|
| 160 |
+
* Typedef for the thread stop handling callback. Used both internally and by
|
| 161 |
+
* providers.
|
| 162 |
+
*
|
| 163 |
+
* Providers may register for notifications about threads stopping by
|
| 164 |
+
* registering a callback to hear about such events. Providers register the
|
| 165 |
+
* callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch
|
| 166 |
+
* table passed to OSSL_provider_init(). The arg passed back to a provider will
|
| 167 |
+
* be the provider side context object.
|
| 168 |
+
*/
|
| 169 |
+
typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
/*-
|
| 173 |
+
* Provider entry point
|
| 174 |
+
* --------------------
|
| 175 |
+
*
|
| 176 |
+
* This function is expected to be present in any dynamically loadable
|
| 177 |
+
* provider module. By definition, if this function doesn't exist in a
|
| 178 |
+
* module, that module is not an OpenSSL provider module.
|
| 179 |
+
*/
|
| 180 |
+
/*-
|
| 181 |
+
* |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used
|
| 182 |
+
* together with some functions passed via |in| to query data.
|
| 183 |
+
* |in| is the array of functions that the Core passes to the provider.
|
| 184 |
+
* |out| will be the array of base functions that the provider passes
|
| 185 |
+
* back to the Core.
|
| 186 |
+
* |provctx| a provider side context object, optionally created if the
|
| 187 |
+
* provider needs it. This value is passed to other provider
|
| 188 |
+
* functions, notably other context constructors.
|
| 189 |
+
*/
|
| 190 |
+
typedef int (OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle,
|
| 191 |
+
const OSSL_DISPATCH *in,
|
| 192 |
+
const OSSL_DISPATCH **out,
|
| 193 |
+
void **provctx);
|
| 194 |
+
# ifdef __VMS
|
| 195 |
+
# pragma names save
|
| 196 |
+
# pragma names uppercase,truncated
|
| 197 |
+
# endif
|
| 198 |
+
OPENSSL_EXPORT OSSL_provider_init_fn OSSL_provider_init;
|
| 199 |
+
# ifdef __VMS
|
| 200 |
+
# pragma names restore
|
| 201 |
+
# endif
|
| 202 |
+
|
| 203 |
+
/*
|
| 204 |
+
* Generic callback function signature.
|
| 205 |
+
*
|
| 206 |
+
* The expectation is that any provider function that wants to offer
|
| 207 |
+
* a callback / hook can do so by taking an argument with this type,
|
| 208 |
+
* as well as a pointer to caller-specific data. When calling the
|
| 209 |
+
* callback, the provider function can populate an OSSL_PARAM array
|
| 210 |
+
* with data of its choice and pass that in the callback call, along
|
| 211 |
+
* with the caller data argument.
|
| 212 |
+
*
|
| 213 |
+
* libcrypto may use the OSSL_PARAM array to create arguments for an
|
| 214 |
+
* application callback it knows about.
|
| 215 |
+
*/
|
| 216 |
+
typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
|
| 217 |
+
typedef int (OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[],
|
| 218 |
+
OSSL_PARAM out_params[], void *arg);
|
| 219 |
+
/*
|
| 220 |
+
* Passphrase callback function signature
|
| 221 |
+
*
|
| 222 |
+
* This is similar to the generic callback function above, but adds a
|
| 223 |
+
* result parameter.
|
| 224 |
+
*/
|
| 225 |
+
typedef int (OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
|
| 226 |
+
size_t *pass_len,
|
| 227 |
+
const OSSL_PARAM params[], void *arg);
|
| 228 |
+
|
| 229 |
+
# ifdef __cplusplus
|
| 230 |
+
}
|
| 231 |
+
# endif
|
| 232 |
+
|
| 233 |
+
#endif
|
llava_next/include/openssl/core_dispatch.h
ADDED
|
@@ -0,0 +1,943 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CORE_NUMBERS_H
|
| 11 |
+
# define OPENSSL_CORE_NUMBERS_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <stdarg.h>
|
| 15 |
+
# include <openssl/core.h>
|
| 16 |
+
|
| 17 |
+
# ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
/*-
|
| 22 |
+
* Identities
|
| 23 |
+
* ----------
|
| 24 |
+
*
|
| 25 |
+
* All series start with 1, to allow 0 to be an array terminator.
|
| 26 |
+
* For any FUNC identity, we also provide a function signature typedef
|
| 27 |
+
* and a static inline function to extract a function pointer from a
|
| 28 |
+
* OSSL_DISPATCH element in a type safe manner.
|
| 29 |
+
*
|
| 30 |
+
* Names:
|
| 31 |
+
* for any function base name 'foo' (uppercase form 'FOO'), we will have
|
| 32 |
+
* the following:
|
| 33 |
+
* - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
|
| 34 |
+
* thereof (to be specified further down)
|
| 35 |
+
* - a function signature typedef with the name OSSL_FUNC_'foo'_fn
|
| 36 |
+
* - a function pointer extractor function with the name OSSL_FUNC_'foo'
|
| 37 |
+
*/
|
| 38 |
+
|
| 39 |
+
/*
|
| 40 |
+
* Helper macro to create the function signature typedef and the extractor
|
| 41 |
+
* |type| is the return-type of the function, |name| is the name of the
|
| 42 |
+
* function to fetch, and |args| is a parenthesized list of parameters
|
| 43 |
+
* for the function (that is, it is |name|'s function signature).
|
| 44 |
+
* Note: This is considered a "reserved" internal macro. Applications should
|
| 45 |
+
* not use this or assume its existence.
|
| 46 |
+
*/
|
| 47 |
+
#define OSSL_CORE_MAKE_FUNC(type,name,args) \
|
| 48 |
+
typedef type (OSSL_FUNC_##name##_fn)args; \
|
| 49 |
+
static ossl_unused ossl_inline \
|
| 50 |
+
OSSL_FUNC_##name##_fn *OSSL_FUNC_##name(const OSSL_DISPATCH *opf) \
|
| 51 |
+
{ \
|
| 52 |
+
return (OSSL_FUNC_##name##_fn *)opf->function; \
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/*
|
| 56 |
+
* Core function identities, for the two OSSL_DISPATCH tables being passed
|
| 57 |
+
* in the OSSL_provider_init call.
|
| 58 |
+
*
|
| 59 |
+
* 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
|
| 60 |
+
* therefore NEVER be used as a function identity.
|
| 61 |
+
*/
|
| 62 |
+
/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
|
| 63 |
+
# define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
|
| 64 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
| 65 |
+
core_gettable_params,(const OSSL_CORE_HANDLE *prov))
|
| 66 |
+
# define OSSL_FUNC_CORE_GET_PARAMS 2
|
| 67 |
+
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
|
| 68 |
+
OSSL_PARAM params[]))
|
| 69 |
+
# define OSSL_FUNC_CORE_THREAD_START 3
|
| 70 |
+
OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
|
| 71 |
+
OSSL_thread_stop_handler_fn handfn,
|
| 72 |
+
void *arg))
|
| 73 |
+
# define OSSL_FUNC_CORE_GET_LIBCTX 4
|
| 74 |
+
OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_libctx,
|
| 75 |
+
(const OSSL_CORE_HANDLE *prov))
|
| 76 |
+
# define OSSL_FUNC_CORE_NEW_ERROR 5
|
| 77 |
+
OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
|
| 78 |
+
# define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
|
| 79 |
+
OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
|
| 80 |
+
(const OSSL_CORE_HANDLE *prov,
|
| 81 |
+
const char *file, int line, const char *func))
|
| 82 |
+
# define OSSL_FUNC_CORE_VSET_ERROR 7
|
| 83 |
+
OSSL_CORE_MAKE_FUNC(void,core_vset_error,
|
| 84 |
+
(const OSSL_CORE_HANDLE *prov,
|
| 85 |
+
uint32_t reason, const char *fmt, va_list args))
|
| 86 |
+
# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
|
| 87 |
+
OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
|
| 88 |
+
# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
|
| 89 |
+
OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
|
| 90 |
+
(const OSSL_CORE_HANDLE *prov))
|
| 91 |
+
# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
|
| 92 |
+
OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
/* Functions to access the OBJ database */
|
| 96 |
+
|
| 97 |
+
#define OSSL_FUNC_CORE_OBJ_ADD_SIGID 11
|
| 98 |
+
#define OSSL_FUNC_CORE_OBJ_CREATE 12
|
| 99 |
+
|
| 100 |
+
OSSL_CORE_MAKE_FUNC(int, core_obj_add_sigid,
|
| 101 |
+
(const OSSL_CORE_HANDLE *prov, const char *sign_name,
|
| 102 |
+
const char *digest_name, const char *pkey_name))
|
| 103 |
+
OSSL_CORE_MAKE_FUNC(int, core_obj_create,
|
| 104 |
+
(const OSSL_CORE_HANDLE *prov, const char *oid,
|
| 105 |
+
const char *sn, const char *ln))
|
| 106 |
+
|
| 107 |
+
/* Memory allocation, freeing, clearing. */
|
| 108 |
+
#define OSSL_FUNC_CRYPTO_MALLOC 20
|
| 109 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 110 |
+
CRYPTO_malloc, (size_t num, const char *file, int line))
|
| 111 |
+
#define OSSL_FUNC_CRYPTO_ZALLOC 21
|
| 112 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 113 |
+
CRYPTO_zalloc, (size_t num, const char *file, int line))
|
| 114 |
+
#define OSSL_FUNC_CRYPTO_FREE 22
|
| 115 |
+
OSSL_CORE_MAKE_FUNC(void,
|
| 116 |
+
CRYPTO_free, (void *ptr, const char *file, int line))
|
| 117 |
+
#define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
|
| 118 |
+
OSSL_CORE_MAKE_FUNC(void,
|
| 119 |
+
CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
|
| 120 |
+
#define OSSL_FUNC_CRYPTO_REALLOC 24
|
| 121 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 122 |
+
CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
|
| 123 |
+
#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
|
| 124 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 125 |
+
CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
|
| 126 |
+
const char *file, int line))
|
| 127 |
+
#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
|
| 128 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 129 |
+
CRYPTO_secure_malloc, (size_t num, const char *file, int line))
|
| 130 |
+
#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
|
| 131 |
+
OSSL_CORE_MAKE_FUNC(void *,
|
| 132 |
+
CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
|
| 133 |
+
#define OSSL_FUNC_CRYPTO_SECURE_FREE 28
|
| 134 |
+
OSSL_CORE_MAKE_FUNC(void,
|
| 135 |
+
CRYPTO_secure_free, (void *ptr, const char *file, int line))
|
| 136 |
+
#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
|
| 137 |
+
OSSL_CORE_MAKE_FUNC(void,
|
| 138 |
+
CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
|
| 139 |
+
int line))
|
| 140 |
+
#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
|
| 141 |
+
OSSL_CORE_MAKE_FUNC(int,
|
| 142 |
+
CRYPTO_secure_allocated, (const void *ptr))
|
| 143 |
+
#define OSSL_FUNC_OPENSSL_CLEANSE 31
|
| 144 |
+
OSSL_CORE_MAKE_FUNC(void,
|
| 145 |
+
OPENSSL_cleanse, (void *ptr, size_t len))
|
| 146 |
+
|
| 147 |
+
/* Bio functions provided by the core */
|
| 148 |
+
#define OSSL_FUNC_BIO_NEW_FILE 40
|
| 149 |
+
#define OSSL_FUNC_BIO_NEW_MEMBUF 41
|
| 150 |
+
#define OSSL_FUNC_BIO_READ_EX 42
|
| 151 |
+
#define OSSL_FUNC_BIO_WRITE_EX 43
|
| 152 |
+
#define OSSL_FUNC_BIO_UP_REF 44
|
| 153 |
+
#define OSSL_FUNC_BIO_FREE 45
|
| 154 |
+
#define OSSL_FUNC_BIO_VPRINTF 46
|
| 155 |
+
#define OSSL_FUNC_BIO_VSNPRINTF 47
|
| 156 |
+
#define OSSL_FUNC_BIO_PUTS 48
|
| 157 |
+
#define OSSL_FUNC_BIO_GETS 49
|
| 158 |
+
#define OSSL_FUNC_BIO_CTRL 50
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
|
| 162 |
+
const char *mode))
|
| 163 |
+
OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
|
| 164 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
|
| 165 |
+
size_t data_len, size_t *bytes_read))
|
| 166 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
|
| 167 |
+
size_t data_len, size_t *written))
|
| 168 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO *bio, char *buf, int size))
|
| 169 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO *bio, const char *str))
|
| 170 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO *bio))
|
| 171 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
|
| 172 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
|
| 173 |
+
va_list args))
|
| 174 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
|
| 175 |
+
(char *buf, size_t n, const char *fmt, va_list args))
|
| 176 |
+
OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio,
|
| 177 |
+
int cmd, long num, void *ptr))
|
| 178 |
+
|
| 179 |
+
#define OSSL_FUNC_SELF_TEST_CB 100
|
| 180 |
+
OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
|
| 181 |
+
void **cbarg))
|
| 182 |
+
|
| 183 |
+
/* Functions to get seed material from the operating system */
|
| 184 |
+
#define OSSL_FUNC_GET_ENTROPY 101
|
| 185 |
+
#define OSSL_FUNC_CLEANUP_ENTROPY 102
|
| 186 |
+
#define OSSL_FUNC_GET_NONCE 103
|
| 187 |
+
#define OSSL_FUNC_CLEANUP_NONCE 104
|
| 188 |
+
OSSL_CORE_MAKE_FUNC(size_t, get_entropy, (const OSSL_CORE_HANDLE *handle,
|
| 189 |
+
unsigned char **pout, int entropy,
|
| 190 |
+
size_t min_len, size_t max_len))
|
| 191 |
+
OSSL_CORE_MAKE_FUNC(void, cleanup_entropy, (const OSSL_CORE_HANDLE *handle,
|
| 192 |
+
unsigned char *buf, size_t len))
|
| 193 |
+
OSSL_CORE_MAKE_FUNC(size_t, get_nonce, (const OSSL_CORE_HANDLE *handle,
|
| 194 |
+
unsigned char **pout, size_t min_len,
|
| 195 |
+
size_t max_len, const void *salt,
|
| 196 |
+
size_t salt_len))
|
| 197 |
+
OSSL_CORE_MAKE_FUNC(void, cleanup_nonce, (const OSSL_CORE_HANDLE *handle,
|
| 198 |
+
unsigned char *buf, size_t len))
|
| 199 |
+
|
| 200 |
+
/* Functions to access the core's providers */
|
| 201 |
+
#define OSSL_FUNC_PROVIDER_REGISTER_CHILD_CB 105
|
| 202 |
+
#define OSSL_FUNC_PROVIDER_DEREGISTER_CHILD_CB 106
|
| 203 |
+
#define OSSL_FUNC_PROVIDER_NAME 107
|
| 204 |
+
#define OSSL_FUNC_PROVIDER_GET0_PROVIDER_CTX 108
|
| 205 |
+
#define OSSL_FUNC_PROVIDER_GET0_DISPATCH 109
|
| 206 |
+
#define OSSL_FUNC_PROVIDER_UP_REF 110
|
| 207 |
+
#define OSSL_FUNC_PROVIDER_FREE 111
|
| 208 |
+
|
| 209 |
+
OSSL_CORE_MAKE_FUNC(int, provider_register_child_cb,
|
| 210 |
+
(const OSSL_CORE_HANDLE *handle,
|
| 211 |
+
int (*create_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
|
| 212 |
+
int (*remove_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
|
| 213 |
+
int (*global_props_cb)(const char *props, void *cbdata),
|
| 214 |
+
void *cbdata))
|
| 215 |
+
OSSL_CORE_MAKE_FUNC(void, provider_deregister_child_cb,
|
| 216 |
+
(const OSSL_CORE_HANDLE *handle))
|
| 217 |
+
OSSL_CORE_MAKE_FUNC(const char *, provider_name,
|
| 218 |
+
(const OSSL_CORE_HANDLE *prov))
|
| 219 |
+
OSSL_CORE_MAKE_FUNC(void *, provider_get0_provider_ctx,
|
| 220 |
+
(const OSSL_CORE_HANDLE *prov))
|
| 221 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, provider_get0_dispatch,
|
| 222 |
+
(const OSSL_CORE_HANDLE *prov))
|
| 223 |
+
OSSL_CORE_MAKE_FUNC(int, provider_up_ref,
|
| 224 |
+
(const OSSL_CORE_HANDLE *prov, int activate))
|
| 225 |
+
OSSL_CORE_MAKE_FUNC(int, provider_free,
|
| 226 |
+
(const OSSL_CORE_HANDLE *prov, int deactivate))
|
| 227 |
+
|
| 228 |
+
/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
|
| 229 |
+
# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
|
| 230 |
+
OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
|
| 231 |
+
# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
|
| 232 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
| 233 |
+
provider_gettable_params,(void *provctx))
|
| 234 |
+
# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
|
| 235 |
+
OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
|
| 236 |
+
OSSL_PARAM params[]))
|
| 237 |
+
# define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
|
| 238 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
|
| 239 |
+
(void *provctx, int operation_id, int *no_store))
|
| 240 |
+
# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028
|
| 241 |
+
OSSL_CORE_MAKE_FUNC(void, provider_unquery_operation,
|
| 242 |
+
(void *provctx, int operation_id, const OSSL_ALGORITHM *))
|
| 243 |
+
# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
|
| 244 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
|
| 245 |
+
(void *provctx))
|
| 246 |
+
# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030
|
| 247 |
+
OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx,
|
| 248 |
+
const char *capability, OSSL_CALLBACK *cb, void *arg))
|
| 249 |
+
# define OSSL_FUNC_PROVIDER_SELF_TEST 1031
|
| 250 |
+
OSSL_CORE_MAKE_FUNC(int, provider_self_test, (void *provctx))
|
| 251 |
+
|
| 252 |
+
/* Operations */
|
| 253 |
+
|
| 254 |
+
# define OSSL_OP_DIGEST 1
|
| 255 |
+
# define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
|
| 256 |
+
# define OSSL_OP_MAC 3
|
| 257 |
+
# define OSSL_OP_KDF 4
|
| 258 |
+
# define OSSL_OP_RAND 5
|
| 259 |
+
# define OSSL_OP_KEYMGMT 10
|
| 260 |
+
# define OSSL_OP_KEYEXCH 11
|
| 261 |
+
# define OSSL_OP_SIGNATURE 12
|
| 262 |
+
# define OSSL_OP_ASYM_CIPHER 13
|
| 263 |
+
# define OSSL_OP_KEM 14
|
| 264 |
+
/* New section for non-EVP operations */
|
| 265 |
+
# define OSSL_OP_ENCODER 20
|
| 266 |
+
# define OSSL_OP_DECODER 21
|
| 267 |
+
# define OSSL_OP_STORE 22
|
| 268 |
+
/* Highest known operation number */
|
| 269 |
+
# define OSSL_OP__HIGHEST 22
|
| 270 |
+
|
| 271 |
+
/* Digests */
|
| 272 |
+
|
| 273 |
+
# define OSSL_FUNC_DIGEST_NEWCTX 1
|
| 274 |
+
# define OSSL_FUNC_DIGEST_INIT 2
|
| 275 |
+
# define OSSL_FUNC_DIGEST_UPDATE 3
|
| 276 |
+
# define OSSL_FUNC_DIGEST_FINAL 4
|
| 277 |
+
# define OSSL_FUNC_DIGEST_DIGEST 5
|
| 278 |
+
# define OSSL_FUNC_DIGEST_FREECTX 6
|
| 279 |
+
# define OSSL_FUNC_DIGEST_DUPCTX 7
|
| 280 |
+
# define OSSL_FUNC_DIGEST_GET_PARAMS 8
|
| 281 |
+
# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
|
| 282 |
+
# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
|
| 283 |
+
# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
|
| 284 |
+
# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
|
| 285 |
+
# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
|
| 286 |
+
|
| 287 |
+
OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx))
|
| 288 |
+
OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx, const OSSL_PARAM params[]))
|
| 289 |
+
OSSL_CORE_MAKE_FUNC(int, digest_update,
|
| 290 |
+
(void *dctx, const unsigned char *in, size_t inl))
|
| 291 |
+
OSSL_CORE_MAKE_FUNC(int, digest_final,
|
| 292 |
+
(void *dctx,
|
| 293 |
+
unsigned char *out, size_t *outl, size_t outsz))
|
| 294 |
+
OSSL_CORE_MAKE_FUNC(int, digest_digest,
|
| 295 |
+
(void *provctx, const unsigned char *in, size_t inl,
|
| 296 |
+
unsigned char *out, size_t *outl, size_t outsz))
|
| 297 |
+
|
| 298 |
+
OSSL_CORE_MAKE_FUNC(void, digest_freectx, (void *dctx))
|
| 299 |
+
OSSL_CORE_MAKE_FUNC(void *, digest_dupctx, (void *dctx))
|
| 300 |
+
|
| 301 |
+
OSSL_CORE_MAKE_FUNC(int, digest_get_params, (OSSL_PARAM params[]))
|
| 302 |
+
OSSL_CORE_MAKE_FUNC(int, digest_set_ctx_params,
|
| 303 |
+
(void *vctx, const OSSL_PARAM params[]))
|
| 304 |
+
OSSL_CORE_MAKE_FUNC(int, digest_get_ctx_params,
|
| 305 |
+
(void *vctx, OSSL_PARAM params[]))
|
| 306 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_params,
|
| 307 |
+
(void *provctx))
|
| 308 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params,
|
| 309 |
+
(void *dctx, void *provctx))
|
| 310 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params,
|
| 311 |
+
(void *dctx, void *provctx))
|
| 312 |
+
|
| 313 |
+
/* Symmetric Ciphers */
|
| 314 |
+
|
| 315 |
+
# define OSSL_FUNC_CIPHER_NEWCTX 1
|
| 316 |
+
# define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
|
| 317 |
+
# define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
|
| 318 |
+
# define OSSL_FUNC_CIPHER_UPDATE 4
|
| 319 |
+
# define OSSL_FUNC_CIPHER_FINAL 5
|
| 320 |
+
# define OSSL_FUNC_CIPHER_CIPHER 6
|
| 321 |
+
# define OSSL_FUNC_CIPHER_FREECTX 7
|
| 322 |
+
# define OSSL_FUNC_CIPHER_DUPCTX 8
|
| 323 |
+
# define OSSL_FUNC_CIPHER_GET_PARAMS 9
|
| 324 |
+
# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
|
| 325 |
+
# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
|
| 326 |
+
# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
|
| 327 |
+
# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
|
| 328 |
+
# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
|
| 329 |
+
|
| 330 |
+
OSSL_CORE_MAKE_FUNC(void *, cipher_newctx, (void *provctx))
|
| 331 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_init, (void *cctx,
|
| 332 |
+
const unsigned char *key,
|
| 333 |
+
size_t keylen,
|
| 334 |
+
const unsigned char *iv,
|
| 335 |
+
size_t ivlen,
|
| 336 |
+
const OSSL_PARAM params[]))
|
| 337 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_init, (void *cctx,
|
| 338 |
+
const unsigned char *key,
|
| 339 |
+
size_t keylen,
|
| 340 |
+
const unsigned char *iv,
|
| 341 |
+
size_t ivlen,
|
| 342 |
+
const OSSL_PARAM params[]))
|
| 343 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_update,
|
| 344 |
+
(void *cctx,
|
| 345 |
+
unsigned char *out, size_t *outl, size_t outsize,
|
| 346 |
+
const unsigned char *in, size_t inl))
|
| 347 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_final,
|
| 348 |
+
(void *cctx,
|
| 349 |
+
unsigned char *out, size_t *outl, size_t outsize))
|
| 350 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_cipher,
|
| 351 |
+
(void *cctx,
|
| 352 |
+
unsigned char *out, size_t *outl, size_t outsize,
|
| 353 |
+
const unsigned char *in, size_t inl))
|
| 354 |
+
OSSL_CORE_MAKE_FUNC(void, cipher_freectx, (void *cctx))
|
| 355 |
+
OSSL_CORE_MAKE_FUNC(void *, cipher_dupctx, (void *cctx))
|
| 356 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_get_params, (OSSL_PARAM params[]))
|
| 357 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_get_ctx_params, (void *cctx,
|
| 358 |
+
OSSL_PARAM params[]))
|
| 359 |
+
OSSL_CORE_MAKE_FUNC(int, cipher_set_ctx_params, (void *cctx,
|
| 360 |
+
const OSSL_PARAM params[]))
|
| 361 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_params,
|
| 362 |
+
(void *provctx))
|
| 363 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_settable_ctx_params,
|
| 364 |
+
(void *cctx, void *provctx))
|
| 365 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params,
|
| 366 |
+
(void *cctx, void *provctx))
|
| 367 |
+
|
| 368 |
+
/* MACs */
|
| 369 |
+
|
| 370 |
+
# define OSSL_FUNC_MAC_NEWCTX 1
|
| 371 |
+
# define OSSL_FUNC_MAC_DUPCTX 2
|
| 372 |
+
# define OSSL_FUNC_MAC_FREECTX 3
|
| 373 |
+
# define OSSL_FUNC_MAC_INIT 4
|
| 374 |
+
# define OSSL_FUNC_MAC_UPDATE 5
|
| 375 |
+
# define OSSL_FUNC_MAC_FINAL 6
|
| 376 |
+
# define OSSL_FUNC_MAC_GET_PARAMS 7
|
| 377 |
+
# define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
|
| 378 |
+
# define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
|
| 379 |
+
# define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
|
| 380 |
+
# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
|
| 381 |
+
# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
|
| 382 |
+
|
| 383 |
+
OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx))
|
| 384 |
+
OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src))
|
| 385 |
+
OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
|
| 386 |
+
OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx, const unsigned char *key,
|
| 387 |
+
size_t keylen, const OSSL_PARAM params[]))
|
| 388 |
+
OSSL_CORE_MAKE_FUNC(int, mac_update,
|
| 389 |
+
(void *mctx, const unsigned char *in, size_t inl))
|
| 390 |
+
OSSL_CORE_MAKE_FUNC(int, mac_final,
|
| 391 |
+
(void *mctx,
|
| 392 |
+
unsigned char *out, size_t *outl, size_t outsize))
|
| 393 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_params, (void *provctx))
|
| 394 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_ctx_params,
|
| 395 |
+
(void *mctx, void *provctx))
|
| 396 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_settable_ctx_params,
|
| 397 |
+
(void *mctx, void *provctx))
|
| 398 |
+
OSSL_CORE_MAKE_FUNC(int, mac_get_params, (OSSL_PARAM params[]))
|
| 399 |
+
OSSL_CORE_MAKE_FUNC(int, mac_get_ctx_params,
|
| 400 |
+
(void *mctx, OSSL_PARAM params[]))
|
| 401 |
+
OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params,
|
| 402 |
+
(void *mctx, const OSSL_PARAM params[]))
|
| 403 |
+
|
| 404 |
+
/* KDFs and PRFs */
|
| 405 |
+
|
| 406 |
+
# define OSSL_FUNC_KDF_NEWCTX 1
|
| 407 |
+
# define OSSL_FUNC_KDF_DUPCTX 2
|
| 408 |
+
# define OSSL_FUNC_KDF_FREECTX 3
|
| 409 |
+
# define OSSL_FUNC_KDF_RESET 4
|
| 410 |
+
# define OSSL_FUNC_KDF_DERIVE 5
|
| 411 |
+
# define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
|
| 412 |
+
# define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
|
| 413 |
+
# define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
|
| 414 |
+
# define OSSL_FUNC_KDF_GET_PARAMS 9
|
| 415 |
+
# define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
|
| 416 |
+
# define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
|
| 417 |
+
|
| 418 |
+
OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx))
|
| 419 |
+
OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src))
|
| 420 |
+
OSSL_CORE_MAKE_FUNC(void, kdf_freectx, (void *kctx))
|
| 421 |
+
OSSL_CORE_MAKE_FUNC(void, kdf_reset, (void *kctx))
|
| 422 |
+
OSSL_CORE_MAKE_FUNC(int, kdf_derive, (void *kctx, unsigned char *key,
|
| 423 |
+
size_t keylen, const OSSL_PARAM params[]))
|
| 424 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_params, (void *provctx))
|
| 425 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_ctx_params,
|
| 426 |
+
(void *kctx, void *provctx))
|
| 427 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_settable_ctx_params,
|
| 428 |
+
(void *kctx, void *provctx))
|
| 429 |
+
OSSL_CORE_MAKE_FUNC(int, kdf_get_params, (OSSL_PARAM params[]))
|
| 430 |
+
OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params,
|
| 431 |
+
(void *kctx, OSSL_PARAM params[]))
|
| 432 |
+
OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params,
|
| 433 |
+
(void *kctx, const OSSL_PARAM params[]))
|
| 434 |
+
|
| 435 |
+
/* RAND */
|
| 436 |
+
|
| 437 |
+
# define OSSL_FUNC_RAND_NEWCTX 1
|
| 438 |
+
# define OSSL_FUNC_RAND_FREECTX 2
|
| 439 |
+
# define OSSL_FUNC_RAND_INSTANTIATE 3
|
| 440 |
+
# define OSSL_FUNC_RAND_UNINSTANTIATE 4
|
| 441 |
+
# define OSSL_FUNC_RAND_GENERATE 5
|
| 442 |
+
# define OSSL_FUNC_RAND_RESEED 6
|
| 443 |
+
# define OSSL_FUNC_RAND_NONCE 7
|
| 444 |
+
# define OSSL_FUNC_RAND_ENABLE_LOCKING 8
|
| 445 |
+
# define OSSL_FUNC_RAND_LOCK 9
|
| 446 |
+
# define OSSL_FUNC_RAND_UNLOCK 10
|
| 447 |
+
# define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
|
| 448 |
+
# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
|
| 449 |
+
# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
|
| 450 |
+
# define OSSL_FUNC_RAND_GET_PARAMS 14
|
| 451 |
+
# define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
|
| 452 |
+
# define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
|
| 453 |
+
# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17
|
| 454 |
+
# define OSSL_FUNC_RAND_GET_SEED 18
|
| 455 |
+
# define OSSL_FUNC_RAND_CLEAR_SEED 19
|
| 456 |
+
|
| 457 |
+
OSSL_CORE_MAKE_FUNC(void *,rand_newctx,
|
| 458 |
+
(void *provctx, void *parent,
|
| 459 |
+
const OSSL_DISPATCH *parent_calls))
|
| 460 |
+
OSSL_CORE_MAKE_FUNC(void,rand_freectx, (void *vctx))
|
| 461 |
+
OSSL_CORE_MAKE_FUNC(int,rand_instantiate,
|
| 462 |
+
(void *vdrbg, unsigned int strength,
|
| 463 |
+
int prediction_resistance,
|
| 464 |
+
const unsigned char *pstr, size_t pstr_len,
|
| 465 |
+
const OSSL_PARAM params[]))
|
| 466 |
+
OSSL_CORE_MAKE_FUNC(int,rand_uninstantiate, (void *vdrbg))
|
| 467 |
+
OSSL_CORE_MAKE_FUNC(int,rand_generate,
|
| 468 |
+
(void *vctx, unsigned char *out, size_t outlen,
|
| 469 |
+
unsigned int strength, int prediction_resistance,
|
| 470 |
+
const unsigned char *addin, size_t addin_len))
|
| 471 |
+
OSSL_CORE_MAKE_FUNC(int,rand_reseed,
|
| 472 |
+
(void *vctx, int prediction_resistance,
|
| 473 |
+
const unsigned char *ent, size_t ent_len,
|
| 474 |
+
const unsigned char *addin, size_t addin_len))
|
| 475 |
+
OSSL_CORE_MAKE_FUNC(size_t,rand_nonce,
|
| 476 |
+
(void *vctx, unsigned char *out, unsigned int strength,
|
| 477 |
+
size_t min_noncelen, size_t max_noncelen))
|
| 478 |
+
OSSL_CORE_MAKE_FUNC(int,rand_enable_locking, (void *vctx))
|
| 479 |
+
OSSL_CORE_MAKE_FUNC(int,rand_lock, (void *vctx))
|
| 480 |
+
OSSL_CORE_MAKE_FUNC(void,rand_unlock, (void *vctx))
|
| 481 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_params, (void *provctx))
|
| 482 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_ctx_params,
|
| 483 |
+
(void *vctx, void *provctx))
|
| 484 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_settable_ctx_params,
|
| 485 |
+
(void *vctx, void *provctx))
|
| 486 |
+
OSSL_CORE_MAKE_FUNC(int,rand_get_params, (OSSL_PARAM params[]))
|
| 487 |
+
OSSL_CORE_MAKE_FUNC(int,rand_get_ctx_params,
|
| 488 |
+
(void *vctx, OSSL_PARAM params[]))
|
| 489 |
+
OSSL_CORE_MAKE_FUNC(int,rand_set_ctx_params,
|
| 490 |
+
(void *vctx, const OSSL_PARAM params[]))
|
| 491 |
+
OSSL_CORE_MAKE_FUNC(void,rand_set_callbacks,
|
| 492 |
+
(void *vctx, OSSL_INOUT_CALLBACK *get_entropy,
|
| 493 |
+
OSSL_CALLBACK *cleanup_entropy,
|
| 494 |
+
OSSL_INOUT_CALLBACK *get_nonce,
|
| 495 |
+
OSSL_CALLBACK *cleanup_nonce, void *arg))
|
| 496 |
+
OSSL_CORE_MAKE_FUNC(int,rand_verify_zeroization,
|
| 497 |
+
(void *vctx))
|
| 498 |
+
OSSL_CORE_MAKE_FUNC(size_t,rand_get_seed,
|
| 499 |
+
(void *vctx, unsigned char **buffer,
|
| 500 |
+
int entropy, size_t min_len, size_t max_len,
|
| 501 |
+
int prediction_resistance,
|
| 502 |
+
const unsigned char *adin, size_t adin_len))
|
| 503 |
+
OSSL_CORE_MAKE_FUNC(void,rand_clear_seed,
|
| 504 |
+
(void *vctx, unsigned char *buffer, size_t b_len))
|
| 505 |
+
|
| 506 |
+
/*-
|
| 507 |
+
* Key management
|
| 508 |
+
*
|
| 509 |
+
* The Key Management takes care of provider side key objects, and includes
|
| 510 |
+
* all current functionality to create them, destroy them, set parameters
|
| 511 |
+
* and key material, etc, essentially everything that manipulates the keys
|
| 512 |
+
* themselves and their parameters.
|
| 513 |
+
*
|
| 514 |
+
* The key objects are commonly refered to as |keydata|, and it MUST be able
|
| 515 |
+
* to contain parameters if the key has any, the public key and the private
|
| 516 |
+
* key. All parts are optional, but their presence determines what can be
|
| 517 |
+
* done with the key object in terms of encryption, signature, and so on.
|
| 518 |
+
* The assumption from libcrypto is that the key object contains any of the
|
| 519 |
+
* following data combinations:
|
| 520 |
+
*
|
| 521 |
+
* - parameters only
|
| 522 |
+
* - public key only
|
| 523 |
+
* - public key + private key
|
| 524 |
+
* - parameters + public key
|
| 525 |
+
* - parameters + public key + private key
|
| 526 |
+
*
|
| 527 |
+
* What "parameters", "public key" and "private key" means in detail is left
|
| 528 |
+
* to the implementation. In the case of DH and DSA, they would typically
|
| 529 |
+
* include domain parameters, while for certain variants of RSA, they would
|
| 530 |
+
* typically include PSS or OAEP parameters.
|
| 531 |
+
*
|
| 532 |
+
* Key objects are created with OSSL_FUNC_keymgmt_new() and destroyed with
|
| 533 |
+
* OSSL_FUNC_keymgmt_free(). Key objects can have data filled in with
|
| 534 |
+
* OSSL_FUNC_keymgmt_import().
|
| 535 |
+
*
|
| 536 |
+
* Three functions are made available to check what selection of data is
|
| 537 |
+
* present in a key object: OSSL_FUNC_keymgmt_has_parameters(),
|
| 538 |
+
* OSSL_FUNC_keymgmt_has_public_key(), and OSSL_FUNC_keymgmt_has_private_key(),
|
| 539 |
+
*/
|
| 540 |
+
|
| 541 |
+
/* Key data subset selection - individual bits */
|
| 542 |
+
# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
|
| 543 |
+
# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
|
| 544 |
+
# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
|
| 545 |
+
# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
|
| 546 |
+
|
| 547 |
+
/* Key data subset selection - combinations */
|
| 548 |
+
# define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
|
| 549 |
+
( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
|
| 550 |
+
| OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
|
| 551 |
+
# define OSSL_KEYMGMT_SELECT_KEYPAIR \
|
| 552 |
+
( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
|
| 553 |
+
# define OSSL_KEYMGMT_SELECT_ALL \
|
| 554 |
+
( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
|
| 555 |
+
|
| 556 |
+
# define OSSL_KEYMGMT_VALIDATE_FULL_CHECK 0
|
| 557 |
+
# define OSSL_KEYMGMT_VALIDATE_QUICK_CHECK 1
|
| 558 |
+
|
| 559 |
+
/* Basic key object creation */
|
| 560 |
+
# define OSSL_FUNC_KEYMGMT_NEW 1
|
| 561 |
+
OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx))
|
| 562 |
+
|
| 563 |
+
/* Generation, a more complex constructor */
|
| 564 |
+
# define OSSL_FUNC_KEYMGMT_GEN_INIT 2
|
| 565 |
+
# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
|
| 566 |
+
# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
|
| 567 |
+
# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
|
| 568 |
+
# define OSSL_FUNC_KEYMGMT_GEN 6
|
| 569 |
+
# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
|
| 570 |
+
OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen_init,
|
| 571 |
+
(void *provctx, int selection, const OSSL_PARAM params[]))
|
| 572 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_template,
|
| 573 |
+
(void *genctx, void *templ))
|
| 574 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_params,
|
| 575 |
+
(void *genctx, const OSSL_PARAM params[]))
|
| 576 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
|
| 577 |
+
keymgmt_gen_settable_params,
|
| 578 |
+
(void *genctx, void *provctx))
|
| 579 |
+
OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen,
|
| 580 |
+
(void *genctx, OSSL_CALLBACK *cb, void *cbarg))
|
| 581 |
+
OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx))
|
| 582 |
+
|
| 583 |
+
/* Key loading by object reference */
|
| 584 |
+
# define OSSL_FUNC_KEYMGMT_LOAD 8
|
| 585 |
+
OSSL_CORE_MAKE_FUNC(void *, keymgmt_load,
|
| 586 |
+
(const void *reference, size_t reference_sz))
|
| 587 |
+
|
| 588 |
+
/* Basic key object destruction */
|
| 589 |
+
# define OSSL_FUNC_KEYMGMT_FREE 10
|
| 590 |
+
OSSL_CORE_MAKE_FUNC(void, keymgmt_free, (void *keydata))
|
| 591 |
+
|
| 592 |
+
/* Key object information, with discovery */
|
| 593 |
+
#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
|
| 594 |
+
#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
|
| 595 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_get_params,
|
| 596 |
+
(void *keydata, OSSL_PARAM params[]))
|
| 597 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gettable_params,
|
| 598 |
+
(void *provctx))
|
| 599 |
+
|
| 600 |
+
#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
|
| 601 |
+
#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
|
| 602 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_set_params,
|
| 603 |
+
(void *keydata, const OSSL_PARAM params[]))
|
| 604 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_settable_params,
|
| 605 |
+
(void *provctx))
|
| 606 |
+
|
| 607 |
+
/* Key checks - discovery of supported operations */
|
| 608 |
+
# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
|
| 609 |
+
OSSL_CORE_MAKE_FUNC(const char *, keymgmt_query_operation_name,
|
| 610 |
+
(int operation_id))
|
| 611 |
+
|
| 612 |
+
/* Key checks - key data content checks */
|
| 613 |
+
# define OSSL_FUNC_KEYMGMT_HAS 21
|
| 614 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_has, (const void *keydata, int selection))
|
| 615 |
+
|
| 616 |
+
/* Key checks - validation */
|
| 617 |
+
# define OSSL_FUNC_KEYMGMT_VALIDATE 22
|
| 618 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_validate, (const void *keydata, int selection,
|
| 619 |
+
int checktype))
|
| 620 |
+
|
| 621 |
+
/* Key checks - matching */
|
| 622 |
+
# define OSSL_FUNC_KEYMGMT_MATCH 23
|
| 623 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_match,
|
| 624 |
+
(const void *keydata1, const void *keydata2,
|
| 625 |
+
int selection))
|
| 626 |
+
|
| 627 |
+
/* Import and export functions, with discovery */
|
| 628 |
+
# define OSSL_FUNC_KEYMGMT_IMPORT 40
|
| 629 |
+
# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
|
| 630 |
+
# define OSSL_FUNC_KEYMGMT_EXPORT 42
|
| 631 |
+
# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
|
| 632 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_import,
|
| 633 |
+
(void *keydata, int selection, const OSSL_PARAM params[]))
|
| 634 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types,
|
| 635 |
+
(int selection))
|
| 636 |
+
OSSL_CORE_MAKE_FUNC(int, keymgmt_export,
|
| 637 |
+
(void *keydata, int selection,
|
| 638 |
+
OSSL_CALLBACK *param_cb, void *cbarg))
|
| 639 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types,
|
| 640 |
+
(int selection))
|
| 641 |
+
|
| 642 |
+
/* Dup function, constructor */
|
| 643 |
+
# define OSSL_FUNC_KEYMGMT_DUP 44
|
| 644 |
+
OSSL_CORE_MAKE_FUNC(void *, keymgmt_dup,
|
| 645 |
+
(const void *keydata_from, int selection))
|
| 646 |
+
|
| 647 |
+
/* Key Exchange */
|
| 648 |
+
|
| 649 |
+
# define OSSL_FUNC_KEYEXCH_NEWCTX 1
|
| 650 |
+
# define OSSL_FUNC_KEYEXCH_INIT 2
|
| 651 |
+
# define OSSL_FUNC_KEYEXCH_DERIVE 3
|
| 652 |
+
# define OSSL_FUNC_KEYEXCH_SET_PEER 4
|
| 653 |
+
# define OSSL_FUNC_KEYEXCH_FREECTX 5
|
| 654 |
+
# define OSSL_FUNC_KEYEXCH_DUPCTX 6
|
| 655 |
+
# define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
|
| 656 |
+
# define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
|
| 657 |
+
# define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
|
| 658 |
+
# define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
|
| 659 |
+
|
| 660 |
+
OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx))
|
| 661 |
+
OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey,
|
| 662 |
+
const OSSL_PARAM params[]))
|
| 663 |
+
OSSL_CORE_MAKE_FUNC(int, keyexch_derive, (void *ctx, unsigned char *secret,
|
| 664 |
+
size_t *secretlen, size_t outlen))
|
| 665 |
+
OSSL_CORE_MAKE_FUNC(int, keyexch_set_peer, (void *ctx, void *provkey))
|
| 666 |
+
OSSL_CORE_MAKE_FUNC(void, keyexch_freectx, (void *ctx))
|
| 667 |
+
OSSL_CORE_MAKE_FUNC(void *, keyexch_dupctx, (void *ctx))
|
| 668 |
+
OSSL_CORE_MAKE_FUNC(int, keyexch_set_ctx_params, (void *ctx,
|
| 669 |
+
const OSSL_PARAM params[]))
|
| 670 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params,
|
| 671 |
+
(void *ctx, void *provctx))
|
| 672 |
+
OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx,
|
| 673 |
+
OSSL_PARAM params[]))
|
| 674 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params,
|
| 675 |
+
(void *ctx, void *provctx))
|
| 676 |
+
|
| 677 |
+
/* Signature */
|
| 678 |
+
|
| 679 |
+
# define OSSL_FUNC_SIGNATURE_NEWCTX 1
|
| 680 |
+
# define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
|
| 681 |
+
# define OSSL_FUNC_SIGNATURE_SIGN 3
|
| 682 |
+
# define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
|
| 683 |
+
# define OSSL_FUNC_SIGNATURE_VERIFY 5
|
| 684 |
+
# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
|
| 685 |
+
# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
|
| 686 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
|
| 687 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
|
| 688 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
|
| 689 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
|
| 690 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
|
| 691 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
|
| 692 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
|
| 693 |
+
# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
|
| 694 |
+
# define OSSL_FUNC_SIGNATURE_FREECTX 16
|
| 695 |
+
# define OSSL_FUNC_SIGNATURE_DUPCTX 17
|
| 696 |
+
# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
|
| 697 |
+
# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
|
| 698 |
+
# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
|
| 699 |
+
# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
|
| 700 |
+
# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
|
| 701 |
+
# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
|
| 702 |
+
# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
|
| 703 |
+
# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
|
| 704 |
+
|
| 705 |
+
OSSL_CORE_MAKE_FUNC(void *, signature_newctx, (void *provctx,
|
| 706 |
+
const char *propq))
|
| 707 |
+
OSSL_CORE_MAKE_FUNC(int, signature_sign_init, (void *ctx, void *provkey,
|
| 708 |
+
const OSSL_PARAM params[]))
|
| 709 |
+
OSSL_CORE_MAKE_FUNC(int, signature_sign, (void *ctx, unsigned char *sig,
|
| 710 |
+
size_t *siglen, size_t sigsize,
|
| 711 |
+
const unsigned char *tbs,
|
| 712 |
+
size_t tbslen))
|
| 713 |
+
OSSL_CORE_MAKE_FUNC(int, signature_verify_init, (void *ctx, void *provkey,
|
| 714 |
+
const OSSL_PARAM params[]))
|
| 715 |
+
OSSL_CORE_MAKE_FUNC(int, signature_verify, (void *ctx,
|
| 716 |
+
const unsigned char *sig,
|
| 717 |
+
size_t siglen,
|
| 718 |
+
const unsigned char *tbs,
|
| 719 |
+
size_t tbslen))
|
| 720 |
+
OSSL_CORE_MAKE_FUNC(int, signature_verify_recover_init,
|
| 721 |
+
(void *ctx, void *provkey, const OSSL_PARAM params[]))
|
| 722 |
+
OSSL_CORE_MAKE_FUNC(int, signature_verify_recover,
|
| 723 |
+
(void *ctx, unsigned char *rout, size_t *routlen,
|
| 724 |
+
size_t routsize, const unsigned char *sig, size_t siglen))
|
| 725 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_init,
|
| 726 |
+
(void *ctx, const char *mdname, void *provkey,
|
| 727 |
+
const OSSL_PARAM params[]))
|
| 728 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_update,
|
| 729 |
+
(void *ctx, const unsigned char *data, size_t datalen))
|
| 730 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_final,
|
| 731 |
+
(void *ctx, unsigned char *sig, size_t *siglen,
|
| 732 |
+
size_t sigsize))
|
| 733 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_sign,
|
| 734 |
+
(void *ctx, unsigned char *sigret, size_t *siglen,
|
| 735 |
+
size_t sigsize, const unsigned char *tbs, size_t tbslen))
|
| 736 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_init,
|
| 737 |
+
(void *ctx, const char *mdname, void *provkey,
|
| 738 |
+
const OSSL_PARAM params[]))
|
| 739 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_update,
|
| 740 |
+
(void *ctx, const unsigned char *data, size_t datalen))
|
| 741 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_final,
|
| 742 |
+
(void *ctx, const unsigned char *sig, size_t siglen))
|
| 743 |
+
OSSL_CORE_MAKE_FUNC(int, signature_digest_verify,
|
| 744 |
+
(void *ctx, const unsigned char *sig, size_t siglen,
|
| 745 |
+
const unsigned char *tbs, size_t tbslen))
|
| 746 |
+
OSSL_CORE_MAKE_FUNC(void, signature_freectx, (void *ctx))
|
| 747 |
+
OSSL_CORE_MAKE_FUNC(void *, signature_dupctx, (void *ctx))
|
| 748 |
+
OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_params,
|
| 749 |
+
(void *ctx, OSSL_PARAM params[]))
|
| 750 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_params,
|
| 751 |
+
(void *ctx, void *provctx))
|
| 752 |
+
OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_params,
|
| 753 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 754 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_params,
|
| 755 |
+
(void *ctx, void *provctx))
|
| 756 |
+
OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_md_params,
|
| 757 |
+
(void *ctx, OSSL_PARAM params[]))
|
| 758 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_md_params,
|
| 759 |
+
(void *ctx))
|
| 760 |
+
OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_md_params,
|
| 761 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 762 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params,
|
| 763 |
+
(void *ctx))
|
| 764 |
+
|
| 765 |
+
|
| 766 |
+
/* Asymmetric Ciphers */
|
| 767 |
+
|
| 768 |
+
# define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
|
| 769 |
+
# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
|
| 770 |
+
# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
|
| 771 |
+
# define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
|
| 772 |
+
# define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
|
| 773 |
+
# define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
|
| 774 |
+
# define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
|
| 775 |
+
# define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
|
| 776 |
+
# define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
|
| 777 |
+
# define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
|
| 778 |
+
# define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
|
| 779 |
+
|
| 780 |
+
OSSL_CORE_MAKE_FUNC(void *, asym_cipher_newctx, (void *provctx))
|
| 781 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt_init, (void *ctx, void *provkey,
|
| 782 |
+
const OSSL_PARAM params[]))
|
| 783 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt, (void *ctx, unsigned char *out,
|
| 784 |
+
size_t *outlen,
|
| 785 |
+
size_t outsize,
|
| 786 |
+
const unsigned char *in,
|
| 787 |
+
size_t inlen))
|
| 788 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt_init, (void *ctx, void *provkey,
|
| 789 |
+
const OSSL_PARAM params[]))
|
| 790 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt, (void *ctx, unsigned char *out,
|
| 791 |
+
size_t *outlen,
|
| 792 |
+
size_t outsize,
|
| 793 |
+
const unsigned char *in,
|
| 794 |
+
size_t inlen))
|
| 795 |
+
OSSL_CORE_MAKE_FUNC(void, asym_cipher_freectx, (void *ctx))
|
| 796 |
+
OSSL_CORE_MAKE_FUNC(void *, asym_cipher_dupctx, (void *ctx))
|
| 797 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_get_ctx_params,
|
| 798 |
+
(void *ctx, OSSL_PARAM params[]))
|
| 799 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_gettable_ctx_params,
|
| 800 |
+
(void *ctx, void *provctx))
|
| 801 |
+
OSSL_CORE_MAKE_FUNC(int, asym_cipher_set_ctx_params,
|
| 802 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 803 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_settable_ctx_params,
|
| 804 |
+
(void *ctx, void *provctx))
|
| 805 |
+
|
| 806 |
+
/* Asymmetric Key encapsulation */
|
| 807 |
+
# define OSSL_FUNC_KEM_NEWCTX 1
|
| 808 |
+
# define OSSL_FUNC_KEM_ENCAPSULATE_INIT 2
|
| 809 |
+
# define OSSL_FUNC_KEM_ENCAPSULATE 3
|
| 810 |
+
# define OSSL_FUNC_KEM_DECAPSULATE_INIT 4
|
| 811 |
+
# define OSSL_FUNC_KEM_DECAPSULATE 5
|
| 812 |
+
# define OSSL_FUNC_KEM_FREECTX 6
|
| 813 |
+
# define OSSL_FUNC_KEM_DUPCTX 7
|
| 814 |
+
# define OSSL_FUNC_KEM_GET_CTX_PARAMS 8
|
| 815 |
+
# define OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS 9
|
| 816 |
+
# define OSSL_FUNC_KEM_SET_CTX_PARAMS 10
|
| 817 |
+
# define OSSL_FUNC_KEM_SETTABLE_CTX_PARAMS 11
|
| 818 |
+
|
| 819 |
+
OSSL_CORE_MAKE_FUNC(void *, kem_newctx, (void *provctx))
|
| 820 |
+
OSSL_CORE_MAKE_FUNC(int, kem_encapsulate_init, (void *ctx, void *provkey,
|
| 821 |
+
const OSSL_PARAM params[]))
|
| 822 |
+
OSSL_CORE_MAKE_FUNC(int, kem_encapsulate, (void *ctx,
|
| 823 |
+
unsigned char *out, size_t *outlen,
|
| 824 |
+
unsigned char *secret,
|
| 825 |
+
size_t *secretlen))
|
| 826 |
+
OSSL_CORE_MAKE_FUNC(int, kem_decapsulate_init, (void *ctx, void *provkey,
|
| 827 |
+
const OSSL_PARAM params[]))
|
| 828 |
+
OSSL_CORE_MAKE_FUNC(int, kem_decapsulate, (void *ctx,
|
| 829 |
+
unsigned char *out, size_t *outlen,
|
| 830 |
+
const unsigned char *in, size_t inlen))
|
| 831 |
+
OSSL_CORE_MAKE_FUNC(void, kem_freectx, (void *ctx))
|
| 832 |
+
OSSL_CORE_MAKE_FUNC(void *, kem_dupctx, (void *ctx))
|
| 833 |
+
OSSL_CORE_MAKE_FUNC(int, kem_get_ctx_params, (void *ctx, OSSL_PARAM params[]))
|
| 834 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_gettable_ctx_params,
|
| 835 |
+
(void *ctx, void *provctx))
|
| 836 |
+
OSSL_CORE_MAKE_FUNC(int, kem_set_ctx_params,
|
| 837 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 838 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_settable_ctx_params,
|
| 839 |
+
(void *ctx, void *provctx))
|
| 840 |
+
|
| 841 |
+
/* Encoders and decoders */
|
| 842 |
+
# define OSSL_FUNC_ENCODER_NEWCTX 1
|
| 843 |
+
# define OSSL_FUNC_ENCODER_FREECTX 2
|
| 844 |
+
# define OSSL_FUNC_ENCODER_GET_PARAMS 3
|
| 845 |
+
# define OSSL_FUNC_ENCODER_GETTABLE_PARAMS 4
|
| 846 |
+
# define OSSL_FUNC_ENCODER_SET_CTX_PARAMS 5
|
| 847 |
+
# define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS 6
|
| 848 |
+
# define OSSL_FUNC_ENCODER_DOES_SELECTION 10
|
| 849 |
+
# define OSSL_FUNC_ENCODER_ENCODE 11
|
| 850 |
+
# define OSSL_FUNC_ENCODER_IMPORT_OBJECT 20
|
| 851 |
+
# define OSSL_FUNC_ENCODER_FREE_OBJECT 21
|
| 852 |
+
OSSL_CORE_MAKE_FUNC(void *, encoder_newctx, (void *provctx))
|
| 853 |
+
OSSL_CORE_MAKE_FUNC(void, encoder_freectx, (void *ctx))
|
| 854 |
+
OSSL_CORE_MAKE_FUNC(int, encoder_get_params, (OSSL_PARAM params[]))
|
| 855 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_gettable_params,
|
| 856 |
+
(void *provctx))
|
| 857 |
+
OSSL_CORE_MAKE_FUNC(int, encoder_set_ctx_params,
|
| 858 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 859 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_settable_ctx_params,
|
| 860 |
+
(void *provctx))
|
| 861 |
+
|
| 862 |
+
OSSL_CORE_MAKE_FUNC(int, encoder_does_selection,
|
| 863 |
+
(void *provctx, int selection))
|
| 864 |
+
OSSL_CORE_MAKE_FUNC(int, encoder_encode,
|
| 865 |
+
(void *ctx, OSSL_CORE_BIO *out,
|
| 866 |
+
const void *obj_raw, const OSSL_PARAM obj_abstract[],
|
| 867 |
+
int selection,
|
| 868 |
+
OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
|
| 869 |
+
|
| 870 |
+
OSSL_CORE_MAKE_FUNC(void *, encoder_import_object,
|
| 871 |
+
(void *ctx, int selection, const OSSL_PARAM params[]))
|
| 872 |
+
OSSL_CORE_MAKE_FUNC(void, encoder_free_object, (void *obj))
|
| 873 |
+
|
| 874 |
+
# define OSSL_FUNC_DECODER_NEWCTX 1
|
| 875 |
+
# define OSSL_FUNC_DECODER_FREECTX 2
|
| 876 |
+
# define OSSL_FUNC_DECODER_GET_PARAMS 3
|
| 877 |
+
# define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4
|
| 878 |
+
# define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5
|
| 879 |
+
# define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6
|
| 880 |
+
# define OSSL_FUNC_DECODER_DOES_SELECTION 10
|
| 881 |
+
# define OSSL_FUNC_DECODER_DECODE 11
|
| 882 |
+
# define OSSL_FUNC_DECODER_EXPORT_OBJECT 20
|
| 883 |
+
OSSL_CORE_MAKE_FUNC(void *, decoder_newctx, (void *provctx))
|
| 884 |
+
OSSL_CORE_MAKE_FUNC(void, decoder_freectx, (void *ctx))
|
| 885 |
+
OSSL_CORE_MAKE_FUNC(int, decoder_get_params, (OSSL_PARAM params[]))
|
| 886 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_gettable_params,
|
| 887 |
+
(void *provctx))
|
| 888 |
+
OSSL_CORE_MAKE_FUNC(int, decoder_set_ctx_params,
|
| 889 |
+
(void *ctx, const OSSL_PARAM params[]))
|
| 890 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_settable_ctx_params,
|
| 891 |
+
(void *provctx))
|
| 892 |
+
|
| 893 |
+
OSSL_CORE_MAKE_FUNC(int, decoder_does_selection,
|
| 894 |
+
(void *provctx, int selection))
|
| 895 |
+
OSSL_CORE_MAKE_FUNC(int, decoder_decode,
|
| 896 |
+
(void *ctx, OSSL_CORE_BIO *in, int selection,
|
| 897 |
+
OSSL_CALLBACK *data_cb, void *data_cbarg,
|
| 898 |
+
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
|
| 899 |
+
OSSL_CORE_MAKE_FUNC(int, decoder_export_object,
|
| 900 |
+
(void *ctx, const void *objref, size_t objref_sz,
|
| 901 |
+
OSSL_CALLBACK *export_cb, void *export_cbarg))
|
| 902 |
+
|
| 903 |
+
/*-
|
| 904 |
+
* Store
|
| 905 |
+
*
|
| 906 |
+
* Objects are scanned by using the 'open', 'load', 'eof' and 'close'
|
| 907 |
+
* functions, which implement an OSSL_STORE loader.
|
| 908 |
+
*
|
| 909 |
+
* store_load() works in a way that's very similar to the decoders, in
|
| 910 |
+
* that they pass an abstract object through a callback, either as a DER
|
| 911 |
+
* octet string or as an object reference, which libcrypto will have to
|
| 912 |
+
* deal with.
|
| 913 |
+
*/
|
| 914 |
+
|
| 915 |
+
#define OSSL_FUNC_STORE_OPEN 1
|
| 916 |
+
#define OSSL_FUNC_STORE_ATTACH 2
|
| 917 |
+
#define OSSL_FUNC_STORE_SETTABLE_CTX_PARAMS 3
|
| 918 |
+
#define OSSL_FUNC_STORE_SET_CTX_PARAMS 4
|
| 919 |
+
#define OSSL_FUNC_STORE_LOAD 5
|
| 920 |
+
#define OSSL_FUNC_STORE_EOF 6
|
| 921 |
+
#define OSSL_FUNC_STORE_CLOSE 7
|
| 922 |
+
#define OSSL_FUNC_STORE_EXPORT_OBJECT 8
|
| 923 |
+
OSSL_CORE_MAKE_FUNC(void *, store_open, (void *provctx, const char *uri))
|
| 924 |
+
OSSL_CORE_MAKE_FUNC(void *, store_attach, (void *provctx, OSSL_CORE_BIO *in))
|
| 925 |
+
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, store_settable_ctx_params,
|
| 926 |
+
(void *provctx))
|
| 927 |
+
OSSL_CORE_MAKE_FUNC(int, store_set_ctx_params,
|
| 928 |
+
(void *loaderctx, const OSSL_PARAM params[]))
|
| 929 |
+
OSSL_CORE_MAKE_FUNC(int, store_load,
|
| 930 |
+
(void *loaderctx,
|
| 931 |
+
OSSL_CALLBACK *object_cb, void *object_cbarg,
|
| 932 |
+
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
|
| 933 |
+
OSSL_CORE_MAKE_FUNC(int, store_eof, (void *loaderctx))
|
| 934 |
+
OSSL_CORE_MAKE_FUNC(int, store_close, (void *loaderctx))
|
| 935 |
+
OSSL_CORE_MAKE_FUNC(int, store_export_object,
|
| 936 |
+
(void *loaderctx, const void *objref, size_t objref_sz,
|
| 937 |
+
OSSL_CALLBACK *export_cb, void *export_cbarg))
|
| 938 |
+
|
| 939 |
+
# ifdef __cplusplus
|
| 940 |
+
}
|
| 941 |
+
# endif
|
| 942 |
+
|
| 943 |
+
#endif
|
llava_next/include/openssl/crmferr.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CRMFERR_H
|
| 12 |
+
# define OPENSSL_CRMFERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# ifndef OPENSSL_NO_CRMF
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* CRMF reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define CRMF_R_BAD_PBM_ITERATIONCOUNT 100
|
| 27 |
+
# define CRMF_R_CRMFERROR 102
|
| 28 |
+
# define CRMF_R_ERROR 103
|
| 29 |
+
# define CRMF_R_ERROR_DECODING_CERTIFICATE 104
|
| 30 |
+
# define CRMF_R_ERROR_DECRYPTING_CERTIFICATE 105
|
| 31 |
+
# define CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY 106
|
| 32 |
+
# define CRMF_R_FAILURE_OBTAINING_RANDOM 107
|
| 33 |
+
# define CRMF_R_ITERATIONCOUNT_BELOW_100 108
|
| 34 |
+
# define CRMF_R_MALFORMED_IV 101
|
| 35 |
+
# define CRMF_R_NULL_ARGUMENT 109
|
| 36 |
+
# define CRMF_R_POPOSKINPUT_NOT_SUPPORTED 113
|
| 37 |
+
# define CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY 117
|
| 38 |
+
# define CRMF_R_POPO_MISSING 121
|
| 39 |
+
# define CRMF_R_POPO_MISSING_PUBLIC_KEY 118
|
| 40 |
+
# define CRMF_R_POPO_MISSING_SUBJECT 119
|
| 41 |
+
# define CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED 120
|
| 42 |
+
# define CRMF_R_SETTING_MAC_ALGOR_FAILURE 110
|
| 43 |
+
# define CRMF_R_SETTING_OWF_ALGOR_FAILURE 111
|
| 44 |
+
# define CRMF_R_UNSUPPORTED_ALGORITHM 112
|
| 45 |
+
# define CRMF_R_UNSUPPORTED_CIPHER 114
|
| 46 |
+
# define CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO 115
|
| 47 |
+
# define CRMF_R_UNSUPPORTED_POPO_METHOD 116
|
| 48 |
+
|
| 49 |
+
# endif
|
| 50 |
+
#endif
|
llava_next/include/openssl/ct.h
ADDED
|
@@ -0,0 +1,573 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/ct.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2016-2020 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 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CT_H
|
| 16 |
+
# define OPENSSL_CT_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CT_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
|
| 26 |
+
# ifndef OPENSSL_NO_CT
|
| 27 |
+
# include <openssl/types.h>
|
| 28 |
+
# include <openssl/safestack.h>
|
| 29 |
+
# include <openssl/x509.h>
|
| 30 |
+
# include <openssl/cterr.h>
|
| 31 |
+
# ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
# endif
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
/* Minimum RSA key size, from RFC6962 */
|
| 37 |
+
# define SCT_MIN_RSA_BITS 2048
|
| 38 |
+
|
| 39 |
+
/* All hashes are SHA256 in v1 of Certificate Transparency */
|
| 40 |
+
# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
|
| 41 |
+
|
| 42 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SCT, SCT, SCT)
|
| 43 |
+
#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
|
| 44 |
+
#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
|
| 45 |
+
#define sk_SCT_new(cmp) ((STACK_OF(SCT) *)OPENSSL_sk_new(ossl_check_SCT_compfunc_type(cmp)))
|
| 46 |
+
#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_new_null())
|
| 47 |
+
#define sk_SCT_new_reserve(cmp, n) ((STACK_OF(SCT) *)OPENSSL_sk_new_reserve(ossl_check_SCT_compfunc_type(cmp), (n)))
|
| 48 |
+
#define sk_SCT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SCT_sk_type(sk), (n))
|
| 49 |
+
#define sk_SCT_free(sk) OPENSSL_sk_free(ossl_check_SCT_sk_type(sk))
|
| 50 |
+
#define sk_SCT_zero(sk) OPENSSL_sk_zero(ossl_check_SCT_sk_type(sk))
|
| 51 |
+
#define sk_SCT_delete(sk, i) ((SCT *)OPENSSL_sk_delete(ossl_check_SCT_sk_type(sk), (i)))
|
| 52 |
+
#define sk_SCT_delete_ptr(sk, ptr) ((SCT *)OPENSSL_sk_delete_ptr(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)))
|
| 53 |
+
#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 54 |
+
#define sk_SCT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 55 |
+
#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk)))
|
| 56 |
+
#define sk_SCT_shift(sk) ((SCT *)OPENSSL_sk_shift(ossl_check_SCT_sk_type(sk)))
|
| 57 |
+
#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk),ossl_check_SCT_freefunc_type(freefunc))
|
| 58 |
+
#define sk_SCT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), (idx))
|
| 59 |
+
#define sk_SCT_set(sk, idx, ptr) ((SCT *)OPENSSL_sk_set(ossl_check_SCT_sk_type(sk), (idx), ossl_check_SCT_type(ptr)))
|
| 60 |
+
#define sk_SCT_find(sk, ptr) OPENSSL_sk_find(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 61 |
+
#define sk_SCT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 62 |
+
#define sk_SCT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), pnum)
|
| 63 |
+
#define sk_SCT_sort(sk) OPENSSL_sk_sort(ossl_check_SCT_sk_type(sk))
|
| 64 |
+
#define sk_SCT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SCT_sk_type(sk))
|
| 65 |
+
#define sk_SCT_dup(sk) ((STACK_OF(SCT) *)OPENSSL_sk_dup(ossl_check_const_SCT_sk_type(sk)))
|
| 66 |
+
#define sk_SCT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SCT) *)OPENSSL_sk_deep_copy(ossl_check_const_SCT_sk_type(sk), ossl_check_SCT_copyfunc_type(copyfunc), ossl_check_SCT_freefunc_type(freefunc)))
|
| 67 |
+
#define sk_SCT_set_cmp_func(sk, cmp) ((sk_SCT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SCT_sk_type(sk), ossl_check_SCT_compfunc_type(cmp)))
|
| 68 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CTLOG, CTLOG, CTLOG)
|
| 69 |
+
#define sk_CTLOG_num(sk) OPENSSL_sk_num(ossl_check_const_CTLOG_sk_type(sk))
|
| 70 |
+
#define sk_CTLOG_value(sk, idx) ((CTLOG *)OPENSSL_sk_value(ossl_check_const_CTLOG_sk_type(sk), (idx)))
|
| 71 |
+
#define sk_CTLOG_new(cmp) ((STACK_OF(CTLOG) *)OPENSSL_sk_new(ossl_check_CTLOG_compfunc_type(cmp)))
|
| 72 |
+
#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null())
|
| 73 |
+
#define sk_CTLOG_new_reserve(cmp, n) ((STACK_OF(CTLOG) *)OPENSSL_sk_new_reserve(ossl_check_CTLOG_compfunc_type(cmp), (n)))
|
| 74 |
+
#define sk_CTLOG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CTLOG_sk_type(sk), (n))
|
| 75 |
+
#define sk_CTLOG_free(sk) OPENSSL_sk_free(ossl_check_CTLOG_sk_type(sk))
|
| 76 |
+
#define sk_CTLOG_zero(sk) OPENSSL_sk_zero(ossl_check_CTLOG_sk_type(sk))
|
| 77 |
+
#define sk_CTLOG_delete(sk, i) ((CTLOG *)OPENSSL_sk_delete(ossl_check_CTLOG_sk_type(sk), (i)))
|
| 78 |
+
#define sk_CTLOG_delete_ptr(sk, ptr) ((CTLOG *)OPENSSL_sk_delete_ptr(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)))
|
| 79 |
+
#define sk_CTLOG_push(sk, ptr) OPENSSL_sk_push(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 80 |
+
#define sk_CTLOG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 81 |
+
#define sk_CTLOG_pop(sk) ((CTLOG *)OPENSSL_sk_pop(ossl_check_CTLOG_sk_type(sk)))
|
| 82 |
+
#define sk_CTLOG_shift(sk) ((CTLOG *)OPENSSL_sk_shift(ossl_check_CTLOG_sk_type(sk)))
|
| 83 |
+
#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk),ossl_check_CTLOG_freefunc_type(freefunc))
|
| 84 |
+
#define sk_CTLOG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), (idx))
|
| 85 |
+
#define sk_CTLOG_set(sk, idx, ptr) ((CTLOG *)OPENSSL_sk_set(ossl_check_CTLOG_sk_type(sk), (idx), ossl_check_CTLOG_type(ptr)))
|
| 86 |
+
#define sk_CTLOG_find(sk, ptr) OPENSSL_sk_find(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 87 |
+
#define sk_CTLOG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 88 |
+
#define sk_CTLOG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), pnum)
|
| 89 |
+
#define sk_CTLOG_sort(sk) OPENSSL_sk_sort(ossl_check_CTLOG_sk_type(sk))
|
| 90 |
+
#define sk_CTLOG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CTLOG_sk_type(sk))
|
| 91 |
+
#define sk_CTLOG_dup(sk) ((STACK_OF(CTLOG) *)OPENSSL_sk_dup(ossl_check_const_CTLOG_sk_type(sk)))
|
| 92 |
+
#define sk_CTLOG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CTLOG) *)OPENSSL_sk_deep_copy(ossl_check_const_CTLOG_sk_type(sk), ossl_check_CTLOG_copyfunc_type(copyfunc), ossl_check_CTLOG_freefunc_type(freefunc)))
|
| 93 |
+
#define sk_CTLOG_set_cmp_func(sk, cmp) ((sk_CTLOG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_compfunc_type(cmp)))
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
typedef enum {
|
| 98 |
+
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
|
| 99 |
+
CT_LOG_ENTRY_TYPE_X509 = 0,
|
| 100 |
+
CT_LOG_ENTRY_TYPE_PRECERT = 1
|
| 101 |
+
} ct_log_entry_type_t;
|
| 102 |
+
|
| 103 |
+
typedef enum {
|
| 104 |
+
SCT_VERSION_NOT_SET = -1,
|
| 105 |
+
SCT_VERSION_V1 = 0
|
| 106 |
+
} sct_version_t;
|
| 107 |
+
|
| 108 |
+
typedef enum {
|
| 109 |
+
SCT_SOURCE_UNKNOWN,
|
| 110 |
+
SCT_SOURCE_TLS_EXTENSION,
|
| 111 |
+
SCT_SOURCE_X509V3_EXTENSION,
|
| 112 |
+
SCT_SOURCE_OCSP_STAPLED_RESPONSE
|
| 113 |
+
} sct_source_t;
|
| 114 |
+
|
| 115 |
+
typedef enum {
|
| 116 |
+
SCT_VALIDATION_STATUS_NOT_SET,
|
| 117 |
+
SCT_VALIDATION_STATUS_UNKNOWN_LOG,
|
| 118 |
+
SCT_VALIDATION_STATUS_VALID,
|
| 119 |
+
SCT_VALIDATION_STATUS_INVALID,
|
| 120 |
+
SCT_VALIDATION_STATUS_UNVERIFIED,
|
| 121 |
+
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
|
| 122 |
+
} sct_validation_status_t;
|
| 123 |
+
|
| 124 |
+
/******************************************
|
| 125 |
+
* CT policy evaluation context functions *
|
| 126 |
+
******************************************/
|
| 127 |
+
|
| 128 |
+
/*
|
| 129 |
+
* Creates a new, empty policy evaluation context associated with the given
|
| 130 |
+
* library context and property query string.
|
| 131 |
+
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
|
| 132 |
+
* with the CT_POLICY_EVAL_CTX.
|
| 133 |
+
*/
|
| 134 |
+
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
|
| 135 |
+
const char *propq);
|
| 136 |
+
|
| 137 |
+
/*
|
| 138 |
+
* The same as CT_POLICY_EVAL_CTX_new_ex() but the default library
|
| 139 |
+
* context and property query string is used.
|
| 140 |
+
*/
|
| 141 |
+
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
|
| 142 |
+
|
| 143 |
+
/* Deletes a policy evaluation context and anything it owns. */
|
| 144 |
+
void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
|
| 145 |
+
|
| 146 |
+
/* Gets the peer certificate that the SCTs are for */
|
| 147 |
+
X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
|
| 148 |
+
|
| 149 |
+
/*
|
| 150 |
+
* Sets the certificate associated with the received SCTs.
|
| 151 |
+
* Increments the reference count of cert.
|
| 152 |
+
* Returns 1 on success, 0 otherwise.
|
| 153 |
+
*/
|
| 154 |
+
int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
|
| 155 |
+
|
| 156 |
+
/* Gets the issuer of the aforementioned certificate */
|
| 157 |
+
X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
|
| 158 |
+
|
| 159 |
+
/*
|
| 160 |
+
* Sets the issuer of the certificate associated with the received SCTs.
|
| 161 |
+
* Increments the reference count of issuer.
|
| 162 |
+
* Returns 1 on success, 0 otherwise.
|
| 163 |
+
*/
|
| 164 |
+
int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
|
| 165 |
+
|
| 166 |
+
/* Gets the CT logs that are trusted sources of SCTs */
|
| 167 |
+
const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
|
| 168 |
+
|
| 169 |
+
/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */
|
| 170 |
+
void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
|
| 171 |
+
CTLOG_STORE *log_store);
|
| 172 |
+
|
| 173 |
+
/*
|
| 174 |
+
* Gets the time, in milliseconds since the Unix epoch, that will be used as the
|
| 175 |
+
* current time when checking whether an SCT was issued in the future.
|
| 176 |
+
* Such SCTs will fail validation, as required by RFC6962.
|
| 177 |
+
*/
|
| 178 |
+
uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
|
| 179 |
+
|
| 180 |
+
/*
|
| 181 |
+
* Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch.
|
| 182 |
+
* If an SCT's timestamp is after this time, it will be interpreted as having
|
| 183 |
+
* been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs
|
| 184 |
+
* whose timestamp is in the future", so an SCT will not validate in this case.
|
| 185 |
+
*/
|
| 186 |
+
void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
|
| 187 |
+
|
| 188 |
+
/*****************
|
| 189 |
+
* SCT functions *
|
| 190 |
+
*****************/
|
| 191 |
+
|
| 192 |
+
/*
|
| 193 |
+
* Creates a new, blank SCT.
|
| 194 |
+
* The caller is responsible for calling SCT_free when finished with the SCT.
|
| 195 |
+
*/
|
| 196 |
+
SCT *SCT_new(void);
|
| 197 |
+
|
| 198 |
+
/*
|
| 199 |
+
* Creates a new SCT from some base64-encoded strings.
|
| 200 |
+
* The caller is responsible for calling SCT_free when finished with the SCT.
|
| 201 |
+
*/
|
| 202 |
+
SCT *SCT_new_from_base64(unsigned char version,
|
| 203 |
+
const char *logid_base64,
|
| 204 |
+
ct_log_entry_type_t entry_type,
|
| 205 |
+
uint64_t timestamp,
|
| 206 |
+
const char *extensions_base64,
|
| 207 |
+
const char *signature_base64);
|
| 208 |
+
|
| 209 |
+
/*
|
| 210 |
+
* Frees the SCT and the underlying data structures.
|
| 211 |
+
*/
|
| 212 |
+
void SCT_free(SCT *sct);
|
| 213 |
+
|
| 214 |
+
/*
|
| 215 |
+
* Free a stack of SCTs, and the underlying SCTs themselves.
|
| 216 |
+
* Intended to be compatible with X509V3_EXT_FREE.
|
| 217 |
+
*/
|
| 218 |
+
void SCT_LIST_free(STACK_OF(SCT) *a);
|
| 219 |
+
|
| 220 |
+
/*
|
| 221 |
+
* Returns the version of the SCT.
|
| 222 |
+
*/
|
| 223 |
+
sct_version_t SCT_get_version(const SCT *sct);
|
| 224 |
+
|
| 225 |
+
/*
|
| 226 |
+
* Set the version of an SCT.
|
| 227 |
+
* Returns 1 on success, 0 if the version is unrecognized.
|
| 228 |
+
*/
|
| 229 |
+
__owur int SCT_set_version(SCT *sct, sct_version_t version);
|
| 230 |
+
|
| 231 |
+
/*
|
| 232 |
+
* Returns the log entry type of the SCT.
|
| 233 |
+
*/
|
| 234 |
+
ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct);
|
| 235 |
+
|
| 236 |
+
/*
|
| 237 |
+
* Set the log entry type of an SCT.
|
| 238 |
+
* Returns 1 on success, 0 otherwise.
|
| 239 |
+
*/
|
| 240 |
+
__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type);
|
| 241 |
+
|
| 242 |
+
/*
|
| 243 |
+
* Gets the ID of the log that an SCT came from.
|
| 244 |
+
* Ownership of the log ID remains with the SCT.
|
| 245 |
+
* Returns the length of the log ID.
|
| 246 |
+
*/
|
| 247 |
+
size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id);
|
| 248 |
+
|
| 249 |
+
/*
|
| 250 |
+
* Set the log ID of an SCT to point directly to the *log_id specified.
|
| 251 |
+
* The SCT takes ownership of the specified pointer.
|
| 252 |
+
* Returns 1 on success, 0 otherwise.
|
| 253 |
+
*/
|
| 254 |
+
__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len);
|
| 255 |
+
|
| 256 |
+
/*
|
| 257 |
+
* Set the log ID of an SCT.
|
| 258 |
+
* This makes a copy of the log_id.
|
| 259 |
+
* Returns 1 on success, 0 otherwise.
|
| 260 |
+
*/
|
| 261 |
+
__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id,
|
| 262 |
+
size_t log_id_len);
|
| 263 |
+
|
| 264 |
+
/*
|
| 265 |
+
* Returns the timestamp for the SCT (epoch time in milliseconds).
|
| 266 |
+
*/
|
| 267 |
+
uint64_t SCT_get_timestamp(const SCT *sct);
|
| 268 |
+
|
| 269 |
+
/*
|
| 270 |
+
* Set the timestamp of an SCT (epoch time in milliseconds).
|
| 271 |
+
*/
|
| 272 |
+
void SCT_set_timestamp(SCT *sct, uint64_t timestamp);
|
| 273 |
+
|
| 274 |
+
/*
|
| 275 |
+
* Return the NID for the signature used by the SCT.
|
| 276 |
+
* For CT v1, this will be either NID_sha256WithRSAEncryption or
|
| 277 |
+
* NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset).
|
| 278 |
+
*/
|
| 279 |
+
int SCT_get_signature_nid(const SCT *sct);
|
| 280 |
+
|
| 281 |
+
/*
|
| 282 |
+
* Set the signature type of an SCT
|
| 283 |
+
* For CT v1, this should be either NID_sha256WithRSAEncryption or
|
| 284 |
+
* NID_ecdsa_with_SHA256.
|
| 285 |
+
* Returns 1 on success, 0 otherwise.
|
| 286 |
+
*/
|
| 287 |
+
__owur int SCT_set_signature_nid(SCT *sct, int nid);
|
| 288 |
+
|
| 289 |
+
/*
|
| 290 |
+
* Set *ext to point to the extension data for the SCT. ext must not be NULL.
|
| 291 |
+
* The SCT retains ownership of this pointer.
|
| 292 |
+
* Returns length of the data pointed to.
|
| 293 |
+
*/
|
| 294 |
+
size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext);
|
| 295 |
+
|
| 296 |
+
/*
|
| 297 |
+
* Set the extensions of an SCT to point directly to the *ext specified.
|
| 298 |
+
* The SCT takes ownership of the specified pointer.
|
| 299 |
+
*/
|
| 300 |
+
void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len);
|
| 301 |
+
|
| 302 |
+
/*
|
| 303 |
+
* Set the extensions of an SCT.
|
| 304 |
+
* This takes a copy of the ext.
|
| 305 |
+
* Returns 1 on success, 0 otherwise.
|
| 306 |
+
*/
|
| 307 |
+
__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext,
|
| 308 |
+
size_t ext_len);
|
| 309 |
+
|
| 310 |
+
/*
|
| 311 |
+
* Set *sig to point to the signature for the SCT. sig must not be NULL.
|
| 312 |
+
* The SCT retains ownership of this pointer.
|
| 313 |
+
* Returns length of the data pointed to.
|
| 314 |
+
*/
|
| 315 |
+
size_t SCT_get0_signature(const SCT *sct, unsigned char **sig);
|
| 316 |
+
|
| 317 |
+
/*
|
| 318 |
+
* Set the signature of an SCT to point directly to the *sig specified.
|
| 319 |
+
* The SCT takes ownership of the specified pointer.
|
| 320 |
+
*/
|
| 321 |
+
void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len);
|
| 322 |
+
|
| 323 |
+
/*
|
| 324 |
+
* Set the signature of an SCT to be a copy of the *sig specified.
|
| 325 |
+
* Returns 1 on success, 0 otherwise.
|
| 326 |
+
*/
|
| 327 |
+
__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig,
|
| 328 |
+
size_t sig_len);
|
| 329 |
+
|
| 330 |
+
/*
|
| 331 |
+
* The origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
| 332 |
+
*/
|
| 333 |
+
sct_source_t SCT_get_source(const SCT *sct);
|
| 334 |
+
|
| 335 |
+
/*
|
| 336 |
+
* Set the origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
| 337 |
+
* Returns 1 on success, 0 otherwise.
|
| 338 |
+
*/
|
| 339 |
+
__owur int SCT_set_source(SCT *sct, sct_source_t source);
|
| 340 |
+
|
| 341 |
+
/*
|
| 342 |
+
* Returns a text string describing the validation status of |sct|.
|
| 343 |
+
*/
|
| 344 |
+
const char *SCT_validation_status_string(const SCT *sct);
|
| 345 |
+
|
| 346 |
+
/*
|
| 347 |
+
* Pretty-prints an |sct| to |out|.
|
| 348 |
+
* It will be indented by the number of spaces specified by |indent|.
|
| 349 |
+
* If |logs| is not NULL, it will be used to lookup the CT log that the SCT came
|
| 350 |
+
* from, so that the log name can be printed.
|
| 351 |
+
*/
|
| 352 |
+
void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs);
|
| 353 |
+
|
| 354 |
+
/*
|
| 355 |
+
* Pretty-prints an |sct_list| to |out|.
|
| 356 |
+
* It will be indented by the number of spaces specified by |indent|.
|
| 357 |
+
* SCTs will be delimited by |separator|.
|
| 358 |
+
* If |logs| is not NULL, it will be used to lookup the CT log that each SCT
|
| 359 |
+
* came from, so that the log names can be printed.
|
| 360 |
+
*/
|
| 361 |
+
void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent,
|
| 362 |
+
const char *separator, const CTLOG_STORE *logs);
|
| 363 |
+
|
| 364 |
+
/*
|
| 365 |
+
* Gets the last result of validating this SCT.
|
| 366 |
+
* If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET.
|
| 367 |
+
*/
|
| 368 |
+
sct_validation_status_t SCT_get_validation_status(const SCT *sct);
|
| 369 |
+
|
| 370 |
+
/*
|
| 371 |
+
* Validates the given SCT with the provided context.
|
| 372 |
+
* Sets the "validation_status" field of the SCT.
|
| 373 |
+
* Returns 1 if the SCT is valid and the signature verifies.
|
| 374 |
+
* Returns 0 if the SCT is invalid or could not be verified.
|
| 375 |
+
* Returns -1 if an error occurs.
|
| 376 |
+
*/
|
| 377 |
+
__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
|
| 378 |
+
|
| 379 |
+
/*
|
| 380 |
+
* Validates the given list of SCTs with the provided context.
|
| 381 |
+
* Sets the "validation_status" field of each SCT.
|
| 382 |
+
* Returns 1 if there are no invalid SCTs and all signatures verify.
|
| 383 |
+
* Returns 0 if at least one SCT is invalid or could not be verified.
|
| 384 |
+
* Returns a negative integer if an error occurs.
|
| 385 |
+
*/
|
| 386 |
+
__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts,
|
| 387 |
+
CT_POLICY_EVAL_CTX *ctx);
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
/*********************************
|
| 391 |
+
* SCT parsing and serialization *
|
| 392 |
+
*********************************/
|
| 393 |
+
|
| 394 |
+
/*
|
| 395 |
+
* Serialize (to TLS format) a stack of SCTs and return the length.
|
| 396 |
+
* "a" must not be NULL.
|
| 397 |
+
* If "pp" is NULL, just return the length of what would have been serialized.
|
| 398 |
+
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
| 399 |
+
* for data that caller is responsible for freeing (only if function returns
|
| 400 |
+
* successfully).
|
| 401 |
+
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
| 402 |
+
* that "*pp" is large enough to accept all of the serialized data.
|
| 403 |
+
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
| 404 |
+
* on success.
|
| 405 |
+
*/
|
| 406 |
+
__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
| 407 |
+
|
| 408 |
+
/*
|
| 409 |
+
* Convert TLS format SCT list to a stack of SCTs.
|
| 410 |
+
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
| 411 |
+
* responsible for freeing (by calling SCT_LIST_free).
|
| 412 |
+
* "**pp" and "*pp" must not be NULL.
|
| 413 |
+
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
| 414 |
+
* will be returned.
|
| 415 |
+
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
| 416 |
+
* not defined.
|
| 417 |
+
*/
|
| 418 |
+
STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
| 419 |
+
size_t len);
|
| 420 |
+
|
| 421 |
+
/*
|
| 422 |
+
* Serialize (to DER format) a stack of SCTs and return the length.
|
| 423 |
+
* "a" must not be NULL.
|
| 424 |
+
* If "pp" is NULL, just returns the length of what would have been serialized.
|
| 425 |
+
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
| 426 |
+
* for data that caller is responsible for freeing (only if function returns
|
| 427 |
+
* successfully).
|
| 428 |
+
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
| 429 |
+
* that "*pp" is large enough to accept all of the serialized data.
|
| 430 |
+
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
| 431 |
+
* on success.
|
| 432 |
+
*/
|
| 433 |
+
__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
| 434 |
+
|
| 435 |
+
/*
|
| 436 |
+
* Parses an SCT list in DER format and returns it.
|
| 437 |
+
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
| 438 |
+
* responsible for freeing (by calling SCT_LIST_free).
|
| 439 |
+
* "**pp" and "*pp" must not be NULL.
|
| 440 |
+
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
| 441 |
+
* will be returned.
|
| 442 |
+
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
| 443 |
+
* not defined.
|
| 444 |
+
*/
|
| 445 |
+
STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
| 446 |
+
long len);
|
| 447 |
+
|
| 448 |
+
/*
|
| 449 |
+
* Serialize (to TLS format) an |sct| and write it to |out|.
|
| 450 |
+
* If |out| is null, no SCT will be output but the length will still be returned.
|
| 451 |
+
* If |out| points to a null pointer, a string will be allocated to hold the
|
| 452 |
+
* TLS-format SCT. It is the responsibility of the caller to free it.
|
| 453 |
+
* If |out| points to an allocated string, the TLS-format SCT will be written
|
| 454 |
+
* to it.
|
| 455 |
+
* The length of the SCT in TLS format will be returned.
|
| 456 |
+
*/
|
| 457 |
+
__owur int i2o_SCT(const SCT *sct, unsigned char **out);
|
| 458 |
+
|
| 459 |
+
/*
|
| 460 |
+
* Parses an SCT in TLS format and returns it.
|
| 461 |
+
* If |psct| is not null, it will end up pointing to the parsed SCT. If it
|
| 462 |
+
* already points to a non-null pointer, the pointer will be free'd.
|
| 463 |
+
* |in| should be a pointer to a string containing the TLS-format SCT.
|
| 464 |
+
* |in| will be advanced to the end of the SCT if parsing succeeds.
|
| 465 |
+
* |len| should be the length of the SCT in |in|.
|
| 466 |
+
* Returns NULL if an error occurs.
|
| 467 |
+
* If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len'
|
| 468 |
+
* fields will be populated (with |in| and |len| respectively).
|
| 469 |
+
*/
|
| 470 |
+
SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len);
|
| 471 |
+
|
| 472 |
+
/********************
|
| 473 |
+
* CT log functions *
|
| 474 |
+
********************/
|
| 475 |
+
|
| 476 |
+
/*
|
| 477 |
+
* Creates a new CT log instance with the given |public_key| and |name| and
|
| 478 |
+
* associates it with the give library context |libctx| and property query
|
| 479 |
+
* string |propq|.
|
| 480 |
+
* Takes ownership of |public_key| but copies |name|.
|
| 481 |
+
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
|
| 482 |
+
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
| 483 |
+
*/
|
| 484 |
+
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
|
| 485 |
+
const char *propq);
|
| 486 |
+
|
| 487 |
+
/*
|
| 488 |
+
* The same as CTLOG_new_ex except that the default library context and
|
| 489 |
+
* property query string are used.
|
| 490 |
+
*/
|
| 491 |
+
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
|
| 492 |
+
|
| 493 |
+
/*
|
| 494 |
+
* Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
|
| 495 |
+
* in |pkey_base64| and associated with the given library context |libctx| and
|
| 496 |
+
* property query string |propq|. The |name| is a string to help users identify
|
| 497 |
+
* this log.
|
| 498 |
+
* Returns 1 on success, 0 on failure.
|
| 499 |
+
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
| 500 |
+
*/
|
| 501 |
+
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
|
| 502 |
+
const char *name, OSSL_LIB_CTX *libctx,
|
| 503 |
+
const char *propq);
|
| 504 |
+
|
| 505 |
+
/*
|
| 506 |
+
* The same as CTLOG_new_from_base64_ex() except that the default
|
| 507 |
+
* library context and property query string are used.
|
| 508 |
+
* Returns 1 on success, 0 on failure.
|
| 509 |
+
*/
|
| 510 |
+
int CTLOG_new_from_base64(CTLOG ** ct_log,
|
| 511 |
+
const char *pkey_base64, const char *name);
|
| 512 |
+
|
| 513 |
+
/*
|
| 514 |
+
* Deletes a CT log instance and its fields.
|
| 515 |
+
*/
|
| 516 |
+
void CTLOG_free(CTLOG *log);
|
| 517 |
+
|
| 518 |
+
/* Gets the name of the CT log */
|
| 519 |
+
const char *CTLOG_get0_name(const CTLOG *log);
|
| 520 |
+
/* Gets the ID of the CT log */
|
| 521 |
+
void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
|
| 522 |
+
size_t *log_id_len);
|
| 523 |
+
/* Gets the public key of the CT log */
|
| 524 |
+
EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
|
| 525 |
+
|
| 526 |
+
/**************************
|
| 527 |
+
* CT log store functions *
|
| 528 |
+
**************************/
|
| 529 |
+
|
| 530 |
+
/*
|
| 531 |
+
* Creates a new CT log store and associates it with the given libctx and
|
| 532 |
+
* property query string.
|
| 533 |
+
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
| 534 |
+
*/
|
| 535 |
+
CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 536 |
+
|
| 537 |
+
/*
|
| 538 |
+
* Same as CTLOG_STORE_new_ex except that the default libctx and
|
| 539 |
+
* property query string are used.
|
| 540 |
+
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
| 541 |
+
*/
|
| 542 |
+
CTLOG_STORE *CTLOG_STORE_new(void);
|
| 543 |
+
|
| 544 |
+
/*
|
| 545 |
+
* Deletes a CT log store and all of the CT log instances held within.
|
| 546 |
+
*/
|
| 547 |
+
void CTLOG_STORE_free(CTLOG_STORE *store);
|
| 548 |
+
|
| 549 |
+
/*
|
| 550 |
+
* Finds a CT log in the store based on its log ID.
|
| 551 |
+
* Returns the CT log, or NULL if no match is found.
|
| 552 |
+
*/
|
| 553 |
+
const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store,
|
| 554 |
+
const uint8_t *log_id,
|
| 555 |
+
size_t log_id_len);
|
| 556 |
+
|
| 557 |
+
/*
|
| 558 |
+
* Loads a CT log list into a |store| from a |file|.
|
| 559 |
+
* Returns 1 if loading is successful, or 0 otherwise.
|
| 560 |
+
*/
|
| 561 |
+
__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
|
| 562 |
+
|
| 563 |
+
/*
|
| 564 |
+
* Loads the default CT log list into a |store|.
|
| 565 |
+
* Returns 1 if loading is successful, or 0 otherwise.
|
| 566 |
+
*/
|
| 567 |
+
__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
|
| 568 |
+
|
| 569 |
+
# ifdef __cplusplus
|
| 570 |
+
}
|
| 571 |
+
# endif
|
| 572 |
+
# endif
|
| 573 |
+
#endif
|
llava_next/include/openssl/decodererr.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_DECODERERR_H
|
| 12 |
+
# define OPENSSL_DECODERERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* OSSL_DECODER reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT 101
|
| 25 |
+
# define OSSL_DECODER_R_DECODER_NOT_FOUND 102
|
| 26 |
+
# define OSSL_DECODER_R_MISSING_GET_PARAMS 100
|
| 27 |
+
|
| 28 |
+
#endif
|
llava_next/include/openssl/dherr.h
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2023 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_DHERR_H
|
| 12 |
+
# define OPENSSL_DHERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# ifndef OPENSSL_NO_DH
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* DH reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define DH_R_BAD_FFC_PARAMETERS 127
|
| 27 |
+
# define DH_R_BAD_GENERATOR 101
|
| 28 |
+
# define DH_R_BN_DECODE_ERROR 109
|
| 29 |
+
# define DH_R_BN_ERROR 106
|
| 30 |
+
# define DH_R_CHECK_INVALID_J_VALUE 115
|
| 31 |
+
# define DH_R_CHECK_INVALID_Q_VALUE 116
|
| 32 |
+
# define DH_R_CHECK_PUBKEY_INVALID 122
|
| 33 |
+
# define DH_R_CHECK_PUBKEY_TOO_LARGE 123
|
| 34 |
+
# define DH_R_CHECK_PUBKEY_TOO_SMALL 124
|
| 35 |
+
# define DH_R_CHECK_P_NOT_PRIME 117
|
| 36 |
+
# define DH_R_CHECK_P_NOT_SAFE_PRIME 118
|
| 37 |
+
# define DH_R_CHECK_Q_NOT_PRIME 119
|
| 38 |
+
# define DH_R_DECODE_ERROR 104
|
| 39 |
+
# define DH_R_INVALID_PARAMETER_NAME 110
|
| 40 |
+
# define DH_R_INVALID_PARAMETER_NID 114
|
| 41 |
+
# define DH_R_INVALID_PUBKEY 102
|
| 42 |
+
# define DH_R_INVALID_SECRET 128
|
| 43 |
+
# define DH_R_KDF_PARAMETER_ERROR 112
|
| 44 |
+
# define DH_R_KEYS_NOT_SET 108
|
| 45 |
+
# define DH_R_MISSING_PUBKEY 125
|
| 46 |
+
# define DH_R_MODULUS_TOO_LARGE 103
|
| 47 |
+
# define DH_R_MODULUS_TOO_SMALL 126
|
| 48 |
+
# define DH_R_NOT_SUITABLE_GENERATOR 120
|
| 49 |
+
# define DH_R_NO_PARAMETERS_SET 107
|
| 50 |
+
# define DH_R_NO_PRIVATE_VALUE 100
|
| 51 |
+
# define DH_R_PARAMETER_ENCODING_ERROR 105
|
| 52 |
+
# define DH_R_PEER_KEY_ERROR 111
|
| 53 |
+
# define DH_R_Q_TOO_LARGE 130
|
| 54 |
+
# define DH_R_SHARED_INFO_ERROR 113
|
| 55 |
+
# define DH_R_UNABLE_TO_CHECK_GENERATOR 121
|
| 56 |
+
|
| 57 |
+
# endif
|
| 58 |
+
#endif
|
llava_next/include/openssl/encoder.h
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_ENCODER_H
|
| 11 |
+
# define OPENSSL_ENCODER_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/opensslconf.h>
|
| 15 |
+
|
| 16 |
+
# ifndef OPENSSL_NO_STDIO
|
| 17 |
+
# include <stdio.h>
|
| 18 |
+
# endif
|
| 19 |
+
# include <stdarg.h>
|
| 20 |
+
# include <stddef.h>
|
| 21 |
+
# include <openssl/encodererr.h>
|
| 22 |
+
# include <openssl/types.h>
|
| 23 |
+
# include <openssl/core.h>
|
| 24 |
+
|
| 25 |
+
# ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
# endif
|
| 28 |
+
|
| 29 |
+
OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
|
| 30 |
+
const char *properties);
|
| 31 |
+
int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
|
| 32 |
+
void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
|
| 33 |
+
|
| 34 |
+
const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder);
|
| 35 |
+
const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder);
|
| 36 |
+
const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *kdf);
|
| 37 |
+
const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *kdf);
|
| 38 |
+
int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
|
| 39 |
+
|
| 40 |
+
void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
|
| 41 |
+
void (*fn)(OSSL_ENCODER *encoder, void *arg),
|
| 42 |
+
void *arg);
|
| 43 |
+
int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
|
| 44 |
+
void (*fn)(const char *name, void *data),
|
| 45 |
+
void *data);
|
| 46 |
+
const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder);
|
| 47 |
+
int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]);
|
| 48 |
+
|
| 49 |
+
const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder);
|
| 50 |
+
OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new(void);
|
| 51 |
+
int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx,
|
| 52 |
+
const OSSL_PARAM params[]);
|
| 53 |
+
void OSSL_ENCODER_CTX_free(OSSL_ENCODER_CTX *ctx);
|
| 54 |
+
|
| 55 |
+
/* Utilities that help set specific parameters */
|
| 56 |
+
int OSSL_ENCODER_CTX_set_passphrase(OSSL_ENCODER_CTX *ctx,
|
| 57 |
+
const unsigned char *kstr, size_t klen);
|
| 58 |
+
int OSSL_ENCODER_CTX_set_pem_password_cb(OSSL_ENCODER_CTX *ctx,
|
| 59 |
+
pem_password_cb *cb, void *cbarg);
|
| 60 |
+
int OSSL_ENCODER_CTX_set_passphrase_cb(OSSL_ENCODER_CTX *ctx,
|
| 61 |
+
OSSL_PASSPHRASE_CALLBACK *cb,
|
| 62 |
+
void *cbarg);
|
| 63 |
+
int OSSL_ENCODER_CTX_set_passphrase_ui(OSSL_ENCODER_CTX *ctx,
|
| 64 |
+
const UI_METHOD *ui_method,
|
| 65 |
+
void *ui_data);
|
| 66 |
+
int OSSL_ENCODER_CTX_set_cipher(OSSL_ENCODER_CTX *ctx,
|
| 67 |
+
const char *cipher_name,
|
| 68 |
+
const char *propquery);
|
| 69 |
+
int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection);
|
| 70 |
+
int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx,
|
| 71 |
+
const char *output_type);
|
| 72 |
+
int OSSL_ENCODER_CTX_set_output_structure(OSSL_ENCODER_CTX *ctx,
|
| 73 |
+
const char *output_structure);
|
| 74 |
+
|
| 75 |
+
/* Utilities to add encoders */
|
| 76 |
+
int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder);
|
| 77 |
+
int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
|
| 78 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 79 |
+
int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx);
|
| 80 |
+
|
| 81 |
+
typedef struct ossl_encoder_instance_st OSSL_ENCODER_INSTANCE;
|
| 82 |
+
OSSL_ENCODER *
|
| 83 |
+
OSSL_ENCODER_INSTANCE_get_encoder(OSSL_ENCODER_INSTANCE *encoder_inst);
|
| 84 |
+
void *
|
| 85 |
+
OSSL_ENCODER_INSTANCE_get_encoder_ctx(OSSL_ENCODER_INSTANCE *encoder_inst);
|
| 86 |
+
const char *
|
| 87 |
+
OSSL_ENCODER_INSTANCE_get_output_type(OSSL_ENCODER_INSTANCE *encoder_inst);
|
| 88 |
+
const char *
|
| 89 |
+
OSSL_ENCODER_INSTANCE_get_output_structure(OSSL_ENCODER_INSTANCE *encoder_inst);
|
| 90 |
+
|
| 91 |
+
typedef const void *OSSL_ENCODER_CONSTRUCT(OSSL_ENCODER_INSTANCE *encoder_inst,
|
| 92 |
+
void *construct_data);
|
| 93 |
+
typedef void OSSL_ENCODER_CLEANUP(void *construct_data);
|
| 94 |
+
|
| 95 |
+
int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx,
|
| 96 |
+
OSSL_ENCODER_CONSTRUCT *construct);
|
| 97 |
+
int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx,
|
| 98 |
+
void *construct_data);
|
| 99 |
+
int OSSL_ENCODER_CTX_set_cleanup(OSSL_ENCODER_CTX *ctx,
|
| 100 |
+
OSSL_ENCODER_CLEANUP *cleanup);
|
| 101 |
+
|
| 102 |
+
/* Utilities to output the object to encode */
|
| 103 |
+
int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out);
|
| 104 |
+
#ifndef OPENSSL_NO_STDIO
|
| 105 |
+
int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp);
|
| 106 |
+
#endif
|
| 107 |
+
int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata,
|
| 108 |
+
size_t *pdata_len);
|
| 109 |
+
|
| 110 |
+
/*
|
| 111 |
+
* Create the OSSL_ENCODER_CTX with an associated type. This will perform
|
| 112 |
+
* an implicit OSSL_ENCODER_fetch(), suitable for the object of that type.
|
| 113 |
+
* This is more useful than calling OSSL_ENCODER_CTX_new().
|
| 114 |
+
*/
|
| 115 |
+
OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey,
|
| 116 |
+
int selection,
|
| 117 |
+
const char *output_type,
|
| 118 |
+
const char *output_struct,
|
| 119 |
+
const char *propquery);
|
| 120 |
+
|
| 121 |
+
# ifdef __cplusplus
|
| 122 |
+
}
|
| 123 |
+
# endif
|
| 124 |
+
#endif
|
llava_next/include/openssl/encodererr.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_ENCODERERR_H
|
| 12 |
+
# define OPENSSL_ENCODERERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* OSSL_ENCODER reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define OSSL_ENCODER_R_ENCODER_NOT_FOUND 101
|
| 25 |
+
# define OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY 100
|
| 26 |
+
# define OSSL_ENCODER_R_MISSING_GET_PARAMS 102
|
| 27 |
+
|
| 28 |
+
#endif
|
llava_next/include/openssl/err.h
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2022 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 |
+
|
| 12 |
+
#ifndef OPENSSL_ERR_H
|
| 13 |
+
# define OPENSSL_ERR_H
|
| 14 |
+
# pragma once
|
| 15 |
+
|
| 16 |
+
# include <openssl/macros.h>
|
| 17 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 18 |
+
# define HEADER_ERR_H
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
# include <openssl/e_os2.h>
|
| 22 |
+
|
| 23 |
+
# ifndef OPENSSL_NO_STDIO
|
| 24 |
+
# include <stdio.h>
|
| 25 |
+
# include <stdlib.h>
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# include <openssl/types.h>
|
| 29 |
+
# include <openssl/bio.h>
|
| 30 |
+
# include <openssl/lhash.h>
|
| 31 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 32 |
+
|
| 33 |
+
#ifdef __cplusplus
|
| 34 |
+
extern "C" {
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 38 |
+
# ifndef OPENSSL_NO_FILENAMES
|
| 39 |
+
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,fn,ln)
|
| 40 |
+
# else
|
| 41 |
+
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,NULL,0)
|
| 42 |
+
# endif
|
| 43 |
+
# endif
|
| 44 |
+
|
| 45 |
+
# include <limits.h>
|
| 46 |
+
# include <errno.h>
|
| 47 |
+
|
| 48 |
+
# define ERR_TXT_MALLOCED 0x01
|
| 49 |
+
# define ERR_TXT_STRING 0x02
|
| 50 |
+
|
| 51 |
+
# if !defined(OPENSSL_NO_DEPRECATED_3_0) || defined(OSSL_FORCE_ERR_STATE)
|
| 52 |
+
# define ERR_FLAG_MARK 0x01
|
| 53 |
+
# define ERR_FLAG_CLEAR 0x02
|
| 54 |
+
|
| 55 |
+
# define ERR_NUM_ERRORS 16
|
| 56 |
+
struct err_state_st {
|
| 57 |
+
int err_flags[ERR_NUM_ERRORS];
|
| 58 |
+
int err_marks[ERR_NUM_ERRORS];
|
| 59 |
+
unsigned long err_buffer[ERR_NUM_ERRORS];
|
| 60 |
+
char *err_data[ERR_NUM_ERRORS];
|
| 61 |
+
size_t err_data_size[ERR_NUM_ERRORS];
|
| 62 |
+
int err_data_flags[ERR_NUM_ERRORS];
|
| 63 |
+
char *err_file[ERR_NUM_ERRORS];
|
| 64 |
+
int err_line[ERR_NUM_ERRORS];
|
| 65 |
+
char *err_func[ERR_NUM_ERRORS];
|
| 66 |
+
int top, bottom;
|
| 67 |
+
};
|
| 68 |
+
# endif
|
| 69 |
+
|
| 70 |
+
/* library */
|
| 71 |
+
# define ERR_LIB_NONE 1
|
| 72 |
+
# define ERR_LIB_SYS 2
|
| 73 |
+
# define ERR_LIB_BN 3
|
| 74 |
+
# define ERR_LIB_RSA 4
|
| 75 |
+
# define ERR_LIB_DH 5
|
| 76 |
+
# define ERR_LIB_EVP 6
|
| 77 |
+
# define ERR_LIB_BUF 7
|
| 78 |
+
# define ERR_LIB_OBJ 8
|
| 79 |
+
# define ERR_LIB_PEM 9
|
| 80 |
+
# define ERR_LIB_DSA 10
|
| 81 |
+
# define ERR_LIB_X509 11
|
| 82 |
+
/* #define ERR_LIB_METH 12 */
|
| 83 |
+
# define ERR_LIB_ASN1 13
|
| 84 |
+
# define ERR_LIB_CONF 14
|
| 85 |
+
# define ERR_LIB_CRYPTO 15
|
| 86 |
+
# define ERR_LIB_EC 16
|
| 87 |
+
# define ERR_LIB_SSL 20
|
| 88 |
+
/* #define ERR_LIB_SSL23 21 */
|
| 89 |
+
/* #define ERR_LIB_SSL2 22 */
|
| 90 |
+
/* #define ERR_LIB_SSL3 23 */
|
| 91 |
+
/* #define ERR_LIB_RSAREF 30 */
|
| 92 |
+
/* #define ERR_LIB_PROXY 31 */
|
| 93 |
+
# define ERR_LIB_BIO 32
|
| 94 |
+
# define ERR_LIB_PKCS7 33
|
| 95 |
+
# define ERR_LIB_X509V3 34
|
| 96 |
+
# define ERR_LIB_PKCS12 35
|
| 97 |
+
# define ERR_LIB_RAND 36
|
| 98 |
+
# define ERR_LIB_DSO 37
|
| 99 |
+
# define ERR_LIB_ENGINE 38
|
| 100 |
+
# define ERR_LIB_OCSP 39
|
| 101 |
+
# define ERR_LIB_UI 40
|
| 102 |
+
# define ERR_LIB_COMP 41
|
| 103 |
+
# define ERR_LIB_ECDSA 42
|
| 104 |
+
# define ERR_LIB_ECDH 43
|
| 105 |
+
# define ERR_LIB_OSSL_STORE 44
|
| 106 |
+
# define ERR_LIB_FIPS 45
|
| 107 |
+
# define ERR_LIB_CMS 46
|
| 108 |
+
# define ERR_LIB_TS 47
|
| 109 |
+
# define ERR_LIB_HMAC 48
|
| 110 |
+
/* # define ERR_LIB_JPAKE 49 */
|
| 111 |
+
# define ERR_LIB_CT 50
|
| 112 |
+
# define ERR_LIB_ASYNC 51
|
| 113 |
+
# define ERR_LIB_KDF 52
|
| 114 |
+
# define ERR_LIB_SM2 53
|
| 115 |
+
# define ERR_LIB_ESS 54
|
| 116 |
+
# define ERR_LIB_PROP 55
|
| 117 |
+
# define ERR_LIB_CRMF 56
|
| 118 |
+
# define ERR_LIB_PROV 57
|
| 119 |
+
# define ERR_LIB_CMP 58
|
| 120 |
+
# define ERR_LIB_OSSL_ENCODER 59
|
| 121 |
+
# define ERR_LIB_OSSL_DECODER 60
|
| 122 |
+
# define ERR_LIB_HTTP 61
|
| 123 |
+
|
| 124 |
+
# define ERR_LIB_USER 128
|
| 125 |
+
|
| 126 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 127 |
+
# define ASN1err(f, r) ERR_raise_data(ERR_LIB_ASN1, (r), NULL)
|
| 128 |
+
# define ASYNCerr(f, r) ERR_raise_data(ERR_LIB_ASYNC, (r), NULL)
|
| 129 |
+
# define BIOerr(f, r) ERR_raise_data(ERR_LIB_BIO, (r), NULL)
|
| 130 |
+
# define BNerr(f, r) ERR_raise_data(ERR_LIB_BN, (r), NULL)
|
| 131 |
+
# define BUFerr(f, r) ERR_raise_data(ERR_LIB_BUF, (r), NULL)
|
| 132 |
+
# define CMPerr(f, r) ERR_raise_data(ERR_LIB_CMP, (r), NULL)
|
| 133 |
+
# define CMSerr(f, r) ERR_raise_data(ERR_LIB_CMS, (r), NULL)
|
| 134 |
+
# define COMPerr(f, r) ERR_raise_data(ERR_LIB_COMP, (r), NULL)
|
| 135 |
+
# define CONFerr(f, r) ERR_raise_data(ERR_LIB_CONF, (r), NULL)
|
| 136 |
+
# define CRMFerr(f, r) ERR_raise_data(ERR_LIB_CRMF, (r), NULL)
|
| 137 |
+
# define CRYPTOerr(f, r) ERR_raise_data(ERR_LIB_CRYPTO, (r), NULL)
|
| 138 |
+
# define CTerr(f, r) ERR_raise_data(ERR_LIB_CT, (r), NULL)
|
| 139 |
+
# define DHerr(f, r) ERR_raise_data(ERR_LIB_DH, (r), NULL)
|
| 140 |
+
# define DSAerr(f, r) ERR_raise_data(ERR_LIB_DSA, (r), NULL)
|
| 141 |
+
# define DSOerr(f, r) ERR_raise_data(ERR_LIB_DSO, (r), NULL)
|
| 142 |
+
# define ECDHerr(f, r) ERR_raise_data(ERR_LIB_ECDH, (r), NULL)
|
| 143 |
+
# define ECDSAerr(f, r) ERR_raise_data(ERR_LIB_ECDSA, (r), NULL)
|
| 144 |
+
# define ECerr(f, r) ERR_raise_data(ERR_LIB_EC, (r), NULL)
|
| 145 |
+
# define ENGINEerr(f, r) ERR_raise_data(ERR_LIB_ENGINE, (r), NULL)
|
| 146 |
+
# define ESSerr(f, r) ERR_raise_data(ERR_LIB_ESS, (r), NULL)
|
| 147 |
+
# define EVPerr(f, r) ERR_raise_data(ERR_LIB_EVP, (r), NULL)
|
| 148 |
+
# define FIPSerr(f, r) ERR_raise_data(ERR_LIB_FIPS, (r), NULL)
|
| 149 |
+
# define HMACerr(f, r) ERR_raise_data(ERR_LIB_HMAC, (r), NULL)
|
| 150 |
+
# define HTTPerr(f, r) ERR_raise_data(ERR_LIB_HTTP, (r), NULL)
|
| 151 |
+
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
| 152 |
+
# define OBJerr(f, r) ERR_raise_data(ERR_LIB_OBJ, (r), NULL)
|
| 153 |
+
# define OCSPerr(f, r) ERR_raise_data(ERR_LIB_OCSP, (r), NULL)
|
| 154 |
+
# define OSSL_STOREerr(f, r) ERR_raise_data(ERR_LIB_OSSL_STORE, (r), NULL)
|
| 155 |
+
# define PEMerr(f, r) ERR_raise_data(ERR_LIB_PEM, (r), NULL)
|
| 156 |
+
# define PKCS12err(f, r) ERR_raise_data(ERR_LIB_PKCS12, (r), NULL)
|
| 157 |
+
# define PKCS7err(f, r) ERR_raise_data(ERR_LIB_PKCS7, (r), NULL)
|
| 158 |
+
# define PROPerr(f, r) ERR_raise_data(ERR_LIB_PROP, (r), NULL)
|
| 159 |
+
# define PROVerr(f, r) ERR_raise_data(ERR_LIB_PROV, (r), NULL)
|
| 160 |
+
# define RANDerr(f, r) ERR_raise_data(ERR_LIB_RAND, (r), NULL)
|
| 161 |
+
# define RSAerr(f, r) ERR_raise_data(ERR_LIB_RSA, (r), NULL)
|
| 162 |
+
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
| 163 |
+
# define SM2err(f, r) ERR_raise_data(ERR_LIB_SM2, (r), NULL)
|
| 164 |
+
# define SSLerr(f, r) ERR_raise_data(ERR_LIB_SSL, (r), NULL)
|
| 165 |
+
# define SYSerr(f, r) ERR_raise_data(ERR_LIB_SYS, (r), NULL)
|
| 166 |
+
# define TSerr(f, r) ERR_raise_data(ERR_LIB_TS, (r), NULL)
|
| 167 |
+
# define UIerr(f, r) ERR_raise_data(ERR_LIB_UI, (r), NULL)
|
| 168 |
+
# define X509V3err(f, r) ERR_raise_data(ERR_LIB_X509V3, (r), NULL)
|
| 169 |
+
# define X509err(f, r) ERR_raise_data(ERR_LIB_X509, (r), NULL)
|
| 170 |
+
# endif
|
| 171 |
+
|
| 172 |
+
/*-
|
| 173 |
+
* The error code packs differently depending on if it records a system
|
| 174 |
+
* error or an OpenSSL error.
|
| 175 |
+
*
|
| 176 |
+
* A system error packs like this (we follow POSIX and only allow positive
|
| 177 |
+
* numbers that fit in an |int|):
|
| 178 |
+
*
|
| 179 |
+
* +-+-------------------------------------------------------------+
|
| 180 |
+
* |1| system error number |
|
| 181 |
+
* +-+-------------------------------------------------------------+
|
| 182 |
+
*
|
| 183 |
+
* An OpenSSL error packs like this:
|
| 184 |
+
*
|
| 185 |
+
* <---------------------------- 32 bits -------------------------->
|
| 186 |
+
* <--- 8 bits ---><------------------ 23 bits ----------------->
|
| 187 |
+
* +-+---------------+---------------------------------------------+
|
| 188 |
+
* |0| library | reason |
|
| 189 |
+
* +-+---------------+---------------------------------------------+
|
| 190 |
+
*
|
| 191 |
+
* A few of the reason bits are reserved as flags with special meaning:
|
| 192 |
+
*
|
| 193 |
+
* <5 bits-<>--------- 19 bits ----------------->
|
| 194 |
+
* +-------+-+-----------------------------------+
|
| 195 |
+
* | rflags| | reason |
|
| 196 |
+
* +-------+-+-----------------------------------+
|
| 197 |
+
* ^
|
| 198 |
+
* |
|
| 199 |
+
* ERR_RFLAG_FATAL = ERR_R_FATAL
|
| 200 |
+
*
|
| 201 |
+
* The reason flags are part of the overall reason code for practical
|
| 202 |
+
* reasons, as they provide an easy way to place different types of
|
| 203 |
+
* reason codes in different numeric ranges.
|
| 204 |
+
*
|
| 205 |
+
* The currently known reason flags are:
|
| 206 |
+
*
|
| 207 |
+
* ERR_RFLAG_FATAL Flags that the reason code is considered fatal.
|
| 208 |
+
* For backward compatibility reasons, this flag
|
| 209 |
+
* is also the code for ERR_R_FATAL (that reason
|
| 210 |
+
* code served the dual purpose of flag and reason
|
| 211 |
+
* code in one in pre-3.0 OpenSSL).
|
| 212 |
+
* ERR_RFLAG_COMMON Flags that the reason code is common to all
|
| 213 |
+
* libraries. All ERR_R_ macros must use this flag,
|
| 214 |
+
* and no other _R_ macro is allowed to use it.
|
| 215 |
+
*/
|
| 216 |
+
|
| 217 |
+
/* Macros to help decode recorded system errors */
|
| 218 |
+
# define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
|
| 219 |
+
# define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
|
| 220 |
+
|
| 221 |
+
/*
|
| 222 |
+
* Macros to help decode recorded OpenSSL errors
|
| 223 |
+
* As expressed above, RFLAGS and REASON overlap by one bit to allow
|
| 224 |
+
* ERR_R_FATAL to use ERR_RFLAG_FATAL as its reason code.
|
| 225 |
+
*/
|
| 226 |
+
# define ERR_LIB_OFFSET 23L
|
| 227 |
+
# define ERR_LIB_MASK 0xFF
|
| 228 |
+
# define ERR_RFLAGS_OFFSET 18L
|
| 229 |
+
# define ERR_RFLAGS_MASK 0x1F
|
| 230 |
+
# define ERR_REASON_MASK 0X7FFFFF
|
| 231 |
+
|
| 232 |
+
/*
|
| 233 |
+
* Reason flags are defined pre-shifted to easily combine with the reason
|
| 234 |
+
* number.
|
| 235 |
+
*/
|
| 236 |
+
# define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
|
| 237 |
+
# define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
|
| 238 |
+
|
| 239 |
+
# define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
|
| 240 |
+
|
| 241 |
+
static ossl_unused ossl_inline int ERR_GET_LIB(unsigned long errcode)
|
| 242 |
+
{
|
| 243 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 244 |
+
return ERR_LIB_SYS;
|
| 245 |
+
return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
static ossl_unused ossl_inline int ERR_GET_RFLAGS(unsigned long errcode)
|
| 249 |
+
{
|
| 250 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 251 |
+
return 0;
|
| 252 |
+
return errcode & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET);
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
static ossl_unused ossl_inline int ERR_GET_REASON(unsigned long errcode)
|
| 256 |
+
{
|
| 257 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 258 |
+
return errcode & ERR_SYSTEM_MASK;
|
| 259 |
+
return errcode & ERR_REASON_MASK;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
static ossl_unused ossl_inline int ERR_FATAL_ERROR(unsigned long errcode)
|
| 263 |
+
{
|
| 264 |
+
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_FATAL) != 0;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
static ossl_unused ossl_inline int ERR_COMMON_ERROR(unsigned long errcode)
|
| 268 |
+
{
|
| 269 |
+
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_COMMON) != 0;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
/*
|
| 273 |
+
* ERR_PACK is a helper macro to properly pack OpenSSL error codes and may
|
| 274 |
+
* only be used for that purpose. System errors are packed internally.
|
| 275 |
+
* ERR_PACK takes reason flags and reason code combined in |reason|.
|
| 276 |
+
* ERR_PACK ignores |func|, that parameter is just legacy from pre-3.0 OpenSSL.
|
| 277 |
+
*/
|
| 278 |
+
# define ERR_PACK(lib,func,reason) \
|
| 279 |
+
( (((unsigned long)(lib) & ERR_LIB_MASK ) << ERR_LIB_OFFSET) | \
|
| 280 |
+
(((unsigned long)(reason) & ERR_REASON_MASK)) )
|
| 281 |
+
|
| 282 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 283 |
+
# define SYS_F_FOPEN 0
|
| 284 |
+
# define SYS_F_CONNECT 0
|
| 285 |
+
# define SYS_F_GETSERVBYNAME 0
|
| 286 |
+
# define SYS_F_SOCKET 0
|
| 287 |
+
# define SYS_F_IOCTLSOCKET 0
|
| 288 |
+
# define SYS_F_BIND 0
|
| 289 |
+
# define SYS_F_LISTEN 0
|
| 290 |
+
# define SYS_F_ACCEPT 0
|
| 291 |
+
# define SYS_F_WSASTARTUP 0
|
| 292 |
+
# define SYS_F_OPENDIR 0
|
| 293 |
+
# define SYS_F_FREAD 0
|
| 294 |
+
# define SYS_F_GETADDRINFO 0
|
| 295 |
+
# define SYS_F_GETNAMEINFO 0
|
| 296 |
+
# define SYS_F_SETSOCKOPT 0
|
| 297 |
+
# define SYS_F_GETSOCKOPT 0
|
| 298 |
+
# define SYS_F_GETSOCKNAME 0
|
| 299 |
+
# define SYS_F_GETHOSTBYNAME 0
|
| 300 |
+
# define SYS_F_FFLUSH 0
|
| 301 |
+
# define SYS_F_OPEN 0
|
| 302 |
+
# define SYS_F_CLOSE 0
|
| 303 |
+
# define SYS_F_IOCTL 0
|
| 304 |
+
# define SYS_F_STAT 0
|
| 305 |
+
# define SYS_F_FCNTL 0
|
| 306 |
+
# define SYS_F_FSTAT 0
|
| 307 |
+
# define SYS_F_SENDFILE 0
|
| 308 |
+
# endif
|
| 309 |
+
|
| 310 |
+
/*
|
| 311 |
+
* All ERR_R_ codes must be combined with ERR_RFLAG_COMMON.
|
| 312 |
+
*/
|
| 313 |
+
|
| 314 |
+
/* "we came from here" global reason codes, range 1..255 */
|
| 315 |
+
# define ERR_R_SYS_LIB (ERR_LIB_SYS/* 2 */ | ERR_RFLAG_COMMON)
|
| 316 |
+
# define ERR_R_BN_LIB (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
|
| 317 |
+
# define ERR_R_RSA_LIB (ERR_LIB_RSA/* 4 */ | ERR_RFLAG_COMMON)
|
| 318 |
+
# define ERR_R_DH_LIB (ERR_LIB_DH/* 5 */ | ERR_RFLAG_COMMON)
|
| 319 |
+
# define ERR_R_EVP_LIB (ERR_LIB_EVP/* 6 */ | ERR_RFLAG_COMMON)
|
| 320 |
+
# define ERR_R_BUF_LIB (ERR_LIB_BUF/* 7 */ | ERR_RFLAG_COMMON)
|
| 321 |
+
# define ERR_R_OBJ_LIB (ERR_LIB_OBJ/* 8 */ | ERR_RFLAG_COMMON)
|
| 322 |
+
# define ERR_R_PEM_LIB (ERR_LIB_PEM/* 9 */ | ERR_RFLAG_COMMON)
|
| 323 |
+
# define ERR_R_DSA_LIB (ERR_LIB_DSA/* 10 */ | ERR_RFLAG_COMMON)
|
| 324 |
+
# define ERR_R_X509_LIB (ERR_LIB_X509/* 11 */ | ERR_RFLAG_COMMON)
|
| 325 |
+
# define ERR_R_ASN1_LIB (ERR_LIB_ASN1/* 13 */ | ERR_RFLAG_COMMON)
|
| 326 |
+
# define ERR_R_CONF_LIB (ERR_LIB_CONF/* 14 */ | ERR_RFLAG_COMMON)
|
| 327 |
+
# define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
|
| 328 |
+
# define ERR_R_EC_LIB (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
|
| 329 |
+
# define ERR_R_SSL_LIB (ERR_LIB_SSL/* 20 */ | ERR_RFLAG_COMMON)
|
| 330 |
+
# define ERR_R_BIO_LIB (ERR_LIB_BIO/* 32 */ | ERR_RFLAG_COMMON)
|
| 331 |
+
# define ERR_R_PKCS7_LIB (ERR_LIB_PKCS7/* 33 */ | ERR_RFLAG_COMMON)
|
| 332 |
+
# define ERR_R_X509V3_LIB (ERR_LIB_X509V3/* 34 */ | ERR_RFLAG_COMMON)
|
| 333 |
+
# define ERR_R_PKCS12_LIB (ERR_LIB_PKCS12/* 35 */ | ERR_RFLAG_COMMON)
|
| 334 |
+
# define ERR_R_RAND_LIB (ERR_LIB_RAND/* 36 */ | ERR_RFLAG_COMMON)
|
| 335 |
+
# define ERR_R_DSO_LIB (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
|
| 336 |
+
# define ERR_R_ENGINE_LIB (ERR_LIB_ENGINE/* 38 */ | ERR_RFLAG_COMMON)
|
| 337 |
+
# define ERR_R_UI_LIB (ERR_LIB_UI/* 40 */ | ERR_RFLAG_COMMON)
|
| 338 |
+
# define ERR_R_ECDSA_LIB (ERR_LIB_ECDSA/* 42 */ | ERR_RFLAG_COMMON)
|
| 339 |
+
# define ERR_R_OSSL_STORE_LIB (ERR_LIB_OSSL_STORE/* 44 */ | ERR_RFLAG_COMMON)
|
| 340 |
+
# define ERR_R_CMS_LIB (ERR_LIB_CMS/* 46 */ | ERR_RFLAG_COMMON)
|
| 341 |
+
# define ERR_R_TS_LIB (ERR_LIB_TS/* 47 */ | ERR_RFLAG_COMMON)
|
| 342 |
+
# define ERR_R_CT_LIB (ERR_LIB_CT/* 50 */ | ERR_RFLAG_COMMON)
|
| 343 |
+
# define ERR_R_PROV_LIB (ERR_LIB_PROV/* 57 */ | ERR_RFLAG_COMMON)
|
| 344 |
+
# define ERR_R_ESS_LIB (ERR_LIB_ESS/* 54 */ | ERR_RFLAG_COMMON)
|
| 345 |
+
# define ERR_R_CMP_LIB (ERR_LIB_CMP/* 58 */ | ERR_RFLAG_COMMON)
|
| 346 |
+
# define ERR_R_OSSL_ENCODER_LIB (ERR_LIB_OSSL_ENCODER/* 59 */ | ERR_RFLAG_COMMON)
|
| 347 |
+
# define ERR_R_OSSL_DECODER_LIB (ERR_LIB_OSSL_DECODER/* 60 */ | ERR_RFLAG_COMMON)
|
| 348 |
+
|
| 349 |
+
/* Other common error codes, range 256..2^ERR_RFLAGS_OFFSET-1 */
|
| 350 |
+
# define ERR_R_FATAL (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
|
| 351 |
+
# define ERR_R_MALLOC_FAILURE (256|ERR_R_FATAL)
|
| 352 |
+
# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (257|ERR_R_FATAL)
|
| 353 |
+
# define ERR_R_PASSED_NULL_PARAMETER (258|ERR_R_FATAL)
|
| 354 |
+
# define ERR_R_INTERNAL_ERROR (259|ERR_R_FATAL)
|
| 355 |
+
# define ERR_R_DISABLED (260|ERR_R_FATAL)
|
| 356 |
+
# define ERR_R_INIT_FAIL (261|ERR_R_FATAL)
|
| 357 |
+
# define ERR_R_PASSED_INVALID_ARGUMENT (262|ERR_RFLAG_COMMON)
|
| 358 |
+
# define ERR_R_OPERATION_FAIL (263|ERR_R_FATAL)
|
| 359 |
+
# define ERR_R_INVALID_PROVIDER_FUNCTIONS (264|ERR_R_FATAL)
|
| 360 |
+
# define ERR_R_INTERRUPTED_OR_CANCELLED (265|ERR_RFLAG_COMMON)
|
| 361 |
+
# define ERR_R_NESTED_ASN1_ERROR (266|ERR_RFLAG_COMMON)
|
| 362 |
+
# define ERR_R_MISSING_ASN1_EOS (267|ERR_RFLAG_COMMON)
|
| 363 |
+
# define ERR_R_UNSUPPORTED (268|ERR_RFLAG_COMMON)
|
| 364 |
+
# define ERR_R_FETCH_FAILED (269|ERR_RFLAG_COMMON)
|
| 365 |
+
# define ERR_R_INVALID_PROPERTY_DEFINITION (270|ERR_RFLAG_COMMON)
|
| 366 |
+
# define ERR_R_UNABLE_TO_GET_READ_LOCK (271|ERR_R_FATAL)
|
| 367 |
+
# define ERR_R_UNABLE_TO_GET_WRITE_LOCK (272|ERR_R_FATAL)
|
| 368 |
+
|
| 369 |
+
typedef struct ERR_string_data_st {
|
| 370 |
+
unsigned long error;
|
| 371 |
+
const char *string;
|
| 372 |
+
} ERR_STRING_DATA;
|
| 373 |
+
|
| 374 |
+
DEFINE_LHASH_OF_INTERNAL(ERR_STRING_DATA);
|
| 375 |
+
#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)))
|
| 376 |
+
#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 377 |
+
#define lh_ERR_STRING_DATA_flush(lh) OPENSSL_LH_flush(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 378 |
+
#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 379 |
+
#define lh_ERR_STRING_DATA_delete(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_delete(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 380 |
+
#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 381 |
+
#define lh_ERR_STRING_DATA_error(lh) OPENSSL_LH_error(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 382 |
+
#define lh_ERR_STRING_DATA_num_items(lh) OPENSSL_LH_num_items(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 383 |
+
#define lh_ERR_STRING_DATA_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 384 |
+
#define lh_ERR_STRING_DATA_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 385 |
+
#define lh_ERR_STRING_DATA_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 386 |
+
#define lh_ERR_STRING_DATA_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 387 |
+
#define lh_ERR_STRING_DATA_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh), dl)
|
| 388 |
+
#define lh_ERR_STRING_DATA_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_doallfunc_type(dfn))
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
/* 12 lines and some on an 80 column terminal */
|
| 392 |
+
#define ERR_MAX_DATA_SIZE 1024
|
| 393 |
+
|
| 394 |
+
/* Building blocks */
|
| 395 |
+
void ERR_new(void);
|
| 396 |
+
void ERR_set_debug(const char *file, int line, const char *func);
|
| 397 |
+
void ERR_set_error(int lib, int reason, const char *fmt, ...);
|
| 398 |
+
void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
|
| 399 |
+
|
| 400 |
+
/* Main error raising functions */
|
| 401 |
+
# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
|
| 402 |
+
# define ERR_raise_data \
|
| 403 |
+
(ERR_new(), \
|
| 404 |
+
ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC), \
|
| 405 |
+
ERR_set_error)
|
| 406 |
+
|
| 407 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 408 |
+
/* Backward compatibility */
|
| 409 |
+
# define ERR_put_error(lib, func, reason, file, line) \
|
| 410 |
+
(ERR_new(), \
|
| 411 |
+
ERR_set_debug((file), (line), OPENSSL_FUNC), \
|
| 412 |
+
ERR_set_error((lib), (reason), NULL))
|
| 413 |
+
# endif
|
| 414 |
+
|
| 415 |
+
void ERR_set_error_data(char *data, int flags);
|
| 416 |
+
|
| 417 |
+
unsigned long ERR_get_error(void);
|
| 418 |
+
unsigned long ERR_get_error_all(const char **file, int *line,
|
| 419 |
+
const char **func,
|
| 420 |
+
const char **data, int *flags);
|
| 421 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 422 |
+
OSSL_DEPRECATEDIN_3_0
|
| 423 |
+
unsigned long ERR_get_error_line(const char **file, int *line);
|
| 424 |
+
OSSL_DEPRECATEDIN_3_0
|
| 425 |
+
unsigned long ERR_get_error_line_data(const char **file, int *line,
|
| 426 |
+
const char **data, int *flags);
|
| 427 |
+
#endif
|
| 428 |
+
unsigned long ERR_peek_error(void);
|
| 429 |
+
unsigned long ERR_peek_error_line(const char **file, int *line);
|
| 430 |
+
unsigned long ERR_peek_error_func(const char **func);
|
| 431 |
+
unsigned long ERR_peek_error_data(const char **data, int *flags);
|
| 432 |
+
unsigned long ERR_peek_error_all(const char **file, int *line,
|
| 433 |
+
const char **func,
|
| 434 |
+
const char **data, int *flags);
|
| 435 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 436 |
+
OSSL_DEPRECATEDIN_3_0
|
| 437 |
+
unsigned long ERR_peek_error_line_data(const char **file, int *line,
|
| 438 |
+
const char **data, int *flags);
|
| 439 |
+
# endif
|
| 440 |
+
unsigned long ERR_peek_last_error(void);
|
| 441 |
+
unsigned long ERR_peek_last_error_line(const char **file, int *line);
|
| 442 |
+
unsigned long ERR_peek_last_error_func(const char **func);
|
| 443 |
+
unsigned long ERR_peek_last_error_data(const char **data, int *flags);
|
| 444 |
+
unsigned long ERR_peek_last_error_all(const char **file, int *line,
|
| 445 |
+
const char **func,
|
| 446 |
+
const char **data, int *flags);
|
| 447 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 448 |
+
OSSL_DEPRECATEDIN_3_0
|
| 449 |
+
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
|
| 450 |
+
const char **data, int *flags);
|
| 451 |
+
# endif
|
| 452 |
+
|
| 453 |
+
void ERR_clear_error(void);
|
| 454 |
+
|
| 455 |
+
char *ERR_error_string(unsigned long e, char *buf);
|
| 456 |
+
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
|
| 457 |
+
const char *ERR_lib_error_string(unsigned long e);
|
| 458 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 459 |
+
OSSL_DEPRECATEDIN_3_0 const char *ERR_func_error_string(unsigned long e);
|
| 460 |
+
# endif
|
| 461 |
+
const char *ERR_reason_error_string(unsigned long e);
|
| 462 |
+
|
| 463 |
+
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
|
| 464 |
+
void *u);
|
| 465 |
+
# ifndef OPENSSL_NO_STDIO
|
| 466 |
+
void ERR_print_errors_fp(FILE *fp);
|
| 467 |
+
# endif
|
| 468 |
+
void ERR_print_errors(BIO *bp);
|
| 469 |
+
|
| 470 |
+
void ERR_add_error_data(int num, ...);
|
| 471 |
+
void ERR_add_error_vdata(int num, va_list args);
|
| 472 |
+
void ERR_add_error_txt(const char *sepr, const char *txt);
|
| 473 |
+
void ERR_add_error_mem_bio(const char *sep, BIO *bio);
|
| 474 |
+
|
| 475 |
+
int ERR_load_strings(int lib, ERR_STRING_DATA *str);
|
| 476 |
+
int ERR_load_strings_const(const ERR_STRING_DATA *str);
|
| 477 |
+
int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
|
| 478 |
+
|
| 479 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 480 |
+
# define ERR_load_crypto_strings() \
|
| 481 |
+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
|
| 482 |
+
# define ERR_free_strings() while(0) continue
|
| 483 |
+
#endif
|
| 484 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 485 |
+
OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *);
|
| 486 |
+
#endif
|
| 487 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
| 488 |
+
OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid);
|
| 489 |
+
#endif
|
| 490 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 491 |
+
OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void);
|
| 492 |
+
#endif
|
| 493 |
+
|
| 494 |
+
int ERR_get_next_error_library(void);
|
| 495 |
+
|
| 496 |
+
int ERR_set_mark(void);
|
| 497 |
+
int ERR_pop_to_mark(void);
|
| 498 |
+
int ERR_clear_last_mark(void);
|
| 499 |
+
|
| 500 |
+
#ifdef __cplusplus
|
| 501 |
+
}
|
| 502 |
+
#endif
|
| 503 |
+
|
| 504 |
+
#endif
|
llava_next/include/openssl/fipskey.h
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/fipskey.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2020-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 |
+
#ifndef OPENSSL_FIPSKEY_H
|
| 14 |
+
# define OPENSSL_FIPSKEY_H
|
| 15 |
+
# pragma once
|
| 16 |
+
|
| 17 |
+
# ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* The FIPS validation HMAC key, usable as an array initializer.
|
| 23 |
+
*/
|
| 24 |
+
#define FIPS_KEY_ELEMENTS \
|
| 25 |
+
0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13
|
| 26 |
+
|
| 27 |
+
/*
|
| 28 |
+
* The FIPS validation key, as a string.
|
| 29 |
+
*/
|
| 30 |
+
#define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813"
|
| 31 |
+
|
| 32 |
+
# ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
# endif
|
| 35 |
+
|
| 36 |
+
#endif
|
llava_next/include/openssl/http.h
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright Siemens AG 2018-2020
|
| 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_HTTP_H
|
| 12 |
+
# define OPENSSL_HTTP_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
|
| 17 |
+
# include <openssl/bio.h>
|
| 18 |
+
# include <openssl/asn1.h>
|
| 19 |
+
# include <openssl/conf.h>
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
# define OSSL_HTTP_NAME "http"
|
| 27 |
+
# define OSSL_HTTPS_NAME "https"
|
| 28 |
+
# define OSSL_HTTP_PREFIX OSSL_HTTP_NAME"://"
|
| 29 |
+
# define OSSL_HTTPS_PREFIX OSSL_HTTPS_NAME"://"
|
| 30 |
+
# define OSSL_HTTP_PORT "80"
|
| 31 |
+
# define OSSL_HTTPS_PORT "443"
|
| 32 |
+
# define OPENSSL_NO_PROXY "NO_PROXY"
|
| 33 |
+
# define OPENSSL_HTTP_PROXY "HTTP_PROXY"
|
| 34 |
+
# define OPENSSL_HTTPS_PROXY "HTTPS_PROXY"
|
| 35 |
+
|
| 36 |
+
# define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024)
|
| 37 |
+
# define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024)
|
| 38 |
+
# define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024)
|
| 39 |
+
|
| 40 |
+
/* Low-level HTTP API */
|
| 41 |
+
OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size);
|
| 42 |
+
void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
|
| 43 |
+
int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, int method_POST,
|
| 44 |
+
const char *server, const char *port,
|
| 45 |
+
const char *path);
|
| 46 |
+
int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
|
| 47 |
+
const char *name, const char *value);
|
| 48 |
+
int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx,
|
| 49 |
+
const char *content_type, int asn1,
|
| 50 |
+
int timeout, int keep_alive);
|
| 51 |
+
int OSSL_HTTP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
|
| 52 |
+
const ASN1_ITEM *it, const ASN1_VALUE *req);
|
| 53 |
+
int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx);
|
| 54 |
+
int OSSL_HTTP_REQ_CTX_nbio_d2i(OSSL_HTTP_REQ_CTX *rctx,
|
| 55 |
+
ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| 56 |
+
BIO *OSSL_HTTP_REQ_CTX_exchange(OSSL_HTTP_REQ_CTX *rctx);
|
| 57 |
+
BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx);
|
| 58 |
+
size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx);
|
| 59 |
+
void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx,
|
| 60 |
+
unsigned long len);
|
| 61 |
+
int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx);
|
| 62 |
+
|
| 63 |
+
/* High-level HTTP API */
|
| 64 |
+
typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail);
|
| 65 |
+
OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
|
| 66 |
+
const char *proxy, const char *no_proxy,
|
| 67 |
+
int use_ssl, BIO *bio, BIO *rbio,
|
| 68 |
+
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
| 69 |
+
int buf_size, int overall_timeout);
|
| 70 |
+
int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
|
| 71 |
+
const char *proxyuser, const char *proxypass,
|
| 72 |
+
int timeout, BIO *bio_err, const char *prog);
|
| 73 |
+
int OSSL_HTTP_set1_request(OSSL_HTTP_REQ_CTX *rctx, const char *path,
|
| 74 |
+
const STACK_OF(CONF_VALUE) *headers,
|
| 75 |
+
const char *content_type, BIO *req,
|
| 76 |
+
const char *expected_content_type, int expect_asn1,
|
| 77 |
+
size_t max_resp_len, int timeout, int keep_alive);
|
| 78 |
+
BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url);
|
| 79 |
+
BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
|
| 80 |
+
BIO *bio, BIO *rbio,
|
| 81 |
+
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
| 82 |
+
int buf_size, const STACK_OF(CONF_VALUE) *headers,
|
| 83 |
+
const char *expected_content_type, int expect_asn1,
|
| 84 |
+
size_t max_resp_len, int timeout);
|
| 85 |
+
BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx,
|
| 86 |
+
const char *server, const char *port,
|
| 87 |
+
const char *path, int use_ssl,
|
| 88 |
+
const char *proxy, const char *no_proxy,
|
| 89 |
+
BIO *bio, BIO *rbio,
|
| 90 |
+
OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
|
| 91 |
+
int buf_size, const STACK_OF(CONF_VALUE) *headers,
|
| 92 |
+
const char *content_type, BIO *req,
|
| 93 |
+
const char *expected_content_type, int expect_asn1,
|
| 94 |
+
size_t max_resp_len, int timeout, int keep_alive);
|
| 95 |
+
int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok);
|
| 96 |
+
|
| 97 |
+
/* Auxiliary functions */
|
| 98 |
+
int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
|
| 99 |
+
char **pport, int *pport_num,
|
| 100 |
+
char **ppath, char **pquery, char **pfrag);
|
| 101 |
+
int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost,
|
| 102 |
+
char **pport, int *pport_num,
|
| 103 |
+
char **ppath, char **pquery, char **pfrag);
|
| 104 |
+
const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy,
|
| 105 |
+
const char *server, int use_ssl);
|
| 106 |
+
|
| 107 |
+
# ifdef __cplusplus
|
| 108 |
+
}
|
| 109 |
+
# endif
|
| 110 |
+
#endif /* !defined(OPENSSL_HTTP_H) */
|
llava_next/include/openssl/objectserr.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 21 |
+
/*
|
| 22 |
+
* OBJ reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define OBJ_R_OID_EXISTS 102
|
| 25 |
+
# define OBJ_R_UNKNOWN_NID 101
|
| 26 |
+
# define OBJ_R_UNKNOWN_OBJECT_NAME 103
|
| 27 |
+
|
| 28 |
+
#endif
|
llava_next/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 */
|
llava_next/include/openssl/pem.h
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-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_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 |
+
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
# define PEM_BUFSIZE 1024
|
| 31 |
+
|
| 32 |
+
# define PEM_STRING_X509_OLD "X509 CERTIFICATE"
|
| 33 |
+
# define PEM_STRING_X509 "CERTIFICATE"
|
| 34 |
+
# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
|
| 35 |
+
# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
|
| 36 |
+
# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
|
| 37 |
+
# define PEM_STRING_X509_CRL "X509 CRL"
|
| 38 |
+
# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
|
| 39 |
+
# define PEM_STRING_PUBLIC "PUBLIC KEY"
|
| 40 |
+
# define PEM_STRING_RSA "RSA PRIVATE KEY"
|
| 41 |
+
# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
|
| 42 |
+
# define PEM_STRING_DSA "DSA PRIVATE KEY"
|
| 43 |
+
# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
|
| 44 |
+
# define PEM_STRING_PKCS7 "PKCS7"
|
| 45 |
+
# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
|
| 46 |
+
# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
|
| 47 |
+
# define PEM_STRING_PKCS8INF "PRIVATE KEY"
|
| 48 |
+
# define PEM_STRING_DHPARAMS "DH PARAMETERS"
|
| 49 |
+
# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
|
| 50 |
+
# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
|
| 51 |
+
# define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
|
| 52 |
+
# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
|
| 53 |
+
# define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
|
| 54 |
+
# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
|
| 55 |
+
# define PEM_STRING_PARAMETERS "PARAMETERS"
|
| 56 |
+
# define PEM_STRING_CMS "CMS"
|
| 57 |
+
|
| 58 |
+
# define PEM_TYPE_ENCRYPTED 10
|
| 59 |
+
# define PEM_TYPE_MIC_ONLY 20
|
| 60 |
+
# define PEM_TYPE_MIC_CLEAR 30
|
| 61 |
+
# define PEM_TYPE_CLEAR 40
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* These macros make the PEM_read/PEM_write functions easier to maintain and
|
| 65 |
+
* write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
|
| 66 |
+
* IMPLEMENT_PEM_rw_cb(...)
|
| 67 |
+
*/
|
| 68 |
+
|
| 69 |
+
# define PEM_read_cb_fnsig(name, type, INTYPE, readname) \
|
| 70 |
+
type *PEM_##readname##_##name(INTYPE *out, type **x, \
|
| 71 |
+
pem_password_cb *cb, void *u)
|
| 72 |
+
# define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname) \
|
| 73 |
+
type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \
|
| 74 |
+
pem_password_cb *cb, void *u, \
|
| 75 |
+
OSSL_LIB_CTX *libctx, \
|
| 76 |
+
const char *propq)
|
| 77 |
+
|
| 78 |
+
# define PEM_write_fnsig(name, type, OUTTYPE, writename) \
|
| 79 |
+
int PEM_##writename##_##name(OUTTYPE *out, const type *x)
|
| 80 |
+
# define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \
|
| 81 |
+
int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
|
| 82 |
+
const EVP_CIPHER *enc, \
|
| 83 |
+
const unsigned char *kstr, int klen, \
|
| 84 |
+
pem_password_cb *cb, void *u)
|
| 85 |
+
# define PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \
|
| 86 |
+
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
| 87 |
+
OSSL_LIB_CTX *libctx, \
|
| 88 |
+
const char *propq)
|
| 89 |
+
# define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename) \
|
| 90 |
+
int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
|
| 91 |
+
const EVP_CIPHER *enc, \
|
| 92 |
+
const unsigned char *kstr, int klen, \
|
| 93 |
+
pem_password_cb *cb, void *u, \
|
| 94 |
+
OSSL_LIB_CTX *libctx, \
|
| 95 |
+
const char *propq)
|
| 96 |
+
|
| 97 |
+
# ifdef OPENSSL_NO_STDIO
|
| 98 |
+
|
| 99 |
+
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
|
| 100 |
+
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
|
| 101 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 102 |
+
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
|
| 103 |
+
# endif
|
| 104 |
+
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
|
| 105 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 106 |
+
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
|
| 107 |
+
# endif
|
| 108 |
+
# else
|
| 109 |
+
|
| 110 |
+
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
|
| 111 |
+
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \
|
| 112 |
+
{ \
|
| 113 |
+
return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp, \
|
| 114 |
+
(void **)x, cb, u); \
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
|
| 118 |
+
PEM_write_fnsig(name, type, FILE, write) \
|
| 119 |
+
{ \
|
| 120 |
+
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
| 121 |
+
x, NULL, NULL, 0, NULL, NULL); \
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 125 |
+
# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
|
| 126 |
+
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
| 127 |
+
# endif
|
| 128 |
+
|
| 129 |
+
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
|
| 130 |
+
PEM_write_cb_fnsig(name, type, FILE, write) \
|
| 131 |
+
{ \
|
| 132 |
+
return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
|
| 133 |
+
x, enc, kstr, klen, cb, u); \
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 137 |
+
# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
|
| 138 |
+
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
| 139 |
+
# endif
|
| 140 |
+
# endif
|
| 141 |
+
|
| 142 |
+
# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
| 143 |
+
type *PEM_read_bio_##name(BIO *bp, type **x, \
|
| 144 |
+
pem_password_cb *cb, void *u) \
|
| 145 |
+
{ \
|
| 146 |
+
return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
|
| 147 |
+
(void **)x, cb, u); \
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
| 151 |
+
PEM_write_fnsig(name, type, BIO, write_bio) \
|
| 152 |
+
{ \
|
| 153 |
+
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
| 154 |
+
x, NULL,NULL,0,NULL,NULL); \
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 158 |
+
# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
| 159 |
+
IMPLEMENT_PEM_write_bio(name, type, str, asn1)
|
| 160 |
+
# endif
|
| 161 |
+
|
| 162 |
+
# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
| 163 |
+
PEM_write_cb_fnsig(name, type, BIO, write_bio) \
|
| 164 |
+
{ \
|
| 165 |
+
return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
|
| 166 |
+
x, enc, kstr, klen, cb, u); \
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 170 |
+
# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
| 171 |
+
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1)
|
| 172 |
+
# endif
|
| 173 |
+
|
| 174 |
+
# define IMPLEMENT_PEM_write(name, type, str, asn1) \
|
| 175 |
+
IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
|
| 176 |
+
IMPLEMENT_PEM_write_fp(name, type, str, asn1)
|
| 177 |
+
|
| 178 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 179 |
+
# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
|
| 180 |
+
IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
|
| 181 |
+
IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
|
| 182 |
+
# endif
|
| 183 |
+
|
| 184 |
+
# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
|
| 185 |
+
IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
|
| 186 |
+
IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
|
| 187 |
+
|
| 188 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 189 |
+
# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
|
| 190 |
+
IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
|
| 191 |
+
IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
|
| 192 |
+
# endif
|
| 193 |
+
|
| 194 |
+
# define IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 195 |
+
IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
|
| 196 |
+
IMPLEMENT_PEM_read_fp(name, type, str, asn1)
|
| 197 |
+
|
| 198 |
+
# define IMPLEMENT_PEM_rw(name, type, str, asn1) \
|
| 199 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 200 |
+
IMPLEMENT_PEM_write(name, type, str, asn1)
|
| 201 |
+
|
| 202 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 203 |
+
# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
|
| 204 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 205 |
+
IMPLEMENT_PEM_write_const(name, type, str, asn1)
|
| 206 |
+
# endif
|
| 207 |
+
|
| 208 |
+
# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
|
| 209 |
+
IMPLEMENT_PEM_read(name, type, str, asn1) \
|
| 210 |
+
IMPLEMENT_PEM_write_cb(name, type, str, asn1)
|
| 211 |
+
|
| 212 |
+
/* These are the same except they are for the declarations */
|
| 213 |
+
|
| 214 |
+
/*
|
| 215 |
+
* The mysterious 'extern' that's passed to some macros is innocuous,
|
| 216 |
+
* and is there to quiet pre-C99 compilers that may complain about empty
|
| 217 |
+
* arguments in macro calls.
|
| 218 |
+
*/
|
| 219 |
+
# if defined(OPENSSL_NO_STDIO)
|
| 220 |
+
|
| 221 |
+
# define DECLARE_PEM_read_fp_attr(attr, name, type) /**/
|
| 222 |
+
# define DECLARE_PEM_read_fp_ex_attr(attr, name, type) /**/
|
| 223 |
+
# define DECLARE_PEM_write_fp_attr(attr, name, type) /**/
|
| 224 |
+
# define DECLARE_PEM_write_fp_ex_attr(attr, name, type) /**/
|
| 225 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 226 |
+
# define DECLARE_PEM_write_fp_const_attr(attr, name, type) /**/
|
| 227 |
+
# endif
|
| 228 |
+
# define DECLARE_PEM_write_cb_fp_attr(attr, name, type) /**/
|
| 229 |
+
# define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) /**/
|
| 230 |
+
|
| 231 |
+
# else
|
| 232 |
+
|
| 233 |
+
# define DECLARE_PEM_read_fp_attr(attr, name, type) \
|
| 234 |
+
attr PEM_read_cb_fnsig(name, type, FILE, read);
|
| 235 |
+
# define DECLARE_PEM_read_fp_ex_attr(attr, name, type) \
|
| 236 |
+
attr PEM_read_cb_fnsig(name, type, FILE, read); \
|
| 237 |
+
attr PEM_read_cb_ex_fnsig(name, type, FILE, read);
|
| 238 |
+
|
| 239 |
+
# define DECLARE_PEM_write_fp_attr(attr, name, type) \
|
| 240 |
+
attr PEM_write_fnsig(name, type, FILE, write);
|
| 241 |
+
# define DECLARE_PEM_write_fp_ex_attr(attr, name, type) \
|
| 242 |
+
attr PEM_write_fnsig(name, type, FILE, write); \
|
| 243 |
+
attr PEM_write_ex_fnsig(name, type, FILE, write);
|
| 244 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 245 |
+
# define DECLARE_PEM_write_fp_const_attr(attr, name, type) \
|
| 246 |
+
attr PEM_write_fnsig(name, type, FILE, write);
|
| 247 |
+
# endif
|
| 248 |
+
# define DECLARE_PEM_write_cb_fp_attr(attr, name, type) \
|
| 249 |
+
attr PEM_write_cb_fnsig(name, type, FILE, write);
|
| 250 |
+
# define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) \
|
| 251 |
+
attr PEM_write_cb_fnsig(name, type, FILE, write); \
|
| 252 |
+
attr PEM_write_cb_ex_fnsig(name, type, FILE, write);
|
| 253 |
+
|
| 254 |
+
# endif
|
| 255 |
+
|
| 256 |
+
# define DECLARE_PEM_read_fp(name, type) \
|
| 257 |
+
DECLARE_PEM_read_fp_attr(extern, name, type)
|
| 258 |
+
# define DECLARE_PEM_write_fp(name, type) \
|
| 259 |
+
DECLARE_PEM_write_fp_attr(extern, name, type)
|
| 260 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 261 |
+
# define DECLARE_PEM_write_fp_const(name, type) \
|
| 262 |
+
DECLARE_PEM_write_fp_const_attr(extern, name, type)
|
| 263 |
+
# endif
|
| 264 |
+
# define DECLARE_PEM_write_cb_fp(name, type) \
|
| 265 |
+
DECLARE_PEM_write_cb_fp_attr(extern, name, type)
|
| 266 |
+
|
| 267 |
+
# define DECLARE_PEM_read_bio_attr(attr, name, type) \
|
| 268 |
+
attr PEM_read_cb_fnsig(name, type, BIO, read_bio);
|
| 269 |
+
# define DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
| 270 |
+
attr PEM_read_cb_fnsig(name, type, BIO, read_bio); \
|
| 271 |
+
attr PEM_read_cb_ex_fnsig(name, type, BIO, read_bio);
|
| 272 |
+
# define DECLARE_PEM_read_bio(name, type) \
|
| 273 |
+
DECLARE_PEM_read_bio_attr(extern, name, type)
|
| 274 |
+
# define DECLARE_PEM_read_bio_ex(name, type) \
|
| 275 |
+
DECLARE_PEM_read_bio_ex_attr(extern, name, type)
|
| 276 |
+
|
| 277 |
+
# define DECLARE_PEM_write_bio_attr(attr, name, type) \
|
| 278 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
| 279 |
+
# define DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
| 280 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio); \
|
| 281 |
+
attr PEM_write_ex_fnsig(name, type, BIO, write_bio);
|
| 282 |
+
# define DECLARE_PEM_write_bio(name, type) \
|
| 283 |
+
DECLARE_PEM_write_bio_attr(extern, name, type)
|
| 284 |
+
# define DECLARE_PEM_write_bio_ex(name, type) \
|
| 285 |
+
DECLARE_PEM_write_bio_ex_attr(extern, name, type)
|
| 286 |
+
|
| 287 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 288 |
+
# define DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
| 289 |
+
attr PEM_write_fnsig(name, type, BIO, write_bio);
|
| 290 |
+
# define DECLARE_PEM_write_bio_const(name, type) \
|
| 291 |
+
DECLARE_PEM_write_bio_const_attr(extern, name, type)
|
| 292 |
+
# endif
|
| 293 |
+
|
| 294 |
+
# define DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
| 295 |
+
attr PEM_write_cb_fnsig(name, type, BIO, write_bio);
|
| 296 |
+
# define DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
| 297 |
+
attr PEM_write_cb_fnsig(name, type, BIO, write_bio); \
|
| 298 |
+
attr PEM_write_cb_ex_fnsig(name, type, BIO, write_bio);
|
| 299 |
+
# define DECLARE_PEM_write_cb_bio(name, type) \
|
| 300 |
+
DECLARE_PEM_write_cb_bio_attr(extern, name, type)
|
| 301 |
+
# define DECLARE_PEM_write_cb_ex_bio(name, type) \
|
| 302 |
+
DECLARE_PEM_write_cb_bio_ex_attr(extern, name, type)
|
| 303 |
+
|
| 304 |
+
# define DECLARE_PEM_write_attr(attr, name, type) \
|
| 305 |
+
DECLARE_PEM_write_bio_attr(attr, name, type) \
|
| 306 |
+
DECLARE_PEM_write_fp_attr(attr, name, type)
|
| 307 |
+
# define DECLARE_PEM_write_ex_attr(attr, name, type) \
|
| 308 |
+
DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
|
| 309 |
+
DECLARE_PEM_write_fp_ex_attr(attr, name, type)
|
| 310 |
+
# define DECLARE_PEM_write(name, type) \
|
| 311 |
+
DECLARE_PEM_write_attr(extern, name, type)
|
| 312 |
+
# define DECLARE_PEM_write_ex(name, type) \
|
| 313 |
+
DECLARE_PEM_write_ex_attr(extern, name, type)
|
| 314 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 315 |
+
# define DECLARE_PEM_write_const_attr(attr, name, type) \
|
| 316 |
+
DECLARE_PEM_write_bio_const_attr(attr, name, type) \
|
| 317 |
+
DECLARE_PEM_write_fp_const_attr(attr, name, type)
|
| 318 |
+
# define DECLARE_PEM_write_const(name, type) \
|
| 319 |
+
DECLARE_PEM_write_const_attr(extern, name, type)
|
| 320 |
+
# endif
|
| 321 |
+
# define DECLARE_PEM_write_cb_attr(attr, name, type) \
|
| 322 |
+
DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
|
| 323 |
+
DECLARE_PEM_write_cb_fp_attr(attr, name, type)
|
| 324 |
+
# define DECLARE_PEM_write_cb_ex_attr(attr, name, type) \
|
| 325 |
+
DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
|
| 326 |
+
DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type)
|
| 327 |
+
# define DECLARE_PEM_write_cb(name, type) \
|
| 328 |
+
DECLARE_PEM_write_cb_attr(extern, name, type)
|
| 329 |
+
# define DECLARE_PEM_write_cb_ex(name, type) \
|
| 330 |
+
DECLARE_PEM_write_cb_ex_attr(extern, name, type)
|
| 331 |
+
# define DECLARE_PEM_read_attr(attr, name, type) \
|
| 332 |
+
DECLARE_PEM_read_bio_attr(attr, name, type) \
|
| 333 |
+
DECLARE_PEM_read_fp_attr(attr, name, type)
|
| 334 |
+
# define DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 335 |
+
DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
|
| 336 |
+
DECLARE_PEM_read_fp_ex_attr(attr, name, type)
|
| 337 |
+
# define DECLARE_PEM_read(name, type) \
|
| 338 |
+
DECLARE_PEM_read_attr(extern, name, type)
|
| 339 |
+
# define DECLARE_PEM_read_ex(name, type) \
|
| 340 |
+
DECLARE_PEM_read_ex_attr(extern, name, type)
|
| 341 |
+
# define DECLARE_PEM_rw_attr(attr, name, type) \
|
| 342 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 343 |
+
DECLARE_PEM_write_attr(attr, name, type)
|
| 344 |
+
# define DECLARE_PEM_rw_ex_attr(attr, name, type) \
|
| 345 |
+
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 346 |
+
DECLARE_PEM_write_ex_attr(attr, name, type)
|
| 347 |
+
# define DECLARE_PEM_rw(name, type) \
|
| 348 |
+
DECLARE_PEM_rw_attr(extern, name, type)
|
| 349 |
+
# define DECLARE_PEM_rw_ex(name, type) \
|
| 350 |
+
DECLARE_PEM_rw_ex_attr(extern, name, type)
|
| 351 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 352 |
+
# define DECLARE_PEM_rw_const_attr(attr, name, type) \
|
| 353 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 354 |
+
DECLARE_PEM_write_const_attr(attr, name, type)
|
| 355 |
+
# define DECLARE_PEM_rw_const(name, type) \
|
| 356 |
+
DECLARE_PEM_rw_const_attr(extern, name, type)
|
| 357 |
+
# endif
|
| 358 |
+
# define DECLARE_PEM_rw_cb_attr(attr, name, type) \
|
| 359 |
+
DECLARE_PEM_read_attr(attr, name, type) \
|
| 360 |
+
DECLARE_PEM_write_cb_attr(attr, name, type)
|
| 361 |
+
# define DECLARE_PEM_rw_cb_ex_attr(attr, name, type) \
|
| 362 |
+
DECLARE_PEM_read_ex_attr(attr, name, type) \
|
| 363 |
+
DECLARE_PEM_write_cb_ex_attr(attr, name, type)
|
| 364 |
+
# define DECLARE_PEM_rw_cb(name, type) \
|
| 365 |
+
DECLARE_PEM_rw_cb_attr(extern, name, type)
|
| 366 |
+
# define DECLARE_PEM_rw_cb_ex(name, type) \
|
| 367 |
+
DECLARE_PEM_rw_cb_ex_attr(extern, name, type)
|
| 368 |
+
|
| 369 |
+
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
|
| 370 |
+
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
|
| 371 |
+
pem_password_cb *callback, void *u);
|
| 372 |
+
|
| 373 |
+
int PEM_read_bio(BIO *bp, char **name, char **header,
|
| 374 |
+
unsigned char **data, long *len);
|
| 375 |
+
# define PEM_FLAG_SECURE 0x1
|
| 376 |
+
# define PEM_FLAG_EAY_COMPATIBLE 0x2
|
| 377 |
+
# define PEM_FLAG_ONLY_B64 0x4
|
| 378 |
+
int PEM_read_bio_ex(BIO *bp, char **name, char **header,
|
| 379 |
+
unsigned char **data, long *len, unsigned int flags);
|
| 380 |
+
int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
|
| 381 |
+
const char *name, BIO *bp, pem_password_cb *cb,
|
| 382 |
+
void *u);
|
| 383 |
+
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
|
| 384 |
+
const unsigned char *data, long len);
|
| 385 |
+
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
|
| 386 |
+
const char *name, BIO *bp, pem_password_cb *cb,
|
| 387 |
+
void *u);
|
| 388 |
+
void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
|
| 389 |
+
pem_password_cb *cb, void *u);
|
| 390 |
+
int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
|
| 391 |
+
const void *x, const EVP_CIPHER *enc,
|
| 392 |
+
const unsigned char *kstr, int klen,
|
| 393 |
+
pem_password_cb *cb, void *u);
|
| 394 |
+
|
| 395 |
+
STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
|
| 396 |
+
pem_password_cb *cb, void *u);
|
| 397 |
+
STACK_OF(X509_INFO)
|
| 398 |
+
*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
|
| 399 |
+
pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
|
| 400 |
+
const char *propq);
|
| 401 |
+
|
| 402 |
+
int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
|
| 403 |
+
const unsigned char *kstr, int klen,
|
| 404 |
+
pem_password_cb *cd, void *u);
|
| 405 |
+
|
| 406 |
+
#ifndef OPENSSL_NO_STDIO
|
| 407 |
+
int PEM_read(FILE *fp, char **name, char **header,
|
| 408 |
+
unsigned char **data, long *len);
|
| 409 |
+
int PEM_write(FILE *fp, const char *name, const char *hdr,
|
| 410 |
+
const unsigned char *data, long len);
|
| 411 |
+
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
|
| 412 |
+
pem_password_cb *cb, void *u);
|
| 413 |
+
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
|
| 414 |
+
const void *x, const EVP_CIPHER *enc,
|
| 415 |
+
const unsigned char *kstr, int klen,
|
| 416 |
+
pem_password_cb *callback, void *u);
|
| 417 |
+
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
|
| 418 |
+
pem_password_cb *cb, void *u);
|
| 419 |
+
STACK_OF(X509_INFO)
|
| 420 |
+
*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
|
| 421 |
+
void *u, OSSL_LIB_CTX *libctx, const char *propq);
|
| 422 |
+
#endif
|
| 423 |
+
|
| 424 |
+
int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
|
| 425 |
+
int PEM_SignUpdate(EVP_MD_CTX *ctx, const unsigned char *d, unsigned int cnt);
|
| 426 |
+
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
|
| 427 |
+
unsigned int *siglen, EVP_PKEY *pkey);
|
| 428 |
+
|
| 429 |
+
/* The default pem_password_cb that's used internally */
|
| 430 |
+
int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
|
| 431 |
+
void PEM_proc_type(char *buf, int type);
|
| 432 |
+
void PEM_dek_info(char *buf, const char *type, int len, const char *str);
|
| 433 |
+
|
| 434 |
+
# include <openssl/symhacks.h>
|
| 435 |
+
|
| 436 |
+
DECLARE_PEM_rw(X509, X509)
|
| 437 |
+
DECLARE_PEM_rw(X509_AUX, X509)
|
| 438 |
+
DECLARE_PEM_rw(X509_REQ, X509_REQ)
|
| 439 |
+
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
|
| 440 |
+
DECLARE_PEM_rw(X509_CRL, X509_CRL)
|
| 441 |
+
DECLARE_PEM_rw(X509_PUBKEY, X509_PUBKEY)
|
| 442 |
+
DECLARE_PEM_rw(PKCS7, PKCS7)
|
| 443 |
+
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
|
| 444 |
+
DECLARE_PEM_rw(PKCS8, X509_SIG)
|
| 445 |
+
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
|
| 446 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 447 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
|
| 448 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA)
|
| 449 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSA_PUBKEY, RSA)
|
| 450 |
+
# endif
|
| 451 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 452 |
+
# ifndef OPENSSL_NO_DSA
|
| 453 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, DSAPrivateKey, DSA)
|
| 454 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSA_PUBKEY, DSA)
|
| 455 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSAparams, DSA)
|
| 456 |
+
# endif
|
| 457 |
+
# endif
|
| 458 |
+
|
| 459 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 460 |
+
# ifndef OPENSSL_NO_EC
|
| 461 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, ECPKParameters, EC_GROUP)
|
| 462 |
+
DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, ECPrivateKey, EC_KEY)
|
| 463 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, EC_PUBKEY, EC_KEY)
|
| 464 |
+
# endif
|
| 465 |
+
# endif
|
| 466 |
+
|
| 467 |
+
# ifndef OPENSSL_NO_DH
|
| 468 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 469 |
+
DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
|
| 470 |
+
DECLARE_PEM_write_attr(OSSL_DEPRECATEDIN_3_0, DHxparams, DH)
|
| 471 |
+
# endif
|
| 472 |
+
# endif
|
| 473 |
+
DECLARE_PEM_rw_cb_ex(PrivateKey, EVP_PKEY)
|
| 474 |
+
DECLARE_PEM_rw_ex(PUBKEY, EVP_PKEY)
|
| 475 |
+
|
| 476 |
+
int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
|
| 477 |
+
const EVP_CIPHER *enc,
|
| 478 |
+
const unsigned char *kstr, int klen,
|
| 479 |
+
pem_password_cb *cb, void *u);
|
| 480 |
+
|
| 481 |
+
/* Why do these take a signed char *kstr? */
|
| 482 |
+
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid,
|
| 483 |
+
const char *kstr, int klen,
|
| 484 |
+
pem_password_cb *cb, void *u);
|
| 485 |
+
int PEM_write_bio_PKCS8PrivateKey(BIO *, const EVP_PKEY *, const EVP_CIPHER *,
|
| 486 |
+
const char *kstr, int klen,
|
| 487 |
+
pem_password_cb *cb, void *u);
|
| 488 |
+
int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
| 489 |
+
const char *kstr, int klen,
|
| 490 |
+
pem_password_cb *cb, void *u);
|
| 491 |
+
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid,
|
| 492 |
+
const char *kstr, int klen,
|
| 493 |
+
pem_password_cb *cb, void *u);
|
| 494 |
+
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
|
| 495 |
+
void *u);
|
| 496 |
+
|
| 497 |
+
# ifndef OPENSSL_NO_STDIO
|
| 498 |
+
int i2d_PKCS8PrivateKey_fp(FILE *fp, 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_fp(FILE *fp, const EVP_PKEY *x, int nid,
|
| 502 |
+
const char *kstr, int klen,
|
| 503 |
+
pem_password_cb *cb, void *u);
|
| 504 |
+
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid,
|
| 505 |
+
const char *kstr, int klen,
|
| 506 |
+
pem_password_cb *cb, void *u);
|
| 507 |
+
|
| 508 |
+
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
|
| 509 |
+
void *u);
|
| 510 |
+
|
| 511 |
+
int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
|
| 512 |
+
const char *kstr, int klen,
|
| 513 |
+
pem_password_cb *cd, void *u);
|
| 514 |
+
# endif
|
| 515 |
+
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
|
| 516 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 517 |
+
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
|
| 518 |
+
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
|
| 519 |
+
|
| 520 |
+
EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
|
| 521 |
+
EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
|
| 522 |
+
EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
|
| 523 |
+
EVP_PKEY *b2i_PublicKey_bio(BIO *in);
|
| 524 |
+
int i2b_PrivateKey_bio(BIO *out, const EVP_PKEY *pk);
|
| 525 |
+
int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk);
|
| 526 |
+
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
|
| 527 |
+
EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
|
| 528 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 529 |
+
int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel,
|
| 530 |
+
pem_password_cb *cb, void *u);
|
| 531 |
+
int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel,
|
| 532 |
+
pem_password_cb *cb, void *u,
|
| 533 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 534 |
+
|
| 535 |
+
# ifdef __cplusplus
|
| 536 |
+
}
|
| 537 |
+
# endif
|
| 538 |
+
#endif
|
llava_next/include/openssl/pemerr.h
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_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 |
+
|
| 21 |
+
/*
|
| 22 |
+
* PEM reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define PEM_R_BAD_BASE64_DECODE 100
|
| 25 |
+
# define PEM_R_BAD_DECRYPT 101
|
| 26 |
+
# define PEM_R_BAD_END_LINE 102
|
| 27 |
+
# define PEM_R_BAD_IV_CHARS 103
|
| 28 |
+
# define PEM_R_BAD_MAGIC_NUMBER 116
|
| 29 |
+
# define PEM_R_BAD_PASSWORD_READ 104
|
| 30 |
+
# define PEM_R_BAD_VERSION_NUMBER 117
|
| 31 |
+
# define PEM_R_BIO_WRITE_FAILURE 118
|
| 32 |
+
# define PEM_R_CIPHER_IS_NULL 127
|
| 33 |
+
# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
|
| 34 |
+
# define PEM_R_EXPECTING_DSS_KEY_BLOB 131
|
| 35 |
+
# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
|
| 36 |
+
# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
|
| 37 |
+
# define PEM_R_EXPECTING_RSA_KEY_BLOB 132
|
| 38 |
+
# define PEM_R_HEADER_TOO_LONG 128
|
| 39 |
+
# define PEM_R_INCONSISTENT_HEADER 121
|
| 40 |
+
# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
|
| 41 |
+
# define PEM_R_KEYBLOB_TOO_SHORT 123
|
| 42 |
+
# define PEM_R_MISSING_DEK_IV 129
|
| 43 |
+
# define PEM_R_NOT_DEK_INFO 105
|
| 44 |
+
# define PEM_R_NOT_ENCRYPTED 106
|
| 45 |
+
# define PEM_R_NOT_PROC_TYPE 107
|
| 46 |
+
# define PEM_R_NO_START_LINE 108
|
| 47 |
+
# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
|
| 48 |
+
# define PEM_R_PVK_DATA_TOO_SHORT 124
|
| 49 |
+
# define PEM_R_PVK_TOO_SHORT 125
|
| 50 |
+
# define PEM_R_READ_KEY 111
|
| 51 |
+
# define PEM_R_SHORT_HEADER 112
|
| 52 |
+
# define PEM_R_UNEXPECTED_DEK_IV 130
|
| 53 |
+
# define PEM_R_UNSUPPORTED_CIPHER 113
|
| 54 |
+
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
|
| 55 |
+
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
|
| 56 |
+
# define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110
|
| 57 |
+
|
| 58 |
+
#endif
|
llava_next/include/openssl/pkcs12.h
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs12.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-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 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_PKCS12_H
|
| 16 |
+
# define OPENSSL_PKCS12_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_PKCS12_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/bio.h>
|
| 25 |
+
# include <openssl/core.h>
|
| 26 |
+
# include <openssl/x509.h>
|
| 27 |
+
# include <openssl/pkcs12err.h>
|
| 28 |
+
|
| 29 |
+
#ifdef __cplusplus
|
| 30 |
+
extern "C" {
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
# define PKCS12_KEY_ID 1
|
| 34 |
+
# define PKCS12_IV_ID 2
|
| 35 |
+
# define PKCS12_MAC_ID 3
|
| 36 |
+
|
| 37 |
+
/* Default iteration count */
|
| 38 |
+
# ifndef PKCS12_DEFAULT_ITER
|
| 39 |
+
# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
|
| 40 |
+
# endif
|
| 41 |
+
|
| 42 |
+
# define PKCS12_MAC_KEY_LENGTH 20
|
| 43 |
+
|
| 44 |
+
# define PKCS12_SALT_LEN 8
|
| 45 |
+
|
| 46 |
+
/* It's not clear if these are actually needed... */
|
| 47 |
+
# define PKCS12_key_gen PKCS12_key_gen_utf8
|
| 48 |
+
# define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8
|
| 49 |
+
|
| 50 |
+
/* MS key usage constants */
|
| 51 |
+
|
| 52 |
+
# define KEY_EX 0x10
|
| 53 |
+
# define KEY_SIG 0x80
|
| 54 |
+
|
| 55 |
+
typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
|
| 56 |
+
|
| 57 |
+
typedef struct PKCS12_st PKCS12;
|
| 58 |
+
|
| 59 |
+
typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
|
| 60 |
+
|
| 61 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS12_SAFEBAG, PKCS12_SAFEBAG, PKCS12_SAFEBAG)
|
| 62 |
+
#define sk_PKCS12_SAFEBAG_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 63 |
+
#define sk_PKCS12_SAFEBAG_value(sk, idx) ((PKCS12_SAFEBAG *)OPENSSL_sk_value(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), (idx)))
|
| 64 |
+
#define sk_PKCS12_SAFEBAG_new(cmp) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
| 65 |
+
#define sk_PKCS12_SAFEBAG_new_null() ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_null())
|
| 66 |
+
#define sk_PKCS12_SAFEBAG_new_reserve(cmp, n) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_reserve(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp), (n)))
|
| 67 |
+
#define sk_PKCS12_SAFEBAG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (n))
|
| 68 |
+
#define sk_PKCS12_SAFEBAG_free(sk) OPENSSL_sk_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 69 |
+
#define sk_PKCS12_SAFEBAG_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 70 |
+
#define sk_PKCS12_SAFEBAG_delete(sk, i) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (i)))
|
| 71 |
+
#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)))
|
| 72 |
+
#define sk_PKCS12_SAFEBAG_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 73 |
+
#define sk_PKCS12_SAFEBAG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 74 |
+
#define sk_PKCS12_SAFEBAG_pop(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_pop(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 75 |
+
#define sk_PKCS12_SAFEBAG_shift(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_shift(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 76 |
+
#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))
|
| 77 |
+
#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))
|
| 78 |
+
#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)))
|
| 79 |
+
#define sk_PKCS12_SAFEBAG_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 80 |
+
#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))
|
| 81 |
+
#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)
|
| 82 |
+
#define sk_PKCS12_SAFEBAG_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 83 |
+
#define sk_PKCS12_SAFEBAG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 84 |
+
#define sk_PKCS12_SAFEBAG_dup(sk) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_dup(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)))
|
| 85 |
+
#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)))
|
| 86 |
+
#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)))
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
typedef struct pkcs12_bag_st PKCS12_BAGS;
|
| 90 |
+
|
| 91 |
+
# define PKCS12_ERROR 0
|
| 92 |
+
# define PKCS12_OK 1
|
| 93 |
+
|
| 94 |
+
/* Compatibility macros */
|
| 95 |
+
|
| 96 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 97 |
+
|
| 98 |
+
# define M_PKCS12_bag_type PKCS12_bag_type
|
| 99 |
+
# define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
|
| 100 |
+
# define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
|
| 101 |
+
|
| 102 |
+
# define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
|
| 103 |
+
# define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl
|
| 104 |
+
# define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
|
| 105 |
+
# define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
|
| 106 |
+
# define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
|
| 107 |
+
# define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
|
| 108 |
+
# define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
|
| 109 |
+
# define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
|
| 110 |
+
|
| 111 |
+
#endif
|
| 112 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 113 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
|
| 114 |
+
int attr_nid);
|
| 115 |
+
#endif
|
| 116 |
+
|
| 117 |
+
ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
|
| 118 |
+
int PKCS12_mac_present(const PKCS12 *p12);
|
| 119 |
+
void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
|
| 120 |
+
const X509_ALGOR **pmacalg,
|
| 121 |
+
const ASN1_OCTET_STRING **psalt,
|
| 122 |
+
const ASN1_INTEGER **piter,
|
| 123 |
+
const PKCS12 *p12);
|
| 124 |
+
|
| 125 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
|
| 126 |
+
int attr_nid);
|
| 127 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
|
| 128 |
+
int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
|
| 129 |
+
int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
|
| 130 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag);
|
| 131 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag);
|
| 132 |
+
|
| 133 |
+
X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
|
| 134 |
+
X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
|
| 135 |
+
const STACK_OF(PKCS12_SAFEBAG) *
|
| 136 |
+
PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
|
| 137 |
+
const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
|
| 138 |
+
const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
|
| 139 |
+
|
| 140 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
|
| 141 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
|
| 142 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, const unsigned char *value, int len);
|
| 143 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
|
| 144 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
|
| 145 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
|
| 146 |
+
const char *pass,
|
| 147 |
+
int passlen,
|
| 148 |
+
unsigned char *salt,
|
| 149 |
+
int saltlen, int iter,
|
| 150 |
+
PKCS8_PRIV_KEY_INFO *p8inf);
|
| 151 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
|
| 152 |
+
const char *pass,
|
| 153 |
+
int passlen,
|
| 154 |
+
unsigned char *salt,
|
| 155 |
+
int saltlen, int iter,
|
| 156 |
+
PKCS8_PRIV_KEY_INFO *p8inf,
|
| 157 |
+
OSSL_LIB_CTX *ctx,
|
| 158 |
+
const char *propq);
|
| 159 |
+
|
| 160 |
+
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
|
| 161 |
+
int nid1, int nid2);
|
| 162 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
|
| 163 |
+
int passlen);
|
| 164 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt_ex(const X509_SIG *p8, const char *pass,
|
| 165 |
+
int passlen, OSSL_LIB_CTX *ctx,
|
| 166 |
+
const char *propq);
|
| 167 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
|
| 168 |
+
const char *pass, int passlen);
|
| 169 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag,
|
| 170 |
+
const char *pass, int passlen,
|
| 171 |
+
OSSL_LIB_CTX *ctx,
|
| 172 |
+
const char *propq);
|
| 173 |
+
X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
|
| 174 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 175 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
|
| 176 |
+
X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher,
|
| 177 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 178 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
|
| 179 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 180 |
+
X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen,
|
| 181 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe);
|
| 182 |
+
X509_SIG *PKCS8_set0_pbe_ex(const char *pass, int passlen,
|
| 183 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe,
|
| 184 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 185 |
+
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
|
| 186 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
|
| 187 |
+
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
|
| 188 |
+
unsigned char *salt, int saltlen, int iter,
|
| 189 |
+
STACK_OF(PKCS12_SAFEBAG) *bags);
|
| 190 |
+
PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
|
| 191 |
+
unsigned char *salt, int saltlen, int iter,
|
| 192 |
+
STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 193 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 194 |
+
|
| 195 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
|
| 196 |
+
int passlen);
|
| 197 |
+
|
| 198 |
+
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
|
| 199 |
+
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
|
| 200 |
+
|
| 201 |
+
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
|
| 202 |
+
int namelen);
|
| 203 |
+
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 204 |
+
int namelen);
|
| 205 |
+
int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
|
| 206 |
+
int namelen);
|
| 207 |
+
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 208 |
+
int namelen);
|
| 209 |
+
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
|
| 210 |
+
const unsigned char *name, int namelen);
|
| 211 |
+
int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
|
| 212 |
+
const unsigned char *bytes, int len);
|
| 213 |
+
int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
|
| 214 |
+
const unsigned char *bytes, int len);
|
| 215 |
+
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
|
| 216 |
+
ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
|
| 217 |
+
int attr_nid);
|
| 218 |
+
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
| 219 |
+
const STACK_OF(X509_ATTRIBUTE) *
|
| 220 |
+
PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
|
| 221 |
+
unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor,
|
| 222 |
+
const char *pass, int passlen,
|
| 223 |
+
const unsigned char *in, int inlen,
|
| 224 |
+
unsigned char **data, int *datalen,
|
| 225 |
+
int en_de);
|
| 226 |
+
unsigned char *PKCS12_pbe_crypt_ex(const X509_ALGOR *algor,
|
| 227 |
+
const char *pass, int passlen,
|
| 228 |
+
const unsigned char *in, int inlen,
|
| 229 |
+
unsigned char **data, int *datalen,
|
| 230 |
+
int en_de, OSSL_LIB_CTX *libctx,
|
| 231 |
+
const char *propq);
|
| 232 |
+
void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 233 |
+
const char *pass, int passlen,
|
| 234 |
+
const ASN1_OCTET_STRING *oct, int zbuf);
|
| 235 |
+
void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 236 |
+
const char *pass, int passlen,
|
| 237 |
+
const ASN1_OCTET_STRING *oct, int zbuf,
|
| 238 |
+
OSSL_LIB_CTX *libctx,
|
| 239 |
+
const char *propq);
|
| 240 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
|
| 241 |
+
const ASN1_ITEM *it,
|
| 242 |
+
const char *pass, int passlen,
|
| 243 |
+
void *obj, int zbuf);
|
| 244 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
|
| 245 |
+
const ASN1_ITEM *it,
|
| 246 |
+
const char *pass, int passlen,
|
| 247 |
+
void *obj, int zbuf,
|
| 248 |
+
OSSL_LIB_CTX *ctx,
|
| 249 |
+
const char *propq);
|
| 250 |
+
PKCS12 *PKCS12_init(int mode);
|
| 251 |
+
PKCS12 *PKCS12_init_ex(int mode, OSSL_LIB_CTX *ctx, const char *propq);
|
| 252 |
+
|
| 253 |
+
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
|
| 254 |
+
int saltlen, int id, int iter, int n,
|
| 255 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 256 |
+
int PKCS12_key_gen_asc_ex(const char *pass, int passlen, unsigned char *salt,
|
| 257 |
+
int saltlen, int id, int iter, int n,
|
| 258 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 259 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 260 |
+
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
|
| 261 |
+
int saltlen, int id, int iter, int n,
|
| 262 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 263 |
+
int PKCS12_key_gen_uni_ex(unsigned char *pass, int passlen, unsigned char *salt,
|
| 264 |
+
int saltlen, int id, int iter, int n,
|
| 265 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 266 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 267 |
+
int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
|
| 268 |
+
int saltlen, int id, int iter, int n,
|
| 269 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 270 |
+
int PKCS12_key_gen_utf8_ex(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 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 274 |
+
|
| 275 |
+
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 276 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 277 |
+
const EVP_MD *md_type, int en_de);
|
| 278 |
+
int PKCS12_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 279 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 280 |
+
const EVP_MD *md_type, int en_de,
|
| 281 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 282 |
+
int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 283 |
+
unsigned char *mac, unsigned int *maclen);
|
| 284 |
+
int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
|
| 285 |
+
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 286 |
+
unsigned char *salt, int saltlen, int iter,
|
| 287 |
+
const EVP_MD *md_type);
|
| 288 |
+
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
|
| 289 |
+
int saltlen, const EVP_MD *md_type);
|
| 290 |
+
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
|
| 291 |
+
unsigned char **uni, int *unilen);
|
| 292 |
+
char *OPENSSL_uni2asc(const unsigned char *uni, int unilen);
|
| 293 |
+
unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
|
| 294 |
+
unsigned char **uni, int *unilen);
|
| 295 |
+
char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen);
|
| 296 |
+
|
| 297 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12)
|
| 298 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
|
| 299 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
|
| 300 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
|
| 301 |
+
|
| 302 |
+
DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
|
| 303 |
+
DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
|
| 304 |
+
|
| 305 |
+
void PKCS12_PBE_add(void);
|
| 306 |
+
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
|
| 307 |
+
STACK_OF(X509) **ca);
|
| 308 |
+
PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 309 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 310 |
+
int iter, int mac_iter, int keytype);
|
| 311 |
+
PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 312 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 313 |
+
int iter, int mac_iter, int keytype,
|
| 314 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 315 |
+
|
| 316 |
+
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
|
| 317 |
+
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 318 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 319 |
+
int key_nid, const char *pass);
|
| 320 |
+
PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 321 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 322 |
+
int key_nid, const char *pass,
|
| 323 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 324 |
+
|
| 325 |
+
PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 326 |
+
int nid_type, const unsigned char *value, int len);
|
| 327 |
+
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 328 |
+
int safe_nid, int iter, const char *pass);
|
| 329 |
+
int PKCS12_add_safe_ex(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 330 |
+
int safe_nid, int iter, const char *pass,
|
| 331 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 332 |
+
|
| 333 |
+
PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
|
| 334 |
+
PKCS12 *PKCS12_add_safes_ex(STACK_OF(PKCS7) *safes, int p7_nid,
|
| 335 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 336 |
+
|
| 337 |
+
int i2d_PKCS12_bio(BIO *bp, const PKCS12 *p12);
|
| 338 |
+
# ifndef OPENSSL_NO_STDIO
|
| 339 |
+
int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12);
|
| 340 |
+
# endif
|
| 341 |
+
PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
|
| 342 |
+
# ifndef OPENSSL_NO_STDIO
|
| 343 |
+
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
|
| 344 |
+
# endif
|
| 345 |
+
int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
|
| 346 |
+
|
| 347 |
+
# ifdef __cplusplus
|
| 348 |
+
}
|
| 349 |
+
# endif
|
| 350 |
+
#endif
|
llava_next/include/openssl/proverr.h
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_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 |
+
|
| 21 |
+
/*
|
| 22 |
+
* PROV reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define PROV_R_ADDITIONAL_INPUT_TOO_LONG 184
|
| 25 |
+
# define PROV_R_ALGORITHM_MISMATCH 173
|
| 26 |
+
# define PROV_R_ALREADY_INSTANTIATED 185
|
| 27 |
+
# define PROV_R_BAD_DECRYPT 100
|
| 28 |
+
# define PROV_R_BAD_ENCODING 141
|
| 29 |
+
# define PROV_R_BAD_LENGTH 142
|
| 30 |
+
# define PROV_R_BAD_TLS_CLIENT_VERSION 161
|
| 31 |
+
# define PROV_R_BN_ERROR 160
|
| 32 |
+
# define PROV_R_CIPHER_OPERATION_FAILED 102
|
| 33 |
+
# define PROV_R_DERIVATION_FUNCTION_INIT_FAILED 205
|
| 34 |
+
# define PROV_R_DIGEST_NOT_ALLOWED 174
|
| 35 |
+
# define PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK 186
|
| 36 |
+
# define PROV_R_ERROR_INSTANTIATING_DRBG 188
|
| 37 |
+
# define PROV_R_ERROR_RETRIEVING_ENTROPY 189
|
| 38 |
+
# define PROV_R_ERROR_RETRIEVING_NONCE 190
|
| 39 |
+
# define PROV_R_FAILED_DURING_DERIVATION 164
|
| 40 |
+
# define PROV_R_FAILED_TO_CREATE_LOCK 180
|
| 41 |
+
# define PROV_R_FAILED_TO_DECRYPT 162
|
| 42 |
+
# define PROV_R_FAILED_TO_GENERATE_KEY 121
|
| 43 |
+
# define PROV_R_FAILED_TO_GET_PARAMETER 103
|
| 44 |
+
# define PROV_R_FAILED_TO_SET_PARAMETER 104
|
| 45 |
+
# define PROV_R_FAILED_TO_SIGN 175
|
| 46 |
+
# define PROV_R_FIPS_MODULE_CONDITIONAL_ERROR 227
|
| 47 |
+
# define PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE 224
|
| 48 |
+
# define PROV_R_FIPS_MODULE_IN_ERROR_STATE 225
|
| 49 |
+
# define PROV_R_GENERATE_ERROR 191
|
| 50 |
+
# define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 165
|
| 51 |
+
# define PROV_R_INDICATOR_INTEGRITY_FAILURE 210
|
| 52 |
+
# define PROV_R_INSUFFICIENT_DRBG_STRENGTH 181
|
| 53 |
+
# define PROV_R_INVALID_AAD 108
|
| 54 |
+
# define PROV_R_INVALID_CONFIG_DATA 211
|
| 55 |
+
# define PROV_R_INVALID_CONSTANT_LENGTH 157
|
| 56 |
+
# define PROV_R_INVALID_CURVE 176
|
| 57 |
+
# define PROV_R_INVALID_CUSTOM_LENGTH 111
|
| 58 |
+
# define PROV_R_INVALID_DATA 115
|
| 59 |
+
# define PROV_R_INVALID_DIGEST 122
|
| 60 |
+
# define PROV_R_INVALID_DIGEST_LENGTH 166
|
| 61 |
+
# define PROV_R_INVALID_DIGEST_SIZE 218
|
| 62 |
+
# define PROV_R_INVALID_INPUT_LENGTH 230
|
| 63 |
+
# define PROV_R_INVALID_ITERATION_COUNT 123
|
| 64 |
+
# define PROV_R_INVALID_IV_LENGTH 109
|
| 65 |
+
# define PROV_R_INVALID_KEY 158
|
| 66 |
+
# define PROV_R_INVALID_KEY_LENGTH 105
|
| 67 |
+
# define PROV_R_INVALID_MAC 151
|
| 68 |
+
# define PROV_R_INVALID_MGF1_MD 167
|
| 69 |
+
# define PROV_R_INVALID_MODE 125
|
| 70 |
+
# define PROV_R_INVALID_OUTPUT_LENGTH 217
|
| 71 |
+
# define PROV_R_INVALID_PADDING_MODE 168
|
| 72 |
+
# define PROV_R_INVALID_PUBINFO 198
|
| 73 |
+
# define PROV_R_INVALID_SALT_LENGTH 112
|
| 74 |
+
# define PROV_R_INVALID_SEED_LENGTH 154
|
| 75 |
+
# define PROV_R_INVALID_SIGNATURE_SIZE 179
|
| 76 |
+
# define PROV_R_INVALID_STATE 212
|
| 77 |
+
# define PROV_R_INVALID_TAG 110
|
| 78 |
+
# define PROV_R_INVALID_TAG_LENGTH 118
|
| 79 |
+
# define PROV_R_INVALID_UKM_LENGTH 200
|
| 80 |
+
# define PROV_R_INVALID_X931_DIGEST 170
|
| 81 |
+
# define PROV_R_IN_ERROR_STATE 192
|
| 82 |
+
# define PROV_R_KEY_SETUP_FAILED 101
|
| 83 |
+
# define PROV_R_KEY_SIZE_TOO_SMALL 171
|
| 84 |
+
# define PROV_R_LENGTH_TOO_LARGE 202
|
| 85 |
+
# define PROV_R_MISMATCHING_DOMAIN_PARAMETERS 203
|
| 86 |
+
# define PROV_R_MISSING_CEK_ALG 144
|
| 87 |
+
# define PROV_R_MISSING_CIPHER 155
|
| 88 |
+
# define PROV_R_MISSING_CONFIG_DATA 213
|
| 89 |
+
# define PROV_R_MISSING_CONSTANT 156
|
| 90 |
+
# define PROV_R_MISSING_KEY 128
|
| 91 |
+
# define PROV_R_MISSING_MAC 150
|
| 92 |
+
# define PROV_R_MISSING_MESSAGE_DIGEST 129
|
| 93 |
+
# define PROV_R_MISSING_OID 209
|
| 94 |
+
# define PROV_R_MISSING_PASS 130
|
| 95 |
+
# define PROV_R_MISSING_SALT 131
|
| 96 |
+
# define PROV_R_MISSING_SECRET 132
|
| 97 |
+
# define PROV_R_MISSING_SEED 140
|
| 98 |
+
# define PROV_R_MISSING_SESSION_ID 133
|
| 99 |
+
# define PROV_R_MISSING_TYPE 134
|
| 100 |
+
# define PROV_R_MISSING_XCGHASH 135
|
| 101 |
+
# define PROV_R_MODULE_INTEGRITY_FAILURE 214
|
| 102 |
+
# define PROV_R_NOT_A_PRIVATE_KEY 221
|
| 103 |
+
# define PROV_R_NOT_A_PUBLIC_KEY 220
|
| 104 |
+
# define PROV_R_NOT_INSTANTIATED 193
|
| 105 |
+
# define PROV_R_NOT_PARAMETERS 226
|
| 106 |
+
# define PROV_R_NOT_SUPPORTED 136
|
| 107 |
+
# define PROV_R_NOT_XOF_OR_INVALID_LENGTH 113
|
| 108 |
+
# define PROV_R_NO_KEY_SET 114
|
| 109 |
+
# define PROV_R_NO_PARAMETERS_SET 177
|
| 110 |
+
# define PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 178
|
| 111 |
+
# define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106
|
| 112 |
+
# define PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS 228
|
| 113 |
+
# define PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED 187
|
| 114 |
+
# define PROV_R_PARENT_LOCKING_NOT_ENABLED 182
|
| 115 |
+
# define PROV_R_PARENT_STRENGTH_TOO_WEAK 194
|
| 116 |
+
# define PROV_R_PATH_MUST_BE_ABSOLUTE 219
|
| 117 |
+
# define PROV_R_PERSONALISATION_STRING_TOO_LONG 195
|
| 118 |
+
# define PROV_R_PSS_SALTLEN_TOO_SMALL 172
|
| 119 |
+
# define PROV_R_REQUEST_TOO_LARGE_FOR_DRBG 196
|
| 120 |
+
# define PROV_R_REQUIRE_CTR_MODE_CIPHER 206
|
| 121 |
+
# define PROV_R_RESEED_ERROR 197
|
| 122 |
+
# define PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 222
|
| 123 |
+
# define PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT 229
|
| 124 |
+
# define PROV_R_SELF_TEST_KAT_FAILURE 215
|
| 125 |
+
# define PROV_R_SELF_TEST_POST_FAILURE 216
|
| 126 |
+
# define PROV_R_TAG_NOT_NEEDED 120
|
| 127 |
+
# define PROV_R_TAG_NOT_SET 119
|
| 128 |
+
# define PROV_R_TOO_MANY_RECORDS 126
|
| 129 |
+
# define PROV_R_UNABLE_TO_FIND_CIPHERS 207
|
| 130 |
+
# define PROV_R_UNABLE_TO_GET_PARENT_STRENGTH 199
|
| 131 |
+
# define PROV_R_UNABLE_TO_GET_PASSPHRASE 159
|
| 132 |
+
# define PROV_R_UNABLE_TO_INITIALISE_CIPHERS 208
|
| 133 |
+
# define PROV_R_UNABLE_TO_LOAD_SHA256 147
|
| 134 |
+
# define PROV_R_UNABLE_TO_LOCK_PARENT 201
|
| 135 |
+
# define PROV_R_UNABLE_TO_RESEED 204
|
| 136 |
+
# define PROV_R_UNSUPPORTED_CEK_ALG 145
|
| 137 |
+
# define PROV_R_UNSUPPORTED_KEY_SIZE 153
|
| 138 |
+
# define PROV_R_UNSUPPORTED_MAC_TYPE 137
|
| 139 |
+
# define PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS 152
|
| 140 |
+
# define PROV_R_URI_AUTHORITY_UNSUPPORTED 223
|
| 141 |
+
# define PROV_R_VALUE_ERROR 138
|
| 142 |
+
# define PROV_R_WRONG_FINAL_BLOCK_LENGTH 107
|
| 143 |
+
# define PROV_R_WRONG_OUTPUT_BUFFER_SIZE 139
|
| 144 |
+
# define PROV_R_XOF_DIGESTS_NOT_ALLOWED 183
|
| 145 |
+
# define PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE 148
|
| 146 |
+
# define PROV_R_XTS_DUPLICATED_KEYS 149
|
| 147 |
+
|
| 148 |
+
#endif
|
llava_next/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
|
llava_next/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
|
llava_next/include/openssl/safestack.h
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/safestack.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-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 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_SAFESTACK_H
|
| 16 |
+
# define OPENSSL_SAFESTACK_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_SAFESTACK_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/stack.h>
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
# define STACK_OF(type) struct stack_st_##type
|
| 32 |
+
|
| 33 |
+
/* Helper macro for internal use */
|
| 34 |
+
# define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3) \
|
| 35 |
+
STACK_OF(t1); \
|
| 36 |
+
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
| 37 |
+
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
| 38 |
+
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
| 39 |
+
static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr) \
|
| 40 |
+
{ \
|
| 41 |
+
return ptr; \
|
| 42 |
+
} \
|
| 43 |
+
static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \
|
| 44 |
+
{ \
|
| 45 |
+
return (const OPENSSL_STACK *)sk; \
|
| 46 |
+
} \
|
| 47 |
+
static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk) \
|
| 48 |
+
{ \
|
| 49 |
+
return (OPENSSL_STACK *)sk; \
|
| 50 |
+
} \
|
| 51 |
+
static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp) \
|
| 52 |
+
{ \
|
| 53 |
+
return (OPENSSL_sk_compfunc)cmp; \
|
| 54 |
+
} \
|
| 55 |
+
static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy) \
|
| 56 |
+
{ \
|
| 57 |
+
return (OPENSSL_sk_copyfunc)cpy; \
|
| 58 |
+
} \
|
| 59 |
+
static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr) \
|
| 60 |
+
{ \
|
| 61 |
+
return (OPENSSL_sk_freefunc)fr; \
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
# define SKM_DEFINE_STACK_OF(t1, t2, t3) \
|
| 65 |
+
STACK_OF(t1); \
|
| 66 |
+
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
| 67 |
+
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
| 68 |
+
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
| 69 |
+
static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
| 70 |
+
{ \
|
| 71 |
+
return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
|
| 72 |
+
} \
|
| 73 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
| 74 |
+
{ \
|
| 75 |
+
return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
|
| 76 |
+
} \
|
| 77 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
| 78 |
+
{ \
|
| 79 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
|
| 80 |
+
} \
|
| 81 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
| 82 |
+
{ \
|
| 83 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
|
| 84 |
+
} \
|
| 85 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
| 86 |
+
{ \
|
| 87 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
|
| 88 |
+
} \
|
| 89 |
+
static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
| 90 |
+
{ \
|
| 91 |
+
return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
|
| 92 |
+
} \
|
| 93 |
+
static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
| 94 |
+
{ \
|
| 95 |
+
OPENSSL_sk_free((OPENSSL_STACK *)sk); \
|
| 96 |
+
} \
|
| 97 |
+
static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
| 98 |
+
{ \
|
| 99 |
+
OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
|
| 100 |
+
} \
|
| 101 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
| 102 |
+
{ \
|
| 103 |
+
return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
|
| 104 |
+
} \
|
| 105 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
| 106 |
+
{ \
|
| 107 |
+
return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
|
| 108 |
+
(const void *)ptr); \
|
| 109 |
+
} \
|
| 110 |
+
static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
| 111 |
+
{ \
|
| 112 |
+
return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 113 |
+
} \
|
| 114 |
+
static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
| 115 |
+
{ \
|
| 116 |
+
return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 117 |
+
} \
|
| 118 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
| 119 |
+
{ \
|
| 120 |
+
return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
|
| 121 |
+
} \
|
| 122 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
| 123 |
+
{ \
|
| 124 |
+
return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
|
| 125 |
+
} \
|
| 126 |
+
static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
| 127 |
+
{ \
|
| 128 |
+
OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
|
| 129 |
+
} \
|
| 130 |
+
static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
| 131 |
+
{ \
|
| 132 |
+
return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
|
| 133 |
+
} \
|
| 134 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
| 135 |
+
{ \
|
| 136 |
+
return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
|
| 137 |
+
} \
|
| 138 |
+
static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
| 139 |
+
{ \
|
| 140 |
+
return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 141 |
+
} \
|
| 142 |
+
static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
| 143 |
+
{ \
|
| 144 |
+
return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 145 |
+
} \
|
| 146 |
+
static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum) \
|
| 147 |
+
{ \
|
| 148 |
+
return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum); \
|
| 149 |
+
} \
|
| 150 |
+
static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
| 151 |
+
{ \
|
| 152 |
+
OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
|
| 153 |
+
} \
|
| 154 |
+
static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
| 155 |
+
{ \
|
| 156 |
+
return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
|
| 157 |
+
} \
|
| 158 |
+
static ossl_unused ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
| 159 |
+
{ \
|
| 160 |
+
return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
|
| 161 |
+
} \
|
| 162 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
| 163 |
+
sk_##t1##_copyfunc copyfunc, \
|
| 164 |
+
sk_##t1##_freefunc freefunc) \
|
| 165 |
+
{ \
|
| 166 |
+
return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
|
| 167 |
+
(OPENSSL_sk_copyfunc)copyfunc, \
|
| 168 |
+
(OPENSSL_sk_freefunc)freefunc); \
|
| 169 |
+
} \
|
| 170 |
+
static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
| 171 |
+
{ \
|
| 172 |
+
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
|
| 176 |
+
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
|
| 177 |
+
# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
|
| 178 |
+
# define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
|
| 179 |
+
SKM_DEFINE_STACK_OF(t1, const t2, t2)
|
| 180 |
+
|
| 181 |
+
/*-
|
| 182 |
+
* Strings are special: normally an lhash entry will point to a single
|
| 183 |
+
* (somewhat) mutable object. In the case of strings:
|
| 184 |
+
*
|
| 185 |
+
* a) Instead of a single char, there is an array of chars, NUL-terminated.
|
| 186 |
+
* b) The string may have be immutable.
|
| 187 |
+
*
|
| 188 |
+
* So, they need their own declarations. Especially important for
|
| 189 |
+
* type-checking tools, such as Deputy.
|
| 190 |
+
*
|
| 191 |
+
* In practice, however, it appears to be hard to have a const
|
| 192 |
+
* string. For now, I'm settling for dealing with the fact it is a
|
| 193 |
+
* string at all.
|
| 194 |
+
*/
|
| 195 |
+
typedef char *OPENSSL_STRING;
|
| 196 |
+
typedef const char *OPENSSL_CSTRING;
|
| 197 |
+
|
| 198 |
+
/*-
|
| 199 |
+
* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
|
| 200 |
+
* STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
|
| 201 |
+
* above, instead of a single char each entry is a NUL-terminated array of
|
| 202 |
+
* chars. So, we have to implement STRING specially for STACK_OF. This is
|
| 203 |
+
* dealt with in the autogenerated macros below.
|
| 204 |
+
*/
|
| 205 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)
|
| 206 |
+
#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 207 |
+
#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
|
| 208 |
+
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
| 209 |
+
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
|
| 210 |
+
#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n)))
|
| 211 |
+
#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n))
|
| 212 |
+
#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 213 |
+
#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 214 |
+
#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i)))
|
| 215 |
+
#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)))
|
| 216 |
+
#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 217 |
+
#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 218 |
+
#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 219 |
+
#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 220 |
+
#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))
|
| 221 |
+
#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))
|
| 222 |
+
#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)))
|
| 223 |
+
#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 224 |
+
#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))
|
| 225 |
+
#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)
|
| 226 |
+
#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 227 |
+
#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 228 |
+
#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
|
| 229 |
+
#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)))
|
| 230 |
+
#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)))
|
| 231 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char)
|
| 232 |
+
#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 233 |
+
#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
|
| 234 |
+
#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
| 235 |
+
#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
|
| 236 |
+
#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n)))
|
| 237 |
+
#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n))
|
| 238 |
+
#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 239 |
+
#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 240 |
+
#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i)))
|
| 241 |
+
#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)))
|
| 242 |
+
#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 243 |
+
#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 244 |
+
#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 245 |
+
#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 246 |
+
#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))
|
| 247 |
+
#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))
|
| 248 |
+
#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)))
|
| 249 |
+
#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 250 |
+
#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))
|
| 251 |
+
#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)
|
| 252 |
+
#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 253 |
+
#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 254 |
+
#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)))
|
| 255 |
+
#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)))
|
| 256 |
+
#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)))
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 260 |
+
/*
|
| 261 |
+
* This is not used by OpenSSL. A block of bytes, NOT nul-terminated.
|
| 262 |
+
* These should also be distinguished from "normal" stacks.
|
| 263 |
+
*/
|
| 264 |
+
typedef void *OPENSSL_BLOCK;
|
| 265 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void)
|
| 266 |
+
#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 267 |
+
#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx)))
|
| 268 |
+
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
| 269 |
+
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null())
|
| 270 |
+
#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n)))
|
| 271 |
+
#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n))
|
| 272 |
+
#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 273 |
+
#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 274 |
+
#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i)))
|
| 275 |
+
#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)))
|
| 276 |
+
#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 277 |
+
#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 278 |
+
#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 279 |
+
#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 280 |
+
#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))
|
| 281 |
+
#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))
|
| 282 |
+
#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)))
|
| 283 |
+
#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 284 |
+
#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))
|
| 285 |
+
#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)
|
| 286 |
+
#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 287 |
+
#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 288 |
+
#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)))
|
| 289 |
+
#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)))
|
| 290 |
+
#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)))
|
| 291 |
+
|
| 292 |
+
#endif
|
| 293 |
+
|
| 294 |
+
# ifdef __cplusplus
|
| 295 |
+
}
|
| 296 |
+
# endif
|
| 297 |
+
#endif
|
llava_next/include/openssl/srp.h
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 18 |
+
|
| 19 |
+
#ifndef OPENSSL_SRP_H
|
| 20 |
+
# define OPENSSL_SRP_H
|
| 21 |
+
# pragma once
|
| 22 |
+
|
| 23 |
+
# include <openssl/macros.h>
|
| 24 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 25 |
+
# define HEADER_SRP_H
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
#include <openssl/opensslconf.h>
|
| 29 |
+
|
| 30 |
+
#ifndef OPENSSL_NO_SRP
|
| 31 |
+
# include <stdio.h>
|
| 32 |
+
# include <string.h>
|
| 33 |
+
# include <openssl/safestack.h>
|
| 34 |
+
# include <openssl/bn.h>
|
| 35 |
+
# include <openssl/crypto.h>
|
| 36 |
+
|
| 37 |
+
# ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 42 |
+
|
| 43 |
+
typedef struct SRP_gN_cache_st {
|
| 44 |
+
char *b64_bn;
|
| 45 |
+
BIGNUM *bn;
|
| 46 |
+
} SRP_gN_cache;
|
| 47 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN_cache, SRP_gN_cache, SRP_gN_cache)
|
| 48 |
+
#define sk_SRP_gN_cache_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 49 |
+
#define sk_SRP_gN_cache_value(sk, idx) ((SRP_gN_cache *)OPENSSL_sk_value(ossl_check_const_SRP_gN_cache_sk_type(sk), (idx)))
|
| 50 |
+
#define sk_SRP_gN_cache_new(cmp) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new(ossl_check_SRP_gN_cache_compfunc_type(cmp)))
|
| 51 |
+
#define sk_SRP_gN_cache_new_null() ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_null())
|
| 52 |
+
#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)))
|
| 53 |
+
#define sk_SRP_gN_cache_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_cache_sk_type(sk), (n))
|
| 54 |
+
#define sk_SRP_gN_cache_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 55 |
+
#define sk_SRP_gN_cache_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 56 |
+
#define sk_SRP_gN_cache_delete(sk, i) ((SRP_gN_cache *)OPENSSL_sk_delete(ossl_check_SRP_gN_cache_sk_type(sk), (i)))
|
| 57 |
+
#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)))
|
| 58 |
+
#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))
|
| 59 |
+
#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))
|
| 60 |
+
#define sk_SRP_gN_cache_pop(sk) ((SRP_gN_cache *)OPENSSL_sk_pop(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 61 |
+
#define sk_SRP_gN_cache_shift(sk) ((SRP_gN_cache *)OPENSSL_sk_shift(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 62 |
+
#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))
|
| 63 |
+
#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))
|
| 64 |
+
#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)))
|
| 65 |
+
#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))
|
| 66 |
+
#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))
|
| 67 |
+
#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)
|
| 68 |
+
#define sk_SRP_gN_cache_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 69 |
+
#define sk_SRP_gN_cache_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 70 |
+
#define sk_SRP_gN_cache_dup(sk) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_cache_sk_type(sk)))
|
| 71 |
+
#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)))
|
| 72 |
+
#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)))
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
typedef struct SRP_user_pwd_st {
|
| 77 |
+
/* Owned by us. */
|
| 78 |
+
char *id;
|
| 79 |
+
BIGNUM *s;
|
| 80 |
+
BIGNUM *v;
|
| 81 |
+
/* Not owned by us. */
|
| 82 |
+
const BIGNUM *g;
|
| 83 |
+
const BIGNUM *N;
|
| 84 |
+
/* Owned by us. */
|
| 85 |
+
char *info;
|
| 86 |
+
} SRP_user_pwd;
|
| 87 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_user_pwd, SRP_user_pwd, SRP_user_pwd)
|
| 88 |
+
#define sk_SRP_user_pwd_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 89 |
+
#define sk_SRP_user_pwd_value(sk, idx) ((SRP_user_pwd *)OPENSSL_sk_value(ossl_check_const_SRP_user_pwd_sk_type(sk), (idx)))
|
| 90 |
+
#define sk_SRP_user_pwd_new(cmp) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new(ossl_check_SRP_user_pwd_compfunc_type(cmp)))
|
| 91 |
+
#define sk_SRP_user_pwd_new_null() ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_null())
|
| 92 |
+
#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)))
|
| 93 |
+
#define sk_SRP_user_pwd_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_user_pwd_sk_type(sk), (n))
|
| 94 |
+
#define sk_SRP_user_pwd_free(sk) OPENSSL_sk_free(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 95 |
+
#define sk_SRP_user_pwd_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 96 |
+
#define sk_SRP_user_pwd_delete(sk, i) ((SRP_user_pwd *)OPENSSL_sk_delete(ossl_check_SRP_user_pwd_sk_type(sk), (i)))
|
| 97 |
+
#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)))
|
| 98 |
+
#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))
|
| 99 |
+
#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))
|
| 100 |
+
#define sk_SRP_user_pwd_pop(sk) ((SRP_user_pwd *)OPENSSL_sk_pop(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 101 |
+
#define sk_SRP_user_pwd_shift(sk) ((SRP_user_pwd *)OPENSSL_sk_shift(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 102 |
+
#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))
|
| 103 |
+
#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))
|
| 104 |
+
#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)))
|
| 105 |
+
#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))
|
| 106 |
+
#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))
|
| 107 |
+
#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)
|
| 108 |
+
#define sk_SRP_user_pwd_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 109 |
+
#define sk_SRP_user_pwd_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 110 |
+
#define sk_SRP_user_pwd_dup(sk) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_dup(ossl_check_const_SRP_user_pwd_sk_type(sk)))
|
| 111 |
+
#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)))
|
| 112 |
+
#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)))
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
OSSL_DEPRECATEDIN_3_0
|
| 116 |
+
SRP_user_pwd *SRP_user_pwd_new(void);
|
| 117 |
+
OSSL_DEPRECATEDIN_3_0
|
| 118 |
+
void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
|
| 119 |
+
|
| 120 |
+
OSSL_DEPRECATEDIN_3_0
|
| 121 |
+
void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g,
|
| 122 |
+
const BIGNUM *N);
|
| 123 |
+
OSSL_DEPRECATEDIN_3_0
|
| 124 |
+
int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id,
|
| 125 |
+
const char *info);
|
| 126 |
+
OSSL_DEPRECATEDIN_3_0
|
| 127 |
+
int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
|
| 128 |
+
|
| 129 |
+
typedef struct SRP_VBASE_st {
|
| 130 |
+
STACK_OF(SRP_user_pwd) *users_pwd;
|
| 131 |
+
STACK_OF(SRP_gN_cache) *gN_cache;
|
| 132 |
+
/* to simulate a user */
|
| 133 |
+
char *seed_key;
|
| 134 |
+
const BIGNUM *default_g;
|
| 135 |
+
const BIGNUM *default_N;
|
| 136 |
+
} SRP_VBASE;
|
| 137 |
+
|
| 138 |
+
/*
|
| 139 |
+
* Internal structure storing N and g pair
|
| 140 |
+
*/
|
| 141 |
+
typedef struct SRP_gN_st {
|
| 142 |
+
char *id;
|
| 143 |
+
const BIGNUM *g;
|
| 144 |
+
const BIGNUM *N;
|
| 145 |
+
} SRP_gN;
|
| 146 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN, SRP_gN, SRP_gN)
|
| 147 |
+
#define sk_SRP_gN_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_sk_type(sk))
|
| 148 |
+
#define sk_SRP_gN_value(sk, idx) ((SRP_gN *)OPENSSL_sk_value(ossl_check_const_SRP_gN_sk_type(sk), (idx)))
|
| 149 |
+
#define sk_SRP_gN_new(cmp) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new(ossl_check_SRP_gN_compfunc_type(cmp)))
|
| 150 |
+
#define sk_SRP_gN_new_null() ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_null())
|
| 151 |
+
#define sk_SRP_gN_new_reserve(cmp, n) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_compfunc_type(cmp), (n)))
|
| 152 |
+
#define sk_SRP_gN_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_sk_type(sk), (n))
|
| 153 |
+
#define sk_SRP_gN_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_sk_type(sk))
|
| 154 |
+
#define sk_SRP_gN_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_sk_type(sk))
|
| 155 |
+
#define sk_SRP_gN_delete(sk, i) ((SRP_gN *)OPENSSL_sk_delete(ossl_check_SRP_gN_sk_type(sk), (i)))
|
| 156 |
+
#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)))
|
| 157 |
+
#define sk_SRP_gN_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 158 |
+
#define sk_SRP_gN_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 159 |
+
#define sk_SRP_gN_pop(sk) ((SRP_gN *)OPENSSL_sk_pop(ossl_check_SRP_gN_sk_type(sk)))
|
| 160 |
+
#define sk_SRP_gN_shift(sk) ((SRP_gN *)OPENSSL_sk_shift(ossl_check_SRP_gN_sk_type(sk)))
|
| 161 |
+
#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))
|
| 162 |
+
#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))
|
| 163 |
+
#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)))
|
| 164 |
+
#define sk_SRP_gN_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 165 |
+
#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))
|
| 166 |
+
#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)
|
| 167 |
+
#define sk_SRP_gN_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_sk_type(sk))
|
| 168 |
+
#define sk_SRP_gN_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_sk_type(sk))
|
| 169 |
+
#define sk_SRP_gN_dup(sk) ((STACK_OF(SRP_gN) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_sk_type(sk)))
|
| 170 |
+
#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)))
|
| 171 |
+
#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)))
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
OSSL_DEPRECATEDIN_3_0
|
| 176 |
+
SRP_VBASE *SRP_VBASE_new(char *seed_key);
|
| 177 |
+
OSSL_DEPRECATEDIN_3_0
|
| 178 |
+
void SRP_VBASE_free(SRP_VBASE *vb);
|
| 179 |
+
OSSL_DEPRECATEDIN_3_0
|
| 180 |
+
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
|
| 181 |
+
|
| 182 |
+
OSSL_DEPRECATEDIN_3_0
|
| 183 |
+
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
|
| 184 |
+
|
| 185 |
+
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
|
| 186 |
+
OSSL_DEPRECATEDIN_3_0
|
| 187 |
+
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
|
| 188 |
+
|
| 189 |
+
OSSL_DEPRECATEDIN_3_0
|
| 190 |
+
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
|
| 191 |
+
char **verifier, const char *N, const char *g,
|
| 192 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 193 |
+
OSSL_DEPRECATEDIN_3_0
|
| 194 |
+
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
|
| 195 |
+
char **verifier, const char *N, const char *g);
|
| 196 |
+
OSSL_DEPRECATEDIN_3_0
|
| 197 |
+
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
|
| 198 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 199 |
+
const BIGNUM *g, OSSL_LIB_CTX *libctx,
|
| 200 |
+
const char *propq);
|
| 201 |
+
OSSL_DEPRECATEDIN_3_0
|
| 202 |
+
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
|
| 203 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 204 |
+
const BIGNUM *g);
|
| 205 |
+
|
| 206 |
+
# define SRP_NO_ERROR 0
|
| 207 |
+
# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
|
| 208 |
+
# define SRP_ERR_VBASE_BN_LIB 2
|
| 209 |
+
# define SRP_ERR_OPEN_FILE 3
|
| 210 |
+
# define SRP_ERR_MEMORY 4
|
| 211 |
+
|
| 212 |
+
# define DB_srptype 0
|
| 213 |
+
# define DB_srpverifier 1
|
| 214 |
+
# define DB_srpsalt 2
|
| 215 |
+
# define DB_srpid 3
|
| 216 |
+
# define DB_srpgN 4
|
| 217 |
+
# define DB_srpinfo 5
|
| 218 |
+
# undef DB_NUMBER
|
| 219 |
+
# define DB_NUMBER 6
|
| 220 |
+
|
| 221 |
+
# define DB_SRP_INDEX 'I'
|
| 222 |
+
# define DB_SRP_VALID 'V'
|
| 223 |
+
# define DB_SRP_REVOKED 'R'
|
| 224 |
+
# define DB_SRP_MODIF 'v'
|
| 225 |
+
|
| 226 |
+
/* see srp.c */
|
| 227 |
+
OSSL_DEPRECATEDIN_3_0
|
| 228 |
+
char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
|
| 229 |
+
OSSL_DEPRECATEDIN_3_0
|
| 230 |
+
SRP_gN *SRP_get_default_gN(const char *id);
|
| 231 |
+
|
| 232 |
+
/* server side .... */
|
| 233 |
+
OSSL_DEPRECATEDIN_3_0
|
| 234 |
+
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
|
| 235 |
+
const BIGNUM *b, const BIGNUM *N);
|
| 236 |
+
OSSL_DEPRECATEDIN_3_0
|
| 237 |
+
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 238 |
+
const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
|
| 239 |
+
OSSL_DEPRECATEDIN_3_0
|
| 240 |
+
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 241 |
+
const BIGNUM *v);
|
| 242 |
+
|
| 243 |
+
OSSL_DEPRECATEDIN_3_0
|
| 244 |
+
int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
|
| 245 |
+
OSSL_DEPRECATEDIN_3_0
|
| 246 |
+
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
|
| 247 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 248 |
+
OSSL_DEPRECATEDIN_3_0
|
| 249 |
+
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
|
| 250 |
+
|
| 251 |
+
/* client side .... */
|
| 252 |
+
|
| 253 |
+
OSSL_DEPRECATEDIN_3_0
|
| 254 |
+
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
|
| 255 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 256 |
+
OSSL_DEPRECATEDIN_3_0
|
| 257 |
+
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
|
| 258 |
+
OSSL_DEPRECATEDIN_3_0
|
| 259 |
+
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
|
| 260 |
+
OSSL_DEPRECATEDIN_3_0
|
| 261 |
+
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 262 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
|
| 263 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 264 |
+
OSSL_DEPRECATEDIN_3_0
|
| 265 |
+
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 266 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
|
| 267 |
+
OSSL_DEPRECATEDIN_3_0
|
| 268 |
+
int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
|
| 269 |
+
|
| 270 |
+
# define SRP_MINIMAL_N 1024
|
| 271 |
+
|
| 272 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 273 |
+
|
| 274 |
+
/* This method ignores the configured seed and fails for an unknown user. */
|
| 275 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 276 |
+
OSSL_DEPRECATEDIN_1_1_0
|
| 277 |
+
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
|
| 278 |
+
# endif
|
| 279 |
+
|
| 280 |
+
# ifdef __cplusplus
|
| 281 |
+
}
|
| 282 |
+
# endif
|
| 283 |
+
# endif
|
| 284 |
+
|
| 285 |
+
#endif
|
llava_next/include/openssl/srtp.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
# ifndef OPENSSL_NO_SRTP
|
| 43 |
+
|
| 44 |
+
__owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
|
| 45 |
+
__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
|
| 46 |
+
|
| 47 |
+
__owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
|
| 48 |
+
__owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
|
| 49 |
+
|
| 50 |
+
# endif
|
| 51 |
+
|
| 52 |
+
#ifdef __cplusplus
|
| 53 |
+
}
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
#endif
|
llava_next/include/openssl/ssl.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
llava_next/include/openssl/sslerr.h
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_SSLERR_H
|
| 12 |
+
# define OPENSSL_SSLERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/sslerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* SSL reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291
|
| 25 |
+
# define SSL_R_APP_DATA_IN_HANDSHAKE 100
|
| 26 |
+
# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
|
| 27 |
+
# define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
|
| 28 |
+
# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
|
| 29 |
+
# define SSL_R_BAD_CIPHER 186
|
| 30 |
+
# define SSL_R_BAD_DATA 390
|
| 31 |
+
# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
|
| 32 |
+
# define SSL_R_BAD_DECOMPRESSION 107
|
| 33 |
+
# define SSL_R_BAD_DH_VALUE 102
|
| 34 |
+
# define SSL_R_BAD_DIGEST_LENGTH 111
|
| 35 |
+
# define SSL_R_BAD_EARLY_DATA 233
|
| 36 |
+
# define SSL_R_BAD_ECC_CERT 304
|
| 37 |
+
# define SSL_R_BAD_ECPOINT 306
|
| 38 |
+
# define SSL_R_BAD_EXTENSION 110
|
| 39 |
+
# define SSL_R_BAD_HANDSHAKE_LENGTH 332
|
| 40 |
+
# define SSL_R_BAD_HANDSHAKE_STATE 236
|
| 41 |
+
# define SSL_R_BAD_HELLO_REQUEST 105
|
| 42 |
+
# define SSL_R_BAD_HRR_VERSION 263
|
| 43 |
+
# define SSL_R_BAD_KEY_SHARE 108
|
| 44 |
+
# define SSL_R_BAD_KEY_UPDATE 122
|
| 45 |
+
# define SSL_R_BAD_LEGACY_VERSION 292
|
| 46 |
+
# define SSL_R_BAD_LENGTH 271
|
| 47 |
+
# define SSL_R_BAD_PACKET 240
|
| 48 |
+
# define SSL_R_BAD_PACKET_LENGTH 115
|
| 49 |
+
# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
|
| 50 |
+
# define SSL_R_BAD_PSK 219
|
| 51 |
+
# define SSL_R_BAD_PSK_IDENTITY 114
|
| 52 |
+
# define SSL_R_BAD_RECORD_TYPE 443
|
| 53 |
+
# define SSL_R_BAD_RSA_ENCRYPT 119
|
| 54 |
+
# define SSL_R_BAD_SIGNATURE 123
|
| 55 |
+
# define SSL_R_BAD_SRP_A_LENGTH 347
|
| 56 |
+
# define SSL_R_BAD_SRP_PARAMETERS 371
|
| 57 |
+
# define SSL_R_BAD_SRTP_MKI_VALUE 352
|
| 58 |
+
# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
|
| 59 |
+
# define SSL_R_BAD_SSL_FILETYPE 124
|
| 60 |
+
# define SSL_R_BAD_VALUE 384
|
| 61 |
+
# define SSL_R_BAD_WRITE_RETRY 127
|
| 62 |
+
# define SSL_R_BINDER_DOES_NOT_VERIFY 253
|
| 63 |
+
# define SSL_R_BIO_NOT_SET 128
|
| 64 |
+
# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
|
| 65 |
+
# define SSL_R_BN_LIB 130
|
| 66 |
+
# define SSL_R_CALLBACK_FAILED 234
|
| 67 |
+
# define SSL_R_CANNOT_CHANGE_CIPHER 109
|
| 68 |
+
# define SSL_R_CANNOT_GET_GROUP_NAME 299
|
| 69 |
+
# define SSL_R_CA_DN_LENGTH_MISMATCH 131
|
| 70 |
+
# define SSL_R_CA_KEY_TOO_SMALL 397
|
| 71 |
+
# define SSL_R_CA_MD_TOO_WEAK 398
|
| 72 |
+
# define SSL_R_CCS_RECEIVED_EARLY 133
|
| 73 |
+
# define SSL_R_CERTIFICATE_VERIFY_FAILED 134
|
| 74 |
+
# define SSL_R_CERT_CB_ERROR 377
|
| 75 |
+
# define SSL_R_CERT_LENGTH_MISMATCH 135
|
| 76 |
+
# define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218
|
| 77 |
+
# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
|
| 78 |
+
# define SSL_R_CLIENTHELLO_TLSEXT 226
|
| 79 |
+
# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
|
| 80 |
+
# define SSL_R_COMPRESSION_DISABLED 343
|
| 81 |
+
# define SSL_R_COMPRESSION_FAILURE 141
|
| 82 |
+
# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
|
| 83 |
+
# define SSL_R_COMPRESSION_LIBRARY_ERROR 142
|
| 84 |
+
# define SSL_R_CONNECTION_TYPE_NOT_SET 144
|
| 85 |
+
# define SSL_R_CONTEXT_NOT_DANE_ENABLED 167
|
| 86 |
+
# define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400
|
| 87 |
+
# define SSL_R_COOKIE_MISMATCH 308
|
| 88 |
+
# define SSL_R_COPY_PARAMETERS_FAILED 296
|
| 89 |
+
# define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206
|
| 90 |
+
# define SSL_R_DANE_ALREADY_ENABLED 172
|
| 91 |
+
# define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173
|
| 92 |
+
# define SSL_R_DANE_NOT_ENABLED 175
|
| 93 |
+
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180
|
| 94 |
+
# define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184
|
| 95 |
+
# define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189
|
| 96 |
+
# define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192
|
| 97 |
+
# define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200
|
| 98 |
+
# define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201
|
| 99 |
+
# define SSL_R_DANE_TLSA_BAD_SELECTOR 202
|
| 100 |
+
# define SSL_R_DANE_TLSA_NULL_DATA 203
|
| 101 |
+
# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
|
| 102 |
+
# define SSL_R_DATA_LENGTH_TOO_LONG 146
|
| 103 |
+
# define SSL_R_DECRYPTION_FAILED 147
|
| 104 |
+
# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
|
| 105 |
+
# define SSL_R_DH_KEY_TOO_SMALL 394
|
| 106 |
+
# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
|
| 107 |
+
# define SSL_R_DIGEST_CHECK_FAILED 149
|
| 108 |
+
# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
|
| 109 |
+
# define SSL_R_DUPLICATE_COMPRESSION_ID 309
|
| 110 |
+
# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
|
| 111 |
+
# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
|
| 112 |
+
# define SSL_R_EE_KEY_TOO_SMALL 399
|
| 113 |
+
# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
|
| 114 |
+
# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
|
| 115 |
+
# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
|
| 116 |
+
# define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204
|
| 117 |
+
# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194
|
| 118 |
+
# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
|
| 119 |
+
# define SSL_R_EXTENSION_NOT_RECEIVED 279
|
| 120 |
+
# define SSL_R_EXTRA_DATA_IN_MESSAGE 153
|
| 121 |
+
# define SSL_R_EXT_LENGTH_MISMATCH 163
|
| 122 |
+
# define SSL_R_FAILED_TO_INIT_ASYNC 405
|
| 123 |
+
# define SSL_R_FRAGMENTED_CLIENT_HELLO 401
|
| 124 |
+
# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
|
| 125 |
+
# define SSL_R_HTTPS_PROXY_REQUEST 155
|
| 126 |
+
# define SSL_R_HTTP_REQUEST 156
|
| 127 |
+
# define SSL_R_ILLEGAL_POINT_COMPRESSION 162
|
| 128 |
+
# define SSL_R_ILLEGAL_SUITEB_DIGEST 380
|
| 129 |
+
# define SSL_R_INAPPROPRIATE_FALLBACK 373
|
| 130 |
+
# define SSL_R_INCONSISTENT_COMPRESSION 340
|
| 131 |
+
# define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222
|
| 132 |
+
# define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231
|
| 133 |
+
# define SSL_R_INCONSISTENT_EXTMS 104
|
| 134 |
+
# define SSL_R_INSUFFICIENT_SECURITY 241
|
| 135 |
+
# define SSL_R_INVALID_ALERT 205
|
| 136 |
+
# define SSL_R_INVALID_CCS_MESSAGE 260
|
| 137 |
+
# define SSL_R_INVALID_CERTIFICATE_OR_ALG 238
|
| 138 |
+
# define SSL_R_INVALID_COMMAND 280
|
| 139 |
+
# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
|
| 140 |
+
# define SSL_R_INVALID_CONFIG 283
|
| 141 |
+
# define SSL_R_INVALID_CONFIGURATION_NAME 113
|
| 142 |
+
# define SSL_R_INVALID_CONTEXT 282
|
| 143 |
+
# define SSL_R_INVALID_CT_VALIDATION_TYPE 212
|
| 144 |
+
# define SSL_R_INVALID_KEY_UPDATE_TYPE 120
|
| 145 |
+
# define SSL_R_INVALID_MAX_EARLY_DATA 174
|
| 146 |
+
# define SSL_R_INVALID_NULL_CMD_NAME 385
|
| 147 |
+
# define SSL_R_INVALID_SEQUENCE_NUMBER 402
|
| 148 |
+
# define SSL_R_INVALID_SERVERINFO_DATA 388
|
| 149 |
+
# define SSL_R_INVALID_SESSION_ID 999
|
| 150 |
+
# define SSL_R_INVALID_SRP_USERNAME 357
|
| 151 |
+
# define SSL_R_INVALID_STATUS_RESPONSE 328
|
| 152 |
+
# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
|
| 153 |
+
# define SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED 333
|
| 154 |
+
# define SSL_R_LENGTH_MISMATCH 159
|
| 155 |
+
# define SSL_R_LENGTH_TOO_LONG 404
|
| 156 |
+
# define SSL_R_LENGTH_TOO_SHORT 160
|
| 157 |
+
# define SSL_R_LIBRARY_BUG 274
|
| 158 |
+
# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
|
| 159 |
+
# define SSL_R_MISSING_DSA_SIGNING_CERT 165
|
| 160 |
+
# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
|
| 161 |
+
# define SSL_R_MISSING_FATAL 256
|
| 162 |
+
# define SSL_R_MISSING_PARAMETERS 290
|
| 163 |
+
# define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310
|
| 164 |
+
# define SSL_R_MISSING_RSA_CERTIFICATE 168
|
| 165 |
+
# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
|
| 166 |
+
# define SSL_R_MISSING_RSA_SIGNING_CERT 170
|
| 167 |
+
# define SSL_R_MISSING_SIGALGS_EXTENSION 112
|
| 168 |
+
# define SSL_R_MISSING_SIGNING_CERT 221
|
| 169 |
+
# define SSL_R_MISSING_SRP_PARAM 358
|
| 170 |
+
# define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
|
| 171 |
+
# define SSL_R_MISSING_TMP_DH_KEY 171
|
| 172 |
+
# define SSL_R_MISSING_TMP_ECDH_KEY 311
|
| 173 |
+
# define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293
|
| 174 |
+
# define SSL_R_NOT_ON_RECORD_BOUNDARY 182
|
| 175 |
+
# define SSL_R_NOT_REPLACING_CERTIFICATE 289
|
| 176 |
+
# define SSL_R_NOT_SERVER 284
|
| 177 |
+
# define SSL_R_NO_APPLICATION_PROTOCOL 235
|
| 178 |
+
# define SSL_R_NO_CERTIFICATES_RETURNED 176
|
| 179 |
+
# define SSL_R_NO_CERTIFICATE_ASSIGNED 177
|
| 180 |
+
# define SSL_R_NO_CERTIFICATE_SET 179
|
| 181 |
+
# define SSL_R_NO_CHANGE_FOLLOWING_HRR 214
|
| 182 |
+
# define SSL_R_NO_CIPHERS_AVAILABLE 181
|
| 183 |
+
# define SSL_R_NO_CIPHERS_SPECIFIED 183
|
| 184 |
+
# define SSL_R_NO_CIPHER_MATCH 185
|
| 185 |
+
# define SSL_R_NO_CLIENT_CERT_METHOD 331
|
| 186 |
+
# define SSL_R_NO_COMPRESSION_SPECIFIED 187
|
| 187 |
+
# define SSL_R_NO_COOKIE_CALLBACK_SET 287
|
| 188 |
+
# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
|
| 189 |
+
# define SSL_R_NO_METHOD_SPECIFIED 188
|
| 190 |
+
# define SSL_R_NO_PEM_EXTENSIONS 389
|
| 191 |
+
# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
|
| 192 |
+
# define SSL_R_NO_PROTOCOLS_AVAILABLE 191
|
| 193 |
+
# define SSL_R_NO_RENEGOTIATION 339
|
| 194 |
+
# define SSL_R_NO_REQUIRED_DIGEST 324
|
| 195 |
+
# define SSL_R_NO_SHARED_CIPHER 193
|
| 196 |
+
# define SSL_R_NO_SHARED_GROUPS 410
|
| 197 |
+
# define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376
|
| 198 |
+
# define SSL_R_NO_SRTP_PROFILES 359
|
| 199 |
+
# define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297
|
| 200 |
+
# define SSL_R_NO_SUITABLE_GROUPS 295
|
| 201 |
+
# define SSL_R_NO_SUITABLE_KEY_SHARE 101
|
| 202 |
+
# define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118
|
| 203 |
+
# define SSL_R_NO_VALID_SCTS 216
|
| 204 |
+
# define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403
|
| 205 |
+
# define SSL_R_NULL_SSL_CTX 195
|
| 206 |
+
# define SSL_R_NULL_SSL_METHOD_PASSED 196
|
| 207 |
+
# define SSL_R_OCSP_CALLBACK_FAILURE 305
|
| 208 |
+
# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
|
| 209 |
+
# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
|
| 210 |
+
# define SSL_R_OVERFLOW_ERROR 237
|
| 211 |
+
# define SSL_R_PACKET_LENGTH_TOO_LONG 198
|
| 212 |
+
# define SSL_R_PARSE_TLSEXT 227
|
| 213 |
+
# define SSL_R_PATH_TOO_LONG 270
|
| 214 |
+
# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
|
| 215 |
+
# define SSL_R_PEM_NAME_BAD_PREFIX 391
|
| 216 |
+
# define SSL_R_PEM_NAME_TOO_SHORT 392
|
| 217 |
+
# define SSL_R_PIPELINE_FAILURE 406
|
| 218 |
+
# define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278
|
| 219 |
+
# define SSL_R_PRIVATE_KEY_MISMATCH 288
|
| 220 |
+
# define SSL_R_PROTOCOL_IS_SHUTDOWN 207
|
| 221 |
+
# define SSL_R_PSK_IDENTITY_NOT_FOUND 223
|
| 222 |
+
# define SSL_R_PSK_NO_CLIENT_CB 224
|
| 223 |
+
# define SSL_R_PSK_NO_SERVER_CB 225
|
| 224 |
+
# define SSL_R_READ_BIO_NOT_SET 211
|
| 225 |
+
# define SSL_R_READ_TIMEOUT_EXPIRED 312
|
| 226 |
+
# define SSL_R_RECORD_LENGTH_MISMATCH 213
|
| 227 |
+
# define SSL_R_RECORD_TOO_SMALL 298
|
| 228 |
+
# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
|
| 229 |
+
# define SSL_R_RENEGOTIATION_ENCODING_ERR 336
|
| 230 |
+
# define SSL_R_RENEGOTIATION_MISMATCH 337
|
| 231 |
+
# define SSL_R_REQUEST_PENDING 285
|
| 232 |
+
# define SSL_R_REQUEST_SENT 286
|
| 233 |
+
# define SSL_R_REQUIRED_CIPHER_MISSING 215
|
| 234 |
+
# define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342
|
| 235 |
+
# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
|
| 236 |
+
# define SSL_R_SCT_VERIFICATION_FAILED 208
|
| 237 |
+
# define SSL_R_SERVERHELLO_TLSEXT 275
|
| 238 |
+
# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
|
| 239 |
+
# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407
|
| 240 |
+
# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
|
| 241 |
+
# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
|
| 242 |
+
# define SSL_R_SRP_A_CALC 361
|
| 243 |
+
# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
|
| 244 |
+
# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
|
| 245 |
+
# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
|
| 246 |
+
# define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
|
| 247 |
+
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
|
| 248 |
+
# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
|
| 249 |
+
# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
|
| 250 |
+
# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
|
| 251 |
+
# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
|
| 252 |
+
# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
|
| 253 |
+
# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
|
| 254 |
+
# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
|
| 255 |
+
# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
|
| 256 |
+
# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
|
| 257 |
+
# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
|
| 258 |
+
# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
|
| 259 |
+
# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
|
| 260 |
+
# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
|
| 261 |
+
# define SSL_R_SSL_COMMAND_SECTION_EMPTY 117
|
| 262 |
+
# define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125
|
| 263 |
+
# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
|
| 264 |
+
# define SSL_R_SSL_HANDSHAKE_FAILURE 229
|
| 265 |
+
# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
|
| 266 |
+
# define SSL_R_SSL_NEGATIVE_LENGTH 372
|
| 267 |
+
# define SSL_R_SSL_SECTION_EMPTY 126
|
| 268 |
+
# define SSL_R_SSL_SECTION_NOT_FOUND 136
|
| 269 |
+
# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
|
| 270 |
+
# define SSL_R_SSL_SESSION_ID_CONFLICT 302
|
| 271 |
+
# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
|
| 272 |
+
# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
|
| 273 |
+
# define SSL_R_SSL_SESSION_ID_TOO_LONG 408
|
| 274 |
+
# define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
|
| 275 |
+
# define SSL_R_STILL_IN_INIT 121
|
| 276 |
+
# define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116
|
| 277 |
+
# define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109
|
| 278 |
+
# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
|
| 279 |
+
# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
|
| 280 |
+
# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
|
| 281 |
+
# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
|
| 282 |
+
# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
|
| 283 |
+
# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
|
| 284 |
+
# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
|
| 285 |
+
# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
|
| 286 |
+
# define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120
|
| 287 |
+
# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
|
| 288 |
+
# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
|
| 289 |
+
# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
|
| 290 |
+
# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
|
| 291 |
+
# define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115
|
| 292 |
+
# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
|
| 293 |
+
# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
|
| 294 |
+
# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
|
| 295 |
+
# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
|
| 296 |
+
# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
|
| 297 |
+
# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
|
| 298 |
+
# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
|
| 299 |
+
# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
|
| 300 |
+
# define SSL_R_TOO_MANY_KEY_UPDATES 132
|
| 301 |
+
# define SSL_R_TOO_MANY_WARN_ALERTS 409
|
| 302 |
+
# define SSL_R_TOO_MUCH_EARLY_DATA 164
|
| 303 |
+
# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
|
| 304 |
+
# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
|
| 305 |
+
# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
|
| 306 |
+
# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
|
| 307 |
+
# define SSL_R_UNEXPECTED_CCS_MESSAGE 262
|
| 308 |
+
# define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
|
| 309 |
+
# define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
|
| 310 |
+
# define SSL_R_UNEXPECTED_MESSAGE 244
|
| 311 |
+
# define SSL_R_UNEXPECTED_RECORD 245
|
| 312 |
+
# define SSL_R_UNINITIALIZED 276
|
| 313 |
+
# define SSL_R_UNKNOWN_ALERT_TYPE 246
|
| 314 |
+
# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
|
| 315 |
+
# define SSL_R_UNKNOWN_CIPHER_RETURNED 248
|
| 316 |
+
# define SSL_R_UNKNOWN_CIPHER_TYPE 249
|
| 317 |
+
# define SSL_R_UNKNOWN_CMD_NAME 386
|
| 318 |
+
# define SSL_R_UNKNOWN_COMMAND 139
|
| 319 |
+
# define SSL_R_UNKNOWN_DIGEST 368
|
| 320 |
+
# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
|
| 321 |
+
# define SSL_R_UNKNOWN_PKEY_TYPE 251
|
| 322 |
+
# define SSL_R_UNKNOWN_PROTOCOL 252
|
| 323 |
+
# define SSL_R_UNKNOWN_SSL_VERSION 254
|
| 324 |
+
# define SSL_R_UNKNOWN_STATE 255
|
| 325 |
+
# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
|
| 326 |
+
# define SSL_R_UNSOLICITED_EXTENSION 217
|
| 327 |
+
# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
|
| 328 |
+
# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
|
| 329 |
+
# define SSL_R_UNSUPPORTED_PROTOCOL 258
|
| 330 |
+
# define SSL_R_UNSUPPORTED_SSL_VERSION 259
|
| 331 |
+
# define SSL_R_UNSUPPORTED_STATUS_TYPE 329
|
| 332 |
+
# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
|
| 333 |
+
# define SSL_R_VERSION_TOO_HIGH 166
|
| 334 |
+
# define SSL_R_VERSION_TOO_LOW 396
|
| 335 |
+
# define SSL_R_WRONG_CERTIFICATE_TYPE 383
|
| 336 |
+
# define SSL_R_WRONG_CIPHER_RETURNED 261
|
| 337 |
+
# define SSL_R_WRONG_CURVE 378
|
| 338 |
+
# define SSL_R_WRONG_SIGNATURE_LENGTH 264
|
| 339 |
+
# define SSL_R_WRONG_SIGNATURE_SIZE 265
|
| 340 |
+
# define SSL_R_WRONG_SIGNATURE_TYPE 370
|
| 341 |
+
# define SSL_R_WRONG_SSL_VERSION 266
|
| 342 |
+
# define SSL_R_WRONG_VERSION_NUMBER 267
|
| 343 |
+
# define SSL_R_X509_LIB 268
|
| 344 |
+
# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
|
| 345 |
+
|
| 346 |
+
#endif
|
llava_next/include/openssl/symhacks.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1999-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_SYMHACKS_H
|
| 11 |
+
# define OPENSSL_SYMHACKS_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_SYMHACKS_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/e_os2.h>
|
| 20 |
+
|
| 21 |
+
/* Case insensitive linking causes problems.... */
|
| 22 |
+
# if defined(OPENSSL_SYS_VMS)
|
| 23 |
+
# undef ERR_load_CRYPTO_strings
|
| 24 |
+
# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
|
| 25 |
+
# undef OCSP_crlID_new
|
| 26 |
+
# define OCSP_crlID_new OCSP_crlID2_new
|
| 27 |
+
|
| 28 |
+
# undef d2i_ECPARAMETERS
|
| 29 |
+
# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
|
| 30 |
+
# undef i2d_ECPARAMETERS
|
| 31 |
+
# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
|
| 32 |
+
# undef d2i_ECPKPARAMETERS
|
| 33 |
+
# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
|
| 34 |
+
# undef i2d_ECPKPARAMETERS
|
| 35 |
+
# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
|
| 36 |
+
|
| 37 |
+
# endif
|
| 38 |
+
|
| 39 |
+
#endif /* ! defined HEADER_VMS_IDHACKS_H */
|
llava_next/include/openssl/tserr.h
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_TSERR_H
|
| 12 |
+
# define OPENSSL_TSERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# ifndef OPENSSL_NO_TS
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* TS reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define TS_R_BAD_PKCS7_TYPE 132
|
| 27 |
+
# define TS_R_BAD_TYPE 133
|
| 28 |
+
# define TS_R_CANNOT_LOAD_CERT 137
|
| 29 |
+
# define TS_R_CANNOT_LOAD_KEY 138
|
| 30 |
+
# define TS_R_CERTIFICATE_VERIFY_ERROR 100
|
| 31 |
+
# define TS_R_COULD_NOT_SET_ENGINE 127
|
| 32 |
+
# define TS_R_COULD_NOT_SET_TIME 115
|
| 33 |
+
# define TS_R_DETACHED_CONTENT 134
|
| 34 |
+
# define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116
|
| 35 |
+
# define TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR 139
|
| 36 |
+
# define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101
|
| 37 |
+
# define TS_R_INVALID_NULL_POINTER 102
|
| 38 |
+
# define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117
|
| 39 |
+
# define TS_R_MESSAGE_IMPRINT_MISMATCH 103
|
| 40 |
+
# define TS_R_NONCE_MISMATCH 104
|
| 41 |
+
# define TS_R_NONCE_NOT_RETURNED 105
|
| 42 |
+
# define TS_R_NO_CONTENT 106
|
| 43 |
+
# define TS_R_NO_TIME_STAMP_TOKEN 107
|
| 44 |
+
# define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118
|
| 45 |
+
# define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119
|
| 46 |
+
# define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129
|
| 47 |
+
# define TS_R_POLICY_MISMATCH 108
|
| 48 |
+
# define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120
|
| 49 |
+
# define TS_R_RESPONSE_SETUP_ERROR 121
|
| 50 |
+
# define TS_R_SIGNATURE_FAILURE 109
|
| 51 |
+
# define TS_R_THERE_MUST_BE_ONE_SIGNER 110
|
| 52 |
+
# define TS_R_TIME_SYSCALL_ERROR 122
|
| 53 |
+
# define TS_R_TOKEN_NOT_PRESENT 130
|
| 54 |
+
# define TS_R_TOKEN_PRESENT 131
|
| 55 |
+
# define TS_R_TSA_NAME_MISMATCH 111
|
| 56 |
+
# define TS_R_TSA_UNTRUSTED 112
|
| 57 |
+
# define TS_R_TST_INFO_SETUP_ERROR 123
|
| 58 |
+
# define TS_R_TS_DATASIGN 124
|
| 59 |
+
# define TS_R_UNACCEPTABLE_POLICY 125
|
| 60 |
+
# define TS_R_UNSUPPORTED_MD_ALGORITHM 126
|
| 61 |
+
# define TS_R_UNSUPPORTED_VERSION 113
|
| 62 |
+
# define TS_R_VAR_BAD_VALUE 135
|
| 63 |
+
# define TS_R_VAR_LOOKUP_FAILURE 136
|
| 64 |
+
# define TS_R_WRONG_CONTENT_TYPE 114
|
| 65 |
+
|
| 66 |
+
# endif
|
| 67 |
+
#endif
|
llava_next/include/openssl/x509.h
ADDED
|
@@ -0,0 +1,1276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/x509.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright (c) 2002, Oracle and/or its affiliates. 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 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
#ifndef OPENSSL_X509_H
|
| 17 |
+
# define OPENSSL_X509_H
|
| 18 |
+
# pragma once
|
| 19 |
+
|
| 20 |
+
# include <openssl/macros.h>
|
| 21 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
# define HEADER_X509_H
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/types.h>
|
| 27 |
+
# include <openssl/symhacks.h>
|
| 28 |
+
# include <openssl/buffer.h>
|
| 29 |
+
# include <openssl/evp.h>
|
| 30 |
+
# include <openssl/bio.h>
|
| 31 |
+
# include <openssl/asn1.h>
|
| 32 |
+
# include <openssl/safestack.h>
|
| 33 |
+
# include <openssl/ec.h>
|
| 34 |
+
|
| 35 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 36 |
+
# include <openssl/rsa.h>
|
| 37 |
+
# include <openssl/dsa.h>
|
| 38 |
+
# include <openssl/dh.h>
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
# include <openssl/sha.h>
|
| 42 |
+
# include <openssl/x509err.h>
|
| 43 |
+
|
| 44 |
+
#ifdef __cplusplus
|
| 45 |
+
extern "C" {
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
/* Needed stacks for types defined in other headers */
|
| 49 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME, X509_NAME, X509_NAME)
|
| 50 |
+
#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk))
|
| 51 |
+
#define sk_X509_NAME_value(sk, idx) ((X509_NAME *)OPENSSL_sk_value(ossl_check_const_X509_NAME_sk_type(sk), (idx)))
|
| 52 |
+
#define sk_X509_NAME_new(cmp) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new(ossl_check_X509_NAME_compfunc_type(cmp)))
|
| 53 |
+
#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
|
| 54 |
+
#define sk_X509_NAME_new_reserve(cmp, n) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_compfunc_type(cmp), (n)))
|
| 55 |
+
#define sk_X509_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_sk_type(sk), (n))
|
| 56 |
+
#define sk_X509_NAME_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_sk_type(sk))
|
| 57 |
+
#define sk_X509_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_sk_type(sk))
|
| 58 |
+
#define sk_X509_NAME_delete(sk, i) ((X509_NAME *)OPENSSL_sk_delete(ossl_check_X509_NAME_sk_type(sk), (i)))
|
| 59 |
+
#define sk_X509_NAME_delete_ptr(sk, ptr) ((X509_NAME *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)))
|
| 60 |
+
#define sk_X509_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 61 |
+
#define sk_X509_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 62 |
+
#define sk_X509_NAME_pop(sk) ((X509_NAME *)OPENSSL_sk_pop(ossl_check_X509_NAME_sk_type(sk)))
|
| 63 |
+
#define sk_X509_NAME_shift(sk) ((X509_NAME *)OPENSSL_sk_shift(ossl_check_X509_NAME_sk_type(sk)))
|
| 64 |
+
#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk),ossl_check_X509_NAME_freefunc_type(freefunc))
|
| 65 |
+
#define sk_X509_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), (idx))
|
| 66 |
+
#define sk_X509_NAME_set(sk, idx, ptr) ((X509_NAME *)OPENSSL_sk_set(ossl_check_X509_NAME_sk_type(sk), (idx), ossl_check_X509_NAME_type(ptr)))
|
| 67 |
+
#define sk_X509_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 68 |
+
#define sk_X509_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 69 |
+
#define sk_X509_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), pnum)
|
| 70 |
+
#define sk_X509_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_sk_type(sk))
|
| 71 |
+
#define sk_X509_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_sk_type(sk))
|
| 72 |
+
#define sk_X509_NAME_dup(sk) ((STACK_OF(X509_NAME) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_sk_type(sk)))
|
| 73 |
+
#define sk_X509_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_sk_type(sk), ossl_check_X509_NAME_copyfunc_type(copyfunc), ossl_check_X509_NAME_freefunc_type(freefunc)))
|
| 74 |
+
#define sk_X509_NAME_set_cmp_func(sk, cmp) ((sk_X509_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_compfunc_type(cmp)))
|
| 75 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509, X509, X509)
|
| 76 |
+
#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
|
| 77 |
+
#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
|
| 78 |
+
#define sk_X509_new(cmp) ((STACK_OF(X509) *)OPENSSL_sk_new(ossl_check_X509_compfunc_type(cmp)))
|
| 79 |
+
#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
|
| 80 |
+
#define sk_X509_new_reserve(cmp, n) ((STACK_OF(X509) *)OPENSSL_sk_new_reserve(ossl_check_X509_compfunc_type(cmp), (n)))
|
| 81 |
+
#define sk_X509_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_sk_type(sk), (n))
|
| 82 |
+
#define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk))
|
| 83 |
+
#define sk_X509_zero(sk) OPENSSL_sk_zero(ossl_check_X509_sk_type(sk))
|
| 84 |
+
#define sk_X509_delete(sk, i) ((X509 *)OPENSSL_sk_delete(ossl_check_X509_sk_type(sk), (i)))
|
| 85 |
+
#define sk_X509_delete_ptr(sk, ptr) ((X509 *)OPENSSL_sk_delete_ptr(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)))
|
| 86 |
+
#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 87 |
+
#define sk_X509_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 88 |
+
#define sk_X509_pop(sk) ((X509 *)OPENSSL_sk_pop(ossl_check_X509_sk_type(sk)))
|
| 89 |
+
#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk)))
|
| 90 |
+
#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk),ossl_check_X509_freefunc_type(freefunc))
|
| 91 |
+
#define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx))
|
| 92 |
+
#define sk_X509_set(sk, idx, ptr) ((X509 *)OPENSSL_sk_set(ossl_check_X509_sk_type(sk), (idx), ossl_check_X509_type(ptr)))
|
| 93 |
+
#define sk_X509_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 94 |
+
#define sk_X509_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 95 |
+
#define sk_X509_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), pnum)
|
| 96 |
+
#define sk_X509_sort(sk) OPENSSL_sk_sort(ossl_check_X509_sk_type(sk))
|
| 97 |
+
#define sk_X509_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_sk_type(sk))
|
| 98 |
+
#define sk_X509_dup(sk) ((STACK_OF(X509) *)OPENSSL_sk_dup(ossl_check_const_X509_sk_type(sk)))
|
| 99 |
+
#define sk_X509_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_sk_type(sk), ossl_check_X509_copyfunc_type(copyfunc), ossl_check_X509_freefunc_type(freefunc)))
|
| 100 |
+
#define sk_X509_set_cmp_func(sk, cmp) ((sk_X509_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_sk_type(sk), ossl_check_X509_compfunc_type(cmp)))
|
| 101 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_REVOKED, X509_REVOKED, X509_REVOKED)
|
| 102 |
+
#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
|
| 103 |
+
#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
|
| 104 |
+
#define sk_X509_REVOKED_new(cmp) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new(ossl_check_X509_REVOKED_compfunc_type(cmp)))
|
| 105 |
+
#define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_null())
|
| 106 |
+
#define sk_X509_REVOKED_new_reserve(cmp, n) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_reserve(ossl_check_X509_REVOKED_compfunc_type(cmp), (n)))
|
| 107 |
+
#define sk_X509_REVOKED_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_REVOKED_sk_type(sk), (n))
|
| 108 |
+
#define sk_X509_REVOKED_free(sk) OPENSSL_sk_free(ossl_check_X509_REVOKED_sk_type(sk))
|
| 109 |
+
#define sk_X509_REVOKED_zero(sk) OPENSSL_sk_zero(ossl_check_X509_REVOKED_sk_type(sk))
|
| 110 |
+
#define sk_X509_REVOKED_delete(sk, i) ((X509_REVOKED *)OPENSSL_sk_delete(ossl_check_X509_REVOKED_sk_type(sk), (i)))
|
| 111 |
+
#define sk_X509_REVOKED_delete_ptr(sk, ptr) ((X509_REVOKED *)OPENSSL_sk_delete_ptr(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)))
|
| 112 |
+
#define sk_X509_REVOKED_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 113 |
+
#define sk_X509_REVOKED_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 114 |
+
#define sk_X509_REVOKED_pop(sk) ((X509_REVOKED *)OPENSSL_sk_pop(ossl_check_X509_REVOKED_sk_type(sk)))
|
| 115 |
+
#define sk_X509_REVOKED_shift(sk) ((X509_REVOKED *)OPENSSL_sk_shift(ossl_check_X509_REVOKED_sk_type(sk)))
|
| 116 |
+
#define sk_X509_REVOKED_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_REVOKED_sk_type(sk),ossl_check_X509_REVOKED_freefunc_type(freefunc))
|
| 117 |
+
#define sk_X509_REVOKED_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), (idx))
|
| 118 |
+
#define sk_X509_REVOKED_set(sk, idx, ptr) ((X509_REVOKED *)OPENSSL_sk_set(ossl_check_X509_REVOKED_sk_type(sk), (idx), ossl_check_X509_REVOKED_type(ptr)))
|
| 119 |
+
#define sk_X509_REVOKED_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 120 |
+
#define sk_X509_REVOKED_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 121 |
+
#define sk_X509_REVOKED_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), pnum)
|
| 122 |
+
#define sk_X509_REVOKED_sort(sk) OPENSSL_sk_sort(ossl_check_X509_REVOKED_sk_type(sk))
|
| 123 |
+
#define sk_X509_REVOKED_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_REVOKED_sk_type(sk))
|
| 124 |
+
#define sk_X509_REVOKED_dup(sk) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_dup(ossl_check_const_X509_REVOKED_sk_type(sk)))
|
| 125 |
+
#define sk_X509_REVOKED_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_copyfunc_type(copyfunc), ossl_check_X509_REVOKED_freefunc_type(freefunc)))
|
| 126 |
+
#define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp)))
|
| 127 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_CRL, X509_CRL, X509_CRL)
|
| 128 |
+
#define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk))
|
| 129 |
+
#define sk_X509_CRL_value(sk, idx) ((X509_CRL *)OPENSSL_sk_value(ossl_check_const_X509_CRL_sk_type(sk), (idx)))
|
| 130 |
+
#define sk_X509_CRL_new(cmp) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new(ossl_check_X509_CRL_compfunc_type(cmp)))
|
| 131 |
+
#define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_null())
|
| 132 |
+
#define sk_X509_CRL_new_reserve(cmp, n) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_reserve(ossl_check_X509_CRL_compfunc_type(cmp), (n)))
|
| 133 |
+
#define sk_X509_CRL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_CRL_sk_type(sk), (n))
|
| 134 |
+
#define sk_X509_CRL_free(sk) OPENSSL_sk_free(ossl_check_X509_CRL_sk_type(sk))
|
| 135 |
+
#define sk_X509_CRL_zero(sk) OPENSSL_sk_zero(ossl_check_X509_CRL_sk_type(sk))
|
| 136 |
+
#define sk_X509_CRL_delete(sk, i) ((X509_CRL *)OPENSSL_sk_delete(ossl_check_X509_CRL_sk_type(sk), (i)))
|
| 137 |
+
#define sk_X509_CRL_delete_ptr(sk, ptr) ((X509_CRL *)OPENSSL_sk_delete_ptr(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)))
|
| 138 |
+
#define sk_X509_CRL_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 139 |
+
#define sk_X509_CRL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 140 |
+
#define sk_X509_CRL_pop(sk) ((X509_CRL *)OPENSSL_sk_pop(ossl_check_X509_CRL_sk_type(sk)))
|
| 141 |
+
#define sk_X509_CRL_shift(sk) ((X509_CRL *)OPENSSL_sk_shift(ossl_check_X509_CRL_sk_type(sk)))
|
| 142 |
+
#define sk_X509_CRL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_CRL_sk_type(sk),ossl_check_X509_CRL_freefunc_type(freefunc))
|
| 143 |
+
#define sk_X509_CRL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), (idx))
|
| 144 |
+
#define sk_X509_CRL_set(sk, idx, ptr) ((X509_CRL *)OPENSSL_sk_set(ossl_check_X509_CRL_sk_type(sk), (idx), ossl_check_X509_CRL_type(ptr)))
|
| 145 |
+
#define sk_X509_CRL_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 146 |
+
#define sk_X509_CRL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 147 |
+
#define sk_X509_CRL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), pnum)
|
| 148 |
+
#define sk_X509_CRL_sort(sk) OPENSSL_sk_sort(ossl_check_X509_CRL_sk_type(sk))
|
| 149 |
+
#define sk_X509_CRL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_CRL_sk_type(sk))
|
| 150 |
+
#define sk_X509_CRL_dup(sk) ((STACK_OF(X509_CRL) *)OPENSSL_sk_dup(ossl_check_const_X509_CRL_sk_type(sk)))
|
| 151 |
+
#define sk_X509_CRL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_CRL) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_CRL_sk_type(sk), ossl_check_X509_CRL_copyfunc_type(copyfunc), ossl_check_X509_CRL_freefunc_type(freefunc)))
|
| 152 |
+
#define sk_X509_CRL_set_cmp_func(sk, cmp) ((sk_X509_CRL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_compfunc_type(cmp)))
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
/* Flags for X509_get_signature_info() */
|
| 156 |
+
/* Signature info is valid */
|
| 157 |
+
# define X509_SIG_INFO_VALID 0x1
|
| 158 |
+
/* Signature is suitable for TLS use */
|
| 159 |
+
# define X509_SIG_INFO_TLS 0x2
|
| 160 |
+
|
| 161 |
+
# define X509_FILETYPE_PEM 1
|
| 162 |
+
# define X509_FILETYPE_ASN1 2
|
| 163 |
+
# define X509_FILETYPE_DEFAULT 3
|
| 164 |
+
|
| 165 |
+
# define X509v3_KU_DIGITAL_SIGNATURE 0x0080
|
| 166 |
+
# define X509v3_KU_NON_REPUDIATION 0x0040
|
| 167 |
+
# define X509v3_KU_KEY_ENCIPHERMENT 0x0020
|
| 168 |
+
# define X509v3_KU_DATA_ENCIPHERMENT 0x0010
|
| 169 |
+
# define X509v3_KU_KEY_AGREEMENT 0x0008
|
| 170 |
+
# define X509v3_KU_KEY_CERT_SIGN 0x0004
|
| 171 |
+
# define X509v3_KU_CRL_SIGN 0x0002
|
| 172 |
+
# define X509v3_KU_ENCIPHER_ONLY 0x0001
|
| 173 |
+
# define X509v3_KU_DECIPHER_ONLY 0x8000
|
| 174 |
+
# define X509v3_KU_UNDEF 0xffff
|
| 175 |
+
|
| 176 |
+
struct X509_algor_st {
|
| 177 |
+
ASN1_OBJECT *algorithm;
|
| 178 |
+
ASN1_TYPE *parameter;
|
| 179 |
+
} /* X509_ALGOR */ ;
|
| 180 |
+
|
| 181 |
+
typedef STACK_OF(X509_ALGOR) X509_ALGORS;
|
| 182 |
+
|
| 183 |
+
typedef struct X509_val_st {
|
| 184 |
+
ASN1_TIME *notBefore;
|
| 185 |
+
ASN1_TIME *notAfter;
|
| 186 |
+
} X509_VAL;
|
| 187 |
+
|
| 188 |
+
typedef struct X509_sig_st X509_SIG;
|
| 189 |
+
|
| 190 |
+
typedef struct X509_name_entry_st X509_NAME_ENTRY;
|
| 191 |
+
|
| 192 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME_ENTRY, X509_NAME_ENTRY, X509_NAME_ENTRY)
|
| 193 |
+
#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
|
| 194 |
+
#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
|
| 195 |
+
#define sk_X509_NAME_ENTRY_new(cmp) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
|
| 196 |
+
#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
|
| 197 |
+
#define sk_X509_NAME_ENTRY_new_reserve(cmp, n) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp), (n)))
|
| 198 |
+
#define sk_X509_NAME_ENTRY_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_ENTRY_sk_type(sk), (n))
|
| 199 |
+
#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 200 |
+
#define sk_X509_NAME_ENTRY_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 201 |
+
#define sk_X509_NAME_ENTRY_delete(sk, i) ((X509_NAME_ENTRY *)OPENSSL_sk_delete(ossl_check_X509_NAME_ENTRY_sk_type(sk), (i)))
|
| 202 |
+
#define sk_X509_NAME_ENTRY_delete_ptr(sk, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)))
|
| 203 |
+
#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 204 |
+
#define sk_X509_NAME_ENTRY_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 205 |
+
#define sk_X509_NAME_ENTRY_pop(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_pop(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
|
| 206 |
+
#define sk_X509_NAME_ENTRY_shift(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_shift(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
|
| 207 |
+
#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk),ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
|
| 208 |
+
#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx))
|
| 209 |
+
#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr)))
|
| 210 |
+
#define sk_X509_NAME_ENTRY_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 211 |
+
#define sk_X509_NAME_ENTRY_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 212 |
+
#define sk_X509_NAME_ENTRY_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), pnum)
|
| 213 |
+
#define sk_X509_NAME_ENTRY_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 214 |
+
#define sk_X509_NAME_ENTRY_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
|
| 215 |
+
#define sk_X509_NAME_ENTRY_dup(sk) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)))
|
| 216 |
+
#define sk_X509_NAME_ENTRY_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_copyfunc_type(copyfunc), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc)))
|
| 217 |
+
#define sk_X509_NAME_ENTRY_set_cmp_func(sk, cmp) ((sk_X509_NAME_ENTRY_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
# define X509_EX_V_NETSCAPE_HACK 0x8000
|
| 221 |
+
# define X509_EX_V_INIT 0x0001
|
| 222 |
+
typedef struct X509_extension_st X509_EXTENSION;
|
| 223 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_EXTENSION, X509_EXTENSION, X509_EXTENSION)
|
| 224 |
+
#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
|
| 225 |
+
#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
|
| 226 |
+
#define sk_X509_EXTENSION_new(cmp) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new(ossl_check_X509_EXTENSION_compfunc_type(cmp)))
|
| 227 |
+
#define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_null())
|
| 228 |
+
#define sk_X509_EXTENSION_new_reserve(cmp, n) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_reserve(ossl_check_X509_EXTENSION_compfunc_type(cmp), (n)))
|
| 229 |
+
#define sk_X509_EXTENSION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_EXTENSION_sk_type(sk), (n))
|
| 230 |
+
#define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 231 |
+
#define sk_X509_EXTENSION_zero(sk) OPENSSL_sk_zero(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 232 |
+
#define sk_X509_EXTENSION_delete(sk, i) ((X509_EXTENSION *)OPENSSL_sk_delete(ossl_check_X509_EXTENSION_sk_type(sk), (i)))
|
| 233 |
+
#define sk_X509_EXTENSION_delete_ptr(sk, ptr) ((X509_EXTENSION *)OPENSSL_sk_delete_ptr(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)))
|
| 234 |
+
#define sk_X509_EXTENSION_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 235 |
+
#define sk_X509_EXTENSION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 236 |
+
#define sk_X509_EXTENSION_pop(sk) ((X509_EXTENSION *)OPENSSL_sk_pop(ossl_check_X509_EXTENSION_sk_type(sk)))
|
| 237 |
+
#define sk_X509_EXTENSION_shift(sk) ((X509_EXTENSION *)OPENSSL_sk_shift(ossl_check_X509_EXTENSION_sk_type(sk)))
|
| 238 |
+
#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk),ossl_check_X509_EXTENSION_freefunc_type(freefunc))
|
| 239 |
+
#define sk_X509_EXTENSION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), (idx))
|
| 240 |
+
#define sk_X509_EXTENSION_set(sk, idx, ptr) ((X509_EXTENSION *)OPENSSL_sk_set(ossl_check_X509_EXTENSION_sk_type(sk), (idx), ossl_check_X509_EXTENSION_type(ptr)))
|
| 241 |
+
#define sk_X509_EXTENSION_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 242 |
+
#define sk_X509_EXTENSION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 243 |
+
#define sk_X509_EXTENSION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), pnum)
|
| 244 |
+
#define sk_X509_EXTENSION_sort(sk) OPENSSL_sk_sort(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 245 |
+
#define sk_X509_EXTENSION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_EXTENSION_sk_type(sk))
|
| 246 |
+
#define sk_X509_EXTENSION_dup(sk) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_dup(ossl_check_const_X509_EXTENSION_sk_type(sk)))
|
| 247 |
+
#define sk_X509_EXTENSION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_copyfunc_type(copyfunc), ossl_check_X509_EXTENSION_freefunc_type(freefunc)))
|
| 248 |
+
#define sk_X509_EXTENSION_set_cmp_func(sk, cmp) ((sk_X509_EXTENSION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_compfunc_type(cmp)))
|
| 249 |
+
|
| 250 |
+
typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
|
| 251 |
+
typedef struct x509_attributes_st X509_ATTRIBUTE;
|
| 252 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_ATTRIBUTE, X509_ATTRIBUTE, X509_ATTRIBUTE)
|
| 253 |
+
#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
|
| 254 |
+
#define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx)))
|
| 255 |
+
#define sk_X509_ATTRIBUTE_new(cmp) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
|
| 256 |
+
#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null())
|
| 257 |
+
#define sk_X509_ATTRIBUTE_new_reserve(cmp, n) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_reserve(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp), (n)))
|
| 258 |
+
#define sk_X509_ATTRIBUTE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ATTRIBUTE_sk_type(sk), (n))
|
| 259 |
+
#define sk_X509_ATTRIBUTE_free(sk) OPENSSL_sk_free(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 260 |
+
#define sk_X509_ATTRIBUTE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 261 |
+
#define sk_X509_ATTRIBUTE_delete(sk, i) ((X509_ATTRIBUTE *)OPENSSL_sk_delete(ossl_check_X509_ATTRIBUTE_sk_type(sk), (i)))
|
| 262 |
+
#define sk_X509_ATTRIBUTE_delete_ptr(sk, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_delete_ptr(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)))
|
| 263 |
+
#define sk_X509_ATTRIBUTE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 264 |
+
#define sk_X509_ATTRIBUTE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 265 |
+
#define sk_X509_ATTRIBUTE_pop(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_pop(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
|
| 266 |
+
#define sk_X509_ATTRIBUTE_shift(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_shift(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
|
| 267 |
+
#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk),ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
|
| 268 |
+
#define sk_X509_ATTRIBUTE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), (idx))
|
| 269 |
+
#define sk_X509_ATTRIBUTE_set(sk, idx, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_set(ossl_check_X509_ATTRIBUTE_sk_type(sk), (idx), ossl_check_X509_ATTRIBUTE_type(ptr)))
|
| 270 |
+
#define sk_X509_ATTRIBUTE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 271 |
+
#define sk_X509_ATTRIBUTE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 272 |
+
#define sk_X509_ATTRIBUTE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), pnum)
|
| 273 |
+
#define sk_X509_ATTRIBUTE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 274 |
+
#define sk_X509_ATTRIBUTE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
|
| 275 |
+
#define sk_X509_ATTRIBUTE_dup(sk) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_dup(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)))
|
| 276 |
+
#define sk_X509_ATTRIBUTE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_copyfunc_type(copyfunc), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc)))
|
| 277 |
+
#define sk_X509_ATTRIBUTE_set_cmp_func(sk, cmp) ((sk_X509_ATTRIBUTE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
|
| 278 |
+
|
| 279 |
+
typedef struct X509_req_info_st X509_REQ_INFO;
|
| 280 |
+
typedef struct X509_req_st X509_REQ;
|
| 281 |
+
typedef struct x509_cert_aux_st X509_CERT_AUX;
|
| 282 |
+
typedef struct x509_cinf_st X509_CINF;
|
| 283 |
+
|
| 284 |
+
/* Flags for X509_print_ex() */
|
| 285 |
+
|
| 286 |
+
# define X509_FLAG_COMPAT 0
|
| 287 |
+
# define X509_FLAG_NO_HEADER 1L
|
| 288 |
+
# define X509_FLAG_NO_VERSION (1L << 1)
|
| 289 |
+
# define X509_FLAG_NO_SERIAL (1L << 2)
|
| 290 |
+
# define X509_FLAG_NO_SIGNAME (1L << 3)
|
| 291 |
+
# define X509_FLAG_NO_ISSUER (1L << 4)
|
| 292 |
+
# define X509_FLAG_NO_VALIDITY (1L << 5)
|
| 293 |
+
# define X509_FLAG_NO_SUBJECT (1L << 6)
|
| 294 |
+
# define X509_FLAG_NO_PUBKEY (1L << 7)
|
| 295 |
+
# define X509_FLAG_NO_EXTENSIONS (1L << 8)
|
| 296 |
+
# define X509_FLAG_NO_SIGDUMP (1L << 9)
|
| 297 |
+
# define X509_FLAG_NO_AUX (1L << 10)
|
| 298 |
+
# define X509_FLAG_NO_ATTRIBUTES (1L << 11)
|
| 299 |
+
# define X509_FLAG_NO_IDS (1L << 12)
|
| 300 |
+
# define X509_FLAG_EXTENSIONS_ONLY_KID (1L << 13)
|
| 301 |
+
|
| 302 |
+
/* Flags specific to X509_NAME_print_ex() */
|
| 303 |
+
|
| 304 |
+
/* The field separator information */
|
| 305 |
+
|
| 306 |
+
# define XN_FLAG_SEP_MASK (0xf << 16)
|
| 307 |
+
|
| 308 |
+
# define XN_FLAG_COMPAT 0/* Traditional; use old X509_NAME_print */
|
| 309 |
+
# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */
|
| 310 |
+
# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */
|
| 311 |
+
# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */
|
| 312 |
+
# define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */
|
| 313 |
+
|
| 314 |
+
# define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */
|
| 315 |
+
|
| 316 |
+
/* How the field name is shown */
|
| 317 |
+
|
| 318 |
+
# define XN_FLAG_FN_MASK (0x3 << 21)
|
| 319 |
+
|
| 320 |
+
# define XN_FLAG_FN_SN 0/* Object short name */
|
| 321 |
+
# define XN_FLAG_FN_LN (1 << 21)/* Object long name */
|
| 322 |
+
# define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */
|
| 323 |
+
# define XN_FLAG_FN_NONE (3 << 21)/* No field names */
|
| 324 |
+
|
| 325 |
+
# define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */
|
| 326 |
+
|
| 327 |
+
/*
|
| 328 |
+
* This determines if we dump fields we don't recognise: RFC2253 requires
|
| 329 |
+
* this.
|
| 330 |
+
*/
|
| 331 |
+
|
| 332 |
+
# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
|
| 333 |
+
|
| 334 |
+
# define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20
|
| 335 |
+
* characters */
|
| 336 |
+
|
| 337 |
+
/* Complete set of RFC2253 flags */
|
| 338 |
+
|
| 339 |
+
# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
|
| 340 |
+
XN_FLAG_SEP_COMMA_PLUS | \
|
| 341 |
+
XN_FLAG_DN_REV | \
|
| 342 |
+
XN_FLAG_FN_SN | \
|
| 343 |
+
XN_FLAG_DUMP_UNKNOWN_FIELDS)
|
| 344 |
+
|
| 345 |
+
/* readable oneline form */
|
| 346 |
+
|
| 347 |
+
# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
|
| 348 |
+
ASN1_STRFLGS_ESC_QUOTE | \
|
| 349 |
+
XN_FLAG_SEP_CPLUS_SPC | \
|
| 350 |
+
XN_FLAG_SPC_EQ | \
|
| 351 |
+
XN_FLAG_FN_SN)
|
| 352 |
+
|
| 353 |
+
/* readable multiline form */
|
| 354 |
+
|
| 355 |
+
# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
|
| 356 |
+
ASN1_STRFLGS_ESC_MSB | \
|
| 357 |
+
XN_FLAG_SEP_MULTILINE | \
|
| 358 |
+
XN_FLAG_SPC_EQ | \
|
| 359 |
+
XN_FLAG_FN_LN | \
|
| 360 |
+
XN_FLAG_FN_ALIGN)
|
| 361 |
+
|
| 362 |
+
typedef struct X509_crl_info_st X509_CRL_INFO;
|
| 363 |
+
|
| 364 |
+
typedef struct private_key_st {
|
| 365 |
+
int version;
|
| 366 |
+
/* The PKCS#8 data types */
|
| 367 |
+
X509_ALGOR *enc_algor;
|
| 368 |
+
ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
|
| 369 |
+
/* When decrypted, the following will not be NULL */
|
| 370 |
+
EVP_PKEY *dec_pkey;
|
| 371 |
+
/* used to encrypt and decrypt */
|
| 372 |
+
int key_length;
|
| 373 |
+
char *key_data;
|
| 374 |
+
int key_free; /* true if we should auto free key_data */
|
| 375 |
+
/* expanded version of 'enc_algor' */
|
| 376 |
+
EVP_CIPHER_INFO cipher;
|
| 377 |
+
} X509_PKEY;
|
| 378 |
+
|
| 379 |
+
typedef struct X509_info_st {
|
| 380 |
+
X509 *x509;
|
| 381 |
+
X509_CRL *crl;
|
| 382 |
+
X509_PKEY *x_pkey;
|
| 383 |
+
EVP_CIPHER_INFO enc_cipher;
|
| 384 |
+
int enc_len;
|
| 385 |
+
char *enc_data;
|
| 386 |
+
} X509_INFO;
|
| 387 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_INFO, X509_INFO, X509_INFO)
|
| 388 |
+
#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk))
|
| 389 |
+
#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx)))
|
| 390 |
+
#define sk_X509_INFO_new(cmp) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new(ossl_check_X509_INFO_compfunc_type(cmp)))
|
| 391 |
+
#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null())
|
| 392 |
+
#define sk_X509_INFO_new_reserve(cmp, n) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_reserve(ossl_check_X509_INFO_compfunc_type(cmp), (n)))
|
| 393 |
+
#define sk_X509_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_INFO_sk_type(sk), (n))
|
| 394 |
+
#define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk))
|
| 395 |
+
#define sk_X509_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_X509_INFO_sk_type(sk))
|
| 396 |
+
#define sk_X509_INFO_delete(sk, i) ((X509_INFO *)OPENSSL_sk_delete(ossl_check_X509_INFO_sk_type(sk), (i)))
|
| 397 |
+
#define sk_X509_INFO_delete_ptr(sk, ptr) ((X509_INFO *)OPENSSL_sk_delete_ptr(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)))
|
| 398 |
+
#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 399 |
+
#define sk_X509_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 400 |
+
#define sk_X509_INFO_pop(sk) ((X509_INFO *)OPENSSL_sk_pop(ossl_check_X509_INFO_sk_type(sk)))
|
| 401 |
+
#define sk_X509_INFO_shift(sk) ((X509_INFO *)OPENSSL_sk_shift(ossl_check_X509_INFO_sk_type(sk)))
|
| 402 |
+
#define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk),ossl_check_X509_INFO_freefunc_type(freefunc))
|
| 403 |
+
#define sk_X509_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), (idx))
|
| 404 |
+
#define sk_X509_INFO_set(sk, idx, ptr) ((X509_INFO *)OPENSSL_sk_set(ossl_check_X509_INFO_sk_type(sk), (idx), ossl_check_X509_INFO_type(ptr)))
|
| 405 |
+
#define sk_X509_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 406 |
+
#define sk_X509_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 407 |
+
#define sk_X509_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), pnum)
|
| 408 |
+
#define sk_X509_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_X509_INFO_sk_type(sk))
|
| 409 |
+
#define sk_X509_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_INFO_sk_type(sk))
|
| 410 |
+
#define sk_X509_INFO_dup(sk) ((STACK_OF(X509_INFO) *)OPENSSL_sk_dup(ossl_check_const_X509_INFO_sk_type(sk)))
|
| 411 |
+
#define sk_X509_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_INFO_sk_type(sk), ossl_check_X509_INFO_copyfunc_type(copyfunc), ossl_check_X509_INFO_freefunc_type(freefunc)))
|
| 412 |
+
#define sk_X509_INFO_set_cmp_func(sk, cmp) ((sk_X509_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_compfunc_type(cmp)))
|
| 413 |
+
|
| 414 |
+
|
| 415 |
+
/*
|
| 416 |
+
* The next 2 structures and their 8 routines are used to manipulate Netscape's
|
| 417 |
+
* spki structures - useful if you are writing a CA web page
|
| 418 |
+
*/
|
| 419 |
+
typedef struct Netscape_spkac_st {
|
| 420 |
+
X509_PUBKEY *pubkey;
|
| 421 |
+
ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
|
| 422 |
+
} NETSCAPE_SPKAC;
|
| 423 |
+
|
| 424 |
+
typedef struct Netscape_spki_st {
|
| 425 |
+
NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
|
| 426 |
+
X509_ALGOR sig_algor;
|
| 427 |
+
ASN1_BIT_STRING *signature;
|
| 428 |
+
} NETSCAPE_SPKI;
|
| 429 |
+
|
| 430 |
+
/* Netscape certificate sequence structure */
|
| 431 |
+
typedef struct Netscape_certificate_sequence {
|
| 432 |
+
ASN1_OBJECT *type;
|
| 433 |
+
STACK_OF(X509) *certs;
|
| 434 |
+
} NETSCAPE_CERT_SEQUENCE;
|
| 435 |
+
|
| 436 |
+
/*- Unused (and iv length is wrong)
|
| 437 |
+
typedef struct CBCParameter_st
|
| 438 |
+
{
|
| 439 |
+
unsigned char iv[8];
|
| 440 |
+
} CBC_PARAM;
|
| 441 |
+
*/
|
| 442 |
+
|
| 443 |
+
/* Password based encryption structure */
|
| 444 |
+
|
| 445 |
+
typedef struct PBEPARAM_st {
|
| 446 |
+
ASN1_OCTET_STRING *salt;
|
| 447 |
+
ASN1_INTEGER *iter;
|
| 448 |
+
} PBEPARAM;
|
| 449 |
+
|
| 450 |
+
/* Password based encryption V2 structures */
|
| 451 |
+
|
| 452 |
+
typedef struct PBE2PARAM_st {
|
| 453 |
+
X509_ALGOR *keyfunc;
|
| 454 |
+
X509_ALGOR *encryption;
|
| 455 |
+
} PBE2PARAM;
|
| 456 |
+
|
| 457 |
+
typedef struct PBKDF2PARAM_st {
|
| 458 |
+
/* Usually OCTET STRING but could be anything */
|
| 459 |
+
ASN1_TYPE *salt;
|
| 460 |
+
ASN1_INTEGER *iter;
|
| 461 |
+
ASN1_INTEGER *keylength;
|
| 462 |
+
X509_ALGOR *prf;
|
| 463 |
+
} PBKDF2PARAM;
|
| 464 |
+
|
| 465 |
+
#ifndef OPENSSL_NO_SCRYPT
|
| 466 |
+
typedef struct SCRYPT_PARAMS_st {
|
| 467 |
+
ASN1_OCTET_STRING *salt;
|
| 468 |
+
ASN1_INTEGER *costParameter;
|
| 469 |
+
ASN1_INTEGER *blockSize;
|
| 470 |
+
ASN1_INTEGER *parallelizationParameter;
|
| 471 |
+
ASN1_INTEGER *keyLength;
|
| 472 |
+
} SCRYPT_PARAMS;
|
| 473 |
+
#endif
|
| 474 |
+
|
| 475 |
+
#ifdef __cplusplus
|
| 476 |
+
}
|
| 477 |
+
#endif
|
| 478 |
+
|
| 479 |
+
# include <openssl/x509_vfy.h>
|
| 480 |
+
# include <openssl/pkcs7.h>
|
| 481 |
+
|
| 482 |
+
#ifdef __cplusplus
|
| 483 |
+
extern "C" {
|
| 484 |
+
#endif
|
| 485 |
+
|
| 486 |
+
# define X509_EXT_PACK_UNKNOWN 1
|
| 487 |
+
# define X509_EXT_PACK_STRING 2
|
| 488 |
+
|
| 489 |
+
# define X509_extract_key(x) X509_get_pubkey(x)/*****/
|
| 490 |
+
# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
|
| 491 |
+
# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
|
| 492 |
+
|
| 493 |
+
void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
|
| 494 |
+
X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),
|
| 495 |
+
int (*crl_free) (X509_CRL *crl),
|
| 496 |
+
int (*crl_lookup) (X509_CRL *crl,
|
| 497 |
+
X509_REVOKED **ret,
|
| 498 |
+
const
|
| 499 |
+
ASN1_INTEGER *serial,
|
| 500 |
+
const
|
| 501 |
+
X509_NAME *issuer),
|
| 502 |
+
int (*crl_verify) (X509_CRL *crl,
|
| 503 |
+
EVP_PKEY *pk));
|
| 504 |
+
void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
|
| 505 |
+
|
| 506 |
+
void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
|
| 507 |
+
void *X509_CRL_get_meth_data(X509_CRL *crl);
|
| 508 |
+
|
| 509 |
+
const char *X509_verify_cert_error_string(long n);
|
| 510 |
+
|
| 511 |
+
int X509_verify(X509 *a, EVP_PKEY *r);
|
| 512 |
+
int X509_self_signed(X509 *cert, int verify_signature);
|
| 513 |
+
|
| 514 |
+
int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
|
| 515 |
+
const char *propq);
|
| 516 |
+
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
|
| 517 |
+
int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
|
| 518 |
+
int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
|
| 519 |
+
|
| 520 |
+
NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len);
|
| 521 |
+
char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
|
| 522 |
+
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
|
| 523 |
+
int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
|
| 524 |
+
|
| 525 |
+
int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
|
| 526 |
+
|
| 527 |
+
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
|
| 528 |
+
int X509_signature_print(BIO *bp, const X509_ALGOR *alg,
|
| 529 |
+
const ASN1_STRING *sig);
|
| 530 |
+
|
| 531 |
+
int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 532 |
+
int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
|
| 533 |
+
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 534 |
+
int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
|
| 535 |
+
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 536 |
+
int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
|
| 537 |
+
int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 538 |
+
|
| 539 |
+
int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
|
| 540 |
+
unsigned char *md, unsigned int *len);
|
| 541 |
+
int X509_digest(const X509 *data, const EVP_MD *type,
|
| 542 |
+
unsigned char *md, unsigned int *len);
|
| 543 |
+
ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert,
|
| 544 |
+
EVP_MD **md_used, int *md_is_fallback);
|
| 545 |
+
int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,
|
| 546 |
+
unsigned char *md, unsigned int *len);
|
| 547 |
+
int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
|
| 548 |
+
unsigned char *md, unsigned int *len);
|
| 549 |
+
int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
|
| 550 |
+
unsigned char *md, unsigned int *len);
|
| 551 |
+
|
| 552 |
+
X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
|
| 553 |
+
X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
|
| 554 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 555 |
+
# include <openssl/http.h> /* OSSL_HTTP_REQ_CTX_nbio_d2i */
|
| 556 |
+
# define X509_http_nbio(rctx, pcert) \
|
| 557 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcert, ASN1_ITEM_rptr(X509))
|
| 558 |
+
# define X509_CRL_http_nbio(rctx, pcrl) \
|
| 559 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcrl, ASN1_ITEM_rptr(X509_CRL))
|
| 560 |
+
# endif
|
| 561 |
+
|
| 562 |
+
# ifndef OPENSSL_NO_STDIO
|
| 563 |
+
X509 *d2i_X509_fp(FILE *fp, X509 **x509);
|
| 564 |
+
int i2d_X509_fp(FILE *fp, const X509 *x509);
|
| 565 |
+
X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);
|
| 566 |
+
int i2d_X509_CRL_fp(FILE *fp, const X509_CRL *crl);
|
| 567 |
+
X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);
|
| 568 |
+
int i2d_X509_REQ_fp(FILE *fp, const X509_REQ *req);
|
| 569 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 570 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);
|
| 571 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_fp(FILE *fp, const RSA *rsa);
|
| 572 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);
|
| 573 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa);
|
| 574 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);
|
| 575 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa);
|
| 576 |
+
# endif
|
| 577 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 578 |
+
# ifndef OPENSSL_NO_DSA
|
| 579 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
|
| 580 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_fp(FILE *fp, const DSA *dsa);
|
| 581 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
|
| 582 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_fp(FILE *fp, const DSA *dsa);
|
| 583 |
+
# endif
|
| 584 |
+
# endif
|
| 585 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 586 |
+
# ifndef OPENSSL_NO_EC
|
| 587 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
|
| 588 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey);
|
| 589 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
|
| 590 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey);
|
| 591 |
+
# endif /* OPENSSL_NO_EC */
|
| 592 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 593 |
+
X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
|
| 594 |
+
int i2d_PKCS8_fp(FILE *fp, const X509_SIG *p8);
|
| 595 |
+
X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk);
|
| 596 |
+
int i2d_X509_PUBKEY_fp(FILE *fp, const X509_PUBKEY *xpk);
|
| 597 |
+
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
|
| 598 |
+
PKCS8_PRIV_KEY_INFO **p8inf);
|
| 599 |
+
int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf);
|
| 600 |
+
int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key);
|
| 601 |
+
int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey);
|
| 602 |
+
EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 603 |
+
const char *propq);
|
| 604 |
+
EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
|
| 605 |
+
int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey);
|
| 606 |
+
EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
|
| 607 |
+
# endif
|
| 608 |
+
|
| 609 |
+
X509 *d2i_X509_bio(BIO *bp, X509 **x509);
|
| 610 |
+
int i2d_X509_bio(BIO *bp, const X509 *x509);
|
| 611 |
+
X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);
|
| 612 |
+
int i2d_X509_CRL_bio(BIO *bp, const X509_CRL *crl);
|
| 613 |
+
X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);
|
| 614 |
+
int i2d_X509_REQ_bio(BIO *bp, const X509_REQ *req);
|
| 615 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 616 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);
|
| 617 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_bio(BIO *bp, const RSA *rsa);
|
| 618 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);
|
| 619 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa);
|
| 620 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);
|
| 621 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa);
|
| 622 |
+
# endif
|
| 623 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 624 |
+
# ifndef OPENSSL_NO_DSA
|
| 625 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
|
| 626 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa);
|
| 627 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
|
| 628 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_bio(BIO *bp, const DSA *dsa);
|
| 629 |
+
# endif
|
| 630 |
+
# endif
|
| 631 |
+
|
| 632 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 633 |
+
# ifndef OPENSSL_NO_EC
|
| 634 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
|
| 635 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_bio(BIO *bp, const EC_KEY *eckey);
|
| 636 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
|
| 637 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey);
|
| 638 |
+
# endif /* OPENSSL_NO_EC */
|
| 639 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 640 |
+
|
| 641 |
+
X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
|
| 642 |
+
int i2d_PKCS8_bio(BIO *bp, const X509_SIG *p8);
|
| 643 |
+
X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk);
|
| 644 |
+
int i2d_X509_PUBKEY_bio(BIO *bp, const X509_PUBKEY *xpk);
|
| 645 |
+
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
|
| 646 |
+
PKCS8_PRIV_KEY_INFO **p8inf);
|
| 647 |
+
int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf);
|
| 648 |
+
int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key);
|
| 649 |
+
int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey);
|
| 650 |
+
EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 651 |
+
const char *propq);
|
| 652 |
+
EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
|
| 653 |
+
int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey);
|
| 654 |
+
EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
|
| 655 |
+
|
| 656 |
+
DECLARE_ASN1_DUP_FUNCTION(X509)
|
| 657 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_ALGOR)
|
| 658 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_ATTRIBUTE)
|
| 659 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_CRL)
|
| 660 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_EXTENSION)
|
| 661 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_PUBKEY)
|
| 662 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_REQ)
|
| 663 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_REVOKED)
|
| 664 |
+
int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,
|
| 665 |
+
void *pval);
|
| 666 |
+
void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
|
| 667 |
+
const void **ppval, const X509_ALGOR *algor);
|
| 668 |
+
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
|
| 669 |
+
int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
|
| 670 |
+
int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src);
|
| 671 |
+
|
| 672 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_NAME)
|
| 673 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY)
|
| 674 |
+
|
| 675 |
+
int X509_cmp_time(const ASN1_TIME *s, time_t *t);
|
| 676 |
+
int X509_cmp_current_time(const ASN1_TIME *s);
|
| 677 |
+
int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
|
| 678 |
+
const ASN1_TIME *start, const ASN1_TIME *end);
|
| 679 |
+
ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
|
| 680 |
+
ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
|
| 681 |
+
int offset_day, long offset_sec, time_t *t);
|
| 682 |
+
ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
|
| 683 |
+
|
| 684 |
+
const char *X509_get_default_cert_area(void);
|
| 685 |
+
const char *X509_get_default_cert_dir(void);
|
| 686 |
+
const char *X509_get_default_cert_file(void);
|
| 687 |
+
const char *X509_get_default_cert_dir_env(void);
|
| 688 |
+
const char *X509_get_default_cert_file_env(void);
|
| 689 |
+
const char *X509_get_default_private_dir(void);
|
| 690 |
+
|
| 691 |
+
X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 692 |
+
X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);
|
| 693 |
+
|
| 694 |
+
DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
|
| 695 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
|
| 696 |
+
DECLARE_ASN1_FUNCTIONS(X509_VAL)
|
| 697 |
+
|
| 698 |
+
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
|
| 699 |
+
|
| 700 |
+
X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 701 |
+
int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
|
| 702 |
+
EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key);
|
| 703 |
+
EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key);
|
| 704 |
+
int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
|
| 705 |
+
long X509_get_pathlen(X509 *x);
|
| 706 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY)
|
| 707 |
+
EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
|
| 708 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 709 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 710 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,RSA, RSA_PUBKEY)
|
| 711 |
+
# endif
|
| 712 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 713 |
+
# ifndef OPENSSL_NO_DSA
|
| 714 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,DSA, DSA_PUBKEY)
|
| 715 |
+
# endif
|
| 716 |
+
# endif
|
| 717 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 718 |
+
# ifndef OPENSSL_NO_EC
|
| 719 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, EC_KEY, EC_PUBKEY)
|
| 720 |
+
# endif
|
| 721 |
+
# endif
|
| 722 |
+
|
| 723 |
+
DECLARE_ASN1_FUNCTIONS(X509_SIG)
|
| 724 |
+
void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg,
|
| 725 |
+
const ASN1_OCTET_STRING **pdigest);
|
| 726 |
+
void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
|
| 727 |
+
ASN1_OCTET_STRING **pdigest);
|
| 728 |
+
|
| 729 |
+
DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
|
| 730 |
+
DECLARE_ASN1_FUNCTIONS(X509_REQ)
|
| 731 |
+
X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 732 |
+
|
| 733 |
+
DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
|
| 734 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
|
| 735 |
+
|
| 736 |
+
DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
|
| 737 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
|
| 738 |
+
|
| 739 |
+
DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
|
| 740 |
+
|
| 741 |
+
DECLARE_ASN1_FUNCTIONS(X509_NAME)
|
| 742 |
+
|
| 743 |
+
int X509_NAME_set(X509_NAME **xn, const X509_NAME *name);
|
| 744 |
+
|
| 745 |
+
DECLARE_ASN1_FUNCTIONS(X509_CINF)
|
| 746 |
+
DECLARE_ASN1_FUNCTIONS(X509)
|
| 747 |
+
X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 748 |
+
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
|
| 749 |
+
|
| 750 |
+
#define X509_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 751 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef)
|
| 752 |
+
int X509_set_ex_data(X509 *r, int idx, void *arg);
|
| 753 |
+
void *X509_get_ex_data(const X509 *r, int idx);
|
| 754 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(X509,X509_AUX)
|
| 755 |
+
|
| 756 |
+
int i2d_re_X509_tbs(X509 *x, unsigned char **pp);
|
| 757 |
+
|
| 758 |
+
int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid,
|
| 759 |
+
int *secbits, uint32_t *flags);
|
| 760 |
+
void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid,
|
| 761 |
+
int secbits, uint32_t flags);
|
| 762 |
+
|
| 763 |
+
int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
|
| 764 |
+
uint32_t *flags);
|
| 765 |
+
|
| 766 |
+
void X509_get0_signature(const ASN1_BIT_STRING **psig,
|
| 767 |
+
const X509_ALGOR **palg, const X509 *x);
|
| 768 |
+
int X509_get_signature_nid(const X509 *x);
|
| 769 |
+
|
| 770 |
+
void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id);
|
| 771 |
+
ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
|
| 772 |
+
void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id);
|
| 773 |
+
ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
|
| 774 |
+
|
| 775 |
+
int X509_alias_set1(X509 *x, const unsigned char *name, int len);
|
| 776 |
+
int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
|
| 777 |
+
unsigned char *X509_alias_get0(X509 *x, int *len);
|
| 778 |
+
unsigned char *X509_keyid_get0(X509 *x, int *len);
|
| 779 |
+
|
| 780 |
+
DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
|
| 781 |
+
DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
|
| 782 |
+
DECLARE_ASN1_FUNCTIONS(X509_CRL)
|
| 783 |
+
X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 784 |
+
|
| 785 |
+
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
|
| 786 |
+
int X509_CRL_get0_by_serial(X509_CRL *crl,
|
| 787 |
+
X509_REVOKED **ret, const ASN1_INTEGER *serial);
|
| 788 |
+
int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
|
| 789 |
+
|
| 790 |
+
X509_PKEY *X509_PKEY_new(void);
|
| 791 |
+
void X509_PKEY_free(X509_PKEY *a);
|
| 792 |
+
|
| 793 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
|
| 794 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
|
| 795 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
|
| 796 |
+
|
| 797 |
+
X509_INFO *X509_INFO_new(void);
|
| 798 |
+
void X509_INFO_free(X509_INFO *a);
|
| 799 |
+
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size);
|
| 800 |
+
|
| 801 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 802 |
+
OSSL_DEPRECATEDIN_3_0
|
| 803 |
+
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
|
| 804 |
+
ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);
|
| 805 |
+
OSSL_DEPRECATEDIN_3_0
|
| 806 |
+
int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
|
| 807 |
+
unsigned char *md, unsigned int *len);
|
| 808 |
+
OSSL_DEPRECATEDIN_3_0
|
| 809 |
+
int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
| 810 |
+
ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
|
| 811 |
+
const EVP_MD *type);
|
| 812 |
+
#endif
|
| 813 |
+
int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,
|
| 814 |
+
unsigned char *md, unsigned int *len);
|
| 815 |
+
int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 816 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 817 |
+
EVP_PKEY *pkey);
|
| 818 |
+
int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 819 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 820 |
+
EVP_MD_CTX *ctx);
|
| 821 |
+
int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
| 822 |
+
ASN1_BIT_STRING *signature, const void *data,
|
| 823 |
+
EVP_PKEY *pkey, const EVP_MD *md);
|
| 824 |
+
int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
| 825 |
+
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
|
| 826 |
+
const void *data, EVP_MD_CTX *ctx);
|
| 827 |
+
|
| 828 |
+
#define X509_VERSION_1 0
|
| 829 |
+
#define X509_VERSION_2 1
|
| 830 |
+
#define X509_VERSION_3 2
|
| 831 |
+
|
| 832 |
+
long X509_get_version(const X509 *x);
|
| 833 |
+
int X509_set_version(X509 *x, long version);
|
| 834 |
+
int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
|
| 835 |
+
ASN1_INTEGER *X509_get_serialNumber(X509 *x);
|
| 836 |
+
const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x);
|
| 837 |
+
int X509_set_issuer_name(X509 *x, const X509_NAME *name);
|
| 838 |
+
X509_NAME *X509_get_issuer_name(const X509 *a);
|
| 839 |
+
int X509_set_subject_name(X509 *x, const X509_NAME *name);
|
| 840 |
+
X509_NAME *X509_get_subject_name(const X509 *a);
|
| 841 |
+
const ASN1_TIME * X509_get0_notBefore(const X509 *x);
|
| 842 |
+
ASN1_TIME *X509_getm_notBefore(const X509 *x);
|
| 843 |
+
int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
|
| 844 |
+
const ASN1_TIME *X509_get0_notAfter(const X509 *x);
|
| 845 |
+
ASN1_TIME *X509_getm_notAfter(const X509 *x);
|
| 846 |
+
int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
|
| 847 |
+
int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
|
| 848 |
+
int X509_up_ref(X509 *x);
|
| 849 |
+
int X509_get_signature_type(const X509 *x);
|
| 850 |
+
|
| 851 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 852 |
+
# define X509_get_notBefore X509_getm_notBefore
|
| 853 |
+
# define X509_get_notAfter X509_getm_notAfter
|
| 854 |
+
# define X509_set_notBefore X509_set1_notBefore
|
| 855 |
+
# define X509_set_notAfter X509_set1_notAfter
|
| 856 |
+
#endif
|
| 857 |
+
|
| 858 |
+
|
| 859 |
+
/*
|
| 860 |
+
* This one is only used so that a binary form can output, as in
|
| 861 |
+
* i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf)
|
| 862 |
+
*/
|
| 863 |
+
X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x);
|
| 864 |
+
const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
|
| 865 |
+
void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
|
| 866 |
+
const ASN1_BIT_STRING **psuid);
|
| 867 |
+
const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
|
| 868 |
+
|
| 869 |
+
EVP_PKEY *X509_get0_pubkey(const X509 *x);
|
| 870 |
+
EVP_PKEY *X509_get_pubkey(X509 *x);
|
| 871 |
+
ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
|
| 872 |
+
|
| 873 |
+
#define X509_REQ_VERSION_1 0
|
| 874 |
+
|
| 875 |
+
long X509_REQ_get_version(const X509_REQ *req);
|
| 876 |
+
int X509_REQ_set_version(X509_REQ *x, long version);
|
| 877 |
+
X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req);
|
| 878 |
+
int X509_REQ_set_subject_name(X509_REQ *req, const X509_NAME *name);
|
| 879 |
+
void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
|
| 880 |
+
const X509_ALGOR **palg);
|
| 881 |
+
void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig);
|
| 882 |
+
int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg);
|
| 883 |
+
int X509_REQ_get_signature_nid(const X509_REQ *req);
|
| 884 |
+
int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
|
| 885 |
+
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
|
| 886 |
+
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
|
| 887 |
+
EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req);
|
| 888 |
+
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req);
|
| 889 |
+
int X509_REQ_extension_nid(int nid);
|
| 890 |
+
int *X509_REQ_get_extension_nids(void);
|
| 891 |
+
void X509_REQ_set_extension_nids(int *nids);
|
| 892 |
+
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
|
| 893 |
+
int X509_REQ_add_extensions_nid(X509_REQ *req,
|
| 894 |
+
const STACK_OF(X509_EXTENSION) *exts, int nid);
|
| 895 |
+
int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext);
|
| 896 |
+
int X509_REQ_get_attr_count(const X509_REQ *req);
|
| 897 |
+
int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos);
|
| 898 |
+
int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
|
| 899 |
+
int lastpos);
|
| 900 |
+
X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
|
| 901 |
+
X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
|
| 902 |
+
int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
|
| 903 |
+
int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
|
| 904 |
+
const ASN1_OBJECT *obj, int type,
|
| 905 |
+
const unsigned char *bytes, int len);
|
| 906 |
+
int X509_REQ_add1_attr_by_NID(X509_REQ *req,
|
| 907 |
+
int nid, int type,
|
| 908 |
+
const unsigned char *bytes, int len);
|
| 909 |
+
int X509_REQ_add1_attr_by_txt(X509_REQ *req,
|
| 910 |
+
const char *attrname, int type,
|
| 911 |
+
const unsigned char *bytes, int len);
|
| 912 |
+
|
| 913 |
+
#define X509_CRL_VERSION_1 0
|
| 914 |
+
#define X509_CRL_VERSION_2 1
|
| 915 |
+
|
| 916 |
+
int X509_CRL_set_version(X509_CRL *x, long version);
|
| 917 |
+
int X509_CRL_set_issuer_name(X509_CRL *x, const X509_NAME *name);
|
| 918 |
+
int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
| 919 |
+
int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
| 920 |
+
int X509_CRL_sort(X509_CRL *crl);
|
| 921 |
+
int X509_CRL_up_ref(X509_CRL *crl);
|
| 922 |
+
|
| 923 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 924 |
+
# define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate
|
| 925 |
+
# define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate
|
| 926 |
+
#endif
|
| 927 |
+
|
| 928 |
+
long X509_CRL_get_version(const X509_CRL *crl);
|
| 929 |
+
const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
|
| 930 |
+
const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
|
| 931 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 932 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
|
| 933 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
|
| 934 |
+
#endif
|
| 935 |
+
X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
|
| 936 |
+
const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
|
| 937 |
+
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
|
| 938 |
+
void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
|
| 939 |
+
const X509_ALGOR **palg);
|
| 940 |
+
int X509_CRL_get_signature_nid(const X509_CRL *crl);
|
| 941 |
+
int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp);
|
| 942 |
+
|
| 943 |
+
const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x);
|
| 944 |
+
int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
|
| 945 |
+
const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x);
|
| 946 |
+
int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
|
| 947 |
+
const STACK_OF(X509_EXTENSION) *
|
| 948 |
+
X509_REVOKED_get0_extensions(const X509_REVOKED *r);
|
| 949 |
+
|
| 950 |
+
X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
|
| 951 |
+
EVP_PKEY *skey, const EVP_MD *md, unsigned int flags);
|
| 952 |
+
|
| 953 |
+
int X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey);
|
| 954 |
+
|
| 955 |
+
int X509_check_private_key(const X509 *x509, const EVP_PKEY *pkey);
|
| 956 |
+
int X509_chain_check_suiteb(int *perror_depth,
|
| 957 |
+
X509 *x, STACK_OF(X509) *chain,
|
| 958 |
+
unsigned long flags);
|
| 959 |
+
int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);
|
| 960 |
+
STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
|
| 961 |
+
|
| 962 |
+
int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
|
| 963 |
+
unsigned long X509_issuer_and_serial_hash(X509 *a);
|
| 964 |
+
|
| 965 |
+
int X509_issuer_name_cmp(const X509 *a, const X509 *b);
|
| 966 |
+
unsigned long X509_issuer_name_hash(X509 *a);
|
| 967 |
+
|
| 968 |
+
int X509_subject_name_cmp(const X509 *a, const X509 *b);
|
| 969 |
+
unsigned long X509_subject_name_hash(X509 *x);
|
| 970 |
+
|
| 971 |
+
# ifndef OPENSSL_NO_MD5
|
| 972 |
+
unsigned long X509_issuer_name_hash_old(X509 *a);
|
| 973 |
+
unsigned long X509_subject_name_hash_old(X509 *x);
|
| 974 |
+
# endif
|
| 975 |
+
|
| 976 |
+
# define X509_ADD_FLAG_DEFAULT 0
|
| 977 |
+
# define X509_ADD_FLAG_UP_REF 0x1
|
| 978 |
+
# define X509_ADD_FLAG_PREPEND 0x2
|
| 979 |
+
# define X509_ADD_FLAG_NO_DUP 0x4
|
| 980 |
+
# define X509_ADD_FLAG_NO_SS 0x8
|
| 981 |
+
int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags);
|
| 982 |
+
int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags);
|
| 983 |
+
|
| 984 |
+
int X509_cmp(const X509 *a, const X509 *b);
|
| 985 |
+
int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
|
| 986 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 987 |
+
# define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL)
|
| 988 |
+
OSSL_DEPRECATEDIN_3_0 int X509_certificate_type(const X509 *x,
|
| 989 |
+
const EVP_PKEY *pubkey);
|
| 990 |
+
#endif
|
| 991 |
+
unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx,
|
| 992 |
+
const char *propq, int *ok);
|
| 993 |
+
unsigned long X509_NAME_hash_old(const X509_NAME *x);
|
| 994 |
+
|
| 995 |
+
int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
|
| 996 |
+
int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
|
| 997 |
+
int X509_aux_print(BIO *out, X509 *x, int indent);
|
| 998 |
+
# ifndef OPENSSL_NO_STDIO
|
| 999 |
+
int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
|
| 1000 |
+
unsigned long cflag);
|
| 1001 |
+
int X509_print_fp(FILE *bp, X509 *x);
|
| 1002 |
+
int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
|
| 1003 |
+
int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
|
| 1004 |
+
int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
|
| 1005 |
+
unsigned long flags);
|
| 1006 |
+
# endif
|
| 1007 |
+
|
| 1008 |
+
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
|
| 1009 |
+
int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
|
| 1010 |
+
unsigned long flags);
|
| 1011 |
+
int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
|
| 1012 |
+
unsigned long cflag);
|
| 1013 |
+
int X509_print(BIO *bp, X509 *x);
|
| 1014 |
+
int X509_ocspid_print(BIO *bp, X509 *x);
|
| 1015 |
+
int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag);
|
| 1016 |
+
int X509_CRL_print(BIO *bp, X509_CRL *x);
|
| 1017 |
+
int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
|
| 1018 |
+
unsigned long cflag);
|
| 1019 |
+
int X509_REQ_print(BIO *bp, X509_REQ *req);
|
| 1020 |
+
|
| 1021 |
+
int X509_NAME_entry_count(const X509_NAME *name);
|
| 1022 |
+
int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
|
| 1023 |
+
char *buf, int len);
|
| 1024 |
+
int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
| 1025 |
+
char *buf, int len);
|
| 1026 |
+
|
| 1027 |
+
/*
|
| 1028 |
+
* NOTE: you should be passing -1, not 0 as lastpos. The functions that use
|
| 1029 |
+
* lastpos, search after that position on.
|
| 1030 |
+
*/
|
| 1031 |
+
int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos);
|
| 1032 |
+
int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
| 1033 |
+
int lastpos);
|
| 1034 |
+
X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
|
| 1035 |
+
X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
|
| 1036 |
+
int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne,
|
| 1037 |
+
int loc, int set);
|
| 1038 |
+
int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type,
|
| 1039 |
+
const unsigned char *bytes, int len, int loc,
|
| 1040 |
+
int set);
|
| 1041 |
+
int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
|
| 1042 |
+
const unsigned char *bytes, int len, int loc,
|
| 1043 |
+
int set);
|
| 1044 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
|
| 1045 |
+
const char *field, int type,
|
| 1046 |
+
const unsigned char *bytes,
|
| 1047 |
+
int len);
|
| 1048 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
|
| 1049 |
+
int type,
|
| 1050 |
+
const unsigned char *bytes,
|
| 1051 |
+
int len);
|
| 1052 |
+
int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
|
| 1053 |
+
const unsigned char *bytes, int len, int loc,
|
| 1054 |
+
int set);
|
| 1055 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
|
| 1056 |
+
const ASN1_OBJECT *obj, int type,
|
| 1057 |
+
const unsigned char *bytes,
|
| 1058 |
+
int len);
|
| 1059 |
+
int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj);
|
| 1060 |
+
int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
|
| 1061 |
+
const unsigned char *bytes, int len);
|
| 1062 |
+
ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
|
| 1063 |
+
ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
|
| 1064 |
+
int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne);
|
| 1065 |
+
|
| 1066 |
+
int X509_NAME_get0_der(const X509_NAME *nm, const unsigned char **pder,
|
| 1067 |
+
size_t *pderlen);
|
| 1068 |
+
|
| 1069 |
+
int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
|
| 1070 |
+
int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
|
| 1071 |
+
int nid, int lastpos);
|
| 1072 |
+
int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
|
| 1073 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 1074 |
+
int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
|
| 1075 |
+
int crit, int lastpos);
|
| 1076 |
+
X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
|
| 1077 |
+
X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
|
| 1078 |
+
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
|
| 1079 |
+
X509_EXTENSION *ex, int loc);
|
| 1080 |
+
|
| 1081 |
+
int X509_get_ext_count(const X509 *x);
|
| 1082 |
+
int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
|
| 1083 |
+
int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos);
|
| 1084 |
+
int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos);
|
| 1085 |
+
X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
|
| 1086 |
+
X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
|
| 1087 |
+
int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
|
| 1088 |
+
void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
|
| 1089 |
+
int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
|
| 1090 |
+
unsigned long flags);
|
| 1091 |
+
|
| 1092 |
+
int X509_CRL_get_ext_count(const X509_CRL *x);
|
| 1093 |
+
int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos);
|
| 1094 |
+
int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
|
| 1095 |
+
int lastpos);
|
| 1096 |
+
int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos);
|
| 1097 |
+
X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
|
| 1098 |
+
X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
|
| 1099 |
+
int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
|
| 1100 |
+
void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx);
|
| 1101 |
+
int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
|
| 1102 |
+
unsigned long flags);
|
| 1103 |
+
|
| 1104 |
+
int X509_REVOKED_get_ext_count(const X509_REVOKED *x);
|
| 1105 |
+
int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos);
|
| 1106 |
+
int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
|
| 1107 |
+
int lastpos);
|
| 1108 |
+
int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit,
|
| 1109 |
+
int lastpos);
|
| 1110 |
+
X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc);
|
| 1111 |
+
X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
|
| 1112 |
+
int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
|
| 1113 |
+
void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit,
|
| 1114 |
+
int *idx);
|
| 1115 |
+
int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
|
| 1116 |
+
unsigned long flags);
|
| 1117 |
+
|
| 1118 |
+
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
|
| 1119 |
+
int nid, int crit,
|
| 1120 |
+
ASN1_OCTET_STRING *data);
|
| 1121 |
+
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
|
| 1122 |
+
const ASN1_OBJECT *obj, int crit,
|
| 1123 |
+
ASN1_OCTET_STRING *data);
|
| 1124 |
+
int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
|
| 1125 |
+
int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
|
| 1126 |
+
int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
|
| 1127 |
+
ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
|
| 1128 |
+
ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
|
| 1129 |
+
int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
|
| 1130 |
+
|
| 1131 |
+
int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
|
| 1132 |
+
int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
|
| 1133 |
+
int lastpos);
|
| 1134 |
+
int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
|
| 1135 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 1136 |
+
X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
|
| 1137 |
+
X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
|
| 1138 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
|
| 1139 |
+
X509_ATTRIBUTE *attr);
|
| 1140 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
|
| 1141 |
+
**x, const ASN1_OBJECT *obj,
|
| 1142 |
+
int type,
|
| 1143 |
+
const unsigned char *bytes,
|
| 1144 |
+
int len);
|
| 1145 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
|
| 1146 |
+
**x, int nid, int type,
|
| 1147 |
+
const unsigned char *bytes,
|
| 1148 |
+
int len);
|
| 1149 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
|
| 1150 |
+
**x, const char *attrname,
|
| 1151 |
+
int type,
|
| 1152 |
+
const unsigned char *bytes,
|
| 1153 |
+
int len);
|
| 1154 |
+
void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
|
| 1155 |
+
const ASN1_OBJECT *obj, int lastpos, int type);
|
| 1156 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
|
| 1157 |
+
int atrtype, const void *data,
|
| 1158 |
+
int len);
|
| 1159 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
|
| 1160 |
+
const ASN1_OBJECT *obj,
|
| 1161 |
+
int atrtype, const void *data,
|
| 1162 |
+
int len);
|
| 1163 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
|
| 1164 |
+
const char *atrname, int type,
|
| 1165 |
+
const unsigned char *bytes,
|
| 1166 |
+
int len);
|
| 1167 |
+
int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
|
| 1168 |
+
int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
|
| 1169 |
+
const void *data, int len);
|
| 1170 |
+
void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
|
| 1171 |
+
void *data);
|
| 1172 |
+
int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);
|
| 1173 |
+
ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
|
| 1174 |
+
ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
|
| 1175 |
+
|
| 1176 |
+
int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
|
| 1177 |
+
int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);
|
| 1178 |
+
int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj,
|
| 1179 |
+
int lastpos);
|
| 1180 |
+
X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
|
| 1181 |
+
X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
|
| 1182 |
+
int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
|
| 1183 |
+
int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
|
| 1184 |
+
const ASN1_OBJECT *obj, int type,
|
| 1185 |
+
const unsigned char *bytes, int len);
|
| 1186 |
+
int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
|
| 1187 |
+
int nid, int type,
|
| 1188 |
+
const unsigned char *bytes, int len);
|
| 1189 |
+
int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
|
| 1190 |
+
const char *attrname, int type,
|
| 1191 |
+
const unsigned char *bytes, int len);
|
| 1192 |
+
|
| 1193 |
+
/* lookup a cert from a X509 STACK */
|
| 1194 |
+
X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name,
|
| 1195 |
+
const ASN1_INTEGER *serial);
|
| 1196 |
+
X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name);
|
| 1197 |
+
|
| 1198 |
+
DECLARE_ASN1_FUNCTIONS(PBEPARAM)
|
| 1199 |
+
DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
|
| 1200 |
+
DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
|
| 1201 |
+
#ifndef OPENSSL_NO_SCRYPT
|
| 1202 |
+
DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS)
|
| 1203 |
+
#endif
|
| 1204 |
+
|
| 1205 |
+
int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
|
| 1206 |
+
const unsigned char *salt, int saltlen);
|
| 1207 |
+
int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor, int alg, int iter,
|
| 1208 |
+
const unsigned char *salt, int saltlen,
|
| 1209 |
+
OSSL_LIB_CTX *libctx);
|
| 1210 |
+
|
| 1211 |
+
X509_ALGOR *PKCS5_pbe_set(int alg, int iter,
|
| 1212 |
+
const unsigned char *salt, int saltlen);
|
| 1213 |
+
X509_ALGOR *PKCS5_pbe_set_ex(int alg, int iter,
|
| 1214 |
+
const unsigned char *salt, int saltlen,
|
| 1215 |
+
OSSL_LIB_CTX *libctx);
|
| 1216 |
+
|
| 1217 |
+
X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
|
| 1218 |
+
unsigned char *salt, int saltlen);
|
| 1219 |
+
X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
|
| 1220 |
+
unsigned char *salt, int saltlen,
|
| 1221 |
+
unsigned char *aiv, int prf_nid);
|
| 1222 |
+
X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter,
|
| 1223 |
+
unsigned char *salt, int saltlen,
|
| 1224 |
+
unsigned char *aiv, int prf_nid,
|
| 1225 |
+
OSSL_LIB_CTX *libctx);
|
| 1226 |
+
|
| 1227 |
+
#ifndef OPENSSL_NO_SCRYPT
|
| 1228 |
+
X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher,
|
| 1229 |
+
const unsigned char *salt, int saltlen,
|
| 1230 |
+
unsigned char *aiv, uint64_t N, uint64_t r,
|
| 1231 |
+
uint64_t p);
|
| 1232 |
+
#endif
|
| 1233 |
+
|
| 1234 |
+
X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
|
| 1235 |
+
int prf_nid, int keylen);
|
| 1236 |
+
X509_ALGOR *PKCS5_pbkdf2_set_ex(int iter, unsigned char *salt, int saltlen,
|
| 1237 |
+
int prf_nid, int keylen,
|
| 1238 |
+
OSSL_LIB_CTX *libctx);
|
| 1239 |
+
|
| 1240 |
+
/* PKCS#8 utilities */
|
| 1241 |
+
|
| 1242 |
+
DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
|
| 1243 |
+
|
| 1244 |
+
EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
|
| 1245 |
+
EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
|
| 1246 |
+
const char *propq);
|
| 1247 |
+
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey);
|
| 1248 |
+
|
| 1249 |
+
int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
|
| 1250 |
+
int version, int ptype, void *pval,
|
| 1251 |
+
unsigned char *penc, int penclen);
|
| 1252 |
+
int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg,
|
| 1253 |
+
const unsigned char **pk, int *ppklen,
|
| 1254 |
+
const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8);
|
| 1255 |
+
|
| 1256 |
+
const STACK_OF(X509_ATTRIBUTE) *
|
| 1257 |
+
PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8);
|
| 1258 |
+
int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr);
|
| 1259 |
+
int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
|
| 1260 |
+
const unsigned char *bytes, int len);
|
| 1261 |
+
int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8, const ASN1_OBJECT *obj,
|
| 1262 |
+
int type, const unsigned char *bytes, int len);
|
| 1263 |
+
|
| 1264 |
+
|
| 1265 |
+
int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
|
| 1266 |
+
int ptype, void *pval,
|
| 1267 |
+
unsigned char *penc, int penclen);
|
| 1268 |
+
int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
|
| 1269 |
+
const unsigned char **pk, int *ppklen,
|
| 1270 |
+
X509_ALGOR **pa, const X509_PUBKEY *pub);
|
| 1271 |
+
int X509_PUBKEY_eq(const X509_PUBKEY *a, const X509_PUBKEY *b);
|
| 1272 |
+
|
| 1273 |
+
# ifdef __cplusplus
|
| 1274 |
+
}
|
| 1275 |
+
# endif
|
| 1276 |
+
#endif
|
llava_next/include/openssl/x509err.h
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2023 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_X509ERR_H
|
| 12 |
+
# define OPENSSL_X509ERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* X509 reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define X509_R_AKID_MISMATCH 110
|
| 25 |
+
# define X509_R_BAD_SELECTOR 133
|
| 26 |
+
# define X509_R_BAD_X509_FILETYPE 100
|
| 27 |
+
# define X509_R_BASE64_DECODE_ERROR 118
|
| 28 |
+
# define X509_R_CANT_CHECK_DH_KEY 114
|
| 29 |
+
# define X509_R_CERTIFICATE_VERIFICATION_FAILED 139
|
| 30 |
+
# define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
|
| 31 |
+
# define X509_R_CRL_ALREADY_DELTA 127
|
| 32 |
+
# define X509_R_CRL_VERIFY_FAILURE 131
|
| 33 |
+
# define X509_R_DUPLICATE_ATTRIBUTE 140
|
| 34 |
+
# define X509_R_ERROR_GETTING_MD_BY_NID 141
|
| 35 |
+
# define X509_R_ERROR_USING_SIGINF_SET 142
|
| 36 |
+
# define X509_R_IDP_MISMATCH 128
|
| 37 |
+
# define X509_R_INVALID_ATTRIBUTES 138
|
| 38 |
+
# define X509_R_INVALID_DIRECTORY 113
|
| 39 |
+
# define X509_R_INVALID_DISTPOINT 143
|
| 40 |
+
# define X509_R_INVALID_FIELD_NAME 119
|
| 41 |
+
# define X509_R_INVALID_TRUST 123
|
| 42 |
+
# define X509_R_ISSUER_MISMATCH 129
|
| 43 |
+
# define X509_R_KEY_TYPE_MISMATCH 115
|
| 44 |
+
# define X509_R_KEY_VALUES_MISMATCH 116
|
| 45 |
+
# define X509_R_LOADING_CERT_DIR 103
|
| 46 |
+
# define X509_R_LOADING_DEFAULTS 104
|
| 47 |
+
# define X509_R_METHOD_NOT_SUPPORTED 124
|
| 48 |
+
# define X509_R_NAME_TOO_LONG 134
|
| 49 |
+
# define X509_R_NEWER_CRL_NOT_NEWER 132
|
| 50 |
+
# define X509_R_NO_CERTIFICATE_FOUND 135
|
| 51 |
+
# define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136
|
| 52 |
+
# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
|
| 53 |
+
# define X509_R_NO_CRL_FOUND 137
|
| 54 |
+
# define X509_R_NO_CRL_NUMBER 130
|
| 55 |
+
# define X509_R_PUBLIC_KEY_DECODE_ERROR 125
|
| 56 |
+
# define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
|
| 57 |
+
# define X509_R_SHOULD_RETRY 106
|
| 58 |
+
# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
|
| 59 |
+
# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
|
| 60 |
+
# define X509_R_UNKNOWN_KEY_TYPE 117
|
| 61 |
+
# define X509_R_UNKNOWN_NID 109
|
| 62 |
+
# define X509_R_UNKNOWN_PURPOSE_ID 121
|
| 63 |
+
# define X509_R_UNKNOWN_SIGID_ALGS 144
|
| 64 |
+
# define X509_R_UNKNOWN_TRUST_ID 120
|
| 65 |
+
# define X509_R_UNSUPPORTED_ALGORITHM 111
|
| 66 |
+
# define X509_R_WRONG_LOOKUP_TYPE 112
|
| 67 |
+
# define X509_R_WRONG_TYPE 122
|
| 68 |
+
|
| 69 |
+
#endif
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/ApproximateClock.h
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2023-present Facebook. All Rights Reserved.
|
| 2 |
+
|
| 3 |
+
#pragma once
|
| 4 |
+
|
| 5 |
+
#include <c10/macros/Export.h>
|
| 6 |
+
#include <array>
|
| 7 |
+
#include <chrono>
|
| 8 |
+
#include <cstddef>
|
| 9 |
+
#include <cstdint>
|
| 10 |
+
#include <ctime>
|
| 11 |
+
#include <functional>
|
| 12 |
+
#include <type_traits>
|
| 13 |
+
|
| 14 |
+
#if defined(C10_IOS) && defined(C10_MOBILE)
|
| 15 |
+
#include <sys/time.h> // for gettimeofday()
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
#if defined(__i386__) || defined(__x86_64__) || defined(__amd64__)
|
| 19 |
+
#define C10_RDTSC
|
| 20 |
+
#if defined(_MSC_VER)
|
| 21 |
+
#include <intrin.h>
|
| 22 |
+
#elif defined(__CUDACC__) || defined(__HIPCC__)
|
| 23 |
+
#undef C10_RDTSC
|
| 24 |
+
#elif defined(__clang__)
|
| 25 |
+
// `__rdtsc` is available by default.
|
| 26 |
+
// NB: This has to be first, because Clang will also define `__GNUC__`
|
| 27 |
+
#elif defined(__GNUC__)
|
| 28 |
+
#include <x86intrin.h>
|
| 29 |
+
#else
|
| 30 |
+
#undef C10_RDTSC
|
| 31 |
+
#endif
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
namespace c10 {
|
| 35 |
+
|
| 36 |
+
using time_t = int64_t;
|
| 37 |
+
using steady_clock_t = std::conditional_t<
|
| 38 |
+
std::chrono::high_resolution_clock::is_steady,
|
| 39 |
+
std::chrono::high_resolution_clock,
|
| 40 |
+
std::chrono::steady_clock>;
|
| 41 |
+
|
| 42 |
+
inline time_t getTimeSinceEpoch() {
|
| 43 |
+
auto now = std::chrono::system_clock::now().time_since_epoch();
|
| 44 |
+
return std::chrono::duration_cast<std::chrono::nanoseconds>(now).count();
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
inline time_t getTime(bool allow_monotonic = false) {
|
| 48 |
+
#if defined(C10_IOS) && defined(C10_MOBILE)
|
| 49 |
+
// clock_gettime is only available on iOS 10.0 or newer. Unlike OS X, iOS
|
| 50 |
+
// can't rely on CLOCK_REALTIME, as it is defined no matter if clock_gettime
|
| 51 |
+
// is implemented or not
|
| 52 |
+
struct timeval now;
|
| 53 |
+
gettimeofday(&now, NULL);
|
| 54 |
+
return static_cast<time_t>(now.tv_sec) * 1000000000 +
|
| 55 |
+
static_cast<time_t>(now.tv_usec) * 1000;
|
| 56 |
+
#elif defined(_WIN32) || defined(__MACH__)
|
| 57 |
+
return std::chrono::duration_cast<std::chrono::nanoseconds>(
|
| 58 |
+
steady_clock_t::now().time_since_epoch())
|
| 59 |
+
.count();
|
| 60 |
+
#else
|
| 61 |
+
// clock_gettime is *much* faster than std::chrono implementation on Linux
|
| 62 |
+
struct timespec t {};
|
| 63 |
+
auto mode = CLOCK_REALTIME;
|
| 64 |
+
if (allow_monotonic) {
|
| 65 |
+
mode = CLOCK_MONOTONIC;
|
| 66 |
+
}
|
| 67 |
+
clock_gettime(mode, &t);
|
| 68 |
+
return static_cast<time_t>(t.tv_sec) * 1000000000 +
|
| 69 |
+
static_cast<time_t>(t.tv_nsec);
|
| 70 |
+
#endif
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
// We often do not need to capture true wall times. If a fast mechanism such
|
| 74 |
+
// as TSC is available we can use that instead and convert back to epoch time
|
| 75 |
+
// during post processing. This greatly reduce the clock's contribution to
|
| 76 |
+
// profiling.
|
| 77 |
+
// http://btorpey.github.io/blog/2014/02/18/clock-sources-in-linux/
|
| 78 |
+
// https://quick-bench.com/q/r8opkkGZSJMu9wM_XTbDouq-0Io
|
| 79 |
+
// TODO: We should use
|
| 80 |
+
// `https://github.com/google/benchmark/blob/main/src/cycleclock.h`
|
| 81 |
+
inline auto getApproximateTime() {
|
| 82 |
+
#if defined(C10_RDTSC)
|
| 83 |
+
return static_cast<uint64_t>(__rdtsc());
|
| 84 |
+
#else
|
| 85 |
+
return getTime();
|
| 86 |
+
#endif
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
using approx_time_t = decltype(getApproximateTime());
|
| 90 |
+
static_assert(
|
| 91 |
+
std::is_same_v<approx_time_t, int64_t> ||
|
| 92 |
+
std::is_same_v<approx_time_t, uint64_t>,
|
| 93 |
+
"Expected either int64_t (`getTime`) or uint64_t (some TSC reads).");
|
| 94 |
+
|
| 95 |
+
// Convert `getCount` results to Nanoseconds since unix epoch.
|
| 96 |
+
class C10_API ApproximateClockToUnixTimeConverter final {
|
| 97 |
+
public:
|
| 98 |
+
ApproximateClockToUnixTimeConverter();
|
| 99 |
+
std::function<time_t(approx_time_t)> makeConverter();
|
| 100 |
+
|
| 101 |
+
struct UnixAndApproximateTimePair {
|
| 102 |
+
time_t t_;
|
| 103 |
+
approx_time_t approx_t_;
|
| 104 |
+
};
|
| 105 |
+
static UnixAndApproximateTimePair measurePair();
|
| 106 |
+
|
| 107 |
+
private:
|
| 108 |
+
static constexpr size_t replicates = 1001;
|
| 109 |
+
using time_pairs = std::array<UnixAndApproximateTimePair, replicates>;
|
| 110 |
+
time_pairs measurePairs();
|
| 111 |
+
|
| 112 |
+
time_pairs start_times_;
|
| 113 |
+
};
|
| 114 |
+
|
| 115 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/Array.h
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <array>
|
| 4 |
+
#include <utility>
|
| 5 |
+
|
| 6 |
+
namespace c10 {
|
| 7 |
+
|
| 8 |
+
// This helper function creates a constexpr std::array
|
| 9 |
+
// From a compile time list of values, without requiring you to explicitly
|
| 10 |
+
// write out the length.
|
| 11 |
+
//
|
| 12 |
+
// See also https://stackoverflow.com/a/26351760/23845
|
| 13 |
+
template <typename V, typename... T>
|
| 14 |
+
inline constexpr auto array_of(T&&... t) -> std::array<V, sizeof...(T)> {
|
| 15 |
+
return {{std::forward<T>(t)...}};
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/ArrayRef.h
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===--- ArrayRef.h - Array Reference Wrapper -------------------*- C++ -*-===//
|
| 2 |
+
//
|
| 3 |
+
// The LLVM Compiler Infrastructure
|
| 4 |
+
//
|
| 5 |
+
// This file is distributed under the University of Illinois Open Source
|
| 6 |
+
// License. See LICENSE.TXT for details.
|
| 7 |
+
//
|
| 8 |
+
//===----------------------------------------------------------------------===//
|
| 9 |
+
|
| 10 |
+
// ATen: modified from llvm::ArrayRef.
|
| 11 |
+
// removed llvm-specific functionality
|
| 12 |
+
// removed some implicit const -> non-const conversions that rely on
|
| 13 |
+
// complicated std::enable_if meta-programming
|
| 14 |
+
// removed a bunch of slice variants for simplicity...
|
| 15 |
+
|
| 16 |
+
#pragma once
|
| 17 |
+
|
| 18 |
+
#include <c10/macros/Macros.h>
|
| 19 |
+
#include <c10/util/Deprecated.h>
|
| 20 |
+
#include <c10/util/Exception.h>
|
| 21 |
+
#include <c10/util/SmallVector.h>
|
| 22 |
+
|
| 23 |
+
#include <array>
|
| 24 |
+
#include <cstddef>
|
| 25 |
+
#include <cstdint>
|
| 26 |
+
#include <initializer_list>
|
| 27 |
+
#include <iterator>
|
| 28 |
+
#include <ostream>
|
| 29 |
+
#include <type_traits>
|
| 30 |
+
#include <vector>
|
| 31 |
+
|
| 32 |
+
namespace c10 {
|
| 33 |
+
/// ArrayRef - Represent a constant reference to an array (0 or more elements
|
| 34 |
+
/// consecutively in memory), i.e. a start pointer and a length. It allows
|
| 35 |
+
/// various APIs to take consecutive elements easily and conveniently.
|
| 36 |
+
///
|
| 37 |
+
/// This class does not own the underlying data, it is expected to be used in
|
| 38 |
+
/// situations where the data resides in some other buffer, whose lifetime
|
| 39 |
+
/// extends past that of the ArrayRef. For this reason, it is not in general
|
| 40 |
+
/// safe to store an ArrayRef.
|
| 41 |
+
///
|
| 42 |
+
/// This is intended to be trivially copyable, so it should be passed by
|
| 43 |
+
/// value.
|
| 44 |
+
template <typename T>
|
| 45 |
+
class ArrayRef final {
|
| 46 |
+
public:
|
| 47 |
+
using iterator = const T*;
|
| 48 |
+
using const_iterator = const T*;
|
| 49 |
+
using size_type = size_t;
|
| 50 |
+
using value_type = T;
|
| 51 |
+
|
| 52 |
+
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 53 |
+
|
| 54 |
+
private:
|
| 55 |
+
/// The start of the array, in an external buffer.
|
| 56 |
+
const T* Data;
|
| 57 |
+
|
| 58 |
+
/// The number of elements.
|
| 59 |
+
size_type Length;
|
| 60 |
+
|
| 61 |
+
void debugCheckNullptrInvariant() {
|
| 62 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
|
| 63 |
+
Data != nullptr || Length == 0,
|
| 64 |
+
"created ArrayRef with nullptr and non-zero length! std::optional relies on this being illegal");
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
public:
|
| 68 |
+
/// @name Constructors
|
| 69 |
+
/// @{
|
| 70 |
+
|
| 71 |
+
/// Construct an empty ArrayRef.
|
| 72 |
+
/* implicit */ constexpr ArrayRef() : Data(nullptr), Length(0) {}
|
| 73 |
+
|
| 74 |
+
/// Construct an ArrayRef from a single element.
|
| 75 |
+
// TODO Make this explicit
|
| 76 |
+
constexpr ArrayRef(const T& OneElt) : Data(&OneElt), Length(1) {}
|
| 77 |
+
|
| 78 |
+
/// Construct an ArrayRef from a pointer and length.
|
| 79 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* data, size_t length)
|
| 80 |
+
: Data(data), Length(length) {
|
| 81 |
+
debugCheckNullptrInvariant();
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/// Construct an ArrayRef from a range.
|
| 85 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef(const T* begin, const T* end)
|
| 86 |
+
: Data(begin), Length(end - begin) {
|
| 87 |
+
debugCheckNullptrInvariant();
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
/// Construct an ArrayRef from a SmallVector. This is templated in order to
|
| 91 |
+
/// avoid instantiating SmallVectorTemplateCommon<T> whenever we
|
| 92 |
+
/// copy-construct an ArrayRef.
|
| 93 |
+
template <typename U>
|
| 94 |
+
/* implicit */ ArrayRef(const SmallVectorTemplateCommon<T, U>& Vec)
|
| 95 |
+
: Data(Vec.data()), Length(Vec.size()) {
|
| 96 |
+
debugCheckNullptrInvariant();
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
template <
|
| 100 |
+
typename Container,
|
| 101 |
+
typename = std::enable_if_t<std::is_same_v<
|
| 102 |
+
std::remove_const_t<decltype(std::declval<Container>().data())>,
|
| 103 |
+
T*>>>
|
| 104 |
+
/* implicit */ ArrayRef(const Container& container)
|
| 105 |
+
: Data(container.data()), Length(container.size()) {
|
| 106 |
+
debugCheckNullptrInvariant();
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
/// Construct an ArrayRef from a std::vector.
|
| 110 |
+
// The enable_if stuff here makes sure that this isn't used for
|
| 111 |
+
// std::vector<bool>, because ArrayRef can't work on a std::vector<bool>
|
| 112 |
+
// bitfield.
|
| 113 |
+
template <typename A>
|
| 114 |
+
/* implicit */ ArrayRef(const std::vector<T, A>& Vec)
|
| 115 |
+
: Data(Vec.data()), Length(Vec.size()) {
|
| 116 |
+
static_assert(
|
| 117 |
+
!std::is_same<T, bool>::value,
|
| 118 |
+
"ArrayRef<bool> cannot be constructed from a std::vector<bool> bitfield.");
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/// Construct an ArrayRef from a std::array
|
| 122 |
+
template <size_t N>
|
| 123 |
+
/* implicit */ constexpr ArrayRef(const std::array<T, N>& Arr)
|
| 124 |
+
: Data(Arr.data()), Length(N) {}
|
| 125 |
+
|
| 126 |
+
/// Construct an ArrayRef from a C array.
|
| 127 |
+
template <size_t N>
|
| 128 |
+
// NOLINTNEXTLINE(*c-arrays*)
|
| 129 |
+
/* implicit */ constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}
|
| 130 |
+
|
| 131 |
+
/// Construct an ArrayRef from a std::initializer_list.
|
| 132 |
+
/* implicit */ constexpr ArrayRef(const std::initializer_list<T>& Vec)
|
| 133 |
+
: Data(
|
| 134 |
+
std::begin(Vec) == std::end(Vec) ? static_cast<T*>(nullptr)
|
| 135 |
+
: std::begin(Vec)),
|
| 136 |
+
Length(Vec.size()) {}
|
| 137 |
+
|
| 138 |
+
/// @}
|
| 139 |
+
/// @name Simple Operations
|
| 140 |
+
/// @{
|
| 141 |
+
|
| 142 |
+
constexpr iterator begin() const {
|
| 143 |
+
return Data;
|
| 144 |
+
}
|
| 145 |
+
constexpr iterator end() const {
|
| 146 |
+
return Data + Length;
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
// These are actually the same as iterator, since ArrayRef only
|
| 150 |
+
// gives you const iterators.
|
| 151 |
+
constexpr const_iterator cbegin() const {
|
| 152 |
+
return Data;
|
| 153 |
+
}
|
| 154 |
+
constexpr const_iterator cend() const {
|
| 155 |
+
return Data + Length;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
constexpr reverse_iterator rbegin() const {
|
| 159 |
+
return reverse_iterator(end());
|
| 160 |
+
}
|
| 161 |
+
constexpr reverse_iterator rend() const {
|
| 162 |
+
return reverse_iterator(begin());
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/// empty - Check if the array is empty.
|
| 166 |
+
constexpr bool empty() const {
|
| 167 |
+
return Length == 0;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
constexpr const T* data() const {
|
| 171 |
+
return Data;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
/// size - Get the array size.
|
| 175 |
+
constexpr size_t size() const {
|
| 176 |
+
return Length;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/// front - Get the first element.
|
| 180 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& front() const {
|
| 181 |
+
TORCH_CHECK(
|
| 182 |
+
!empty(), "ArrayRef: attempted to access front() of empty list");
|
| 183 |
+
return Data[0];
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
/// back - Get the last element.
|
| 187 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& back() const {
|
| 188 |
+
TORCH_CHECK(!empty(), "ArrayRef: attempted to access back() of empty list");
|
| 189 |
+
return Data[Length - 1];
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
/// equals - Check for element-wise equality.
|
| 193 |
+
constexpr bool equals(ArrayRef RHS) const {
|
| 194 |
+
return Length == RHS.Length && std::equal(begin(), end(), RHS.begin());
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
/// slice(n, m) - Take M elements of the array starting at element N
|
| 198 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef<T> slice(size_t N, size_t M)
|
| 199 |
+
const {
|
| 200 |
+
TORCH_CHECK(
|
| 201 |
+
N + M <= size(),
|
| 202 |
+
"ArrayRef: invalid slice, N = ",
|
| 203 |
+
N,
|
| 204 |
+
"; M = ",
|
| 205 |
+
M,
|
| 206 |
+
"; size = ",
|
| 207 |
+
size());
|
| 208 |
+
return ArrayRef<T>(data() + N, M);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
/// slice(n) - Chop off the first N elements of the array.
|
| 212 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA ArrayRef<T> slice(size_t N) const {
|
| 213 |
+
TORCH_CHECK(
|
| 214 |
+
N <= size(), "ArrayRef: invalid slice, N = ", N, "; size = ", size());
|
| 215 |
+
return slice(N, size() - N);
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
/// @}
|
| 219 |
+
/// @name Operator Overloads
|
| 220 |
+
/// @{
|
| 221 |
+
constexpr const T& operator[](size_t Index) const {
|
| 222 |
+
return Data[Index];
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
/// Vector compatibility
|
| 226 |
+
C10_HOST_CONSTEXPR_EXCEPT_WIN_CUDA const T& at(size_t Index) const {
|
| 227 |
+
TORCH_CHECK(
|
| 228 |
+
Index < Length,
|
| 229 |
+
"ArrayRef: invalid index Index = ",
|
| 230 |
+
Index,
|
| 231 |
+
"; Length = ",
|
| 232 |
+
Length);
|
| 233 |
+
return Data[Index];
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
/// Disallow accidental assignment from a temporary.
|
| 237 |
+
///
|
| 238 |
+
/// The declaration here is extra complicated so that "arrayRef = {}"
|
| 239 |
+
/// continues to select the move assignment operator.
|
| 240 |
+
template <typename U>
|
| 241 |
+
std::enable_if_t<std::is_same_v<U, T>, ArrayRef<T>>& operator=(
|
| 242 |
+
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward)
|
| 243 |
+
U&& Temporary) = delete;
|
| 244 |
+
|
| 245 |
+
/// Disallow accidental assignment from a temporary.
|
| 246 |
+
///
|
| 247 |
+
/// The declaration here is extra complicated so that "arrayRef = {}"
|
| 248 |
+
/// continues to select the move assignment operator.
|
| 249 |
+
template <typename U>
|
| 250 |
+
std::enable_if_t<std::is_same_v<U, T>, ArrayRef<T>>& operator=(
|
| 251 |
+
std::initializer_list<U>) = delete;
|
| 252 |
+
|
| 253 |
+
/// @}
|
| 254 |
+
/// @name Expensive Operations
|
| 255 |
+
/// @{
|
| 256 |
+
std::vector<T> vec() const {
|
| 257 |
+
return std::vector<T>(Data, Data + Length);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
/// @}
|
| 261 |
+
};
|
| 262 |
+
|
| 263 |
+
template <typename T>
|
| 264 |
+
std::ostream& operator<<(std::ostream& out, ArrayRef<T> list) {
|
| 265 |
+
int i = 0;
|
| 266 |
+
out << "[";
|
| 267 |
+
for (const auto& e : list) {
|
| 268 |
+
if (i++ > 0)
|
| 269 |
+
out << ", ";
|
| 270 |
+
out << e;
|
| 271 |
+
}
|
| 272 |
+
out << "]";
|
| 273 |
+
return out;
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
/// @name ArrayRef Convenience constructors
|
| 277 |
+
/// @{
|
| 278 |
+
|
| 279 |
+
/// Construct an ArrayRef from a single element.
|
| 280 |
+
template <typename T>
|
| 281 |
+
ArrayRef<T> makeArrayRef(const T& OneElt) {
|
| 282 |
+
return OneElt;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
/// Construct an ArrayRef from a pointer and length.
|
| 286 |
+
template <typename T>
|
| 287 |
+
ArrayRef<T> makeArrayRef(const T* data, size_t length) {
|
| 288 |
+
return ArrayRef<T>(data, length);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
/// Construct an ArrayRef from a range.
|
| 292 |
+
template <typename T>
|
| 293 |
+
ArrayRef<T> makeArrayRef(const T* begin, const T* end) {
|
| 294 |
+
return ArrayRef<T>(begin, end);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
/// Construct an ArrayRef from a SmallVector.
|
| 298 |
+
template <typename T>
|
| 299 |
+
ArrayRef<T> makeArrayRef(const SmallVectorImpl<T>& Vec) {
|
| 300 |
+
return Vec;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
/// Construct an ArrayRef from a SmallVector.
|
| 304 |
+
template <typename T, unsigned N>
|
| 305 |
+
ArrayRef<T> makeArrayRef(const SmallVector<T, N>& Vec) {
|
| 306 |
+
return Vec;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
/// Construct an ArrayRef from a std::vector.
|
| 310 |
+
template <typename T>
|
| 311 |
+
ArrayRef<T> makeArrayRef(const std::vector<T>& Vec) {
|
| 312 |
+
return Vec;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
/// Construct an ArrayRef from a std::array.
|
| 316 |
+
template <typename T, std::size_t N>
|
| 317 |
+
ArrayRef<T> makeArrayRef(const std::array<T, N>& Arr) {
|
| 318 |
+
return Arr;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
/// Construct an ArrayRef from an ArrayRef (no-op) (const)
|
| 322 |
+
template <typename T>
|
| 323 |
+
ArrayRef<T> makeArrayRef(const ArrayRef<T>& Vec) {
|
| 324 |
+
return Vec;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
/// Construct an ArrayRef from an ArrayRef (no-op)
|
| 328 |
+
template <typename T>
|
| 329 |
+
ArrayRef<T>& makeArrayRef(ArrayRef<T>& Vec) {
|
| 330 |
+
return Vec;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
/// Construct an ArrayRef from a C array.
|
| 334 |
+
template <typename T, size_t N>
|
| 335 |
+
// NOLINTNEXTLINE(*c-arrays*)
|
| 336 |
+
ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
|
| 337 |
+
return ArrayRef<T>(Arr);
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
// WARNING: Template instantiation will NOT be willing to do an implicit
|
| 341 |
+
// conversions to get you to an c10::ArrayRef, which is why we need so
|
| 342 |
+
// many overloads.
|
| 343 |
+
|
| 344 |
+
template <typename T>
|
| 345 |
+
bool operator==(c10::ArrayRef<T> a1, c10::ArrayRef<T> a2) {
|
| 346 |
+
return a1.equals(a2);
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
template <typename T>
|
| 350 |
+
bool operator!=(c10::ArrayRef<T> a1, c10::ArrayRef<T> a2) {
|
| 351 |
+
return !a1.equals(a2);
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
template <typename T>
|
| 355 |
+
bool operator==(const std::vector<T>& a1, c10::ArrayRef<T> a2) {
|
| 356 |
+
return c10::ArrayRef<T>(a1).equals(a2);
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
template <typename T>
|
| 360 |
+
bool operator!=(const std::vector<T>& a1, c10::ArrayRef<T> a2) {
|
| 361 |
+
return !c10::ArrayRef<T>(a1).equals(a2);
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
template <typename T>
|
| 365 |
+
bool operator==(c10::ArrayRef<T> a1, const std::vector<T>& a2) {
|
| 366 |
+
return a1.equals(c10::ArrayRef<T>(a2));
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
template <typename T>
|
| 370 |
+
bool operator!=(c10::ArrayRef<T> a1, const std::vector<T>& a2) {
|
| 371 |
+
return !a1.equals(c10::ArrayRef<T>(a2));
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
using IntArrayRef = ArrayRef<int64_t>;
|
| 375 |
+
|
| 376 |
+
// This alias is deprecated because it doesn't make ownership
|
| 377 |
+
// semantics obvious. Use IntArrayRef instead!
|
| 378 |
+
C10_DEFINE_DEPRECATED_USING(IntList, ArrayRef<int64_t>)
|
| 379 |
+
|
| 380 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/BFloat16.h
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// Defines the bloat16 type (brain floating-point). This representation uses
|
| 4 |
+
// 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa.
|
| 5 |
+
|
| 6 |
+
#include <c10/macros/Macros.h>
|
| 7 |
+
#include <cmath>
|
| 8 |
+
#include <cstdint>
|
| 9 |
+
#include <cstring>
|
| 10 |
+
#include <iosfwd>
|
| 11 |
+
#include <ostream>
|
| 12 |
+
|
| 13 |
+
#if defined(__CUDACC__) && !defined(USE_ROCM)
|
| 14 |
+
#include <cuda_bf16.h>
|
| 15 |
+
#endif
|
| 16 |
+
|
| 17 |
+
#if defined(SYCL_EXT_ONEAPI_BFLOAT16_MATH_FUNCTIONS)
|
| 18 |
+
#if defined(CL_SYCL_LANGUAGE_VERSION)
|
| 19 |
+
#include <CL/sycl.hpp> // for SYCL 1.2.1
|
| 20 |
+
#else
|
| 21 |
+
#include <sycl/sycl.hpp> // for SYCL 2020
|
| 22 |
+
#endif
|
| 23 |
+
#include <ext/oneapi/bfloat16.hpp>
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
namespace c10 {
|
| 27 |
+
|
| 28 |
+
namespace detail {
|
| 29 |
+
inline C10_HOST_DEVICE float f32_from_bits(uint16_t src) {
|
| 30 |
+
float res = 0;
|
| 31 |
+
uint32_t tmp = src;
|
| 32 |
+
tmp <<= 16;
|
| 33 |
+
|
| 34 |
+
#if defined(USE_ROCM)
|
| 35 |
+
float* tempRes;
|
| 36 |
+
|
| 37 |
+
// We should be using memcpy in order to respect the strict aliasing rule
|
| 38 |
+
// but it fails in the HIP environment.
|
| 39 |
+
tempRes = reinterpret_cast<float*>(&tmp);
|
| 40 |
+
res = *tempRes;
|
| 41 |
+
#else
|
| 42 |
+
std::memcpy(&res, &tmp, sizeof(tmp));
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
return res;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
inline C10_HOST_DEVICE uint16_t bits_from_f32(float src) {
|
| 49 |
+
uint32_t res = 0;
|
| 50 |
+
|
| 51 |
+
#if defined(USE_ROCM)
|
| 52 |
+
// We should be using memcpy in order to respect the strict aliasing rule
|
| 53 |
+
// but it fails in the HIP environment.
|
| 54 |
+
uint32_t* tempRes = reinterpret_cast<uint32_t*>(&src);
|
| 55 |
+
res = *tempRes;
|
| 56 |
+
#else
|
| 57 |
+
std::memcpy(&res, &src, sizeof(res));
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
return res >> 16;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
inline C10_HOST_DEVICE uint16_t round_to_nearest_even(float src) {
|
| 64 |
+
#if defined(USE_ROCM)
|
| 65 |
+
if (src != src) {
|
| 66 |
+
#elif defined(_MSC_VER)
|
| 67 |
+
if (isnan(src)) {
|
| 68 |
+
#else
|
| 69 |
+
if (std::isnan(src)) {
|
| 70 |
+
#endif
|
| 71 |
+
return UINT16_C(0x7FC0);
|
| 72 |
+
} else {
|
| 73 |
+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
| 74 |
+
union {
|
| 75 |
+
uint32_t U32;
|
| 76 |
+
float F32;
|
| 77 |
+
};
|
| 78 |
+
|
| 79 |
+
F32 = src;
|
| 80 |
+
uint32_t rounding_bias = ((U32 >> 16) & 1) + UINT32_C(0x7FFF);
|
| 81 |
+
return static_cast<uint16_t>((U32 + rounding_bias) >> 16);
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
} // namespace detail
|
| 85 |
+
|
| 86 |
+
struct alignas(2) BFloat16 {
|
| 87 |
+
uint16_t x;
|
| 88 |
+
|
| 89 |
+
// HIP wants __host__ __device__ tag, CUDA does not
|
| 90 |
+
#if defined(USE_ROCM)
|
| 91 |
+
C10_HOST_DEVICE BFloat16() = default;
|
| 92 |
+
#else
|
| 93 |
+
BFloat16() = default;
|
| 94 |
+
#endif
|
| 95 |
+
|
| 96 |
+
struct from_bits_t {};
|
| 97 |
+
static constexpr C10_HOST_DEVICE from_bits_t from_bits() {
|
| 98 |
+
return from_bits_t();
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
constexpr C10_HOST_DEVICE BFloat16(unsigned short bits, from_bits_t)
|
| 102 |
+
: x(bits) {}
|
| 103 |
+
inline C10_HOST_DEVICE BFloat16(float value);
|
| 104 |
+
inline C10_HOST_DEVICE operator float() const;
|
| 105 |
+
|
| 106 |
+
#if defined(__CUDACC__) && !defined(USE_ROCM)
|
| 107 |
+
inline C10_HOST_DEVICE BFloat16(const __nv_bfloat16& value);
|
| 108 |
+
explicit inline C10_HOST_DEVICE operator __nv_bfloat16() const;
|
| 109 |
+
#endif
|
| 110 |
+
|
| 111 |
+
#if defined(SYCL_EXT_ONEAPI_BFLOAT16_MATH_FUNCTIONS)
|
| 112 |
+
inline C10_HOST_DEVICE BFloat16(const sycl::ext::oneapi::bfloat16& value);
|
| 113 |
+
explicit inline C10_HOST_DEVICE operator sycl::ext::oneapi::bfloat16() const;
|
| 114 |
+
#endif
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
C10_API inline std::ostream& operator<<(
|
| 118 |
+
std::ostream& out,
|
| 119 |
+
const BFloat16& value) {
|
| 120 |
+
out << (float)value;
|
| 121 |
+
return out;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
} // namespace c10
|
| 125 |
+
|
| 126 |
+
#include <c10/util/BFloat16-inl.h> // IWYU pragma: keep
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/DeadlockDetection.h
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Export.h>
|
| 4 |
+
#include <c10/util/Exception.h>
|
| 5 |
+
|
| 6 |
+
/// This file provides some simple utilities for detecting common deadlocks in
|
| 7 |
+
/// PyTorch. For now, we focus exclusively on detecting Python GIL deadlocks,
|
| 8 |
+
/// as the GIL is a wide ranging lock that is taken out in many situations.
|
| 9 |
+
/// The basic strategy is before performing an operation that may block, you
|
| 10 |
+
/// can use TORCH_ASSERT_NO_GIL_WITHOUT_PYTHON_DEP() to assert that the GIL is
|
| 11 |
+
/// not held. This macro is to be used in contexts where no static dependency
|
| 12 |
+
/// on Python is available (we will handle indirecting a virtual call for you).
|
| 13 |
+
///
|
| 14 |
+
/// If the GIL is held by a torchdeploy interpreter, we always report false.
|
| 15 |
+
/// If you are in a context where Python bindings are available, it's better
|
| 16 |
+
/// to directly assert on PyGILState_Check (as it avoids a vcall and also
|
| 17 |
+
/// works correctly with torchdeploy.)
|
| 18 |
+
|
| 19 |
+
#define TORCH_ASSERT_NO_GIL_WITHOUT_PYTHON_DEP() \
|
| 20 |
+
TORCH_INTERNAL_ASSERT( \
|
| 21 |
+
!c10::impl::check_python_gil(), \
|
| 22 |
+
"Holding GIL before a blocking operation! Please release the GIL before blocking, or see https://github.com/pytorch/pytorch/issues/56297 for how to release the GIL for destructors of objects")
|
| 23 |
+
|
| 24 |
+
namespace c10::impl {
|
| 25 |
+
|
| 26 |
+
C10_API bool check_python_gil();
|
| 27 |
+
|
| 28 |
+
struct C10_API PythonGILHooks {
|
| 29 |
+
virtual ~PythonGILHooks() = default;
|
| 30 |
+
// Returns true if we hold the GIL. If not linked against Python we
|
| 31 |
+
// always return false.
|
| 32 |
+
virtual bool check_python_gil() const = 0;
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
C10_API void SetPythonGILHooks(PythonGILHooks* factory);
|
| 36 |
+
|
| 37 |
+
// DO NOT call this registerer from a torch deploy instance! You will clobber
|
| 38 |
+
// other registrations
|
| 39 |
+
struct C10_API PythonGILHooksRegisterer {
|
| 40 |
+
explicit PythonGILHooksRegisterer(PythonGILHooks* factory) {
|
| 41 |
+
SetPythonGILHooks(factory);
|
| 42 |
+
}
|
| 43 |
+
~PythonGILHooksRegisterer() {
|
| 44 |
+
SetPythonGILHooks(nullptr);
|
| 45 |
+
}
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/ExclusivelyOwnedTensorTraits.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/TensorImpl.h>
|
| 4 |
+
#include <c10/core/UndefinedTensorImpl.h>
|
| 5 |
+
|
| 6 |
+
#include <utility>
|
| 7 |
+
|
| 8 |
+
namespace c10 {
|
| 9 |
+
// Shared ExclusivelyOwnedTraits implementation between caffe2::Tensor and
|
| 10 |
+
// at::TensorBase.
|
| 11 |
+
template <typename TensorType>
|
| 12 |
+
struct ExclusivelyOwnedTensorTraits {
|
| 13 |
+
using repr_type = TensorType;
|
| 14 |
+
using pointer_type = TensorType*;
|
| 15 |
+
using const_pointer_type = const TensorType*;
|
| 16 |
+
|
| 17 |
+
static repr_type nullRepr() {
|
| 18 |
+
return TensorType();
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
template <class... Args>
|
| 22 |
+
static repr_type createInPlace(Args&&... args) {
|
| 23 |
+
return TensorType(std::forward<Args>(args)...);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
static repr_type moveToRepr(TensorType&& x) {
|
| 27 |
+
return std::move(x);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
static void destroyOwned(TensorType& x) {
|
| 31 |
+
TensorImpl* const toDestroy = x.unsafeReleaseTensorImpl();
|
| 32 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
|
| 33 |
+
toDestroy != nullptr, "Tensor somehow got null TensorImpl?");
|
| 34 |
+
// May be 0 because UndefinedTensorImpl doesn't get its refcount
|
| 35 |
+
// incremented.
|
| 36 |
+
const bool isUndefined = toDestroy == UndefinedTensorImpl::singleton();
|
| 37 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
|
| 38 |
+
toDestroy->refcount_ == 1 || (toDestroy->refcount_ == 0 && isUndefined),
|
| 39 |
+
"ExclusivelyOwned<Tensor> destroyed with isUndefined ",
|
| 40 |
+
isUndefined,
|
| 41 |
+
" and refcount ",
|
| 42 |
+
toDestroy->refcount_,
|
| 43 |
+
", expected 1 or, if isUndefined, 0!");
|
| 44 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
|
| 45 |
+
toDestroy->weakcount_ == 1 ||
|
| 46 |
+
(toDestroy->weakcount_ == 0 &&
|
| 47 |
+
toDestroy == UndefinedTensorImpl::singleton()),
|
| 48 |
+
"ExclusivelyOwned<Tensor> destroyed with isUndefined ",
|
| 49 |
+
isUndefined,
|
| 50 |
+
" and weakcount ",
|
| 51 |
+
toDestroy->weakcount_,
|
| 52 |
+
", expected 1 or, if isUndefined, 0!");
|
| 53 |
+
if (!isUndefined) {
|
| 54 |
+
#ifndef NDEBUG
|
| 55 |
+
// Needed to pass the debug assertions in ~intrusive_ptr_target.
|
| 56 |
+
toDestroy->refcount_ = 0;
|
| 57 |
+
toDestroy->weakcount_ = 0;
|
| 58 |
+
#endif
|
| 59 |
+
delete toDestroy;
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
static TensorType take(TensorType& x) {
|
| 64 |
+
return std::move(x);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
static pointer_type getImpl(repr_type& x) {
|
| 68 |
+
return &x;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
static const_pointer_type getImpl(const repr_type& x) {
|
| 72 |
+
return &x;
|
| 73 |
+
}
|
| 74 |
+
};
|
| 75 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e4m3fn-inl.h
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Macros.h>
|
| 4 |
+
#include <cstring>
|
| 5 |
+
#include <limits>
|
| 6 |
+
|
| 7 |
+
C10_CLANG_DIAGNOSTIC_PUSH()
|
| 8 |
+
#if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
|
| 9 |
+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wimplicit-int-float-conversion")
|
| 10 |
+
#endif
|
| 11 |
+
|
| 12 |
+
namespace c10 {
|
| 13 |
+
|
| 14 |
+
/// Constructors
|
| 15 |
+
|
| 16 |
+
inline C10_HOST_DEVICE Float8_e4m3fn::Float8_e4m3fn(float value)
|
| 17 |
+
: x(detail::fp8e4m3fn_from_fp32_value(value)) {}
|
| 18 |
+
|
| 19 |
+
/// Implicit conversions
|
| 20 |
+
|
| 21 |
+
inline C10_HOST_DEVICE Float8_e4m3fn::operator float() const {
|
| 22 |
+
return detail::fp8e4m3fn_to_fp32_value(x);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/// Special values helper
|
| 26 |
+
|
| 27 |
+
inline C10_HOST_DEVICE bool Float8_e4m3fn::isnan() const {
|
| 28 |
+
return (x & 0b01111111) == 0b01111111;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
/// Arithmetic
|
| 32 |
+
|
| 33 |
+
inline C10_HOST_DEVICE Float8_e4m3fn
|
| 34 |
+
operator+(const Float8_e4m3fn& a, const Float8_e4m3fn& b) {
|
| 35 |
+
return static_cast<float>(a) + static_cast<float>(b);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
inline C10_HOST_DEVICE Float8_e4m3fn
|
| 39 |
+
operator-(const Float8_e4m3fn& a, const Float8_e4m3fn& b) {
|
| 40 |
+
return static_cast<float>(a) - static_cast<float>(b);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
inline C10_HOST_DEVICE Float8_e4m3fn
|
| 44 |
+
operator*(const Float8_e4m3fn& a, const Float8_e4m3fn& b) {
|
| 45 |
+
return static_cast<float>(a) * static_cast<float>(b);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator/(
|
| 49 |
+
const Float8_e4m3fn& a,
|
| 50 |
+
const Float8_e4m3fn& b) __ubsan_ignore_float_divide_by_zero__ {
|
| 51 |
+
return static_cast<float>(a) / static_cast<float>(b);
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator-(const Float8_e4m3fn& a) {
|
| 55 |
+
return -static_cast<float>(a);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
inline C10_HOST_DEVICE Float8_e4m3fn& operator+=(
|
| 59 |
+
Float8_e4m3fn& a,
|
| 60 |
+
const Float8_e4m3fn& b) {
|
| 61 |
+
a = a + b;
|
| 62 |
+
return a;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
inline C10_HOST_DEVICE Float8_e4m3fn& operator-=(
|
| 66 |
+
Float8_e4m3fn& a,
|
| 67 |
+
const Float8_e4m3fn& b) {
|
| 68 |
+
a = a - b;
|
| 69 |
+
return a;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
inline C10_HOST_DEVICE Float8_e4m3fn& operator*=(
|
| 73 |
+
Float8_e4m3fn& a,
|
| 74 |
+
const Float8_e4m3fn& b) {
|
| 75 |
+
a = a * b;
|
| 76 |
+
return a;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
inline C10_HOST_DEVICE Float8_e4m3fn& operator/=(
|
| 80 |
+
Float8_e4m3fn& a,
|
| 81 |
+
const Float8_e4m3fn& b) {
|
| 82 |
+
a = a / b;
|
| 83 |
+
return a;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/// Arithmetic with floats
|
| 87 |
+
|
| 88 |
+
inline C10_HOST_DEVICE float operator+(Float8_e4m3fn a, float b) {
|
| 89 |
+
return static_cast<float>(a) + b;
|
| 90 |
+
}
|
| 91 |
+
inline C10_HOST_DEVICE float operator-(Float8_e4m3fn a, float b) {
|
| 92 |
+
return static_cast<float>(a) - b;
|
| 93 |
+
}
|
| 94 |
+
inline C10_HOST_DEVICE float operator*(Float8_e4m3fn a, float b) {
|
| 95 |
+
return static_cast<float>(a) * b;
|
| 96 |
+
}
|
| 97 |
+
inline C10_HOST_DEVICE float operator/(Float8_e4m3fn a, float b)
|
| 98 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 99 |
+
return static_cast<float>(a) / b;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
inline C10_HOST_DEVICE float operator+(float a, Float8_e4m3fn b) {
|
| 103 |
+
return a + static_cast<float>(b);
|
| 104 |
+
}
|
| 105 |
+
inline C10_HOST_DEVICE float operator-(float a, Float8_e4m3fn b) {
|
| 106 |
+
return a - static_cast<float>(b);
|
| 107 |
+
}
|
| 108 |
+
inline C10_HOST_DEVICE float operator*(float a, Float8_e4m3fn b) {
|
| 109 |
+
return a * static_cast<float>(b);
|
| 110 |
+
}
|
| 111 |
+
inline C10_HOST_DEVICE float operator/(float a, Float8_e4m3fn b)
|
| 112 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 113 |
+
return a / static_cast<float>(b);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
inline C10_HOST_DEVICE float& operator+=(float& a, const Float8_e4m3fn& b) {
|
| 117 |
+
return a += static_cast<float>(b);
|
| 118 |
+
}
|
| 119 |
+
inline C10_HOST_DEVICE float& operator-=(float& a, const Float8_e4m3fn& b) {
|
| 120 |
+
return a -= static_cast<float>(b);
|
| 121 |
+
}
|
| 122 |
+
inline C10_HOST_DEVICE float& operator*=(float& a, const Float8_e4m3fn& b) {
|
| 123 |
+
return a *= static_cast<float>(b);
|
| 124 |
+
}
|
| 125 |
+
inline C10_HOST_DEVICE float& operator/=(float& a, const Float8_e4m3fn& b) {
|
| 126 |
+
return a /= static_cast<float>(b);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
/// Arithmetic with doubles
|
| 130 |
+
|
| 131 |
+
inline C10_HOST_DEVICE double operator+(Float8_e4m3fn a, double b) {
|
| 132 |
+
return static_cast<double>(a) + b;
|
| 133 |
+
}
|
| 134 |
+
inline C10_HOST_DEVICE double operator-(Float8_e4m3fn a, double b) {
|
| 135 |
+
return static_cast<double>(a) - b;
|
| 136 |
+
}
|
| 137 |
+
inline C10_HOST_DEVICE double operator*(Float8_e4m3fn a, double b) {
|
| 138 |
+
return static_cast<double>(a) * b;
|
| 139 |
+
}
|
| 140 |
+
inline C10_HOST_DEVICE double operator/(Float8_e4m3fn a, double b)
|
| 141 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 142 |
+
return static_cast<double>(a) / b;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
inline C10_HOST_DEVICE double operator+(double a, Float8_e4m3fn b) {
|
| 146 |
+
return a + static_cast<double>(b);
|
| 147 |
+
}
|
| 148 |
+
inline C10_HOST_DEVICE double operator-(double a, Float8_e4m3fn b) {
|
| 149 |
+
return a - static_cast<double>(b);
|
| 150 |
+
}
|
| 151 |
+
inline C10_HOST_DEVICE double operator*(double a, Float8_e4m3fn b) {
|
| 152 |
+
return a * static_cast<double>(b);
|
| 153 |
+
}
|
| 154 |
+
inline C10_HOST_DEVICE double operator/(double a, Float8_e4m3fn b)
|
| 155 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 156 |
+
return a / static_cast<double>(b);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
/// Arithmetic with ints
|
| 160 |
+
|
| 161 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator+(Float8_e4m3fn a, int b) {
|
| 162 |
+
return a + static_cast<Float8_e4m3fn>(b);
|
| 163 |
+
}
|
| 164 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator-(Float8_e4m3fn a, int b) {
|
| 165 |
+
return a - static_cast<Float8_e4m3fn>(b);
|
| 166 |
+
}
|
| 167 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator*(Float8_e4m3fn a, int b) {
|
| 168 |
+
return a * static_cast<Float8_e4m3fn>(b);
|
| 169 |
+
}
|
| 170 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator/(Float8_e4m3fn a, int b) {
|
| 171 |
+
return a / static_cast<Float8_e4m3fn>(b);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator+(int a, Float8_e4m3fn b) {
|
| 175 |
+
return static_cast<Float8_e4m3fn>(a) + b;
|
| 176 |
+
}
|
| 177 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator-(int a, Float8_e4m3fn b) {
|
| 178 |
+
return static_cast<Float8_e4m3fn>(a) - b;
|
| 179 |
+
}
|
| 180 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator*(int a, Float8_e4m3fn b) {
|
| 181 |
+
return static_cast<Float8_e4m3fn>(a) * b;
|
| 182 |
+
}
|
| 183 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator/(int a, Float8_e4m3fn b) {
|
| 184 |
+
return static_cast<Float8_e4m3fn>(a) / b;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
//// Arithmetic with int64_t
|
| 188 |
+
|
| 189 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator+(Float8_e4m3fn a, int64_t b) {
|
| 190 |
+
return a + static_cast<Float8_e4m3fn>(b);
|
| 191 |
+
}
|
| 192 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator-(Float8_e4m3fn a, int64_t b) {
|
| 193 |
+
return a - static_cast<Float8_e4m3fn>(b);
|
| 194 |
+
}
|
| 195 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator*(Float8_e4m3fn a, int64_t b) {
|
| 196 |
+
return a * static_cast<Float8_e4m3fn>(b);
|
| 197 |
+
}
|
| 198 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator/(Float8_e4m3fn a, int64_t b) {
|
| 199 |
+
return a / static_cast<Float8_e4m3fn>(b);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator+(int64_t a, Float8_e4m3fn b) {
|
| 203 |
+
return static_cast<Float8_e4m3fn>(a) + b;
|
| 204 |
+
}
|
| 205 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator-(int64_t a, Float8_e4m3fn b) {
|
| 206 |
+
return static_cast<Float8_e4m3fn>(a) - b;
|
| 207 |
+
}
|
| 208 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator*(int64_t a, Float8_e4m3fn b) {
|
| 209 |
+
return static_cast<Float8_e4m3fn>(a) * b;
|
| 210 |
+
}
|
| 211 |
+
inline C10_HOST_DEVICE Float8_e4m3fn operator/(int64_t a, Float8_e4m3fn b) {
|
| 212 |
+
return static_cast<Float8_e4m3fn>(a) / b;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
/// NOTE: we do not define comparisons directly and instead rely on the implicit
|
| 216 |
+
/// conversion from c10::Float8_e4m3fn to float.
|
| 217 |
+
|
| 218 |
+
} // namespace c10
|
| 219 |
+
|
| 220 |
+
namespace std {
|
| 221 |
+
|
| 222 |
+
template <>
|
| 223 |
+
class numeric_limits<c10::Float8_e4m3fn> {
|
| 224 |
+
public:
|
| 225 |
+
static constexpr bool is_specialized = true;
|
| 226 |
+
static constexpr bool is_signed = true;
|
| 227 |
+
static constexpr bool is_integer = false;
|
| 228 |
+
static constexpr bool is_exact = false;
|
| 229 |
+
static constexpr bool has_infinity = false;
|
| 230 |
+
static constexpr bool has_quiet_NaN = true;
|
| 231 |
+
static constexpr bool has_signaling_NaN = false;
|
| 232 |
+
static constexpr auto has_denorm = true;
|
| 233 |
+
static constexpr auto has_denorm_loss = true;
|
| 234 |
+
static constexpr auto round_style = numeric_limits<float>::round_style;
|
| 235 |
+
static constexpr bool is_iec559 = false;
|
| 236 |
+
static constexpr bool is_bounded = true;
|
| 237 |
+
static constexpr bool is_modulo = false;
|
| 238 |
+
static constexpr int digits = 4;
|
| 239 |
+
static constexpr int digits10 = 0;
|
| 240 |
+
static constexpr int max_digits10 = 3;
|
| 241 |
+
static constexpr int radix = 2;
|
| 242 |
+
static constexpr int min_exponent = -5;
|
| 243 |
+
static constexpr int min_exponent10 = -1;
|
| 244 |
+
static constexpr int max_exponent = 8;
|
| 245 |
+
static constexpr int max_exponent10 = 2;
|
| 246 |
+
static constexpr auto traps = numeric_limits<float>::traps;
|
| 247 |
+
static constexpr auto tinyness_before = false;
|
| 248 |
+
|
| 249 |
+
static constexpr c10::Float8_e4m3fn min() {
|
| 250 |
+
return c10::Float8_e4m3fn(0x08, c10::Float8_e4m3fn::from_bits());
|
| 251 |
+
}
|
| 252 |
+
static constexpr c10::Float8_e4m3fn lowest() {
|
| 253 |
+
return c10::Float8_e4m3fn(0xFE, c10::Float8_e4m3fn::from_bits());
|
| 254 |
+
}
|
| 255 |
+
static constexpr c10::Float8_e4m3fn max() {
|
| 256 |
+
return c10::Float8_e4m3fn(0x7E, c10::Float8_e4m3fn::from_bits());
|
| 257 |
+
}
|
| 258 |
+
static constexpr c10::Float8_e4m3fn epsilon() {
|
| 259 |
+
return c10::Float8_e4m3fn(0x20, c10::Float8_e4m3fn::from_bits());
|
| 260 |
+
}
|
| 261 |
+
static constexpr c10::Float8_e4m3fn round_error() {
|
| 262 |
+
return c10::Float8_e4m3fn(0x30, c10::Float8_e4m3fn::from_bits());
|
| 263 |
+
}
|
| 264 |
+
static constexpr c10::Float8_e4m3fn quiet_NaN() {
|
| 265 |
+
return c10::Float8_e4m3fn(0x7F, c10::Float8_e4m3fn::from_bits());
|
| 266 |
+
}
|
| 267 |
+
static constexpr c10::Float8_e4m3fn denorm_min() {
|
| 268 |
+
return c10::Float8_e4m3fn(0x01, c10::Float8_e4m3fn::from_bits());
|
| 269 |
+
}
|
| 270 |
+
};
|
| 271 |
+
|
| 272 |
+
} // namespace std
|
| 273 |
+
|
| 274 |
+
C10_CLANG_DIAGNOSTIC_POP()
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e4m3fnuz-inl.h
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Macros.h>
|
| 4 |
+
#include <c10/util/Float8_fnuz_cvt.h>
|
| 5 |
+
#include <cstring>
|
| 6 |
+
#include <limits>
|
| 7 |
+
|
| 8 |
+
C10_CLANG_DIAGNOSTIC_PUSH()
|
| 9 |
+
#if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
|
| 10 |
+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wimplicit-int-float-conversion")
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
namespace c10 {
|
| 14 |
+
|
| 15 |
+
/// Constructors
|
| 16 |
+
|
| 17 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz::Float8_e4m3fnuz(float value)
|
| 18 |
+
: x(detail::fp8e4m3fnuz_from_fp32_value(value)) {}
|
| 19 |
+
|
| 20 |
+
/// Implicit conversions
|
| 21 |
+
|
| 22 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz::operator float() const {
|
| 23 |
+
return detail::fp8_fnuz_to_fp32_value<4, 3>(x);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/// Special values helper
|
| 27 |
+
|
| 28 |
+
inline C10_HOST_DEVICE bool Float8_e4m3fnuz::isnan() const {
|
| 29 |
+
return x == 0b10000000;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/// Arithmetic
|
| 33 |
+
|
| 34 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz
|
| 35 |
+
operator+(const Float8_e4m3fnuz& a, const Float8_e4m3fnuz& b) {
|
| 36 |
+
return static_cast<float>(a) + static_cast<float>(b);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz
|
| 40 |
+
operator-(const Float8_e4m3fnuz& a, const Float8_e4m3fnuz& b) {
|
| 41 |
+
return static_cast<float>(a) - static_cast<float>(b);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz
|
| 45 |
+
operator*(const Float8_e4m3fnuz& a, const Float8_e4m3fnuz& b) {
|
| 46 |
+
return static_cast<float>(a) * static_cast<float>(b);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator/(
|
| 50 |
+
const Float8_e4m3fnuz& a,
|
| 51 |
+
const Float8_e4m3fnuz& b) __ubsan_ignore_float_divide_by_zero__ {
|
| 52 |
+
return static_cast<float>(a) / static_cast<float>(b);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator-(const Float8_e4m3fnuz& a) {
|
| 56 |
+
return -static_cast<float>(a);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz& operator+=(
|
| 60 |
+
Float8_e4m3fnuz& a,
|
| 61 |
+
const Float8_e4m3fnuz& b) {
|
| 62 |
+
a = a + b;
|
| 63 |
+
return a;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz& operator-=(
|
| 67 |
+
Float8_e4m3fnuz& a,
|
| 68 |
+
const Float8_e4m3fnuz& b) {
|
| 69 |
+
a = a - b;
|
| 70 |
+
return a;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz& operator*=(
|
| 74 |
+
Float8_e4m3fnuz& a,
|
| 75 |
+
const Float8_e4m3fnuz& b) {
|
| 76 |
+
a = a * b;
|
| 77 |
+
return a;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz& operator/=(
|
| 81 |
+
Float8_e4m3fnuz& a,
|
| 82 |
+
const Float8_e4m3fnuz& b) {
|
| 83 |
+
a = a / b;
|
| 84 |
+
return a;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
/// Arithmetic with floats
|
| 88 |
+
|
| 89 |
+
inline C10_HOST_DEVICE float operator+(Float8_e4m3fnuz a, float b) {
|
| 90 |
+
return static_cast<float>(a) + b;
|
| 91 |
+
}
|
| 92 |
+
inline C10_HOST_DEVICE float operator-(Float8_e4m3fnuz a, float b) {
|
| 93 |
+
return static_cast<float>(a) - b;
|
| 94 |
+
}
|
| 95 |
+
inline C10_HOST_DEVICE float operator*(Float8_e4m3fnuz a, float b) {
|
| 96 |
+
return static_cast<float>(a) * b;
|
| 97 |
+
}
|
| 98 |
+
inline C10_HOST_DEVICE float operator/(Float8_e4m3fnuz a, float b)
|
| 99 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 100 |
+
return static_cast<float>(a) / b;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
inline C10_HOST_DEVICE float operator+(float a, Float8_e4m3fnuz b) {
|
| 104 |
+
return a + static_cast<float>(b);
|
| 105 |
+
}
|
| 106 |
+
inline C10_HOST_DEVICE float operator-(float a, Float8_e4m3fnuz b) {
|
| 107 |
+
return a - static_cast<float>(b);
|
| 108 |
+
}
|
| 109 |
+
inline C10_HOST_DEVICE float operator*(float a, Float8_e4m3fnuz b) {
|
| 110 |
+
return a * static_cast<float>(b);
|
| 111 |
+
}
|
| 112 |
+
inline C10_HOST_DEVICE float operator/(float a, Float8_e4m3fnuz b)
|
| 113 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 114 |
+
return a / static_cast<float>(b);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
inline C10_HOST_DEVICE float& operator+=(float& a, const Float8_e4m3fnuz& b) {
|
| 118 |
+
return a += static_cast<float>(b);
|
| 119 |
+
}
|
| 120 |
+
inline C10_HOST_DEVICE float& operator-=(float& a, const Float8_e4m3fnuz& b) {
|
| 121 |
+
return a -= static_cast<float>(b);
|
| 122 |
+
}
|
| 123 |
+
inline C10_HOST_DEVICE float& operator*=(float& a, const Float8_e4m3fnuz& b) {
|
| 124 |
+
return a *= static_cast<float>(b);
|
| 125 |
+
}
|
| 126 |
+
inline C10_HOST_DEVICE float& operator/=(float& a, const Float8_e4m3fnuz& b) {
|
| 127 |
+
return a /= static_cast<float>(b);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/// Arithmetic with doubles
|
| 131 |
+
|
| 132 |
+
inline C10_HOST_DEVICE double operator+(Float8_e4m3fnuz a, double b) {
|
| 133 |
+
return static_cast<double>(a) + b;
|
| 134 |
+
}
|
| 135 |
+
inline C10_HOST_DEVICE double operator-(Float8_e4m3fnuz a, double b) {
|
| 136 |
+
return static_cast<double>(a) - b;
|
| 137 |
+
}
|
| 138 |
+
inline C10_HOST_DEVICE double operator*(Float8_e4m3fnuz a, double b) {
|
| 139 |
+
return static_cast<double>(a) * b;
|
| 140 |
+
}
|
| 141 |
+
inline C10_HOST_DEVICE double operator/(Float8_e4m3fnuz a, double b)
|
| 142 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 143 |
+
return static_cast<double>(a) / b;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
inline C10_HOST_DEVICE double operator+(double a, Float8_e4m3fnuz b) {
|
| 147 |
+
return a + static_cast<double>(b);
|
| 148 |
+
}
|
| 149 |
+
inline C10_HOST_DEVICE double operator-(double a, Float8_e4m3fnuz b) {
|
| 150 |
+
return a - static_cast<double>(b);
|
| 151 |
+
}
|
| 152 |
+
inline C10_HOST_DEVICE double operator*(double a, Float8_e4m3fnuz b) {
|
| 153 |
+
return a * static_cast<double>(b);
|
| 154 |
+
}
|
| 155 |
+
inline C10_HOST_DEVICE double operator/(double a, Float8_e4m3fnuz b)
|
| 156 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 157 |
+
return a / static_cast<double>(b);
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
/// Arithmetic with ints
|
| 161 |
+
|
| 162 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator+(Float8_e4m3fnuz a, int b) {
|
| 163 |
+
return a + static_cast<Float8_e4m3fnuz>(b);
|
| 164 |
+
}
|
| 165 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator-(Float8_e4m3fnuz a, int b) {
|
| 166 |
+
return a - static_cast<Float8_e4m3fnuz>(b);
|
| 167 |
+
}
|
| 168 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator*(Float8_e4m3fnuz a, int b) {
|
| 169 |
+
return a * static_cast<Float8_e4m3fnuz>(b);
|
| 170 |
+
}
|
| 171 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator/(Float8_e4m3fnuz a, int b) {
|
| 172 |
+
return a / static_cast<Float8_e4m3fnuz>(b);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator+(int a, Float8_e4m3fnuz b) {
|
| 176 |
+
return static_cast<Float8_e4m3fnuz>(a) + b;
|
| 177 |
+
}
|
| 178 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator-(int a, Float8_e4m3fnuz b) {
|
| 179 |
+
return static_cast<Float8_e4m3fnuz>(a) - b;
|
| 180 |
+
}
|
| 181 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator*(int a, Float8_e4m3fnuz b) {
|
| 182 |
+
return static_cast<Float8_e4m3fnuz>(a) * b;
|
| 183 |
+
}
|
| 184 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator/(int a, Float8_e4m3fnuz b) {
|
| 185 |
+
return static_cast<Float8_e4m3fnuz>(a) / b;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
//// Arithmetic with int64_t
|
| 189 |
+
|
| 190 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator+(Float8_e4m3fnuz a, int64_t b) {
|
| 191 |
+
return a + static_cast<Float8_e4m3fnuz>(b);
|
| 192 |
+
}
|
| 193 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator-(Float8_e4m3fnuz a, int64_t b) {
|
| 194 |
+
return a - static_cast<Float8_e4m3fnuz>(b);
|
| 195 |
+
}
|
| 196 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator*(Float8_e4m3fnuz a, int64_t b) {
|
| 197 |
+
return a * static_cast<Float8_e4m3fnuz>(b);
|
| 198 |
+
}
|
| 199 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator/(Float8_e4m3fnuz a, int64_t b) {
|
| 200 |
+
return a / static_cast<Float8_e4m3fnuz>(b);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator+(int64_t a, Float8_e4m3fnuz b) {
|
| 204 |
+
return static_cast<Float8_e4m3fnuz>(a) + b;
|
| 205 |
+
}
|
| 206 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator-(int64_t a, Float8_e4m3fnuz b) {
|
| 207 |
+
return static_cast<Float8_e4m3fnuz>(a) - b;
|
| 208 |
+
}
|
| 209 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator*(int64_t a, Float8_e4m3fnuz b) {
|
| 210 |
+
return static_cast<Float8_e4m3fnuz>(a) * b;
|
| 211 |
+
}
|
| 212 |
+
inline C10_HOST_DEVICE Float8_e4m3fnuz operator/(int64_t a, Float8_e4m3fnuz b) {
|
| 213 |
+
return static_cast<Float8_e4m3fnuz>(a) / b;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
/// NOTE: we do not define comparisons directly and instead rely on the implicit
|
| 217 |
+
/// conversion from c10::Float8_e4m3fnuz to float.
|
| 218 |
+
|
| 219 |
+
} // namespace c10
|
| 220 |
+
|
| 221 |
+
namespace std {
|
| 222 |
+
|
| 223 |
+
template <>
|
| 224 |
+
class numeric_limits<c10::Float8_e4m3fnuz> {
|
| 225 |
+
public:
|
| 226 |
+
static constexpr bool is_specialized = true;
|
| 227 |
+
static constexpr bool is_signed = true;
|
| 228 |
+
static constexpr bool is_integer = false;
|
| 229 |
+
static constexpr bool is_exact = false;
|
| 230 |
+
static constexpr bool has_infinity = false;
|
| 231 |
+
static constexpr bool has_quiet_NaN = true;
|
| 232 |
+
static constexpr bool has_signaling_NaN = false;
|
| 233 |
+
static constexpr auto has_denorm = true;
|
| 234 |
+
static constexpr auto has_denorm_loss = true;
|
| 235 |
+
static constexpr auto round_style = numeric_limits<float>::round_style;
|
| 236 |
+
static constexpr bool is_iec559 = false;
|
| 237 |
+
static constexpr bool is_bounded = true;
|
| 238 |
+
static constexpr bool is_modulo = false;
|
| 239 |
+
static constexpr int digits = 4;
|
| 240 |
+
static constexpr int digits10 = 0;
|
| 241 |
+
static constexpr int max_digits10 = 3;
|
| 242 |
+
static constexpr int radix = 2;
|
| 243 |
+
static constexpr int min_exponent = -6;
|
| 244 |
+
static constexpr int min_exponent10 = -1;
|
| 245 |
+
static constexpr int max_exponent = 8;
|
| 246 |
+
static constexpr int max_exponent10 = 2;
|
| 247 |
+
static constexpr auto traps = numeric_limits<float>::traps;
|
| 248 |
+
static constexpr auto tinyness_before = false;
|
| 249 |
+
|
| 250 |
+
static constexpr c10::Float8_e4m3fnuz min() {
|
| 251 |
+
return c10::Float8_e4m3fnuz(0x08, c10::Float8_e4m3fnuz::from_bits());
|
| 252 |
+
}
|
| 253 |
+
static constexpr c10::Float8_e4m3fnuz lowest() {
|
| 254 |
+
return c10::Float8_e4m3fnuz(0xFF, c10::Float8_e4m3fnuz::from_bits());
|
| 255 |
+
}
|
| 256 |
+
static constexpr c10::Float8_e4m3fnuz max() {
|
| 257 |
+
return c10::Float8_e4m3fnuz(0x7F, c10::Float8_e4m3fnuz::from_bits());
|
| 258 |
+
}
|
| 259 |
+
static constexpr c10::Float8_e4m3fnuz epsilon() {
|
| 260 |
+
return c10::Float8_e4m3fnuz(0x28, c10::Float8_e4m3fnuz::from_bits());
|
| 261 |
+
}
|
| 262 |
+
static constexpr c10::Float8_e4m3fnuz round_error() {
|
| 263 |
+
return c10::Float8_e4m3fnuz(0x38, c10::Float8_e4m3fnuz::from_bits());
|
| 264 |
+
}
|
| 265 |
+
static constexpr c10::Float8_e4m3fnuz infinity() {
|
| 266 |
+
// NaN (no infinities)
|
| 267 |
+
return c10::Float8_e4m3fnuz(0x80, c10::Float8_e4m3fnuz::from_bits());
|
| 268 |
+
}
|
| 269 |
+
static constexpr c10::Float8_e4m3fnuz quiet_NaN() {
|
| 270 |
+
return c10::Float8_e4m3fnuz(0x80, c10::Float8_e4m3fnuz::from_bits());
|
| 271 |
+
}
|
| 272 |
+
static constexpr c10::Float8_e4m3fnuz denorm_min() {
|
| 273 |
+
return c10::Float8_e4m3fnuz(0x01, c10::Float8_e4m3fnuz::from_bits());
|
| 274 |
+
}
|
| 275 |
+
};
|
| 276 |
+
|
| 277 |
+
} // namespace std
|
| 278 |
+
|
| 279 |
+
C10_CLANG_DIAGNOSTIC_POP()
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/Float8_e5m2fnuz-inl.h
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Macros.h>
|
| 4 |
+
#include <c10/util/Float8_fnuz_cvt.h>
|
| 5 |
+
#include <cstring>
|
| 6 |
+
#include <limits>
|
| 7 |
+
|
| 8 |
+
C10_CLANG_DIAGNOSTIC_PUSH()
|
| 9 |
+
#if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
|
| 10 |
+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wimplicit-int-float-conversion")
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
namespace c10 {
|
| 14 |
+
|
| 15 |
+
/// Constructors
|
| 16 |
+
|
| 17 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz::Float8_e5m2fnuz(float value)
|
| 18 |
+
: x(detail::fp8e5m2fnuz_from_fp32_value(value)) {}
|
| 19 |
+
|
| 20 |
+
/// Implicit conversions
|
| 21 |
+
|
| 22 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz::operator float() const {
|
| 23 |
+
return detail::fp8_fnuz_to_fp32_value<5, 2>(x);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/// Special values helpers
|
| 27 |
+
|
| 28 |
+
inline C10_HOST_DEVICE bool Float8_e5m2fnuz::isnan() const {
|
| 29 |
+
return x == 0b10000000;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
inline C10_HOST_DEVICE bool Float8_e5m2fnuz::isinf() const {
|
| 33 |
+
return false;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/// Arithmetic
|
| 37 |
+
|
| 38 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz
|
| 39 |
+
operator+(const Float8_e5m2fnuz& a, const Float8_e5m2fnuz& b) {
|
| 40 |
+
return static_cast<float>(a) + static_cast<float>(b);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz
|
| 44 |
+
operator-(const Float8_e5m2fnuz& a, const Float8_e5m2fnuz& b) {
|
| 45 |
+
return static_cast<float>(a) - static_cast<float>(b);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz
|
| 49 |
+
operator*(const Float8_e5m2fnuz& a, const Float8_e5m2fnuz& b) {
|
| 50 |
+
return static_cast<float>(a) * static_cast<float>(b);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator/(
|
| 54 |
+
const Float8_e5m2fnuz& a,
|
| 55 |
+
const Float8_e5m2fnuz& b) __ubsan_ignore_float_divide_by_zero__ {
|
| 56 |
+
return static_cast<float>(a) / static_cast<float>(b);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator-(const Float8_e5m2fnuz& a) {
|
| 60 |
+
return -static_cast<float>(a);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz& operator+=(
|
| 64 |
+
Float8_e5m2fnuz& a,
|
| 65 |
+
const Float8_e5m2fnuz& b) {
|
| 66 |
+
a = a + b;
|
| 67 |
+
return a;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz& operator-=(
|
| 71 |
+
Float8_e5m2fnuz& a,
|
| 72 |
+
const Float8_e5m2fnuz& b) {
|
| 73 |
+
a = a - b;
|
| 74 |
+
return a;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz& operator*=(
|
| 78 |
+
Float8_e5m2fnuz& a,
|
| 79 |
+
const Float8_e5m2fnuz& b) {
|
| 80 |
+
a = a * b;
|
| 81 |
+
return a;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz& operator/=(
|
| 85 |
+
Float8_e5m2fnuz& a,
|
| 86 |
+
const Float8_e5m2fnuz& b) {
|
| 87 |
+
a = a / b;
|
| 88 |
+
return a;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/// Arithmetic with floats
|
| 92 |
+
|
| 93 |
+
inline C10_HOST_DEVICE float operator+(Float8_e5m2fnuz a, float b) {
|
| 94 |
+
return static_cast<float>(a) + b;
|
| 95 |
+
}
|
| 96 |
+
inline C10_HOST_DEVICE float operator-(Float8_e5m2fnuz a, float b) {
|
| 97 |
+
return static_cast<float>(a) - b;
|
| 98 |
+
}
|
| 99 |
+
inline C10_HOST_DEVICE float operator*(Float8_e5m2fnuz a, float b) {
|
| 100 |
+
return static_cast<float>(a) * b;
|
| 101 |
+
}
|
| 102 |
+
inline C10_HOST_DEVICE float operator/(Float8_e5m2fnuz a, float b)
|
| 103 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 104 |
+
return static_cast<float>(a) / b;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
inline C10_HOST_DEVICE float operator+(float a, Float8_e5m2fnuz b) {
|
| 108 |
+
return a + static_cast<float>(b);
|
| 109 |
+
}
|
| 110 |
+
inline C10_HOST_DEVICE float operator-(float a, Float8_e5m2fnuz b) {
|
| 111 |
+
return a - static_cast<float>(b);
|
| 112 |
+
}
|
| 113 |
+
inline C10_HOST_DEVICE float operator*(float a, Float8_e5m2fnuz b) {
|
| 114 |
+
return a * static_cast<float>(b);
|
| 115 |
+
}
|
| 116 |
+
inline C10_HOST_DEVICE float operator/(float a, Float8_e5m2fnuz b)
|
| 117 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 118 |
+
return a / static_cast<float>(b);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
inline C10_HOST_DEVICE float& operator+=(float& a, const Float8_e5m2fnuz& b) {
|
| 122 |
+
return a += static_cast<float>(b);
|
| 123 |
+
}
|
| 124 |
+
inline C10_HOST_DEVICE float& operator-=(float& a, const Float8_e5m2fnuz& b) {
|
| 125 |
+
return a -= static_cast<float>(b);
|
| 126 |
+
}
|
| 127 |
+
inline C10_HOST_DEVICE float& operator*=(float& a, const Float8_e5m2fnuz& b) {
|
| 128 |
+
return a *= static_cast<float>(b);
|
| 129 |
+
}
|
| 130 |
+
inline C10_HOST_DEVICE float& operator/=(float& a, const Float8_e5m2fnuz& b) {
|
| 131 |
+
return a /= static_cast<float>(b);
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/// Arithmetic with doubles
|
| 135 |
+
|
| 136 |
+
inline C10_HOST_DEVICE double operator+(Float8_e5m2fnuz a, double b) {
|
| 137 |
+
return static_cast<double>(a) + b;
|
| 138 |
+
}
|
| 139 |
+
inline C10_HOST_DEVICE double operator-(Float8_e5m2fnuz a, double b) {
|
| 140 |
+
return static_cast<double>(a) - b;
|
| 141 |
+
}
|
| 142 |
+
inline C10_HOST_DEVICE double operator*(Float8_e5m2fnuz a, double b) {
|
| 143 |
+
return static_cast<double>(a) * b;
|
| 144 |
+
}
|
| 145 |
+
inline C10_HOST_DEVICE double operator/(Float8_e5m2fnuz a, double b)
|
| 146 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 147 |
+
return static_cast<double>(a) / b;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
inline C10_HOST_DEVICE double operator+(double a, Float8_e5m2fnuz b) {
|
| 151 |
+
return a + static_cast<double>(b);
|
| 152 |
+
}
|
| 153 |
+
inline C10_HOST_DEVICE double operator-(double a, Float8_e5m2fnuz b) {
|
| 154 |
+
return a - static_cast<double>(b);
|
| 155 |
+
}
|
| 156 |
+
inline C10_HOST_DEVICE double operator*(double a, Float8_e5m2fnuz b) {
|
| 157 |
+
return a * static_cast<double>(b);
|
| 158 |
+
}
|
| 159 |
+
inline C10_HOST_DEVICE double operator/(double a, Float8_e5m2fnuz b)
|
| 160 |
+
__ubsan_ignore_float_divide_by_zero__ {
|
| 161 |
+
return a / static_cast<double>(b);
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
/// Arithmetic with ints
|
| 165 |
+
|
| 166 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator+(Float8_e5m2fnuz a, int b) {
|
| 167 |
+
return a + static_cast<Float8_e5m2fnuz>(b);
|
| 168 |
+
}
|
| 169 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator-(Float8_e5m2fnuz a, int b) {
|
| 170 |
+
return a - static_cast<Float8_e5m2fnuz>(b);
|
| 171 |
+
}
|
| 172 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator*(Float8_e5m2fnuz a, int b) {
|
| 173 |
+
return a * static_cast<Float8_e5m2fnuz>(b);
|
| 174 |
+
}
|
| 175 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator/(Float8_e5m2fnuz a, int b) {
|
| 176 |
+
return a / static_cast<Float8_e5m2fnuz>(b);
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator+(int a, Float8_e5m2fnuz b) {
|
| 180 |
+
return static_cast<Float8_e5m2fnuz>(a) + b;
|
| 181 |
+
}
|
| 182 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator-(int a, Float8_e5m2fnuz b) {
|
| 183 |
+
return static_cast<Float8_e5m2fnuz>(a) - b;
|
| 184 |
+
}
|
| 185 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator*(int a, Float8_e5m2fnuz b) {
|
| 186 |
+
return static_cast<Float8_e5m2fnuz>(a) * b;
|
| 187 |
+
}
|
| 188 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator/(int a, Float8_e5m2fnuz b) {
|
| 189 |
+
return static_cast<Float8_e5m2fnuz>(a) / b;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
//// Arithmetic with int64_t
|
| 193 |
+
|
| 194 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator+(Float8_e5m2fnuz a, int64_t b) {
|
| 195 |
+
return a + static_cast<Float8_e5m2fnuz>(b);
|
| 196 |
+
}
|
| 197 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator-(Float8_e5m2fnuz a, int64_t b) {
|
| 198 |
+
return a - static_cast<Float8_e5m2fnuz>(b);
|
| 199 |
+
}
|
| 200 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator*(Float8_e5m2fnuz a, int64_t b) {
|
| 201 |
+
return a * static_cast<Float8_e5m2fnuz>(b);
|
| 202 |
+
}
|
| 203 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator/(Float8_e5m2fnuz a, int64_t b) {
|
| 204 |
+
return a / static_cast<Float8_e5m2fnuz>(b);
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator+(int64_t a, Float8_e5m2fnuz b) {
|
| 208 |
+
return static_cast<Float8_e5m2fnuz>(a) + b;
|
| 209 |
+
}
|
| 210 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator-(int64_t a, Float8_e5m2fnuz b) {
|
| 211 |
+
return static_cast<Float8_e5m2fnuz>(a) - b;
|
| 212 |
+
}
|
| 213 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator*(int64_t a, Float8_e5m2fnuz b) {
|
| 214 |
+
return static_cast<Float8_e5m2fnuz>(a) * b;
|
| 215 |
+
}
|
| 216 |
+
inline C10_HOST_DEVICE Float8_e5m2fnuz operator/(int64_t a, Float8_e5m2fnuz b) {
|
| 217 |
+
return static_cast<Float8_e5m2fnuz>(a) / b;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/// NOTE: we do not define comparisons directly and instead rely on the implicit
|
| 221 |
+
/// conversion from c10::Float8_e5m2fnuz to float.
|
| 222 |
+
|
| 223 |
+
} // namespace c10
|
| 224 |
+
|
| 225 |
+
namespace std {
|
| 226 |
+
|
| 227 |
+
template <>
|
| 228 |
+
class numeric_limits<c10::Float8_e5m2fnuz> {
|
| 229 |
+
public:
|
| 230 |
+
static constexpr bool is_signed = true;
|
| 231 |
+
static constexpr bool is_integer = false;
|
| 232 |
+
static constexpr bool is_specialized = true;
|
| 233 |
+
static constexpr bool is_exact = false;
|
| 234 |
+
static constexpr bool has_infinity = false;
|
| 235 |
+
static constexpr bool has_quiet_NaN = true;
|
| 236 |
+
static constexpr bool has_signaling_NaN = false;
|
| 237 |
+
static constexpr auto has_denorm = true;
|
| 238 |
+
static constexpr auto has_denorm_loss = true;
|
| 239 |
+
static constexpr auto round_style = numeric_limits<float>::round_style;
|
| 240 |
+
static constexpr bool is_iec559 = false;
|
| 241 |
+
static constexpr bool is_bounded = true;
|
| 242 |
+
static constexpr bool is_modulo = false;
|
| 243 |
+
static constexpr int digits = 3;
|
| 244 |
+
static constexpr int digits10 = 0;
|
| 245 |
+
static constexpr int max_digits10 = 2;
|
| 246 |
+
static constexpr int radix = 2;
|
| 247 |
+
static constexpr int min_exponent = -14;
|
| 248 |
+
static constexpr int min_exponent10 = -4;
|
| 249 |
+
static constexpr int max_exponent = 16;
|
| 250 |
+
static constexpr int max_exponent10 = 4;
|
| 251 |
+
static constexpr auto traps = numeric_limits<float>::traps;
|
| 252 |
+
static constexpr auto tinyness_before =
|
| 253 |
+
numeric_limits<float>::tinyness_before;
|
| 254 |
+
|
| 255 |
+
static constexpr c10::Float8_e5m2fnuz min() {
|
| 256 |
+
return c10::Float8_e5m2fnuz(0x04, c10::Float8_e5m2fnuz::from_bits());
|
| 257 |
+
}
|
| 258 |
+
static constexpr c10::Float8_e5m2fnuz max() {
|
| 259 |
+
return c10::Float8_e5m2fnuz(0x7F, c10::Float8_e5m2fnuz::from_bits());
|
| 260 |
+
}
|
| 261 |
+
static constexpr c10::Float8_e5m2fnuz lowest() {
|
| 262 |
+
return c10::Float8_e5m2fnuz(0xFF, c10::Float8_e5m2fnuz::from_bits());
|
| 263 |
+
}
|
| 264 |
+
static constexpr c10::Float8_e5m2fnuz epsilon() {
|
| 265 |
+
return c10::Float8_e5m2fnuz(0x34, c10::Float8_e5m2fnuz::from_bits());
|
| 266 |
+
}
|
| 267 |
+
static constexpr c10::Float8_e5m2fnuz round_error() {
|
| 268 |
+
return c10::Float8_e5m2fnuz(0x38, c10::Float8_e5m2fnuz::from_bits());
|
| 269 |
+
}
|
| 270 |
+
static constexpr c10::Float8_e5m2fnuz infinity() {
|
| 271 |
+
return c10::Float8_e5m2fnuz(0x80, c10::Float8_e5m2fnuz::from_bits());
|
| 272 |
+
}
|
| 273 |
+
static constexpr c10::Float8_e5m2fnuz denorm_min() {
|
| 274 |
+
return c10::Float8_e5m2fnuz(0x01, c10::Float8_e5m2fnuz::from_bits());
|
| 275 |
+
}
|
| 276 |
+
};
|
| 277 |
+
|
| 278 |
+
} // namespace std
|
| 279 |
+
|
| 280 |
+
C10_CLANG_DIAGNOSTIC_POP()
|