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/asn1.h +1128 -0
- llava_next/include/openssl/asn1_mac.h +10 -0
- llava_next/include/openssl/async.h +96 -0
- llava_next/include/openssl/cmperr.h +116 -0
- llava_next/include/openssl/core_names.h +556 -0
- llava_next/include/openssl/crmf.h +227 -0
- llava_next/include/openssl/crypto.h +558 -0
- llava_next/include/openssl/cryptoerr_legacy.h +1466 -0
- llava_next/include/openssl/cterr.h +45 -0
- llava_next/include/openssl/decoder.h +133 -0
- llava_next/include/openssl/dtls1.h +57 -0
- llava_next/include/openssl/ebcdic.h +39 -0
- llava_next/include/openssl/ec.h +1569 -0
- llava_next/include/openssl/fips_names.h +60 -0
- llava_next/include/openssl/idea.h +82 -0
- llava_next/include/openssl/kdf.h +138 -0
- llava_next/include/openssl/lhash.h +288 -0
- llava_next/include/openssl/md5.h +62 -0
- llava_next/include/openssl/mdc2.h +55 -0
- llava_next/include/openssl/modes.h +219 -0
- llava_next/include/openssl/objects.h +183 -0
- llava_next/include/openssl/ocsperr.h +53 -0
- llava_next/include/openssl/ossl_typ.h +16 -0
- llava_next/include/openssl/param_build.h +63 -0
- llava_next/include/openssl/pkcs7.h +427 -0
- llava_next/include/openssl/pkcs7err.h +63 -0
- llava_next/include/openssl/prov_ssl.h +34 -0
- llava_next/include/openssl/rsa.h +604 -0
- llava_next/include/openssl/ssl2.h +30 -0
- llava_next/include/openssl/sslerr_legacy.h +468 -0
- llava_next/include/openssl/stack.h +90 -0
- llava_next/include/openssl/whrlpool.h +62 -0
- llava_next/include/openssl/x509_vfy.h +894 -0
- llava_next/include/openssl/x509v3err.h +93 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/ConstantSymNodeImpl.h +104 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/Event.h +137 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/GeneratorImpl.h +110 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/Layout.h +78 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/COW.h +32 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/COWDeleter.h +66 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/FakeGuardImpl.h +102 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/GPUTrace.h +28 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/InlineEvent.h +139 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/PyInterpreter.h +260 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/SizesAndStrides.h +315 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/TorchDispatchModeTLS.h +67 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/VirtualGuardImpl.h +103 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/AbortHandler.h +81 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/BFloat16-math.h +287 -0
- parrot/lib/python3.10/site-packages/torch/include/c10/util/C++17.h +142 -0
llava_next/include/openssl/asn1.h
ADDED
|
@@ -0,0 +1,1128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/asn1.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_ASN1_H
|
| 16 |
+
# define OPENSSL_ASN1_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_ASN1_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <time.h>
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/opensslconf.h>
|
| 27 |
+
# include <openssl/bio.h>
|
| 28 |
+
# include <openssl/safestack.h>
|
| 29 |
+
# include <openssl/asn1err.h>
|
| 30 |
+
# include <openssl/symhacks.h>
|
| 31 |
+
|
| 32 |
+
# include <openssl/types.h>
|
| 33 |
+
# include <openssl/bn.h>
|
| 34 |
+
|
| 35 |
+
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
| 36 |
+
# undef OPENSSL_EXTERN
|
| 37 |
+
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
| 38 |
+
# endif
|
| 39 |
+
|
| 40 |
+
#ifdef __cplusplus
|
| 41 |
+
extern "C" {
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
# define V_ASN1_UNIVERSAL 0x00
|
| 45 |
+
# define V_ASN1_APPLICATION 0x40
|
| 46 |
+
# define V_ASN1_CONTEXT_SPECIFIC 0x80
|
| 47 |
+
# define V_ASN1_PRIVATE 0xc0
|
| 48 |
+
|
| 49 |
+
# define V_ASN1_CONSTRUCTED 0x20
|
| 50 |
+
# define V_ASN1_PRIMITIVE_TAG 0x1f
|
| 51 |
+
# define V_ASN1_PRIMATIVE_TAG /*compat*/ V_ASN1_PRIMITIVE_TAG
|
| 52 |
+
|
| 53 |
+
# define V_ASN1_APP_CHOOSE -2/* let the recipient choose */
|
| 54 |
+
# define V_ASN1_OTHER -3/* used in ASN1_TYPE */
|
| 55 |
+
# define V_ASN1_ANY -4/* used in ASN1 template code */
|
| 56 |
+
|
| 57 |
+
# define V_ASN1_UNDEF -1
|
| 58 |
+
/* ASN.1 tag values */
|
| 59 |
+
# define V_ASN1_EOC 0
|
| 60 |
+
# define V_ASN1_BOOLEAN 1 /**/
|
| 61 |
+
# define V_ASN1_INTEGER 2
|
| 62 |
+
# define V_ASN1_BIT_STRING 3
|
| 63 |
+
# define V_ASN1_OCTET_STRING 4
|
| 64 |
+
# define V_ASN1_NULL 5
|
| 65 |
+
# define V_ASN1_OBJECT 6
|
| 66 |
+
# define V_ASN1_OBJECT_DESCRIPTOR 7
|
| 67 |
+
# define V_ASN1_EXTERNAL 8
|
| 68 |
+
# define V_ASN1_REAL 9
|
| 69 |
+
# define V_ASN1_ENUMERATED 10
|
| 70 |
+
# define V_ASN1_UTF8STRING 12
|
| 71 |
+
# define V_ASN1_SEQUENCE 16
|
| 72 |
+
# define V_ASN1_SET 17
|
| 73 |
+
# define V_ASN1_NUMERICSTRING 18 /**/
|
| 74 |
+
# define V_ASN1_PRINTABLESTRING 19
|
| 75 |
+
# define V_ASN1_T61STRING 20
|
| 76 |
+
# define V_ASN1_TELETEXSTRING 20/* alias */
|
| 77 |
+
# define V_ASN1_VIDEOTEXSTRING 21 /**/
|
| 78 |
+
# define V_ASN1_IA5STRING 22
|
| 79 |
+
# define V_ASN1_UTCTIME 23
|
| 80 |
+
# define V_ASN1_GENERALIZEDTIME 24 /**/
|
| 81 |
+
# define V_ASN1_GRAPHICSTRING 25 /**/
|
| 82 |
+
# define V_ASN1_ISO64STRING 26 /**/
|
| 83 |
+
# define V_ASN1_VISIBLESTRING 26/* alias */
|
| 84 |
+
# define V_ASN1_GENERALSTRING 27 /**/
|
| 85 |
+
# define V_ASN1_UNIVERSALSTRING 28 /**/
|
| 86 |
+
# define V_ASN1_BMPSTRING 30
|
| 87 |
+
|
| 88 |
+
/*
|
| 89 |
+
* NB the constants below are used internally by ASN1_INTEGER
|
| 90 |
+
* and ASN1_ENUMERATED to indicate the sign. They are *not* on
|
| 91 |
+
* the wire tag values.
|
| 92 |
+
*/
|
| 93 |
+
|
| 94 |
+
# define V_ASN1_NEG 0x100
|
| 95 |
+
# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
|
| 96 |
+
# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
|
| 97 |
+
|
| 98 |
+
/* For use with d2i_ASN1_type_bytes() */
|
| 99 |
+
# define B_ASN1_NUMERICSTRING 0x0001
|
| 100 |
+
# define B_ASN1_PRINTABLESTRING 0x0002
|
| 101 |
+
# define B_ASN1_T61STRING 0x0004
|
| 102 |
+
# define B_ASN1_TELETEXSTRING 0x0004
|
| 103 |
+
# define B_ASN1_VIDEOTEXSTRING 0x0008
|
| 104 |
+
# define B_ASN1_IA5STRING 0x0010
|
| 105 |
+
# define B_ASN1_GRAPHICSTRING 0x0020
|
| 106 |
+
# define B_ASN1_ISO64STRING 0x0040
|
| 107 |
+
# define B_ASN1_VISIBLESTRING 0x0040
|
| 108 |
+
# define B_ASN1_GENERALSTRING 0x0080
|
| 109 |
+
# define B_ASN1_UNIVERSALSTRING 0x0100
|
| 110 |
+
# define B_ASN1_OCTET_STRING 0x0200
|
| 111 |
+
# define B_ASN1_BIT_STRING 0x0400
|
| 112 |
+
# define B_ASN1_BMPSTRING 0x0800
|
| 113 |
+
# define B_ASN1_UNKNOWN 0x1000
|
| 114 |
+
# define B_ASN1_UTF8STRING 0x2000
|
| 115 |
+
# define B_ASN1_UTCTIME 0x4000
|
| 116 |
+
# define B_ASN1_GENERALIZEDTIME 0x8000
|
| 117 |
+
# define B_ASN1_SEQUENCE 0x10000
|
| 118 |
+
/* For use with ASN1_mbstring_copy() */
|
| 119 |
+
# define MBSTRING_FLAG 0x1000
|
| 120 |
+
# define MBSTRING_UTF8 (MBSTRING_FLAG)
|
| 121 |
+
# define MBSTRING_ASC (MBSTRING_FLAG|1)
|
| 122 |
+
# define MBSTRING_BMP (MBSTRING_FLAG|2)
|
| 123 |
+
# define MBSTRING_UNIV (MBSTRING_FLAG|4)
|
| 124 |
+
# define SMIME_OLDMIME 0x400
|
| 125 |
+
# define SMIME_CRLFEOL 0x800
|
| 126 |
+
# define SMIME_STREAM 0x1000
|
| 127 |
+
|
| 128 |
+
/* Stacks for types not otherwise defined in this header */
|
| 129 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_ALGOR, X509_ALGOR, X509_ALGOR)
|
| 130 |
+
#define sk_X509_ALGOR_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ALGOR_sk_type(sk))
|
| 131 |
+
#define sk_X509_ALGOR_value(sk, idx) ((X509_ALGOR *)OPENSSL_sk_value(ossl_check_const_X509_ALGOR_sk_type(sk), (idx)))
|
| 132 |
+
#define sk_X509_ALGOR_new(cmp) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new(ossl_check_X509_ALGOR_compfunc_type(cmp)))
|
| 133 |
+
#define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_null())
|
| 134 |
+
#define sk_X509_ALGOR_new_reserve(cmp, n) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_reserve(ossl_check_X509_ALGOR_compfunc_type(cmp), (n)))
|
| 135 |
+
#define sk_X509_ALGOR_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ALGOR_sk_type(sk), (n))
|
| 136 |
+
#define sk_X509_ALGOR_free(sk) OPENSSL_sk_free(ossl_check_X509_ALGOR_sk_type(sk))
|
| 137 |
+
#define sk_X509_ALGOR_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ALGOR_sk_type(sk))
|
| 138 |
+
#define sk_X509_ALGOR_delete(sk, i) ((X509_ALGOR *)OPENSSL_sk_delete(ossl_check_X509_ALGOR_sk_type(sk), (i)))
|
| 139 |
+
#define sk_X509_ALGOR_delete_ptr(sk, ptr) ((X509_ALGOR *)OPENSSL_sk_delete_ptr(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)))
|
| 140 |
+
#define sk_X509_ALGOR_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 141 |
+
#define sk_X509_ALGOR_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 142 |
+
#define sk_X509_ALGOR_pop(sk) ((X509_ALGOR *)OPENSSL_sk_pop(ossl_check_X509_ALGOR_sk_type(sk)))
|
| 143 |
+
#define sk_X509_ALGOR_shift(sk) ((X509_ALGOR *)OPENSSL_sk_shift(ossl_check_X509_ALGOR_sk_type(sk)))
|
| 144 |
+
#define sk_X509_ALGOR_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ALGOR_sk_type(sk),ossl_check_X509_ALGOR_freefunc_type(freefunc))
|
| 145 |
+
#define sk_X509_ALGOR_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), (idx))
|
| 146 |
+
#define sk_X509_ALGOR_set(sk, idx, ptr) ((X509_ALGOR *)OPENSSL_sk_set(ossl_check_X509_ALGOR_sk_type(sk), (idx), ossl_check_X509_ALGOR_type(ptr)))
|
| 147 |
+
#define sk_X509_ALGOR_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 148 |
+
#define sk_X509_ALGOR_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 149 |
+
#define sk_X509_ALGOR_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), pnum)
|
| 150 |
+
#define sk_X509_ALGOR_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ALGOR_sk_type(sk))
|
| 151 |
+
#define sk_X509_ALGOR_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ALGOR_sk_type(sk))
|
| 152 |
+
#define sk_X509_ALGOR_dup(sk) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_dup(ossl_check_const_X509_ALGOR_sk_type(sk)))
|
| 153 |
+
#define sk_X509_ALGOR_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_copyfunc_type(copyfunc), ossl_check_X509_ALGOR_freefunc_type(freefunc)))
|
| 154 |
+
#define sk_X509_ALGOR_set_cmp_func(sk, cmp) ((sk_X509_ALGOR_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_compfunc_type(cmp)))
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
|
| 159 |
+
/*
|
| 160 |
+
* This indicates that the ASN1_STRING is not a real value but just a place
|
| 161 |
+
* holder for the location where indefinite length constructed data should be
|
| 162 |
+
* inserted in the memory buffer
|
| 163 |
+
*/
|
| 164 |
+
# define ASN1_STRING_FLAG_NDEF 0x010
|
| 165 |
+
|
| 166 |
+
/*
|
| 167 |
+
* This flag is used by the CMS code to indicate that a string is not
|
| 168 |
+
* complete and is a place holder for content when it had all been accessed.
|
| 169 |
+
* The flag will be reset when content has been written to it.
|
| 170 |
+
*/
|
| 171 |
+
|
| 172 |
+
# define ASN1_STRING_FLAG_CONT 0x020
|
| 173 |
+
/*
|
| 174 |
+
* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
|
| 175 |
+
* type.
|
| 176 |
+
*/
|
| 177 |
+
# define ASN1_STRING_FLAG_MSTRING 0x040
|
| 178 |
+
/* String is embedded and only content should be freed */
|
| 179 |
+
# define ASN1_STRING_FLAG_EMBED 0x080
|
| 180 |
+
/* String should be parsed in RFC 5280's time format */
|
| 181 |
+
# define ASN1_STRING_FLAG_X509_TIME 0x100
|
| 182 |
+
/* This is the base type that holds just about everything :-) */
|
| 183 |
+
struct asn1_string_st {
|
| 184 |
+
int length;
|
| 185 |
+
int type;
|
| 186 |
+
unsigned char *data;
|
| 187 |
+
/*
|
| 188 |
+
* The value of the following field depends on the type being held. It
|
| 189 |
+
* is mostly being used for BIT_STRING so if the input data has a
|
| 190 |
+
* non-zero 'unused bits' value, it will be handled correctly
|
| 191 |
+
*/
|
| 192 |
+
long flags;
|
| 193 |
+
};
|
| 194 |
+
|
| 195 |
+
/*
|
| 196 |
+
* ASN1_ENCODING structure: this is used to save the received encoding of an
|
| 197 |
+
* ASN1 type. This is useful to get round problems with invalid encodings
|
| 198 |
+
* which can break signatures.
|
| 199 |
+
*/
|
| 200 |
+
|
| 201 |
+
typedef struct ASN1_ENCODING_st {
|
| 202 |
+
unsigned char *enc; /* DER encoding */
|
| 203 |
+
long len; /* Length of encoding */
|
| 204 |
+
int modified; /* set to 1 if 'enc' is invalid */
|
| 205 |
+
} ASN1_ENCODING;
|
| 206 |
+
|
| 207 |
+
/* Used with ASN1 LONG type: if a long is set to this it is omitted */
|
| 208 |
+
# define ASN1_LONG_UNDEF 0x7fffffffL
|
| 209 |
+
|
| 210 |
+
# define STABLE_FLAGS_MALLOC 0x01
|
| 211 |
+
/*
|
| 212 |
+
* A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted
|
| 213 |
+
* as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting
|
| 214 |
+
* STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias
|
| 215 |
+
* STABLE_FLAGS_CLEAR to reflect this.
|
| 216 |
+
*/
|
| 217 |
+
# define STABLE_FLAGS_CLEAR STABLE_FLAGS_MALLOC
|
| 218 |
+
# define STABLE_NO_MASK 0x02
|
| 219 |
+
# define DIRSTRING_TYPE \
|
| 220 |
+
(B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
|
| 221 |
+
# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
|
| 222 |
+
|
| 223 |
+
struct asn1_string_table_st {
|
| 224 |
+
int nid;
|
| 225 |
+
long minsize;
|
| 226 |
+
long maxsize;
|
| 227 |
+
unsigned long mask;
|
| 228 |
+
unsigned long flags;
|
| 229 |
+
};
|
| 230 |
+
|
| 231 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING_TABLE, ASN1_STRING_TABLE, ASN1_STRING_TABLE)
|
| 232 |
+
#define sk_ASN1_STRING_TABLE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
| 233 |
+
#define sk_ASN1_STRING_TABLE_value(sk, idx) ((ASN1_STRING_TABLE *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), (idx)))
|
| 234 |
+
#define sk_ASN1_STRING_TABLE_new(cmp) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)))
|
| 235 |
+
#define sk_ASN1_STRING_TABLE_new_null() ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_null())
|
| 236 |
+
#define sk_ASN1_STRING_TABLE_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp), (n)))
|
| 237 |
+
#define sk_ASN1_STRING_TABLE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (n))
|
| 238 |
+
#define sk_ASN1_STRING_TABLE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 239 |
+
#define sk_ASN1_STRING_TABLE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 240 |
+
#define sk_ASN1_STRING_TABLE_delete(sk, i) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (i)))
|
| 241 |
+
#define sk_ASN1_STRING_TABLE_delete_ptr(sk, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
| 242 |
+
#define sk_ASN1_STRING_TABLE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 243 |
+
#define sk_ASN1_STRING_TABLE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 244 |
+
#define sk_ASN1_STRING_TABLE_pop(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
| 245 |
+
#define sk_ASN1_STRING_TABLE_shift(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
| 246 |
+
#define sk_ASN1_STRING_TABLE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk),ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc))
|
| 247 |
+
#define sk_ASN1_STRING_TABLE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), (idx))
|
| 248 |
+
#define sk_ASN1_STRING_TABLE_set(sk, idx, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_set(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (idx), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
| 249 |
+
#define sk_ASN1_STRING_TABLE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 250 |
+
#define sk_ASN1_STRING_TABLE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 251 |
+
#define sk_ASN1_STRING_TABLE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), pnum)
|
| 252 |
+
#define sk_ASN1_STRING_TABLE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 253 |
+
#define sk_ASN1_STRING_TABLE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
| 254 |
+
#define sk_ASN1_STRING_TABLE_dup(sk) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)))
|
| 255 |
+
#define sk_ASN1_STRING_TABLE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc)))
|
| 256 |
+
#define sk_ASN1_STRING_TABLE_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_TABLE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)))
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
/* size limits: this stuff is taken straight from RFC2459 */
|
| 260 |
+
|
| 261 |
+
# define ub_name 32768
|
| 262 |
+
# define ub_common_name 64
|
| 263 |
+
# define ub_locality_name 128
|
| 264 |
+
# define ub_state_name 128
|
| 265 |
+
# define ub_organization_name 64
|
| 266 |
+
# define ub_organization_unit_name 64
|
| 267 |
+
# define ub_title 64
|
| 268 |
+
# define ub_email_address 128
|
| 269 |
+
|
| 270 |
+
/*
|
| 271 |
+
* Declarations for template structures: for full definitions see asn1t.h
|
| 272 |
+
*/
|
| 273 |
+
typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
|
| 274 |
+
typedef struct ASN1_TLC_st ASN1_TLC;
|
| 275 |
+
/* This is just an opaque pointer */
|
| 276 |
+
typedef struct ASN1_VALUE_st ASN1_VALUE;
|
| 277 |
+
|
| 278 |
+
/* Declare ASN1 functions: the implement macro in in asn1t.h */
|
| 279 |
+
|
| 280 |
+
/*
|
| 281 |
+
* The mysterious 'extern' that's passed to some macros is innocuous,
|
| 282 |
+
* and is there to quiet pre-C99 compilers that may complain about empty
|
| 283 |
+
* arguments in macro calls.
|
| 284 |
+
*/
|
| 285 |
+
|
| 286 |
+
# define DECLARE_ASN1_FUNCTIONS_attr(attr, type) \
|
| 287 |
+
DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, type)
|
| 288 |
+
# define DECLARE_ASN1_FUNCTIONS(type) \
|
| 289 |
+
DECLARE_ASN1_FUNCTIONS_attr(extern, type)
|
| 290 |
+
|
| 291 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_attr(attr, type) \
|
| 292 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, type)
|
| 293 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
|
| 294 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_attr(extern, type)
|
| 295 |
+
|
| 296 |
+
# define DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, name) \
|
| 297 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
| 298 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name)
|
| 299 |
+
# define DECLARE_ASN1_FUNCTIONS_name(type, name) \
|
| 300 |
+
DECLARE_ASN1_FUNCTIONS_name_attr(extern, type, name)
|
| 301 |
+
|
| 302 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, itname, name) \
|
| 303 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
| 304 |
+
DECLARE_ASN1_ITEM_attr(attr, itname)
|
| 305 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
|
| 306 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(extern, type, itname, name)
|
| 307 |
+
|
| 308 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) \
|
| 309 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, name, name)
|
| 310 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_name(type, name) \
|
| 311 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, type, name)
|
| 312 |
+
|
| 313 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
| 314 |
+
attr type *d2i_##name(type **a, const unsigned char **in, long len); \
|
| 315 |
+
attr int i2d_##name(const type *a, unsigned char **out);
|
| 316 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_only(type, name) \
|
| 317 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(extern, type, name)
|
| 318 |
+
|
| 319 |
+
# define DECLARE_ASN1_NDEF_FUNCTION_attr(attr, name) \
|
| 320 |
+
attr int i2d_##name##_NDEF(const name *a, unsigned char **out);
|
| 321 |
+
# define DECLARE_ASN1_NDEF_FUNCTION(name) \
|
| 322 |
+
DECLARE_ASN1_NDEF_FUNCTION_attr(extern, name)
|
| 323 |
+
|
| 324 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
| 325 |
+
attr type *name##_new(void); \
|
| 326 |
+
attr void name##_free(type *a);
|
| 327 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
| 328 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(extern, type, name)
|
| 329 |
+
|
| 330 |
+
# define DECLARE_ASN1_DUP_FUNCTION_attr(attr, type) \
|
| 331 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, type)
|
| 332 |
+
# define DECLARE_ASN1_DUP_FUNCTION(type) \
|
| 333 |
+
DECLARE_ASN1_DUP_FUNCTION_attr(extern, type)
|
| 334 |
+
|
| 335 |
+
# define DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, name) \
|
| 336 |
+
attr type *name##_dup(const type *a);
|
| 337 |
+
# define DECLARE_ASN1_DUP_FUNCTION_name(type, name) \
|
| 338 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(extern, type, name)
|
| 339 |
+
|
| 340 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_attr(attr, stname) \
|
| 341 |
+
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, stname)
|
| 342 |
+
# define DECLARE_ASN1_PRINT_FUNCTION(stname) \
|
| 343 |
+
DECLARE_ASN1_PRINT_FUNCTION_attr(extern, stname)
|
| 344 |
+
|
| 345 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, fname) \
|
| 346 |
+
attr int fname##_print_ctx(BIO *out, const stname *x, int indent, \
|
| 347 |
+
const ASN1_PCTX *pctx);
|
| 348 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
|
| 349 |
+
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(extern, stname, fname)
|
| 350 |
+
|
| 351 |
+
# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
|
| 352 |
+
# define I2D_OF(type) int (*)(const type *,unsigned char **)
|
| 353 |
+
|
| 354 |
+
# define CHECKED_D2I_OF(type, d2i) \
|
| 355 |
+
((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
|
| 356 |
+
# define CHECKED_I2D_OF(type, i2d) \
|
| 357 |
+
((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
|
| 358 |
+
# define CHECKED_NEW_OF(type, xnew) \
|
| 359 |
+
((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
|
| 360 |
+
# define CHECKED_PTR_OF(type, p) \
|
| 361 |
+
((void*) (1 ? p : (type*)0))
|
| 362 |
+
# define CHECKED_PPTR_OF(type, p) \
|
| 363 |
+
((void**) (1 ? p : (type**)0))
|
| 364 |
+
|
| 365 |
+
# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
|
| 366 |
+
# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *,unsigned char **)
|
| 367 |
+
# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
|
| 368 |
+
|
| 369 |
+
typedef void *d2i_of_void(void **, const unsigned char **, long);
|
| 370 |
+
typedef int i2d_of_void(const void *, unsigned char **);
|
| 371 |
+
|
| 372 |
+
/*-
|
| 373 |
+
* The following macros and typedefs allow an ASN1_ITEM
|
| 374 |
+
* to be embedded in a structure and referenced. Since
|
| 375 |
+
* the ASN1_ITEM pointers need to be globally accessible
|
| 376 |
+
* (possibly from shared libraries) they may exist in
|
| 377 |
+
* different forms. On platforms that support it the
|
| 378 |
+
* ASN1_ITEM structure itself will be globally exported.
|
| 379 |
+
* Other platforms will export a function that returns
|
| 380 |
+
* an ASN1_ITEM pointer.
|
| 381 |
+
*
|
| 382 |
+
* To handle both cases transparently the macros below
|
| 383 |
+
* should be used instead of hard coding an ASN1_ITEM
|
| 384 |
+
* pointer in a structure.
|
| 385 |
+
*
|
| 386 |
+
* The structure will look like this:
|
| 387 |
+
*
|
| 388 |
+
* typedef struct SOMETHING_st {
|
| 389 |
+
* ...
|
| 390 |
+
* ASN1_ITEM_EXP *iptr;
|
| 391 |
+
* ...
|
| 392 |
+
* } SOMETHING;
|
| 393 |
+
*
|
| 394 |
+
* It would be initialised as e.g.:
|
| 395 |
+
*
|
| 396 |
+
* SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
|
| 397 |
+
*
|
| 398 |
+
* and the actual pointer extracted with:
|
| 399 |
+
*
|
| 400 |
+
* const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
|
| 401 |
+
*
|
| 402 |
+
* Finally an ASN1_ITEM pointer can be extracted from an
|
| 403 |
+
* appropriate reference with: ASN1_ITEM_rptr(X509). This
|
| 404 |
+
* would be used when a function takes an ASN1_ITEM * argument.
|
| 405 |
+
*
|
| 406 |
+
*/
|
| 407 |
+
|
| 408 |
+
|
| 409 |
+
/*
|
| 410 |
+
* Platforms that can't easily handle shared global variables are declared as
|
| 411 |
+
* functions returning ASN1_ITEM pointers.
|
| 412 |
+
*/
|
| 413 |
+
|
| 414 |
+
/* ASN1_ITEM pointer exported type */
|
| 415 |
+
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
| 416 |
+
|
| 417 |
+
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
| 418 |
+
# define ASN1_ITEM_ptr(iptr) (iptr())
|
| 419 |
+
|
| 420 |
+
/* Macro to include ASN1_ITEM pointer from base type */
|
| 421 |
+
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
| 422 |
+
|
| 423 |
+
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
| 424 |
+
|
| 425 |
+
# define DECLARE_ASN1_ITEM_attr(attr, name) \
|
| 426 |
+
attr const ASN1_ITEM * name##_it(void);
|
| 427 |
+
# define DECLARE_ASN1_ITEM(name) \
|
| 428 |
+
DECLARE_ASN1_ITEM_attr(extern, name)
|
| 429 |
+
|
| 430 |
+
/* Parameters used by ASN1_STRING_print_ex() */
|
| 431 |
+
|
| 432 |
+
/*
|
| 433 |
+
* These determine which characters to escape: RFC2253 special characters,
|
| 434 |
+
* control characters and MSB set characters
|
| 435 |
+
*/
|
| 436 |
+
|
| 437 |
+
# define ASN1_STRFLGS_ESC_2253 1
|
| 438 |
+
# define ASN1_STRFLGS_ESC_CTRL 2
|
| 439 |
+
# define ASN1_STRFLGS_ESC_MSB 4
|
| 440 |
+
|
| 441 |
+
/* Lower 8 bits are reserved as an output type specifier */
|
| 442 |
+
# define ASN1_DTFLGS_TYPE_MASK 0x0FUL
|
| 443 |
+
# define ASN1_DTFLGS_RFC822 0x00UL
|
| 444 |
+
# define ASN1_DTFLGS_ISO8601 0x01UL
|
| 445 |
+
|
| 446 |
+
/*
|
| 447 |
+
* This flag determines how we do escaping: normally RC2253 backslash only,
|
| 448 |
+
* set this to use backslash and quote.
|
| 449 |
+
*/
|
| 450 |
+
|
| 451 |
+
# define ASN1_STRFLGS_ESC_QUOTE 8
|
| 452 |
+
|
| 453 |
+
/* These three flags are internal use only. */
|
| 454 |
+
|
| 455 |
+
/* Character is a valid PrintableString character */
|
| 456 |
+
# define CHARTYPE_PRINTABLESTRING 0x10
|
| 457 |
+
/* Character needs escaping if it is the first character */
|
| 458 |
+
# define CHARTYPE_FIRST_ESC_2253 0x20
|
| 459 |
+
/* Character needs escaping if it is the last character */
|
| 460 |
+
# define CHARTYPE_LAST_ESC_2253 0x40
|
| 461 |
+
|
| 462 |
+
/*
|
| 463 |
+
* NB the internal flags are safely reused below by flags handled at the top
|
| 464 |
+
* level.
|
| 465 |
+
*/
|
| 466 |
+
|
| 467 |
+
/*
|
| 468 |
+
* If this is set we convert all character strings to UTF8 first
|
| 469 |
+
*/
|
| 470 |
+
|
| 471 |
+
# define ASN1_STRFLGS_UTF8_CONVERT 0x10
|
| 472 |
+
|
| 473 |
+
/*
|
| 474 |
+
* If this is set we don't attempt to interpret content: just assume all
|
| 475 |
+
* strings are 1 byte per character. This will produce some pretty odd
|
| 476 |
+
* looking output!
|
| 477 |
+
*/
|
| 478 |
+
|
| 479 |
+
# define ASN1_STRFLGS_IGNORE_TYPE 0x20
|
| 480 |
+
|
| 481 |
+
/* If this is set we include the string type in the output */
|
| 482 |
+
# define ASN1_STRFLGS_SHOW_TYPE 0x40
|
| 483 |
+
|
| 484 |
+
/*
|
| 485 |
+
* This determines which strings to display and which to 'dump' (hex dump of
|
| 486 |
+
* content octets or DER encoding). We can only dump non character strings or
|
| 487 |
+
* everything. If we don't dump 'unknown' they are interpreted as character
|
| 488 |
+
* strings with 1 octet per character and are subject to the usual escaping
|
| 489 |
+
* options.
|
| 490 |
+
*/
|
| 491 |
+
|
| 492 |
+
# define ASN1_STRFLGS_DUMP_ALL 0x80
|
| 493 |
+
# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
|
| 494 |
+
|
| 495 |
+
/*
|
| 496 |
+
* These determine what 'dumping' does, we can dump the content octets or the
|
| 497 |
+
* DER encoding: both use the RFC2253 #XXXXX notation.
|
| 498 |
+
*/
|
| 499 |
+
|
| 500 |
+
# define ASN1_STRFLGS_DUMP_DER 0x200
|
| 501 |
+
|
| 502 |
+
/*
|
| 503 |
+
* This flag specifies that RC2254 escaping shall be performed.
|
| 504 |
+
*/
|
| 505 |
+
#define ASN1_STRFLGS_ESC_2254 0x400
|
| 506 |
+
|
| 507 |
+
/*
|
| 508 |
+
* All the string flags consistent with RFC2253, escaping control characters
|
| 509 |
+
* isn't essential in RFC2253 but it is advisable anyway.
|
| 510 |
+
*/
|
| 511 |
+
|
| 512 |
+
# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
|
| 513 |
+
ASN1_STRFLGS_ESC_CTRL | \
|
| 514 |
+
ASN1_STRFLGS_ESC_MSB | \
|
| 515 |
+
ASN1_STRFLGS_UTF8_CONVERT | \
|
| 516 |
+
ASN1_STRFLGS_DUMP_UNKNOWN | \
|
| 517 |
+
ASN1_STRFLGS_DUMP_DER)
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
struct asn1_type_st {
|
| 521 |
+
int type;
|
| 522 |
+
union {
|
| 523 |
+
char *ptr;
|
| 524 |
+
ASN1_BOOLEAN boolean;
|
| 525 |
+
ASN1_STRING *asn1_string;
|
| 526 |
+
ASN1_OBJECT *object;
|
| 527 |
+
ASN1_INTEGER *integer;
|
| 528 |
+
ASN1_ENUMERATED *enumerated;
|
| 529 |
+
ASN1_BIT_STRING *bit_string;
|
| 530 |
+
ASN1_OCTET_STRING *octet_string;
|
| 531 |
+
ASN1_PRINTABLESTRING *printablestring;
|
| 532 |
+
ASN1_T61STRING *t61string;
|
| 533 |
+
ASN1_IA5STRING *ia5string;
|
| 534 |
+
ASN1_GENERALSTRING *generalstring;
|
| 535 |
+
ASN1_BMPSTRING *bmpstring;
|
| 536 |
+
ASN1_UNIVERSALSTRING *universalstring;
|
| 537 |
+
ASN1_UTCTIME *utctime;
|
| 538 |
+
ASN1_GENERALIZEDTIME *generalizedtime;
|
| 539 |
+
ASN1_VISIBLESTRING *visiblestring;
|
| 540 |
+
ASN1_UTF8STRING *utf8string;
|
| 541 |
+
/*
|
| 542 |
+
* set and sequence are left complete and still contain the set or
|
| 543 |
+
* sequence bytes
|
| 544 |
+
*/
|
| 545 |
+
ASN1_STRING *set;
|
| 546 |
+
ASN1_STRING *sequence;
|
| 547 |
+
ASN1_VALUE *asn1_value;
|
| 548 |
+
} value;
|
| 549 |
+
};
|
| 550 |
+
|
| 551 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_TYPE, ASN1_TYPE, ASN1_TYPE)
|
| 552 |
+
#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
| 553 |
+
#define sk_ASN1_TYPE_value(sk, idx) ((ASN1_TYPE *)OPENSSL_sk_value(ossl_check_const_ASN1_TYPE_sk_type(sk), (idx)))
|
| 554 |
+
#define sk_ASN1_TYPE_new(cmp) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new(ossl_check_ASN1_TYPE_compfunc_type(cmp)))
|
| 555 |
+
#define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_null())
|
| 556 |
+
#define sk_ASN1_TYPE_new_reserve(cmp, n) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_TYPE_compfunc_type(cmp), (n)))
|
| 557 |
+
#define sk_ASN1_TYPE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_TYPE_sk_type(sk), (n))
|
| 558 |
+
#define sk_ASN1_TYPE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 559 |
+
#define sk_ASN1_TYPE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 560 |
+
#define sk_ASN1_TYPE_delete(sk, i) ((ASN1_TYPE *)OPENSSL_sk_delete(ossl_check_ASN1_TYPE_sk_type(sk), (i)))
|
| 561 |
+
#define sk_ASN1_TYPE_delete_ptr(sk, ptr) ((ASN1_TYPE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)))
|
| 562 |
+
#define sk_ASN1_TYPE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 563 |
+
#define sk_ASN1_TYPE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 564 |
+
#define sk_ASN1_TYPE_pop(sk) ((ASN1_TYPE *)OPENSSL_sk_pop(ossl_check_ASN1_TYPE_sk_type(sk)))
|
| 565 |
+
#define sk_ASN1_TYPE_shift(sk) ((ASN1_TYPE *)OPENSSL_sk_shift(ossl_check_ASN1_TYPE_sk_type(sk)))
|
| 566 |
+
#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk),ossl_check_ASN1_TYPE_freefunc_type(freefunc))
|
| 567 |
+
#define sk_ASN1_TYPE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), (idx))
|
| 568 |
+
#define sk_ASN1_TYPE_set(sk, idx, ptr) ((ASN1_TYPE *)OPENSSL_sk_set(ossl_check_ASN1_TYPE_sk_type(sk), (idx), ossl_check_ASN1_TYPE_type(ptr)))
|
| 569 |
+
#define sk_ASN1_TYPE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 570 |
+
#define sk_ASN1_TYPE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 571 |
+
#define sk_ASN1_TYPE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), pnum)
|
| 572 |
+
#define sk_ASN1_TYPE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 573 |
+
#define sk_ASN1_TYPE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
| 574 |
+
#define sk_ASN1_TYPE_dup(sk) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_TYPE_sk_type(sk)))
|
| 575 |
+
#define sk_ASN1_TYPE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_copyfunc_type(copyfunc), ossl_check_ASN1_TYPE_freefunc_type(freefunc)))
|
| 576 |
+
#define sk_ASN1_TYPE_set_cmp_func(sk, cmp) ((sk_ASN1_TYPE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_compfunc_type(cmp)))
|
| 577 |
+
|
| 578 |
+
|
| 579 |
+
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
|
| 580 |
+
|
| 581 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
|
| 582 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
|
| 583 |
+
|
| 584 |
+
/* This is used to contain a list of bit names */
|
| 585 |
+
typedef struct BIT_STRING_BITNAME_st {
|
| 586 |
+
int bitnum;
|
| 587 |
+
const char *lname;
|
| 588 |
+
const char *sname;
|
| 589 |
+
} BIT_STRING_BITNAME;
|
| 590 |
+
|
| 591 |
+
# define B_ASN1_TIME \
|
| 592 |
+
B_ASN1_UTCTIME | \
|
| 593 |
+
B_ASN1_GENERALIZEDTIME
|
| 594 |
+
|
| 595 |
+
# define B_ASN1_PRINTABLE \
|
| 596 |
+
B_ASN1_NUMERICSTRING| \
|
| 597 |
+
B_ASN1_PRINTABLESTRING| \
|
| 598 |
+
B_ASN1_T61STRING| \
|
| 599 |
+
B_ASN1_IA5STRING| \
|
| 600 |
+
B_ASN1_BIT_STRING| \
|
| 601 |
+
B_ASN1_UNIVERSALSTRING|\
|
| 602 |
+
B_ASN1_BMPSTRING|\
|
| 603 |
+
B_ASN1_UTF8STRING|\
|
| 604 |
+
B_ASN1_SEQUENCE|\
|
| 605 |
+
B_ASN1_UNKNOWN
|
| 606 |
+
|
| 607 |
+
# define B_ASN1_DIRECTORYSTRING \
|
| 608 |
+
B_ASN1_PRINTABLESTRING| \
|
| 609 |
+
B_ASN1_TELETEXSTRING|\
|
| 610 |
+
B_ASN1_BMPSTRING|\
|
| 611 |
+
B_ASN1_UNIVERSALSTRING|\
|
| 612 |
+
B_ASN1_UTF8STRING
|
| 613 |
+
|
| 614 |
+
# define B_ASN1_DISPLAYTEXT \
|
| 615 |
+
B_ASN1_IA5STRING| \
|
| 616 |
+
B_ASN1_VISIBLESTRING| \
|
| 617 |
+
B_ASN1_BMPSTRING|\
|
| 618 |
+
B_ASN1_UTF8STRING
|
| 619 |
+
|
| 620 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name(ASN1_TYPE, ASN1_TYPE)
|
| 621 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
|
| 622 |
+
|
| 623 |
+
int ASN1_TYPE_get(const ASN1_TYPE *a);
|
| 624 |
+
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
|
| 625 |
+
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
|
| 626 |
+
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
|
| 627 |
+
|
| 628 |
+
ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t);
|
| 629 |
+
void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
|
| 630 |
+
|
| 631 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_OBJECT, ASN1_OBJECT, ASN1_OBJECT)
|
| 632 |
+
#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
| 633 |
+
#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
|
| 634 |
+
#define sk_ASN1_OBJECT_new(cmp) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new(ossl_check_ASN1_OBJECT_compfunc_type(cmp)))
|
| 635 |
+
#define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_null())
|
| 636 |
+
#define sk_ASN1_OBJECT_new_reserve(cmp, n) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_OBJECT_compfunc_type(cmp), (n)))
|
| 637 |
+
#define sk_ASN1_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_OBJECT_sk_type(sk), (n))
|
| 638 |
+
#define sk_ASN1_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 639 |
+
#define sk_ASN1_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 640 |
+
#define sk_ASN1_OBJECT_delete(sk, i) ((ASN1_OBJECT *)OPENSSL_sk_delete(ossl_check_ASN1_OBJECT_sk_type(sk), (i)))
|
| 641 |
+
#define sk_ASN1_OBJECT_delete_ptr(sk, ptr) ((ASN1_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)))
|
| 642 |
+
#define sk_ASN1_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 643 |
+
#define sk_ASN1_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 644 |
+
#define sk_ASN1_OBJECT_pop(sk) ((ASN1_OBJECT *)OPENSSL_sk_pop(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
| 645 |
+
#define sk_ASN1_OBJECT_shift(sk) ((ASN1_OBJECT *)OPENSSL_sk_shift(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
| 646 |
+
#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk),ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
|
| 647 |
+
#define sk_ASN1_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), (idx))
|
| 648 |
+
#define sk_ASN1_OBJECT_set(sk, idx, ptr) ((ASN1_OBJECT *)OPENSSL_sk_set(ossl_check_ASN1_OBJECT_sk_type(sk), (idx), ossl_check_ASN1_OBJECT_type(ptr)))
|
| 649 |
+
#define sk_ASN1_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 650 |
+
#define sk_ASN1_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 651 |
+
#define sk_ASN1_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), pnum)
|
| 652 |
+
#define sk_ASN1_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 653 |
+
#define sk_ASN1_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
| 654 |
+
#define sk_ASN1_OBJECT_dup(sk) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_ASN1_OBJECT_sk_type(sk)))
|
| 655 |
+
#define sk_ASN1_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_copyfunc_type(copyfunc), ossl_check_ASN1_OBJECT_freefunc_type(freefunc)))
|
| 656 |
+
#define sk_ASN1_OBJECT_set_cmp_func(sk, cmp) ((sk_ASN1_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_compfunc_type(cmp)))
|
| 657 |
+
|
| 658 |
+
|
| 659 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
|
| 660 |
+
|
| 661 |
+
ASN1_STRING *ASN1_STRING_new(void);
|
| 662 |
+
void ASN1_STRING_free(ASN1_STRING *a);
|
| 663 |
+
void ASN1_STRING_clear_free(ASN1_STRING *a);
|
| 664 |
+
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
|
| 665 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING)
|
| 666 |
+
ASN1_STRING *ASN1_STRING_type_new(int type);
|
| 667 |
+
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
|
| 668 |
+
/*
|
| 669 |
+
* Since this is used to store all sorts of things, via macros, for now,
|
| 670 |
+
* make its data void *
|
| 671 |
+
*/
|
| 672 |
+
int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
|
| 673 |
+
void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
|
| 674 |
+
int ASN1_STRING_length(const ASN1_STRING *x);
|
| 675 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 676 |
+
OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
|
| 677 |
+
# endif
|
| 678 |
+
int ASN1_STRING_type(const ASN1_STRING *x);
|
| 679 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 680 |
+
OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
|
| 681 |
+
# endif
|
| 682 |
+
const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
|
| 683 |
+
|
| 684 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
|
| 685 |
+
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
|
| 686 |
+
int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
|
| 687 |
+
int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
|
| 688 |
+
int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
|
| 689 |
+
const unsigned char *flags, int flags_len);
|
| 690 |
+
|
| 691 |
+
int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
|
| 692 |
+
BIT_STRING_BITNAME *tbl, int indent);
|
| 693 |
+
int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
|
| 694 |
+
int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
|
| 695 |
+
BIT_STRING_BITNAME *tbl);
|
| 696 |
+
|
| 697 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_INTEGER, ASN1_INTEGER, ASN1_INTEGER)
|
| 698 |
+
#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
| 699 |
+
#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
|
| 700 |
+
#define sk_ASN1_INTEGER_new(cmp) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new(ossl_check_ASN1_INTEGER_compfunc_type(cmp)))
|
| 701 |
+
#define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_null())
|
| 702 |
+
#define sk_ASN1_INTEGER_new_reserve(cmp, n) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_INTEGER_compfunc_type(cmp), (n)))
|
| 703 |
+
#define sk_ASN1_INTEGER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_INTEGER_sk_type(sk), (n))
|
| 704 |
+
#define sk_ASN1_INTEGER_free(sk) OPENSSL_sk_free(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 705 |
+
#define sk_ASN1_INTEGER_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 706 |
+
#define sk_ASN1_INTEGER_delete(sk, i) ((ASN1_INTEGER *)OPENSSL_sk_delete(ossl_check_ASN1_INTEGER_sk_type(sk), (i)))
|
| 707 |
+
#define sk_ASN1_INTEGER_delete_ptr(sk, ptr) ((ASN1_INTEGER *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)))
|
| 708 |
+
#define sk_ASN1_INTEGER_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 709 |
+
#define sk_ASN1_INTEGER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 710 |
+
#define sk_ASN1_INTEGER_pop(sk) ((ASN1_INTEGER *)OPENSSL_sk_pop(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
| 711 |
+
#define sk_ASN1_INTEGER_shift(sk) ((ASN1_INTEGER *)OPENSSL_sk_shift(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
| 712 |
+
#define sk_ASN1_INTEGER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_INTEGER_sk_type(sk),ossl_check_ASN1_INTEGER_freefunc_type(freefunc))
|
| 713 |
+
#define sk_ASN1_INTEGER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), (idx))
|
| 714 |
+
#define sk_ASN1_INTEGER_set(sk, idx, ptr) ((ASN1_INTEGER *)OPENSSL_sk_set(ossl_check_ASN1_INTEGER_sk_type(sk), (idx), ossl_check_ASN1_INTEGER_type(ptr)))
|
| 715 |
+
#define sk_ASN1_INTEGER_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 716 |
+
#define sk_ASN1_INTEGER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 717 |
+
#define sk_ASN1_INTEGER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), pnum)
|
| 718 |
+
#define sk_ASN1_INTEGER_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 719 |
+
#define sk_ASN1_INTEGER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
| 720 |
+
#define sk_ASN1_INTEGER_dup(sk) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_dup(ossl_check_const_ASN1_INTEGER_sk_type(sk)))
|
| 721 |
+
#define sk_ASN1_INTEGER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_copyfunc_type(copyfunc), ossl_check_ASN1_INTEGER_freefunc_type(freefunc)))
|
| 722 |
+
#define sk_ASN1_INTEGER_set_cmp_func(sk, cmp) ((sk_ASN1_INTEGER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_compfunc_type(cmp)))
|
| 723 |
+
|
| 724 |
+
|
| 725 |
+
|
| 726 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
|
| 727 |
+
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
|
| 728 |
+
long length);
|
| 729 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_INTEGER)
|
| 730 |
+
int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
|
| 731 |
+
|
| 732 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
|
| 733 |
+
|
| 734 |
+
int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
|
| 735 |
+
ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
|
| 736 |
+
ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
|
| 737 |
+
int offset_day, long offset_sec);
|
| 738 |
+
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
|
| 739 |
+
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
|
| 740 |
+
|
| 741 |
+
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
|
| 742 |
+
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
| 743 |
+
time_t t);
|
| 744 |
+
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
|
| 745 |
+
time_t t, int offset_day,
|
| 746 |
+
long offset_sec);
|
| 747 |
+
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
|
| 748 |
+
|
| 749 |
+
int ASN1_TIME_diff(int *pday, int *psec,
|
| 750 |
+
const ASN1_TIME *from, const ASN1_TIME *to);
|
| 751 |
+
|
| 752 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
|
| 753 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_OCTET_STRING)
|
| 754 |
+
int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
|
| 755 |
+
const ASN1_OCTET_STRING *b);
|
| 756 |
+
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
|
| 757 |
+
int len);
|
| 758 |
+
|
| 759 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_UTF8STRING, ASN1_UTF8STRING, ASN1_UTF8STRING)
|
| 760 |
+
#define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
| 761 |
+
#define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx)))
|
| 762 |
+
#define sk_ASN1_UTF8STRING_new(cmp) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)))
|
| 763 |
+
#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null())
|
| 764 |
+
#define sk_ASN1_UTF8STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp), (n)))
|
| 765 |
+
#define sk_ASN1_UTF8STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_UTF8STRING_sk_type(sk), (n))
|
| 766 |
+
#define sk_ASN1_UTF8STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 767 |
+
#define sk_ASN1_UTF8STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 768 |
+
#define sk_ASN1_UTF8STRING_delete(sk, i) ((ASN1_UTF8STRING *)OPENSSL_sk_delete(ossl_check_ASN1_UTF8STRING_sk_type(sk), (i)))
|
| 769 |
+
#define sk_ASN1_UTF8STRING_delete_ptr(sk, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
| 770 |
+
#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 771 |
+
#define sk_ASN1_UTF8STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 772 |
+
#define sk_ASN1_UTF8STRING_pop(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_pop(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
| 773 |
+
#define sk_ASN1_UTF8STRING_shift(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_shift(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
| 774 |
+
#define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk),ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))
|
| 775 |
+
#define sk_ASN1_UTF8STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), (idx))
|
| 776 |
+
#define sk_ASN1_UTF8STRING_set(sk, idx, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_set(ossl_check_ASN1_UTF8STRING_sk_type(sk), (idx), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
| 777 |
+
#define sk_ASN1_UTF8STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 778 |
+
#define sk_ASN1_UTF8STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 779 |
+
#define sk_ASN1_UTF8STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), pnum)
|
| 780 |
+
#define sk_ASN1_UTF8STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 781 |
+
#define sk_ASN1_UTF8STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
| 782 |
+
#define sk_ASN1_UTF8STRING_dup(sk) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)))
|
| 783 |
+
#define sk_ASN1_UTF8STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_copyfunc_type(copyfunc), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc)))
|
| 784 |
+
#define sk_ASN1_UTF8STRING_set_cmp_func(sk, cmp) ((sk_ASN1_UTF8STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)))
|
| 785 |
+
|
| 786 |
+
|
| 787 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
|
| 788 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
|
| 789 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
|
| 790 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
|
| 791 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
|
| 792 |
+
|
| 793 |
+
int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
|
| 794 |
+
int UTF8_putc(unsigned char *str, int len, unsigned long value);
|
| 795 |
+
|
| 796 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_GENERALSTRING, ASN1_GENERALSTRING, ASN1_GENERALSTRING)
|
| 797 |
+
#define sk_ASN1_GENERALSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
| 798 |
+
#define sk_ASN1_GENERALSTRING_value(sk, idx) ((ASN1_GENERALSTRING *)OPENSSL_sk_value(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), (idx)))
|
| 799 |
+
#define sk_ASN1_GENERALSTRING_new(cmp) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)))
|
| 800 |
+
#define sk_ASN1_GENERALSTRING_new_null() ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_null())
|
| 801 |
+
#define sk_ASN1_GENERALSTRING_new_reserve(cmp, n) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp), (n)))
|
| 802 |
+
#define sk_ASN1_GENERALSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (n))
|
| 803 |
+
#define sk_ASN1_GENERALSTRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 804 |
+
#define sk_ASN1_GENERALSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 805 |
+
#define sk_ASN1_GENERALSTRING_delete(sk, i) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (i)))
|
| 806 |
+
#define sk_ASN1_GENERALSTRING_delete_ptr(sk, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
| 807 |
+
#define sk_ASN1_GENERALSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 808 |
+
#define sk_ASN1_GENERALSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 809 |
+
#define sk_ASN1_GENERALSTRING_pop(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_pop(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
| 810 |
+
#define sk_ASN1_GENERALSTRING_shift(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_shift(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
| 811 |
+
#define sk_ASN1_GENERALSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk),ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc))
|
| 812 |
+
#define sk_ASN1_GENERALSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), (idx))
|
| 813 |
+
#define sk_ASN1_GENERALSTRING_set(sk, idx, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_set(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (idx), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
| 814 |
+
#define sk_ASN1_GENERALSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 815 |
+
#define sk_ASN1_GENERALSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 816 |
+
#define sk_ASN1_GENERALSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), pnum)
|
| 817 |
+
#define sk_ASN1_GENERALSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 818 |
+
#define sk_ASN1_GENERALSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
| 819 |
+
#define sk_ASN1_GENERALSTRING_dup(sk) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)))
|
| 820 |
+
#define sk_ASN1_GENERALSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_copyfunc_type(copyfunc), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc)))
|
| 821 |
+
#define sk_ASN1_GENERALSTRING_set_cmp_func(sk, cmp) ((sk_ASN1_GENERALSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)))
|
| 822 |
+
|
| 823 |
+
|
| 824 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
|
| 825 |
+
|
| 826 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
|
| 827 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
|
| 828 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
|
| 829 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
|
| 830 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
|
| 831 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
|
| 832 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
|
| 833 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
|
| 834 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
|
| 835 |
+
|
| 836 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_TIME)
|
| 837 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_UTCTIME)
|
| 838 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_GENERALIZEDTIME)
|
| 839 |
+
|
| 840 |
+
DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
|
| 841 |
+
|
| 842 |
+
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
|
| 843 |
+
ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
|
| 844 |
+
int offset_day, long offset_sec);
|
| 845 |
+
int ASN1_TIME_check(const ASN1_TIME *t);
|
| 846 |
+
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
|
| 847 |
+
ASN1_GENERALIZEDTIME **out);
|
| 848 |
+
int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
|
| 849 |
+
int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str);
|
| 850 |
+
int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm);
|
| 851 |
+
int ASN1_TIME_normalize(ASN1_TIME *s);
|
| 852 |
+
int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t);
|
| 853 |
+
int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b);
|
| 854 |
+
|
| 855 |
+
int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);
|
| 856 |
+
int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
|
| 857 |
+
int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a);
|
| 858 |
+
int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
|
| 859 |
+
int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a);
|
| 860 |
+
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
|
| 861 |
+
int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
|
| 862 |
+
int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a);
|
| 863 |
+
|
| 864 |
+
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
|
| 865 |
+
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
|
| 866 |
+
const char *sn, const char *ln);
|
| 867 |
+
|
| 868 |
+
int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a);
|
| 869 |
+
int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r);
|
| 870 |
+
int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a);
|
| 871 |
+
int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r);
|
| 872 |
+
|
| 873 |
+
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
|
| 874 |
+
long ASN1_INTEGER_get(const ASN1_INTEGER *a);
|
| 875 |
+
ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
|
| 876 |
+
BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
|
| 877 |
+
|
| 878 |
+
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a);
|
| 879 |
+
int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r);
|
| 880 |
+
|
| 881 |
+
|
| 882 |
+
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
|
| 883 |
+
long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
|
| 884 |
+
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
|
| 885 |
+
BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn);
|
| 886 |
+
|
| 887 |
+
/* General */
|
| 888 |
+
/* given a string, return the correct type, max is the maximum length */
|
| 889 |
+
int ASN1_PRINTABLE_type(const unsigned char *s, int max);
|
| 890 |
+
|
| 891 |
+
unsigned long ASN1_tag2bit(int tag);
|
| 892 |
+
|
| 893 |
+
/* SPECIALS */
|
| 894 |
+
int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
|
| 895 |
+
int *pclass, long omax);
|
| 896 |
+
int ASN1_check_infinite_end(unsigned char **p, long len);
|
| 897 |
+
int ASN1_const_check_infinite_end(const unsigned char **p, long len);
|
| 898 |
+
void ASN1_put_object(unsigned char **pp, int constructed, int length,
|
| 899 |
+
int tag, int xclass);
|
| 900 |
+
int ASN1_put_eoc(unsigned char **pp);
|
| 901 |
+
int ASN1_object_size(int constructed, int length, int tag);
|
| 902 |
+
|
| 903 |
+
/* Used to implement other functions */
|
| 904 |
+
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, const void *x);
|
| 905 |
+
|
| 906 |
+
# define ASN1_dup_of(type,i2d,d2i,x) \
|
| 907 |
+
((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
|
| 908 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 909 |
+
CHECKED_PTR_OF(const type, x)))
|
| 910 |
+
|
| 911 |
+
void *ASN1_item_dup(const ASN1_ITEM *it, const void *x);
|
| 912 |
+
int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
| 913 |
+
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
|
| 914 |
+
const void *data, const ASN1_OCTET_STRING *id,
|
| 915 |
+
EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx,
|
| 916 |
+
const char *propq);
|
| 917 |
+
int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 918 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 919 |
+
const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
|
| 920 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 921 |
+
|
| 922 |
+
/* ASN1 alloc/free macros for when a type is only used internally */
|
| 923 |
+
|
| 924 |
+
# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))
|
| 925 |
+
# define M_ASN1_free_of(x, type) \
|
| 926 |
+
ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
|
| 927 |
+
|
| 928 |
+
# ifndef OPENSSL_NO_STDIO
|
| 929 |
+
void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);
|
| 930 |
+
|
| 931 |
+
# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
|
| 932 |
+
((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
|
| 933 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 934 |
+
in, \
|
| 935 |
+
CHECKED_PPTR_OF(type, x)))
|
| 936 |
+
|
| 937 |
+
void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x,
|
| 938 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 939 |
+
void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
|
| 940 |
+
int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, const void *x);
|
| 941 |
+
|
| 942 |
+
# define ASN1_i2d_fp_of(type,i2d,out,x) \
|
| 943 |
+
(ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
|
| 944 |
+
out, \
|
| 945 |
+
CHECKED_PTR_OF(const type, x)))
|
| 946 |
+
|
| 947 |
+
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, const void *x);
|
| 948 |
+
int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags);
|
| 949 |
+
# endif
|
| 950 |
+
|
| 951 |
+
int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in);
|
| 952 |
+
|
| 953 |
+
void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);
|
| 954 |
+
|
| 955 |
+
# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
|
| 956 |
+
((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
|
| 957 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 958 |
+
in, \
|
| 959 |
+
CHECKED_PPTR_OF(type, x)))
|
| 960 |
+
|
| 961 |
+
void *ASN1_item_d2i_bio_ex(const ASN1_ITEM *it, BIO *in, void *pval,
|
| 962 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 963 |
+
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval);
|
| 964 |
+
int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, const void *x);
|
| 965 |
+
|
| 966 |
+
# define ASN1_i2d_bio_of(type,i2d,out,x) \
|
| 967 |
+
(ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
|
| 968 |
+
out, \
|
| 969 |
+
CHECKED_PTR_OF(const type, x)))
|
| 970 |
+
|
| 971 |
+
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x);
|
| 972 |
+
BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
|
| 973 |
+
int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
|
| 974 |
+
int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
|
| 975 |
+
int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm);
|
| 976 |
+
int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags);
|
| 977 |
+
int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
|
| 978 |
+
int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
|
| 979 |
+
int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off);
|
| 980 |
+
int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
|
| 981 |
+
unsigned char *buf, int off);
|
| 982 |
+
int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
|
| 983 |
+
int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent,
|
| 984 |
+
int dump);
|
| 985 |
+
const char *ASN1_tag2str(int tag);
|
| 986 |
+
|
| 987 |
+
/* Used to load and write Netscape format cert */
|
| 988 |
+
|
| 989 |
+
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
|
| 990 |
+
|
| 991 |
+
int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);
|
| 992 |
+
int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len);
|
| 993 |
+
int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
|
| 994 |
+
unsigned char *data, int len);
|
| 995 |
+
int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
|
| 996 |
+
unsigned char *data, int max_len);
|
| 997 |
+
|
| 998 |
+
void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
|
| 999 |
+
|
| 1000 |
+
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
|
| 1001 |
+
ASN1_OCTET_STRING **oct);
|
| 1002 |
+
|
| 1003 |
+
void ASN1_STRING_set_default_mask(unsigned long mask);
|
| 1004 |
+
int ASN1_STRING_set_default_mask_asc(const char *p);
|
| 1005 |
+
unsigned long ASN1_STRING_get_default_mask(void);
|
| 1006 |
+
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
|
| 1007 |
+
int inform, unsigned long mask);
|
| 1008 |
+
int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
| 1009 |
+
int inform, unsigned long mask,
|
| 1010 |
+
long minsize, long maxsize);
|
| 1011 |
+
|
| 1012 |
+
ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
|
| 1013 |
+
const unsigned char *in, int inlen,
|
| 1014 |
+
int inform, int nid);
|
| 1015 |
+
ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
|
| 1016 |
+
int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
|
| 1017 |
+
void ASN1_STRING_TABLE_cleanup(void);
|
| 1018 |
+
|
| 1019 |
+
/* ASN1 template functions */
|
| 1020 |
+
|
| 1021 |
+
/* Old API compatible functions */
|
| 1022 |
+
ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
|
| 1023 |
+
ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx,
|
| 1024 |
+
const char *propq);
|
| 1025 |
+
void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
|
| 1026 |
+
ASN1_VALUE *ASN1_item_d2i_ex(ASN1_VALUE **val, const unsigned char **in,
|
| 1027 |
+
long len, const ASN1_ITEM *it,
|
| 1028 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1029 |
+
ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
|
| 1030 |
+
long len, const ASN1_ITEM *it);
|
| 1031 |
+
int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
| 1032 |
+
int ASN1_item_ndef_i2d(const ASN1_VALUE *val, unsigned char **out,
|
| 1033 |
+
const ASN1_ITEM *it);
|
| 1034 |
+
|
| 1035 |
+
void ASN1_add_oid_module(void);
|
| 1036 |
+
void ASN1_add_stable_module(void);
|
| 1037 |
+
|
| 1038 |
+
ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
|
| 1039 |
+
ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);
|
| 1040 |
+
int ASN1_str2mask(const char *str, unsigned long *pmask);
|
| 1041 |
+
|
| 1042 |
+
/* ASN1 Print flags */
|
| 1043 |
+
|
| 1044 |
+
/* Indicate missing OPTIONAL fields */
|
| 1045 |
+
# define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001
|
| 1046 |
+
/* Mark start and end of SEQUENCE */
|
| 1047 |
+
# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002
|
| 1048 |
+
/* Mark start and end of SEQUENCE/SET OF */
|
| 1049 |
+
# define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004
|
| 1050 |
+
/* Show the ASN1 type of primitives */
|
| 1051 |
+
# define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008
|
| 1052 |
+
/* Don't show ASN1 type of ANY */
|
| 1053 |
+
# define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010
|
| 1054 |
+
/* Don't show ASN1 type of MSTRINGs */
|
| 1055 |
+
# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020
|
| 1056 |
+
/* Don't show field names in SEQUENCE */
|
| 1057 |
+
# define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040
|
| 1058 |
+
/* Show structure names of each SEQUENCE field */
|
| 1059 |
+
# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080
|
| 1060 |
+
/* Don't show structure name even at top level */
|
| 1061 |
+
# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
|
| 1062 |
+
|
| 1063 |
+
int ASN1_item_print(BIO *out, const ASN1_VALUE *ifld, int indent,
|
| 1064 |
+
const ASN1_ITEM *it, const ASN1_PCTX *pctx);
|
| 1065 |
+
ASN1_PCTX *ASN1_PCTX_new(void);
|
| 1066 |
+
void ASN1_PCTX_free(ASN1_PCTX *p);
|
| 1067 |
+
unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p);
|
| 1068 |
+
void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1069 |
+
unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p);
|
| 1070 |
+
void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1071 |
+
unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p);
|
| 1072 |
+
void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1073 |
+
unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p);
|
| 1074 |
+
void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1075 |
+
unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p);
|
| 1076 |
+
void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1077 |
+
|
| 1078 |
+
ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx));
|
| 1079 |
+
void ASN1_SCTX_free(ASN1_SCTX *p);
|
| 1080 |
+
const ASN1_ITEM *ASN1_SCTX_get_item(ASN1_SCTX *p);
|
| 1081 |
+
const ASN1_TEMPLATE *ASN1_SCTX_get_template(ASN1_SCTX *p);
|
| 1082 |
+
unsigned long ASN1_SCTX_get_flags(ASN1_SCTX *p);
|
| 1083 |
+
void ASN1_SCTX_set_app_data(ASN1_SCTX *p, void *data);
|
| 1084 |
+
void *ASN1_SCTX_get_app_data(ASN1_SCTX *p);
|
| 1085 |
+
|
| 1086 |
+
const BIO_METHOD *BIO_f_asn1(void);
|
| 1087 |
+
|
| 1088 |
+
/* cannot constify val because of CMS_stream() */
|
| 1089 |
+
BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
|
| 1090 |
+
|
| 1091 |
+
int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
| 1092 |
+
const ASN1_ITEM *it);
|
| 1093 |
+
int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
| 1094 |
+
const char *hdr, const ASN1_ITEM *it);
|
| 1095 |
+
/* cannot constify val because of CMS_dataFinal() */
|
| 1096 |
+
int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
| 1097 |
+
int ctype_nid, int econt_nid,
|
| 1098 |
+
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);
|
| 1099 |
+
int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
| 1100 |
+
int ctype_nid, int econt_nid,
|
| 1101 |
+
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
|
| 1102 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1103 |
+
ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
|
| 1104 |
+
ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont,
|
| 1105 |
+
const ASN1_ITEM *it, ASN1_VALUE **x,
|
| 1106 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1107 |
+
int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
|
| 1108 |
+
int SMIME_text(BIO *in, BIO *out);
|
| 1109 |
+
|
| 1110 |
+
const ASN1_ITEM *ASN1_ITEM_lookup(const char *name);
|
| 1111 |
+
const ASN1_ITEM *ASN1_ITEM_get(size_t i);
|
| 1112 |
+
|
| 1113 |
+
/* Legacy compatibility */
|
| 1114 |
+
# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
|
| 1115 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
| 1116 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
|
| 1117 |
+
# define DECLARE_ASN1_FUNCTIONS_const(type) DECLARE_ASN1_FUNCTIONS(type)
|
| 1118 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
|
| 1119 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name)
|
| 1120 |
+
# define I2D_OF_const(type) I2D_OF(type)
|
| 1121 |
+
# define ASN1_dup_of_const(type,i2d,d2i,x) ASN1_dup_of(type,i2d,d2i,x)
|
| 1122 |
+
# define ASN1_i2d_fp_of_const(type,i2d,out,x) ASN1_i2d_fp_of(type,i2d,out,x)
|
| 1123 |
+
# define ASN1_i2d_bio_of_const(type,i2d,out,x) ASN1_i2d_bio_of(type,i2d,out,x)
|
| 1124 |
+
|
| 1125 |
+
# ifdef __cplusplus
|
| 1126 |
+
}
|
| 1127 |
+
# endif
|
| 1128 |
+
#endif
|
llava_next/include/openssl/asn1_mac.h
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2015-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 |
+
#error "This file is obsolete; please update your software."
|
llava_next/include/openssl/async.h
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
#include <stdlib.h>
|
| 11 |
+
|
| 12 |
+
#ifndef OPENSSL_ASYNC_H
|
| 13 |
+
# define OPENSSL_ASYNC_H
|
| 14 |
+
# pragma once
|
| 15 |
+
|
| 16 |
+
# include <openssl/macros.h>
|
| 17 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 18 |
+
# define HEADER_ASYNC_H
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
#if defined(_WIN32)
|
| 22 |
+
# if defined(BASETYPES) || defined(_WINDEF_H)
|
| 23 |
+
/* application has to include <windows.h> to use this */
|
| 24 |
+
#define OSSL_ASYNC_FD HANDLE
|
| 25 |
+
#define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE
|
| 26 |
+
# endif
|
| 27 |
+
#else
|
| 28 |
+
#define OSSL_ASYNC_FD int
|
| 29 |
+
#define OSSL_BAD_ASYNC_FD -1
|
| 30 |
+
#endif
|
| 31 |
+
# include <openssl/asyncerr.h>
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
# endif
|
| 37 |
+
|
| 38 |
+
typedef struct async_job_st ASYNC_JOB;
|
| 39 |
+
typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
|
| 40 |
+
typedef int (*ASYNC_callback_fn)(void *arg);
|
| 41 |
+
|
| 42 |
+
#define ASYNC_ERR 0
|
| 43 |
+
#define ASYNC_NO_JOBS 1
|
| 44 |
+
#define ASYNC_PAUSE 2
|
| 45 |
+
#define ASYNC_FINISH 3
|
| 46 |
+
|
| 47 |
+
#define ASYNC_STATUS_UNSUPPORTED 0
|
| 48 |
+
#define ASYNC_STATUS_ERR 1
|
| 49 |
+
#define ASYNC_STATUS_OK 2
|
| 50 |
+
#define ASYNC_STATUS_EAGAIN 3
|
| 51 |
+
|
| 52 |
+
int ASYNC_init_thread(size_t max_size, size_t init_size);
|
| 53 |
+
void ASYNC_cleanup_thread(void);
|
| 54 |
+
|
| 55 |
+
#ifdef OSSL_ASYNC_FD
|
| 56 |
+
ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void);
|
| 57 |
+
void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx);
|
| 58 |
+
int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
| 59 |
+
OSSL_ASYNC_FD fd,
|
| 60 |
+
void *custom_data,
|
| 61 |
+
void (*cleanup)(ASYNC_WAIT_CTX *, const void *,
|
| 62 |
+
OSSL_ASYNC_FD, void *));
|
| 63 |
+
int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
| 64 |
+
OSSL_ASYNC_FD *fd, void **custom_data);
|
| 65 |
+
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
|
| 66 |
+
size_t *numfds);
|
| 67 |
+
int ASYNC_WAIT_CTX_get_callback(ASYNC_WAIT_CTX *ctx,
|
| 68 |
+
ASYNC_callback_fn *callback,
|
| 69 |
+
void **callback_arg);
|
| 70 |
+
int ASYNC_WAIT_CTX_set_callback(ASYNC_WAIT_CTX *ctx,
|
| 71 |
+
ASYNC_callback_fn callback,
|
| 72 |
+
void *callback_arg);
|
| 73 |
+
int ASYNC_WAIT_CTX_set_status(ASYNC_WAIT_CTX *ctx, int status);
|
| 74 |
+
int ASYNC_WAIT_CTX_get_status(ASYNC_WAIT_CTX *ctx);
|
| 75 |
+
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
|
| 76 |
+
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
|
| 77 |
+
size_t *numdelfds);
|
| 78 |
+
int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
|
| 79 |
+
#endif
|
| 80 |
+
|
| 81 |
+
int ASYNC_is_capable(void);
|
| 82 |
+
|
| 83 |
+
int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret,
|
| 84 |
+
int (*func)(void *), void *args, size_t size);
|
| 85 |
+
int ASYNC_pause_job(void);
|
| 86 |
+
|
| 87 |
+
ASYNC_JOB *ASYNC_get_current_job(void);
|
| 88 |
+
ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job);
|
| 89 |
+
void ASYNC_block_pause(void);
|
| 90 |
+
void ASYNC_unblock_pause(void);
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
# ifdef __cplusplus
|
| 94 |
+
}
|
| 95 |
+
# endif
|
| 96 |
+
#endif
|
llava_next/include/openssl/cmperr.h
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CMPERR_H
|
| 12 |
+
# define OPENSSL_CMPERR_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_CMP
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* CMP reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define CMP_R_ALGORITHM_NOT_SUPPORTED 139
|
| 27 |
+
# define CMP_R_BAD_CHECKAFTER_IN_POLLREP 167
|
| 28 |
+
# define CMP_R_BAD_REQUEST_ID 108
|
| 29 |
+
# define CMP_R_CERTHASH_UNMATCHED 156
|
| 30 |
+
# define CMP_R_CERTID_NOT_FOUND 109
|
| 31 |
+
# define CMP_R_CERTIFICATE_NOT_ACCEPTED 169
|
| 32 |
+
# define CMP_R_CERTIFICATE_NOT_FOUND 112
|
| 33 |
+
# define CMP_R_CERTREQMSG_NOT_FOUND 157
|
| 34 |
+
# define CMP_R_CERTRESPONSE_NOT_FOUND 113
|
| 35 |
+
# define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114
|
| 36 |
+
# define CMP_R_CHECKAFTER_OUT_OF_RANGE 181
|
| 37 |
+
# define CMP_R_ENCOUNTERED_KEYUPDATEWARNING 176
|
| 38 |
+
# define CMP_R_ENCOUNTERED_WAITING 162
|
| 39 |
+
# define CMP_R_ERROR_CALCULATING_PROTECTION 115
|
| 40 |
+
# define CMP_R_ERROR_CREATING_CERTCONF 116
|
| 41 |
+
# define CMP_R_ERROR_CREATING_CERTREP 117
|
| 42 |
+
# define CMP_R_ERROR_CREATING_CERTREQ 163
|
| 43 |
+
# define CMP_R_ERROR_CREATING_ERROR 118
|
| 44 |
+
# define CMP_R_ERROR_CREATING_GENM 119
|
| 45 |
+
# define CMP_R_ERROR_CREATING_GENP 120
|
| 46 |
+
# define CMP_R_ERROR_CREATING_PKICONF 122
|
| 47 |
+
# define CMP_R_ERROR_CREATING_POLLREP 123
|
| 48 |
+
# define CMP_R_ERROR_CREATING_POLLREQ 124
|
| 49 |
+
# define CMP_R_ERROR_CREATING_RP 125
|
| 50 |
+
# define CMP_R_ERROR_CREATING_RR 126
|
| 51 |
+
# define CMP_R_ERROR_PARSING_PKISTATUS 107
|
| 52 |
+
# define CMP_R_ERROR_PROCESSING_MESSAGE 158
|
| 53 |
+
# define CMP_R_ERROR_PROTECTING_MESSAGE 127
|
| 54 |
+
# define CMP_R_ERROR_SETTING_CERTHASH 128
|
| 55 |
+
# define CMP_R_ERROR_UNEXPECTED_CERTCONF 160
|
| 56 |
+
# define CMP_R_ERROR_VALIDATING_PROTECTION 140
|
| 57 |
+
# define CMP_R_ERROR_VALIDATING_SIGNATURE 171
|
| 58 |
+
# define CMP_R_FAILED_BUILDING_OWN_CHAIN 164
|
| 59 |
+
# define CMP_R_FAILED_EXTRACTING_PUBKEY 141
|
| 60 |
+
# define CMP_R_FAILURE_OBTAINING_RANDOM 110
|
| 61 |
+
# define CMP_R_FAIL_INFO_OUT_OF_RANGE 129
|
| 62 |
+
# define CMP_R_INVALID_ARGS 100
|
| 63 |
+
# define CMP_R_INVALID_OPTION 174
|
| 64 |
+
# define CMP_R_MISSING_CERTID 165
|
| 65 |
+
# define CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION 130
|
| 66 |
+
# define CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE 142
|
| 67 |
+
# define CMP_R_MISSING_P10CSR 121
|
| 68 |
+
# define CMP_R_MISSING_PBM_SECRET 166
|
| 69 |
+
# define CMP_R_MISSING_PRIVATE_KEY 131
|
| 70 |
+
# define CMP_R_MISSING_PRIVATE_KEY_FOR_POPO 190
|
| 71 |
+
# define CMP_R_MISSING_PROTECTION 143
|
| 72 |
+
# define CMP_R_MISSING_PUBLIC_KEY 183
|
| 73 |
+
# define CMP_R_MISSING_REFERENCE_CERT 168
|
| 74 |
+
# define CMP_R_MISSING_SECRET 178
|
| 75 |
+
# define CMP_R_MISSING_SENDER_IDENTIFICATION 111
|
| 76 |
+
# define CMP_R_MISSING_TRUST_ANCHOR 179
|
| 77 |
+
# define CMP_R_MISSING_TRUST_STORE 144
|
| 78 |
+
# define CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED 161
|
| 79 |
+
# define CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED 170
|
| 80 |
+
# define CMP_R_MULTIPLE_SAN_SOURCES 102
|
| 81 |
+
# define CMP_R_NO_STDIO 194
|
| 82 |
+
# define CMP_R_NO_SUITABLE_SENDER_CERT 145
|
| 83 |
+
# define CMP_R_NULL_ARGUMENT 103
|
| 84 |
+
# define CMP_R_PKIBODY_ERROR 146
|
| 85 |
+
# define CMP_R_PKISTATUSINFO_NOT_FOUND 132
|
| 86 |
+
# define CMP_R_POLLING_FAILED 172
|
| 87 |
+
# define CMP_R_POTENTIALLY_INVALID_CERTIFICATE 147
|
| 88 |
+
# define CMP_R_RECEIVED_ERROR 180
|
| 89 |
+
# define CMP_R_RECIPNONCE_UNMATCHED 148
|
| 90 |
+
# define CMP_R_REQUEST_NOT_ACCEPTED 149
|
| 91 |
+
# define CMP_R_REQUEST_REJECTED_BY_SERVER 182
|
| 92 |
+
# define CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED 150
|
| 93 |
+
# define CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG 151
|
| 94 |
+
# define CMP_R_TOTAL_TIMEOUT 184
|
| 95 |
+
# define CMP_R_TRANSACTIONID_UNMATCHED 152
|
| 96 |
+
# define CMP_R_TRANSFER_ERROR 159
|
| 97 |
+
# define CMP_R_UNEXPECTED_PKIBODY 133
|
| 98 |
+
# define CMP_R_UNEXPECTED_PKISTATUS 185
|
| 99 |
+
# define CMP_R_UNEXPECTED_PVNO 153
|
| 100 |
+
# define CMP_R_UNKNOWN_ALGORITHM_ID 134
|
| 101 |
+
# define CMP_R_UNKNOWN_CERT_TYPE 135
|
| 102 |
+
# define CMP_R_UNKNOWN_PKISTATUS 186
|
| 103 |
+
# define CMP_R_UNSUPPORTED_ALGORITHM 136
|
| 104 |
+
# define CMP_R_UNSUPPORTED_KEY_TYPE 137
|
| 105 |
+
# define CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC 154
|
| 106 |
+
# define CMP_R_VALUE_TOO_LARGE 175
|
| 107 |
+
# define CMP_R_VALUE_TOO_SMALL 177
|
| 108 |
+
# define CMP_R_WRONG_ALGORITHM_OID 138
|
| 109 |
+
# define CMP_R_WRONG_CERTID 189
|
| 110 |
+
# define CMP_R_WRONG_CERTID_IN_RP 187
|
| 111 |
+
# define CMP_R_WRONG_PBM_VALUE 155
|
| 112 |
+
# define CMP_R_WRONG_RP_COMPONENT_COUNT 188
|
| 113 |
+
# define CMP_R_WRONG_SERIAL_IN_RP 173
|
| 114 |
+
|
| 115 |
+
# endif
|
| 116 |
+
#endif
|
llava_next/include/openssl/core_names.h
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-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 |
+
#ifndef OPENSSL_CORE_NAMES_H
|
| 11 |
+
# define OPENSSL_CORE_NAMES_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
# endif
|
| 17 |
+
|
| 18 |
+
/* Well known parameter names that core passes to providers */
|
| 19 |
+
#define OSSL_PROV_PARAM_CORE_VERSION "openssl-version" /* utf8_ptr */
|
| 20 |
+
#define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name" /* utf8_ptr */
|
| 21 |
+
#define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename" /* utf8_ptr */
|
| 22 |
+
|
| 23 |
+
/* Well known parameter names that Providers can define */
|
| 24 |
+
#define OSSL_PROV_PARAM_NAME "name" /* utf8_ptr */
|
| 25 |
+
#define OSSL_PROV_PARAM_VERSION "version" /* utf8_ptr */
|
| 26 |
+
#define OSSL_PROV_PARAM_BUILDINFO "buildinfo" /* utf8_ptr */
|
| 27 |
+
#define OSSL_PROV_PARAM_STATUS "status" /* uint */
|
| 28 |
+
#define OSSL_PROV_PARAM_SECURITY_CHECKS "security-checks" /* uint */
|
| 29 |
+
|
| 30 |
+
/* Self test callback parameters */
|
| 31 |
+
#define OSSL_PROV_PARAM_SELF_TEST_PHASE "st-phase" /* utf8_string */
|
| 32 |
+
#define OSSL_PROV_PARAM_SELF_TEST_TYPE "st-type" /* utf8_string */
|
| 33 |
+
#define OSSL_PROV_PARAM_SELF_TEST_DESC "st-desc" /* utf8_string */
|
| 34 |
+
|
| 35 |
+
/*-
|
| 36 |
+
* Provider-native object abstractions
|
| 37 |
+
*
|
| 38 |
+
* These are used when a provider wants to pass object data or an object
|
| 39 |
+
* reference back to libcrypto. This is only useful for provider functions
|
| 40 |
+
* that take a callback to which an OSSL_PARAM array with these parameters
|
| 41 |
+
* can be passed.
|
| 42 |
+
*
|
| 43 |
+
* This set of parameter names is explained in detail in provider-object(7)
|
| 44 |
+
* (doc/man7/provider-object.pod)
|
| 45 |
+
*/
|
| 46 |
+
#define OSSL_OBJECT_PARAM_TYPE "type" /* INTEGER */
|
| 47 |
+
#define OSSL_OBJECT_PARAM_DATA_TYPE "data-type" /* UTF8_STRING */
|
| 48 |
+
#define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure" /* UTF8_STRING */
|
| 49 |
+
#define OSSL_OBJECT_PARAM_REFERENCE "reference" /* OCTET_STRING */
|
| 50 |
+
#define OSSL_OBJECT_PARAM_DATA "data" /* OCTET_STRING or UTF8_STRING */
|
| 51 |
+
#define OSSL_OBJECT_PARAM_DESC "desc" /* UTF8_STRING */
|
| 52 |
+
|
| 53 |
+
/*
|
| 54 |
+
* Algorithm parameters
|
| 55 |
+
* If "engine" or "properties" are specified, they should always be paired
|
| 56 |
+
* with the algorithm type.
|
| 57 |
+
* Note these are common names that are shared by many types (such as kdf, mac,
|
| 58 |
+
* and pkey) e.g: see OSSL_MAC_PARAM_DIGEST below.
|
| 59 |
+
*/
|
| 60 |
+
#define OSSL_ALG_PARAM_DIGEST "digest" /* utf8_string */
|
| 61 |
+
#define OSSL_ALG_PARAM_CIPHER "cipher" /* utf8_string */
|
| 62 |
+
#define OSSL_ALG_PARAM_ENGINE "engine" /* utf8_string */
|
| 63 |
+
#define OSSL_ALG_PARAM_MAC "mac" /* utf8_string */
|
| 64 |
+
#define OSSL_ALG_PARAM_PROPERTIES "properties"/* utf8_string */
|
| 65 |
+
|
| 66 |
+
/* cipher parameters */
|
| 67 |
+
#define OSSL_CIPHER_PARAM_PADDING "padding" /* uint */
|
| 68 |
+
#define OSSL_CIPHER_PARAM_USE_BITS "use-bits" /* uint */
|
| 69 |
+
#define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version" /* uint */
|
| 70 |
+
#define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac" /* octet_ptr */
|
| 71 |
+
#define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size" /* size_t */
|
| 72 |
+
#define OSSL_CIPHER_PARAM_MODE "mode" /* uint */
|
| 73 |
+
#define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize" /* size_t */
|
| 74 |
+
#define OSSL_CIPHER_PARAM_AEAD "aead" /* int, 0 or 1 */
|
| 75 |
+
#define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv" /* int, 0 or 1 */
|
| 76 |
+
#define OSSL_CIPHER_PARAM_CTS "cts" /* int, 0 or 1 */
|
| 77 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi" /* int, 0 or 1 */
|
| 78 |
+
#define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey" /* int, 0 or 1 */
|
| 79 |
+
#define OSSL_CIPHER_PARAM_KEYLEN "keylen" /* size_t */
|
| 80 |
+
#define OSSL_CIPHER_PARAM_IVLEN "ivlen" /* size_t */
|
| 81 |
+
#define OSSL_CIPHER_PARAM_IV "iv" /* octet_string OR octet_ptr */
|
| 82 |
+
#define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv" /* octet_string OR octet_ptr */
|
| 83 |
+
#define OSSL_CIPHER_PARAM_NUM "num" /* uint */
|
| 84 |
+
#define OSSL_CIPHER_PARAM_ROUNDS "rounds" /* uint */
|
| 85 |
+
#define OSSL_CIPHER_PARAM_AEAD_TAG "tag" /* octet_string */
|
| 86 |
+
#define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD "tlsaad" /* octet_string */
|
| 87 |
+
#define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD "tlsaadpad" /* size_t */
|
| 88 |
+
#define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED "tlsivfixed" /* octet_string */
|
| 89 |
+
#define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen" /* octet_string */
|
| 90 |
+
#define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv" /* octet_string */
|
| 91 |
+
#define OSSL_CIPHER_PARAM_AEAD_IVLEN OSSL_CIPHER_PARAM_IVLEN
|
| 92 |
+
#define OSSL_CIPHER_PARAM_AEAD_TAGLEN "taglen" /* size_t */
|
| 93 |
+
#define OSSL_CIPHER_PARAM_AEAD_MAC_KEY "mackey" /* octet_string */
|
| 94 |
+
#define OSSL_CIPHER_PARAM_RANDOM_KEY "randkey" /* octet_string */
|
| 95 |
+
#define OSSL_CIPHER_PARAM_RC2_KEYBITS "keybits" /* size_t */
|
| 96 |
+
#define OSSL_CIPHER_PARAM_SPEED "speed" /* uint */
|
| 97 |
+
#define OSSL_CIPHER_PARAM_CTS_MODE "cts_mode" /* utf8_string */
|
| 98 |
+
/* For passing the AlgorithmIdentifier parameter in DER form */
|
| 99 |
+
#define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS "alg_id_param" /* octet_string */
|
| 100 |
+
|
| 101 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT \
|
| 102 |
+
"tls1multi_maxsndfrag" /* uint */
|
| 103 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE \
|
| 104 |
+
"tls1multi_maxbufsz" /* size_t */
|
| 105 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE \
|
| 106 |
+
"tls1multi_interleave" /* uint */
|
| 107 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD \
|
| 108 |
+
"tls1multi_aad" /* octet_string */
|
| 109 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN \
|
| 110 |
+
"tls1multi_aadpacklen" /* uint */
|
| 111 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC \
|
| 112 |
+
"tls1multi_enc" /* octet_string */
|
| 113 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN \
|
| 114 |
+
"tls1multi_encin" /* octet_string */
|
| 115 |
+
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN \
|
| 116 |
+
"tls1multi_enclen" /* size_t */
|
| 117 |
+
|
| 118 |
+
/* OSSL_CIPHER_PARAM_CTS_MODE Values */
|
| 119 |
+
#define OSSL_CIPHER_CTS_MODE_CS1 "CS1"
|
| 120 |
+
#define OSSL_CIPHER_CTS_MODE_CS2 "CS2"
|
| 121 |
+
#define OSSL_CIPHER_CTS_MODE_CS3 "CS3"
|
| 122 |
+
|
| 123 |
+
/* digest parameters */
|
| 124 |
+
#define OSSL_DIGEST_PARAM_XOFLEN "xoflen" /* size_t */
|
| 125 |
+
#define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms" /* octet string */
|
| 126 |
+
#define OSSL_DIGEST_PARAM_PAD_TYPE "pad-type" /* uint */
|
| 127 |
+
#define OSSL_DIGEST_PARAM_MICALG "micalg" /* utf8 string */
|
| 128 |
+
#define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize" /* size_t */
|
| 129 |
+
#define OSSL_DIGEST_PARAM_SIZE "size" /* size_t */
|
| 130 |
+
#define OSSL_DIGEST_PARAM_XOF "xof" /* int, 0 or 1 */
|
| 131 |
+
#define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent" /* int, 0 or 1 */
|
| 132 |
+
|
| 133 |
+
/* Known DIGEST names (not a complete list) */
|
| 134 |
+
#define OSSL_DIGEST_NAME_MD5 "MD5"
|
| 135 |
+
#define OSSL_DIGEST_NAME_MD5_SHA1 "MD5-SHA1"
|
| 136 |
+
#define OSSL_DIGEST_NAME_SHA1 "SHA1"
|
| 137 |
+
#define OSSL_DIGEST_NAME_SHA2_224 "SHA2-224"
|
| 138 |
+
#define OSSL_DIGEST_NAME_SHA2_256 "SHA2-256"
|
| 139 |
+
#define OSSL_DIGEST_NAME_SHA2_384 "SHA2-384"
|
| 140 |
+
#define OSSL_DIGEST_NAME_SHA2_512 "SHA2-512"
|
| 141 |
+
#define OSSL_DIGEST_NAME_SHA2_512_224 "SHA2-512/224"
|
| 142 |
+
#define OSSL_DIGEST_NAME_SHA2_512_256 "SHA2-512/256"
|
| 143 |
+
#define OSSL_DIGEST_NAME_MD2 "MD2"
|
| 144 |
+
#define OSSL_DIGEST_NAME_MD4 "MD4"
|
| 145 |
+
#define OSSL_DIGEST_NAME_MDC2 "MDC2"
|
| 146 |
+
#define OSSL_DIGEST_NAME_RIPEMD160 "RIPEMD160"
|
| 147 |
+
#define OSSL_DIGEST_NAME_SHA3_224 "SHA3-224"
|
| 148 |
+
#define OSSL_DIGEST_NAME_SHA3_256 "SHA3-256"
|
| 149 |
+
#define OSSL_DIGEST_NAME_SHA3_384 "SHA3-384"
|
| 150 |
+
#define OSSL_DIGEST_NAME_SHA3_512 "SHA3-512"
|
| 151 |
+
#define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
|
| 152 |
+
#define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
|
| 153 |
+
#define OSSL_DIGEST_NAME_SM3 "SM3"
|
| 154 |
+
|
| 155 |
+
/* MAC parameters */
|
| 156 |
+
#define OSSL_MAC_PARAM_KEY "key" /* octet string */
|
| 157 |
+
#define OSSL_MAC_PARAM_IV "iv" /* octet string */
|
| 158 |
+
#define OSSL_MAC_PARAM_CUSTOM "custom" /* utf8 string */
|
| 159 |
+
#define OSSL_MAC_PARAM_SALT "salt" /* octet string */
|
| 160 |
+
#define OSSL_MAC_PARAM_XOF "xof" /* int, 0 or 1 */
|
| 161 |
+
#define OSSL_MAC_PARAM_DIGEST_NOINIT "digest-noinit" /* int, 0 or 1 */
|
| 162 |
+
#define OSSL_MAC_PARAM_DIGEST_ONESHOT "digest-oneshot" /* int, 0 or 1 */
|
| 163 |
+
#define OSSL_MAC_PARAM_C_ROUNDS "c-rounds" /* unsigned int */
|
| 164 |
+
#define OSSL_MAC_PARAM_D_ROUNDS "d-rounds" /* unsigned int */
|
| 165 |
+
|
| 166 |
+
/*
|
| 167 |
+
* If "engine" or "properties" are specified, they should always be paired
|
| 168 |
+
* with "cipher" or "digest".
|
| 169 |
+
*/
|
| 170 |
+
#define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER /* utf8 string */
|
| 171 |
+
#define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST /* utf8 string */
|
| 172 |
+
#define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
|
| 173 |
+
#define OSSL_MAC_PARAM_SIZE "size" /* size_t */
|
| 174 |
+
#define OSSL_MAC_PARAM_BLOCK_SIZE "block-size" /* size_t */
|
| 175 |
+
#define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size" /* size_t */
|
| 176 |
+
|
| 177 |
+
/* Known MAC names */
|
| 178 |
+
#define OSSL_MAC_NAME_BLAKE2BMAC "BLAKE2BMAC"
|
| 179 |
+
#define OSSL_MAC_NAME_BLAKE2SMAC "BLAKE2SMAC"
|
| 180 |
+
#define OSSL_MAC_NAME_CMAC "CMAC"
|
| 181 |
+
#define OSSL_MAC_NAME_GMAC "GMAC"
|
| 182 |
+
#define OSSL_MAC_NAME_HMAC "HMAC"
|
| 183 |
+
#define OSSL_MAC_NAME_KMAC128 "KMAC128"
|
| 184 |
+
#define OSSL_MAC_NAME_KMAC256 "KMAC256"
|
| 185 |
+
#define OSSL_MAC_NAME_POLY1305 "POLY1305"
|
| 186 |
+
#define OSSL_MAC_NAME_SIPHASH "SIPHASH"
|
| 187 |
+
|
| 188 |
+
/* KDF / PRF parameters */
|
| 189 |
+
#define OSSL_KDF_PARAM_SECRET "secret" /* octet string */
|
| 190 |
+
#define OSSL_KDF_PARAM_KEY "key" /* octet string */
|
| 191 |
+
#define OSSL_KDF_PARAM_SALT "salt" /* octet string */
|
| 192 |
+
#define OSSL_KDF_PARAM_PASSWORD "pass" /* octet string */
|
| 193 |
+
#define OSSL_KDF_PARAM_PREFIX "prefix" /* octet string */
|
| 194 |
+
#define OSSL_KDF_PARAM_LABEL "label" /* octet string */
|
| 195 |
+
#define OSSL_KDF_PARAM_DATA "data" /* octet string */
|
| 196 |
+
#define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST /* utf8 string */
|
| 197 |
+
#define OSSL_KDF_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER /* utf8 string */
|
| 198 |
+
#define OSSL_KDF_PARAM_MAC OSSL_ALG_PARAM_MAC /* utf8 string */
|
| 199 |
+
#define OSSL_KDF_PARAM_MAC_SIZE "maclen" /* size_t */
|
| 200 |
+
#define OSSL_KDF_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
|
| 201 |
+
#define OSSL_KDF_PARAM_ITER "iter" /* unsigned int */
|
| 202 |
+
#define OSSL_KDF_PARAM_MODE "mode" /* utf8 string or int */
|
| 203 |
+
#define OSSL_KDF_PARAM_PKCS5 "pkcs5" /* int */
|
| 204 |
+
#define OSSL_KDF_PARAM_UKM "ukm" /* octet string */
|
| 205 |
+
#define OSSL_KDF_PARAM_CEK_ALG "cekalg" /* utf8 string */
|
| 206 |
+
#define OSSL_KDF_PARAM_SCRYPT_N "n" /* uint64_t */
|
| 207 |
+
#define OSSL_KDF_PARAM_SCRYPT_R "r" /* uint32_t */
|
| 208 |
+
#define OSSL_KDF_PARAM_SCRYPT_P "p" /* uint32_t */
|
| 209 |
+
#define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes" /* uint64_t */
|
| 210 |
+
#define OSSL_KDF_PARAM_INFO "info" /* octet string */
|
| 211 |
+
#define OSSL_KDF_PARAM_SEED "seed" /* octet string */
|
| 212 |
+
#define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash" /* octet string */
|
| 213 |
+
#define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id" /* octet string */
|
| 214 |
+
#define OSSL_KDF_PARAM_SSHKDF_TYPE "type" /* int */
|
| 215 |
+
#define OSSL_KDF_PARAM_SIZE "size" /* size_t */
|
| 216 |
+
#define OSSL_KDF_PARAM_CONSTANT "constant" /* octet string */
|
| 217 |
+
#define OSSL_KDF_PARAM_PKCS12_ID "id" /* int */
|
| 218 |
+
#define OSSL_KDF_PARAM_KBKDF_USE_L "use-l" /* int */
|
| 219 |
+
#define OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR "use-separator" /* int */
|
| 220 |
+
#define OSSL_KDF_PARAM_X942_ACVPINFO "acvp-info"
|
| 221 |
+
#define OSSL_KDF_PARAM_X942_PARTYUINFO "partyu-info"
|
| 222 |
+
#define OSSL_KDF_PARAM_X942_PARTYVINFO "partyv-info"
|
| 223 |
+
#define OSSL_KDF_PARAM_X942_SUPP_PUBINFO "supp-pubinfo"
|
| 224 |
+
#define OSSL_KDF_PARAM_X942_SUPP_PRIVINFO "supp-privinfo"
|
| 225 |
+
#define OSSL_KDF_PARAM_X942_USE_KEYBITS "use-keybits"
|
| 226 |
+
|
| 227 |
+
/* Known KDF names */
|
| 228 |
+
#define OSSL_KDF_NAME_HKDF "HKDF"
|
| 229 |
+
#define OSSL_KDF_NAME_TLS1_3_KDF "TLS13-KDF"
|
| 230 |
+
#define OSSL_KDF_NAME_PBKDF1 "PBKDF1"
|
| 231 |
+
#define OSSL_KDF_NAME_PBKDF2 "PBKDF2"
|
| 232 |
+
#define OSSL_KDF_NAME_SCRYPT "SCRYPT"
|
| 233 |
+
#define OSSL_KDF_NAME_SSHKDF "SSHKDF"
|
| 234 |
+
#define OSSL_KDF_NAME_SSKDF "SSKDF"
|
| 235 |
+
#define OSSL_KDF_NAME_TLS1_PRF "TLS1-PRF"
|
| 236 |
+
#define OSSL_KDF_NAME_X942KDF_ASN1 "X942KDF-ASN1"
|
| 237 |
+
#define OSSL_KDF_NAME_X942KDF_CONCAT "X942KDF-CONCAT"
|
| 238 |
+
#define OSSL_KDF_NAME_X963KDF "X963KDF"
|
| 239 |
+
#define OSSL_KDF_NAME_KBKDF "KBKDF"
|
| 240 |
+
#define OSSL_KDF_NAME_KRB5KDF "KRB5KDF"
|
| 241 |
+
|
| 242 |
+
/* Known RAND names */
|
| 243 |
+
#define OSSL_RAND_PARAM_STATE "state"
|
| 244 |
+
#define OSSL_RAND_PARAM_STRENGTH "strength"
|
| 245 |
+
#define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
|
| 246 |
+
#define OSSL_RAND_PARAM_TEST_ENTROPY "test_entropy"
|
| 247 |
+
#define OSSL_RAND_PARAM_TEST_NONCE "test_nonce"
|
| 248 |
+
|
| 249 |
+
/* RAND/DRBG names */
|
| 250 |
+
#define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
|
| 251 |
+
#define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
|
| 252 |
+
#define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
|
| 253 |
+
#define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
|
| 254 |
+
#define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
|
| 255 |
+
#define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
|
| 256 |
+
#define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
|
| 257 |
+
#define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
|
| 258 |
+
#define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
|
| 259 |
+
#define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
|
| 260 |
+
#define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 261 |
+
#define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 262 |
+
#define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 263 |
+
#define OSSL_DRBG_PARAM_MAC OSSL_ALG_PARAM_MAC
|
| 264 |
+
#define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
|
| 265 |
+
|
| 266 |
+
/* DRBG call back parameters */
|
| 267 |
+
#define OSSL_DRBG_PARAM_ENTROPY_REQUIRED "entropy_required"
|
| 268 |
+
#define OSSL_DRBG_PARAM_PREDICTION_RESISTANCE "prediction_resistance"
|
| 269 |
+
#define OSSL_DRBG_PARAM_MIN_LENGTH "minium_length"
|
| 270 |
+
#define OSSL_DRBG_PARAM_MAX_LENGTH "maxium_length"
|
| 271 |
+
#define OSSL_DRBG_PARAM_RANDOM_DATA "random_data"
|
| 272 |
+
#define OSSL_DRBG_PARAM_SIZE "size"
|
| 273 |
+
|
| 274 |
+
/* PKEY parameters */
|
| 275 |
+
/* Common PKEY parameters */
|
| 276 |
+
#define OSSL_PKEY_PARAM_BITS "bits" /* integer */
|
| 277 |
+
#define OSSL_PKEY_PARAM_MAX_SIZE "max-size" /* integer */
|
| 278 |
+
#define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits" /* integer */
|
| 279 |
+
#define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 280 |
+
#define OSSL_PKEY_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER /* utf8 string */
|
| 281 |
+
#define OSSL_PKEY_PARAM_ENGINE OSSL_ALG_PARAM_ENGINE /* utf8 string */
|
| 282 |
+
#define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 283 |
+
#define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest" /* utf8 string */
|
| 284 |
+
#define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest" /* utf8 string */
|
| 285 |
+
#define OSSL_PKEY_PARAM_PAD_MODE "pad-mode"
|
| 286 |
+
#define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size"
|
| 287 |
+
#define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
|
| 288 |
+
#define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
|
| 289 |
+
#define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties"
|
| 290 |
+
#define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
|
| 291 |
+
#define OSSL_PKEY_PARAM_GROUP_NAME "group"
|
| 292 |
+
#define OSSL_PKEY_PARAM_DIST_ID "distid"
|
| 293 |
+
#define OSSL_PKEY_PARAM_PUB_KEY "pub"
|
| 294 |
+
#define OSSL_PKEY_PARAM_PRIV_KEY "priv"
|
| 295 |
+
|
| 296 |
+
/* Diffie-Hellman/DSA Parameters */
|
| 297 |
+
#define OSSL_PKEY_PARAM_FFC_P "p"
|
| 298 |
+
#define OSSL_PKEY_PARAM_FFC_G "g"
|
| 299 |
+
#define OSSL_PKEY_PARAM_FFC_Q "q"
|
| 300 |
+
#define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
|
| 301 |
+
#define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
|
| 302 |
+
#define OSSL_PKEY_PARAM_FFC_SEED "seed"
|
| 303 |
+
#define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
|
| 304 |
+
#define OSSL_PKEY_PARAM_FFC_H "hindex"
|
| 305 |
+
#define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
|
| 306 |
+
#define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
|
| 307 |
+
#define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
|
| 308 |
+
|
| 309 |
+
/* Diffie-Hellman params */
|
| 310 |
+
#define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator"
|
| 311 |
+
#define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
|
| 312 |
+
|
| 313 |
+
/* Elliptic Curve Domain Parameters */
|
| 314 |
+
#define OSSL_PKEY_PARAM_EC_PUB_X "qx"
|
| 315 |
+
#define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
|
| 316 |
+
|
| 317 |
+
/* Elliptic Curve Explicit Domain Parameters */
|
| 318 |
+
#define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
|
| 319 |
+
#define OSSL_PKEY_PARAM_EC_P "p"
|
| 320 |
+
#define OSSL_PKEY_PARAM_EC_A "a"
|
| 321 |
+
#define OSSL_PKEY_PARAM_EC_B "b"
|
| 322 |
+
#define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
|
| 323 |
+
#define OSSL_PKEY_PARAM_EC_ORDER "order"
|
| 324 |
+
#define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
|
| 325 |
+
#define OSSL_PKEY_PARAM_EC_SEED "seed"
|
| 326 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
|
| 327 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
|
| 328 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
|
| 329 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
|
| 330 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
|
| 331 |
+
#define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
|
| 332 |
+
#define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
|
| 333 |
+
|
| 334 |
+
/* Elliptic Curve Key Parameters */
|
| 335 |
+
#define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
|
| 336 |
+
#define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH \
|
| 337 |
+
OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
|
| 338 |
+
|
| 339 |
+
/* RSA Keys */
|
| 340 |
+
/*
|
| 341 |
+
* n, e, d are the usual public and private key components
|
| 342 |
+
*
|
| 343 |
+
* rsa-num is the number of factors, including p and q
|
| 344 |
+
* rsa-factor is used for each factor: p, q, r_i (i = 3, ...)
|
| 345 |
+
* rsa-exponent is used for each exponent: dP, dQ, d_i (i = 3, ...)
|
| 346 |
+
* rsa-coefficient is used for each coefficient: qInv, t_i (i = 3, ...)
|
| 347 |
+
*
|
| 348 |
+
* The number of rsa-factor items must be equal to the number of rsa-exponent
|
| 349 |
+
* items, and the number of rsa-coefficients must be one less.
|
| 350 |
+
* (the base i for the coefficients is 2, not 1, at least as implied by
|
| 351 |
+
* RFC 8017)
|
| 352 |
+
*/
|
| 353 |
+
#define OSSL_PKEY_PARAM_RSA_N "n"
|
| 354 |
+
#define OSSL_PKEY_PARAM_RSA_E "e"
|
| 355 |
+
#define OSSL_PKEY_PARAM_RSA_D "d"
|
| 356 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR "rsa-factor"
|
| 357 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT "rsa-exponent"
|
| 358 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient"
|
| 359 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR1 OSSL_PKEY_PARAM_RSA_FACTOR"1"
|
| 360 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR2 OSSL_PKEY_PARAM_RSA_FACTOR"2"
|
| 361 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR3 OSSL_PKEY_PARAM_RSA_FACTOR"3"
|
| 362 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR4 OSSL_PKEY_PARAM_RSA_FACTOR"4"
|
| 363 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR5 OSSL_PKEY_PARAM_RSA_FACTOR"5"
|
| 364 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR6 OSSL_PKEY_PARAM_RSA_FACTOR"6"
|
| 365 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR7 OSSL_PKEY_PARAM_RSA_FACTOR"7"
|
| 366 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR8 OSSL_PKEY_PARAM_RSA_FACTOR"8"
|
| 367 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR9 OSSL_PKEY_PARAM_RSA_FACTOR"9"
|
| 368 |
+
#define OSSL_PKEY_PARAM_RSA_FACTOR10 OSSL_PKEY_PARAM_RSA_FACTOR"10"
|
| 369 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT1 OSSL_PKEY_PARAM_RSA_EXPONENT"1"
|
| 370 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT2 OSSL_PKEY_PARAM_RSA_EXPONENT"2"
|
| 371 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT3 OSSL_PKEY_PARAM_RSA_EXPONENT"3"
|
| 372 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT4 OSSL_PKEY_PARAM_RSA_EXPONENT"4"
|
| 373 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT5 OSSL_PKEY_PARAM_RSA_EXPONENT"5"
|
| 374 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT6 OSSL_PKEY_PARAM_RSA_EXPONENT"6"
|
| 375 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT7 OSSL_PKEY_PARAM_RSA_EXPONENT"7"
|
| 376 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT8 OSSL_PKEY_PARAM_RSA_EXPONENT"8"
|
| 377 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT9 OSSL_PKEY_PARAM_RSA_EXPONENT"9"
|
| 378 |
+
#define OSSL_PKEY_PARAM_RSA_EXPONENT10 OSSL_PKEY_PARAM_RSA_EXPONENT"10"
|
| 379 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 OSSL_PKEY_PARAM_RSA_COEFFICIENT"1"
|
| 380 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 OSSL_PKEY_PARAM_RSA_COEFFICIENT"2"
|
| 381 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 OSSL_PKEY_PARAM_RSA_COEFFICIENT"3"
|
| 382 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 OSSL_PKEY_PARAM_RSA_COEFFICIENT"4"
|
| 383 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 OSSL_PKEY_PARAM_RSA_COEFFICIENT"5"
|
| 384 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 OSSL_PKEY_PARAM_RSA_COEFFICIENT"6"
|
| 385 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 OSSL_PKEY_PARAM_RSA_COEFFICIENT"7"
|
| 386 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 OSSL_PKEY_PARAM_RSA_COEFFICIENT"8"
|
| 387 |
+
#define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 OSSL_PKEY_PARAM_RSA_COEFFICIENT"9"
|
| 388 |
+
|
| 389 |
+
/* RSA padding modes */
|
| 390 |
+
#define OSSL_PKEY_RSA_PAD_MODE_NONE "none"
|
| 391 |
+
#define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1"
|
| 392 |
+
#define OSSL_PKEY_RSA_PAD_MODE_OAEP "oaep"
|
| 393 |
+
#define OSSL_PKEY_RSA_PAD_MODE_X931 "x931"
|
| 394 |
+
#define OSSL_PKEY_RSA_PAD_MODE_PSS "pss"
|
| 395 |
+
|
| 396 |
+
/* RSA pss padding salt length */
|
| 397 |
+
#define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
|
| 398 |
+
#define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX "max"
|
| 399 |
+
#define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO "auto"
|
| 400 |
+
|
| 401 |
+
/* Key generation parameters */
|
| 402 |
+
#define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
|
| 403 |
+
#define OSSL_PKEY_PARAM_RSA_PRIMES "primes"
|
| 404 |
+
#define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 405 |
+
#define OSSL_PKEY_PARAM_RSA_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
| 406 |
+
#define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
|
| 407 |
+
#define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 408 |
+
#define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
|
| 409 |
+
|
| 410 |
+
/* Key generation parameters */
|
| 411 |
+
#define OSSL_PKEY_PARAM_FFC_TYPE "type"
|
| 412 |
+
#define OSSL_PKEY_PARAM_FFC_PBITS "pbits"
|
| 413 |
+
#define OSSL_PKEY_PARAM_FFC_QBITS "qbits"
|
| 414 |
+
#define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 415 |
+
#define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
| 416 |
+
|
| 417 |
+
#define OSSL_PKEY_PARAM_EC_ENCODING "encoding" /* utf8_string */
|
| 418 |
+
#define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
|
| 419 |
+
#define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
|
| 420 |
+
#define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
|
| 421 |
+
|
| 422 |
+
/* OSSL_PKEY_PARAM_EC_ENCODING values */
|
| 423 |
+
#define OSSL_PKEY_EC_ENCODING_EXPLICIT "explicit"
|
| 424 |
+
#define OSSL_PKEY_EC_ENCODING_GROUP "named_curve"
|
| 425 |
+
|
| 426 |
+
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_UNCOMPRESSED "uncompressed"
|
| 427 |
+
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_COMPRESSED "compressed"
|
| 428 |
+
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID "hybrid"
|
| 429 |
+
|
| 430 |
+
#define OSSL_PKEY_EC_GROUP_CHECK_DEFAULT "default"
|
| 431 |
+
#define OSSL_PKEY_EC_GROUP_CHECK_NAMED "named"
|
| 432 |
+
#define OSSL_PKEY_EC_GROUP_CHECK_NAMED_NIST "named-nist"
|
| 433 |
+
|
| 434 |
+
/* Key Exchange parameters */
|
| 435 |
+
#define OSSL_EXCHANGE_PARAM_PAD "pad" /* uint */
|
| 436 |
+
#define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode" /* int */
|
| 437 |
+
#define OSSL_EXCHANGE_PARAM_KDF_TYPE "kdf-type" /* utf8_string */
|
| 438 |
+
#define OSSL_EXCHANGE_PARAM_KDF_DIGEST "kdf-digest" /* utf8_string */
|
| 439 |
+
#define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS "kdf-digest-props" /* utf8_string */
|
| 440 |
+
#define OSSL_EXCHANGE_PARAM_KDF_OUTLEN "kdf-outlen" /* size_t */
|
| 441 |
+
/* The following parameter is an octet_string on set and an octet_ptr on get */
|
| 442 |
+
#define OSSL_EXCHANGE_PARAM_KDF_UKM "kdf-ukm"
|
| 443 |
+
|
| 444 |
+
/* Signature parameters */
|
| 445 |
+
#define OSSL_SIGNATURE_PARAM_ALGORITHM_ID "algorithm-id"
|
| 446 |
+
#define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
| 447 |
+
#define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 448 |
+
#define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
| 449 |
+
#define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen"
|
| 450 |
+
#define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 451 |
+
#define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES \
|
| 452 |
+
OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
| 453 |
+
#define OSSL_SIGNATURE_PARAM_DIGEST_SIZE OSSL_PKEY_PARAM_DIGEST_SIZE
|
| 454 |
+
|
| 455 |
+
/* Asym cipher parameters */
|
| 456 |
+
#define OSSL_ASYM_CIPHER_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 457 |
+
#define OSSL_ASYM_CIPHER_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
| 458 |
+
#define OSSL_ASYM_CIPHER_PARAM_ENGINE OSSL_PKEY_PARAM_ENGINE
|
| 459 |
+
#define OSSL_ASYM_CIPHER_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
| 460 |
+
#define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST \
|
| 461 |
+
OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 462 |
+
#define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS \
|
| 463 |
+
OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
| 464 |
+
#define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 465 |
+
#define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS "digest-props"
|
| 466 |
+
/* The following parameter is an octet_string on set and an octet_ptr on get */
|
| 467 |
+
#define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label"
|
| 468 |
+
#define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version"
|
| 469 |
+
#define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version"
|
| 470 |
+
|
| 471 |
+
/*
|
| 472 |
+
* Encoder / decoder parameters
|
| 473 |
+
*/
|
| 474 |
+
#define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 475 |
+
#define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 476 |
+
/* Currently PVK only, but reusable for others as needed */
|
| 477 |
+
#define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL "encrypt-level"
|
| 478 |
+
#define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters" /* integer */
|
| 479 |
+
|
| 480 |
+
#define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 481 |
+
|
| 482 |
+
/* Passphrase callback parameters */
|
| 483 |
+
#define OSSL_PASSPHRASE_PARAM_INFO "info"
|
| 484 |
+
|
| 485 |
+
/* Keygen callback parameters, from provider to libcrypto */
|
| 486 |
+
#define OSSL_GEN_PARAM_POTENTIAL "potential" /* integer */
|
| 487 |
+
#define OSSL_GEN_PARAM_ITERATION "iteration" /* integer */
|
| 488 |
+
|
| 489 |
+
/* ACVP Test parameters : These should not be used normally */
|
| 490 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XP1 "xp1"
|
| 491 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XP2 "xp2"
|
| 492 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XP "xp"
|
| 493 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XQ1 "xq1"
|
| 494 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XQ2 "xq2"
|
| 495 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_XQ "xq"
|
| 496 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_P1 "p1"
|
| 497 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_P2 "p2"
|
| 498 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_Q1 "q1"
|
| 499 |
+
#define OSSL_PKEY_PARAM_RSA_TEST_Q2 "q2"
|
| 500 |
+
#define OSSL_SIGNATURE_PARAM_KAT "kat"
|
| 501 |
+
|
| 502 |
+
/* KEM parameters */
|
| 503 |
+
#define OSSL_KEM_PARAM_OPERATION "operation"
|
| 504 |
+
|
| 505 |
+
/* OSSL_KEM_PARAM_OPERATION values */
|
| 506 |
+
#define OSSL_KEM_PARAM_OPERATION_RSASVE "RSASVE"
|
| 507 |
+
|
| 508 |
+
/* Capabilities */
|
| 509 |
+
|
| 510 |
+
/* TLS-GROUP Capability */
|
| 511 |
+
#define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name"
|
| 512 |
+
#define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal"
|
| 513 |
+
#define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id"
|
| 514 |
+
#define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg"
|
| 515 |
+
#define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits"
|
| 516 |
+
#define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem"
|
| 517 |
+
#define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls"
|
| 518 |
+
#define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls"
|
| 519 |
+
#define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls"
|
| 520 |
+
#define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls"
|
| 521 |
+
|
| 522 |
+
/*-
|
| 523 |
+
* storemgmt parameters
|
| 524 |
+
*/
|
| 525 |
+
|
| 526 |
+
/*
|
| 527 |
+
* Used by storemgmt_ctx_set_params():
|
| 528 |
+
*
|
| 529 |
+
* - OSSL_STORE_PARAM_EXPECT is an INTEGER, and the value is any of the
|
| 530 |
+
* OSSL_STORE_INFO numbers. This is used to set the expected type of
|
| 531 |
+
* object loaded.
|
| 532 |
+
*
|
| 533 |
+
* - OSSL_STORE_PARAM_SUBJECT, OSSL_STORE_PARAM_ISSUER,
|
| 534 |
+
* OSSL_STORE_PARAM_SERIAL, OSSL_STORE_PARAM_FINGERPRINT,
|
| 535 |
+
* OSSL_STORE_PARAM_DIGEST, OSSL_STORE_PARAM_ALIAS
|
| 536 |
+
* are used as search criteria.
|
| 537 |
+
* (OSSL_STORE_PARAM_DIGEST is used with OSSL_STORE_PARAM_FINGERPRINT)
|
| 538 |
+
*/
|
| 539 |
+
#define OSSL_STORE_PARAM_EXPECT "expect" /* INTEGER */
|
| 540 |
+
#define OSSL_STORE_PARAM_SUBJECT "subject" /* DER blob => OCTET_STRING */
|
| 541 |
+
#define OSSL_STORE_PARAM_ISSUER "name" /* DER blob => OCTET_STRING */
|
| 542 |
+
#define OSSL_STORE_PARAM_SERIAL "serial" /* INTEGER */
|
| 543 |
+
#define OSSL_STORE_PARAM_DIGEST "digest" /* UTF8_STRING */
|
| 544 |
+
#define OSSL_STORE_PARAM_FINGERPRINT "fingerprint" /* OCTET_STRING */
|
| 545 |
+
#define OSSL_STORE_PARAM_ALIAS "alias" /* UTF8_STRING */
|
| 546 |
+
|
| 547 |
+
/* You may want to pass properties for the provider implementation to use */
|
| 548 |
+
#define OSSL_STORE_PARAM_PROPERTIES "properties" /* utf8_string */
|
| 549 |
+
/* OSSL_DECODER input type if a decoder is used by the store */
|
| 550 |
+
#define OSSL_STORE_PARAM_INPUT_TYPE "input-type" /* UTF8_STRING */
|
| 551 |
+
|
| 552 |
+
# ifdef __cplusplus
|
| 553 |
+
}
|
| 554 |
+
# endif
|
| 555 |
+
|
| 556 |
+
#endif
|
llava_next/include/openssl/crmf.h
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/crmf.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright Nokia 2007-2019
|
| 7 |
+
* Copyright Siemens AG 2015-2019
|
| 8 |
+
*
|
| 9 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 10 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 11 |
+
* in the file LICENSE in the source distribution or at
|
| 12 |
+
* https://www.openssl.org/source/license.html
|
| 13 |
+
*
|
| 14 |
+
* CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
#ifndef OPENSSL_CRMF_H
|
| 20 |
+
# define OPENSSL_CRMF_H
|
| 21 |
+
|
| 22 |
+
# include <openssl/opensslconf.h>
|
| 23 |
+
|
| 24 |
+
# ifndef OPENSSL_NO_CRMF
|
| 25 |
+
# include <openssl/opensslv.h>
|
| 26 |
+
# include <openssl/safestack.h>
|
| 27 |
+
# include <openssl/crmferr.h>
|
| 28 |
+
# include <openssl/x509v3.h> /* for GENERAL_NAME etc. */
|
| 29 |
+
|
| 30 |
+
/* explicit #includes not strictly needed since implied by the above: */
|
| 31 |
+
# include <openssl/types.h>
|
| 32 |
+
# include <openssl/x509.h>
|
| 33 |
+
|
| 34 |
+
# ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
# endif
|
| 37 |
+
|
| 38 |
+
# define OSSL_CRMF_POPOPRIVKEY_THISMESSAGE 0
|
| 39 |
+
# define OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE 1
|
| 40 |
+
# define OSSL_CRMF_POPOPRIVKEY_DHMAC 2
|
| 41 |
+
# define OSSL_CRMF_POPOPRIVKEY_AGREEMAC 3
|
| 42 |
+
# define OSSL_CRMF_POPOPRIVKEY_ENCRYPTEDKEY 4
|
| 43 |
+
|
| 44 |
+
# define OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT 0
|
| 45 |
+
# define OSSL_CRMF_SUBSEQUENTMESSAGE_CHALLENGERESP 1
|
| 46 |
+
|
| 47 |
+
typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE;
|
| 48 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
|
| 49 |
+
typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
|
| 50 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
|
| 51 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
|
| 52 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_MSG, OSSL_CRMF_MSG, OSSL_CRMF_MSG)
|
| 53 |
+
#define sk_OSSL_CRMF_MSG_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
|
| 54 |
+
#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx)))
|
| 55 |
+
#define sk_OSSL_CRMF_MSG_new(cmp) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
| 56 |
+
#define sk_OSSL_CRMF_MSG_new_null() ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_null())
|
| 57 |
+
#define sk_OSSL_CRMF_MSG_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp), (n)))
|
| 58 |
+
#define sk_OSSL_CRMF_MSG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (n))
|
| 59 |
+
#define sk_OSSL_CRMF_MSG_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 60 |
+
#define sk_OSSL_CRMF_MSG_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 61 |
+
#define sk_OSSL_CRMF_MSG_delete(sk, i) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (i)))
|
| 62 |
+
#define sk_OSSL_CRMF_MSG_delete_ptr(sk, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)))
|
| 63 |
+
#define sk_OSSL_CRMF_MSG_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 64 |
+
#define sk_OSSL_CRMF_MSG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 65 |
+
#define sk_OSSL_CRMF_MSG_pop(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_MSG_sk_type(sk)))
|
| 66 |
+
#define sk_OSSL_CRMF_MSG_shift(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_MSG_sk_type(sk)))
|
| 67 |
+
#define sk_OSSL_CRMF_MSG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk),ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc))
|
| 68 |
+
#define sk_OSSL_CRMF_MSG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), (idx))
|
| 69 |
+
#define sk_OSSL_CRMF_MSG_set(sk, idx, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (idx), ossl_check_OSSL_CRMF_MSG_type(ptr)))
|
| 70 |
+
#define sk_OSSL_CRMF_MSG_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 71 |
+
#define sk_OSSL_CRMF_MSG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 72 |
+
#define sk_OSSL_CRMF_MSG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), pnum)
|
| 73 |
+
#define sk_OSSL_CRMF_MSG_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 74 |
+
#define sk_OSSL_CRMF_MSG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
|
| 75 |
+
#define sk_OSSL_CRMF_MSG_dup(sk) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk)))
|
| 76 |
+
#define sk_OSSL_CRMF_MSG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc)))
|
| 77 |
+
#define sk_OSSL_CRMF_MSG_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_MSG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
| 78 |
+
|
| 79 |
+
typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
|
| 80 |
+
typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
|
| 81 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
|
| 82 |
+
typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY;
|
| 83 |
+
typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
|
| 84 |
+
typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
|
| 85 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
|
| 86 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
|
| 87 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_CERTID, OSSL_CRMF_CERTID, OSSL_CRMF_CERTID)
|
| 88 |
+
#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
|
| 89 |
+
#define sk_OSSL_CRMF_CERTID_value(sk, idx) ((OSSL_CRMF_CERTID *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), (idx)))
|
| 90 |
+
#define sk_OSSL_CRMF_CERTID_new(cmp) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
| 91 |
+
#define sk_OSSL_CRMF_CERTID_new_null() ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_null())
|
| 92 |
+
#define sk_OSSL_CRMF_CERTID_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp), (n)))
|
| 93 |
+
#define sk_OSSL_CRMF_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (n))
|
| 94 |
+
#define sk_OSSL_CRMF_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 95 |
+
#define sk_OSSL_CRMF_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 96 |
+
#define sk_OSSL_CRMF_CERTID_delete(sk, i) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (i)))
|
| 97 |
+
#define sk_OSSL_CRMF_CERTID_delete_ptr(sk, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)))
|
| 98 |
+
#define sk_OSSL_CRMF_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 99 |
+
#define sk_OSSL_CRMF_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 100 |
+
#define sk_OSSL_CRMF_CERTID_pop(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 101 |
+
#define sk_OSSL_CRMF_CERTID_shift(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 102 |
+
#define sk_OSSL_CRMF_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk),ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc))
|
| 103 |
+
#define sk_OSSL_CRMF_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), (idx))
|
| 104 |
+
#define sk_OSSL_CRMF_CERTID_set(sk, idx, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (idx), ossl_check_OSSL_CRMF_CERTID_type(ptr)))
|
| 105 |
+
#define sk_OSSL_CRMF_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 106 |
+
#define sk_OSSL_CRMF_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 107 |
+
#define sk_OSSL_CRMF_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), pnum)
|
| 108 |
+
#define sk_OSSL_CRMF_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 109 |
+
#define sk_OSSL_CRMF_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
|
| 110 |
+
#define sk_OSSL_CRMF_CERTID_dup(sk) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 111 |
+
#define sk_OSSL_CRMF_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc)))
|
| 112 |
+
#define sk_OSSL_CRMF_CERTID_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
|
| 116 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
|
| 117 |
+
typedef struct ossl_crmf_singlepubinfo_st OSSL_CRMF_SINGLEPUBINFO;
|
| 118 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_SINGLEPUBINFO)
|
| 119 |
+
typedef struct ossl_crmf_certtemplate_st OSSL_CRMF_CERTTEMPLATE;
|
| 120 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTTEMPLATE)
|
| 121 |
+
typedef STACK_OF(OSSL_CRMF_MSG) OSSL_CRMF_MSGS;
|
| 122 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSGS)
|
| 123 |
+
|
| 124 |
+
typedef struct ossl_crmf_optionalvalidity_st OSSL_CRMF_OPTIONALVALIDITY;
|
| 125 |
+
|
| 126 |
+
/* crmf_pbm.c */
|
| 127 |
+
OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen,
|
| 128 |
+
int owfnid, size_t itercnt,
|
| 129 |
+
int macnid);
|
| 130 |
+
int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
|
| 131 |
+
const OSSL_CRMF_PBMPARAMETER *pbmp,
|
| 132 |
+
const unsigned char *msg, size_t msglen,
|
| 133 |
+
const unsigned char *sec, size_t seclen,
|
| 134 |
+
unsigned char **mac, size_t *maclen);
|
| 135 |
+
|
| 136 |
+
/* crmf_lib.c */
|
| 137 |
+
int OSSL_CRMF_MSG_set1_regCtrl_regToken(OSSL_CRMF_MSG *msg,
|
| 138 |
+
const ASN1_UTF8STRING *tok);
|
| 139 |
+
ASN1_UTF8STRING
|
| 140 |
+
*OSSL_CRMF_MSG_get0_regCtrl_regToken(const OSSL_CRMF_MSG *msg);
|
| 141 |
+
int OSSL_CRMF_MSG_set1_regCtrl_authenticator(OSSL_CRMF_MSG *msg,
|
| 142 |
+
const ASN1_UTF8STRING *auth);
|
| 143 |
+
ASN1_UTF8STRING
|
| 144 |
+
*OSSL_CRMF_MSG_get0_regCtrl_authenticator(const OSSL_CRMF_MSG *msg);
|
| 145 |
+
int
|
| 146 |
+
OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
| 147 |
+
OSSL_CRMF_SINGLEPUBINFO *spi);
|
| 148 |
+
# define OSSL_CRMF_PUB_METHOD_DONTCARE 0
|
| 149 |
+
# define OSSL_CRMF_PUB_METHOD_X500 1
|
| 150 |
+
# define OSSL_CRMF_PUB_METHOD_WEB 2
|
| 151 |
+
# define OSSL_CRMF_PUB_METHOD_LDAP 3
|
| 152 |
+
int OSSL_CRMF_MSG_set0_SinglePubInfo(OSSL_CRMF_SINGLEPUBINFO *spi,
|
| 153 |
+
int method, GENERAL_NAME *nm);
|
| 154 |
+
# define OSSL_CRMF_PUB_ACTION_DONTPUBLISH 0
|
| 155 |
+
# define OSSL_CRMF_PUB_ACTION_PLEASEPUBLISH 1
|
| 156 |
+
int OSSL_CRMF_MSG_set_PKIPublicationInfo_action(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
| 157 |
+
int action);
|
| 158 |
+
int OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo(OSSL_CRMF_MSG *msg,
|
| 159 |
+
const OSSL_CRMF_PKIPUBLICATIONINFO *pi);
|
| 160 |
+
OSSL_CRMF_PKIPUBLICATIONINFO
|
| 161 |
+
*OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo(const OSSL_CRMF_MSG *msg);
|
| 162 |
+
int OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey(OSSL_CRMF_MSG *msg,
|
| 163 |
+
const X509_PUBKEY *pubkey);
|
| 164 |
+
X509_PUBKEY
|
| 165 |
+
*OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey(const OSSL_CRMF_MSG *msg);
|
| 166 |
+
int OSSL_CRMF_MSG_set1_regCtrl_oldCertID(OSSL_CRMF_MSG *msg,
|
| 167 |
+
const OSSL_CRMF_CERTID *cid);
|
| 168 |
+
OSSL_CRMF_CERTID
|
| 169 |
+
*OSSL_CRMF_MSG_get0_regCtrl_oldCertID(const OSSL_CRMF_MSG *msg);
|
| 170 |
+
OSSL_CRMF_CERTID *OSSL_CRMF_CERTID_gen(const X509_NAME *issuer,
|
| 171 |
+
const ASN1_INTEGER *serial);
|
| 172 |
+
|
| 173 |
+
int OSSL_CRMF_MSG_set1_regInfo_utf8Pairs(OSSL_CRMF_MSG *msg,
|
| 174 |
+
const ASN1_UTF8STRING *utf8pairs);
|
| 175 |
+
ASN1_UTF8STRING
|
| 176 |
+
*OSSL_CRMF_MSG_get0_regInfo_utf8Pairs(const OSSL_CRMF_MSG *msg);
|
| 177 |
+
int OSSL_CRMF_MSG_set1_regInfo_certReq(OSSL_CRMF_MSG *msg,
|
| 178 |
+
const OSSL_CRMF_CERTREQUEST *cr);
|
| 179 |
+
OSSL_CRMF_CERTREQUEST
|
| 180 |
+
*OSSL_CRMF_MSG_get0_regInfo_certReq(const OSSL_CRMF_MSG *msg);
|
| 181 |
+
|
| 182 |
+
int OSSL_CRMF_MSG_set0_validity(OSSL_CRMF_MSG *crm,
|
| 183 |
+
ASN1_TIME *notBefore, ASN1_TIME *notAfter);
|
| 184 |
+
int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid);
|
| 185 |
+
int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm);
|
| 186 |
+
int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts);
|
| 187 |
+
|
| 188 |
+
int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext);
|
| 189 |
+
# define OSSL_CRMF_POPO_NONE -1
|
| 190 |
+
# define OSSL_CRMF_POPO_RAVERIFIED 0
|
| 191 |
+
# define OSSL_CRMF_POPO_SIGNATURE 1
|
| 192 |
+
# define OSSL_CRMF_POPO_KEYENC 2
|
| 193 |
+
# define OSSL_CRMF_POPO_KEYAGREE 3
|
| 194 |
+
int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
|
| 195 |
+
EVP_PKEY *pkey, const EVP_MD *digest,
|
| 196 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 197 |
+
int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
|
| 198 |
+
int rid, int acceptRAVerified,
|
| 199 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 200 |
+
OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm);
|
| 201 |
+
const ASN1_INTEGER
|
| 202 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 203 |
+
const X509_NAME
|
| 204 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_subject(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 205 |
+
const X509_NAME
|
| 206 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 207 |
+
X509_EXTENSIONS
|
| 208 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_extensions(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 209 |
+
const X509_NAME
|
| 210 |
+
*OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid);
|
| 211 |
+
const ASN1_INTEGER
|
| 212 |
+
*OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid);
|
| 213 |
+
int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl,
|
| 214 |
+
EVP_PKEY *pubkey,
|
| 215 |
+
const X509_NAME *subject,
|
| 216 |
+
const X509_NAME *issuer,
|
| 217 |
+
const ASN1_INTEGER *serial);
|
| 218 |
+
X509
|
| 219 |
+
*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
|
| 220 |
+
OSSL_LIB_CTX *libctx, const char *propq,
|
| 221 |
+
EVP_PKEY *pkey);
|
| 222 |
+
|
| 223 |
+
# ifdef __cplusplus
|
| 224 |
+
}
|
| 225 |
+
# endif
|
| 226 |
+
# endif /* !defined(OPENSSL_NO_CRMF) */
|
| 227 |
+
#endif /* !defined(OPENSSL_CRMF_H) */
|
llava_next/include/openssl/crypto.h
ADDED
|
@@ -0,0 +1,558 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/crypto.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_CRYPTO_H
|
| 17 |
+
# define OPENSSL_CRYPTO_H
|
| 18 |
+
# pragma once
|
| 19 |
+
|
| 20 |
+
# include <openssl/macros.h>
|
| 21 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
# define HEADER_CRYPTO_H
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <stdlib.h>
|
| 26 |
+
# include <time.h>
|
| 27 |
+
|
| 28 |
+
# include <openssl/e_os2.h>
|
| 29 |
+
|
| 30 |
+
# ifndef OPENSSL_NO_STDIO
|
| 31 |
+
# include <stdio.h>
|
| 32 |
+
# endif
|
| 33 |
+
|
| 34 |
+
# include <openssl/safestack.h>
|
| 35 |
+
# include <openssl/opensslv.h>
|
| 36 |
+
# include <openssl/types.h>
|
| 37 |
+
# include <openssl/opensslconf.h>
|
| 38 |
+
# include <openssl/cryptoerr.h>
|
| 39 |
+
# include <openssl/core.h>
|
| 40 |
+
|
| 41 |
+
# ifdef CHARSET_EBCDIC
|
| 42 |
+
# include <openssl/ebcdic.h>
|
| 43 |
+
# endif
|
| 44 |
+
|
| 45 |
+
/*
|
| 46 |
+
* Resolve problems on some operating systems with symbol names that clash
|
| 47 |
+
* one way or another
|
| 48 |
+
*/
|
| 49 |
+
# include <openssl/symhacks.h>
|
| 50 |
+
|
| 51 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 52 |
+
# include <openssl/opensslv.h>
|
| 53 |
+
# endif
|
| 54 |
+
|
| 55 |
+
#ifdef __cplusplus
|
| 56 |
+
extern "C" {
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 60 |
+
# define SSLeay OpenSSL_version_num
|
| 61 |
+
# define SSLeay_version OpenSSL_version
|
| 62 |
+
# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
|
| 63 |
+
# define SSLEAY_VERSION OPENSSL_VERSION
|
| 64 |
+
# define SSLEAY_CFLAGS OPENSSL_CFLAGS
|
| 65 |
+
# define SSLEAY_BUILT_ON OPENSSL_BUILT_ON
|
| 66 |
+
# define SSLEAY_PLATFORM OPENSSL_PLATFORM
|
| 67 |
+
# define SSLEAY_DIR OPENSSL_DIR
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
+
* Old type for allocating dynamic locks. No longer used. Use the new thread
|
| 71 |
+
* API instead.
|
| 72 |
+
*/
|
| 73 |
+
typedef struct {
|
| 74 |
+
int dummy;
|
| 75 |
+
} CRYPTO_dynlock;
|
| 76 |
+
|
| 77 |
+
# endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
| 78 |
+
|
| 79 |
+
typedef void CRYPTO_RWLOCK;
|
| 80 |
+
|
| 81 |
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
|
| 82 |
+
__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
|
| 83 |
+
__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
|
| 84 |
+
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock);
|
| 85 |
+
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock);
|
| 86 |
+
|
| 87 |
+
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
|
| 88 |
+
int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
|
| 89 |
+
CRYPTO_RWLOCK *lock);
|
| 90 |
+
int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock);
|
| 91 |
+
|
| 92 |
+
/* No longer needed, so this is a no-op */
|
| 93 |
+
#define OPENSSL_malloc_init() while(0) continue
|
| 94 |
+
|
| 95 |
+
# define OPENSSL_malloc(num) \
|
| 96 |
+
CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
| 97 |
+
# define OPENSSL_zalloc(num) \
|
| 98 |
+
CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
| 99 |
+
# define OPENSSL_realloc(addr, num) \
|
| 100 |
+
CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
| 101 |
+
# define OPENSSL_clear_realloc(addr, old_num, num) \
|
| 102 |
+
CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
|
| 103 |
+
# define OPENSSL_clear_free(addr, num) \
|
| 104 |
+
CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
| 105 |
+
# define OPENSSL_free(addr) \
|
| 106 |
+
CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
| 107 |
+
# define OPENSSL_memdup(str, s) \
|
| 108 |
+
CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
|
| 109 |
+
# define OPENSSL_strdup(str) \
|
| 110 |
+
CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
|
| 111 |
+
# define OPENSSL_strndup(str, n) \
|
| 112 |
+
CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
|
| 113 |
+
# define OPENSSL_secure_malloc(num) \
|
| 114 |
+
CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
| 115 |
+
# define OPENSSL_secure_zalloc(num) \
|
| 116 |
+
CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
| 117 |
+
# define OPENSSL_secure_free(addr) \
|
| 118 |
+
CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
| 119 |
+
# define OPENSSL_secure_clear_free(addr, num) \
|
| 120 |
+
CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
| 121 |
+
# define OPENSSL_secure_actual_size(ptr) \
|
| 122 |
+
CRYPTO_secure_actual_size(ptr)
|
| 123 |
+
|
| 124 |
+
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
|
| 125 |
+
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
|
| 126 |
+
size_t OPENSSL_strnlen(const char *str, size_t maxlen);
|
| 127 |
+
int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlength,
|
| 128 |
+
const unsigned char *buf, size_t buflen,
|
| 129 |
+
const char sep);
|
| 130 |
+
char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen);
|
| 131 |
+
int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen,
|
| 132 |
+
const char *str, const char sep);
|
| 133 |
+
unsigned char *OPENSSL_hexstr2buf(const char *str, long *buflen);
|
| 134 |
+
int OPENSSL_hexchar2int(unsigned char c);
|
| 135 |
+
int OPENSSL_strcasecmp(const char *s1, const char *s2);
|
| 136 |
+
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
|
| 137 |
+
|
| 138 |
+
# define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
|
| 139 |
+
|
| 140 |
+
/*
|
| 141 |
+
* These functions return the values of OPENSSL_VERSION_MAJOR,
|
| 142 |
+
* OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH, OPENSSL_VERSION_PRE_RELEASE
|
| 143 |
+
* and OPENSSL_VERSION_BUILD_METADATA, respectively.
|
| 144 |
+
*/
|
| 145 |
+
unsigned int OPENSSL_version_major(void);
|
| 146 |
+
unsigned int OPENSSL_version_minor(void);
|
| 147 |
+
unsigned int OPENSSL_version_patch(void);
|
| 148 |
+
const char *OPENSSL_version_pre_release(void);
|
| 149 |
+
const char *OPENSSL_version_build_metadata(void);
|
| 150 |
+
|
| 151 |
+
unsigned long OpenSSL_version_num(void);
|
| 152 |
+
const char *OpenSSL_version(int type);
|
| 153 |
+
# define OPENSSL_VERSION 0
|
| 154 |
+
# define OPENSSL_CFLAGS 1
|
| 155 |
+
# define OPENSSL_BUILT_ON 2
|
| 156 |
+
# define OPENSSL_PLATFORM 3
|
| 157 |
+
# define OPENSSL_DIR 4
|
| 158 |
+
# define OPENSSL_ENGINES_DIR 5
|
| 159 |
+
# define OPENSSL_VERSION_STRING 6
|
| 160 |
+
# define OPENSSL_FULL_VERSION_STRING 7
|
| 161 |
+
# define OPENSSL_MODULES_DIR 8
|
| 162 |
+
# define OPENSSL_CPU_INFO 9
|
| 163 |
+
|
| 164 |
+
const char *OPENSSL_info(int type);
|
| 165 |
+
/*
|
| 166 |
+
* The series starts at 1001 to avoid confusion with the OpenSSL_version
|
| 167 |
+
* types.
|
| 168 |
+
*/
|
| 169 |
+
# define OPENSSL_INFO_CONFIG_DIR 1001
|
| 170 |
+
# define OPENSSL_INFO_ENGINES_DIR 1002
|
| 171 |
+
# define OPENSSL_INFO_MODULES_DIR 1003
|
| 172 |
+
# define OPENSSL_INFO_DSO_EXTENSION 1004
|
| 173 |
+
# define OPENSSL_INFO_DIR_FILENAME_SEPARATOR 1005
|
| 174 |
+
# define OPENSSL_INFO_LIST_SEPARATOR 1006
|
| 175 |
+
# define OPENSSL_INFO_SEED_SOURCE 1007
|
| 176 |
+
# define OPENSSL_INFO_CPU_SETTINGS 1008
|
| 177 |
+
|
| 178 |
+
int OPENSSL_issetugid(void);
|
| 179 |
+
|
| 180 |
+
struct crypto_ex_data_st {
|
| 181 |
+
OSSL_LIB_CTX *ctx;
|
| 182 |
+
STACK_OF(void) *sk;
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
SKM_DEFINE_STACK_OF_INTERNAL(void, void, void)
|
| 186 |
+
#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
|
| 187 |
+
#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx)))
|
| 188 |
+
#define sk_void_new(cmp) ((STACK_OF(void) *)OPENSSL_sk_new(ossl_check_void_compfunc_type(cmp)))
|
| 189 |
+
#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null())
|
| 190 |
+
#define sk_void_new_reserve(cmp, n) ((STACK_OF(void) *)OPENSSL_sk_new_reserve(ossl_check_void_compfunc_type(cmp), (n)))
|
| 191 |
+
#define sk_void_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_void_sk_type(sk), (n))
|
| 192 |
+
#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
|
| 193 |
+
#define sk_void_zero(sk) OPENSSL_sk_zero(ossl_check_void_sk_type(sk))
|
| 194 |
+
#define sk_void_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_void_sk_type(sk), (i)))
|
| 195 |
+
#define sk_void_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)))
|
| 196 |
+
#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
| 197 |
+
#define sk_void_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
| 198 |
+
#define sk_void_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_void_sk_type(sk)))
|
| 199 |
+
#define sk_void_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_void_sk_type(sk)))
|
| 200 |
+
#define sk_void_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_void_sk_type(sk),ossl_check_void_freefunc_type(freefunc))
|
| 201 |
+
#define sk_void_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), (idx))
|
| 202 |
+
#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr)))
|
| 203 |
+
#define sk_void_find(sk, ptr) OPENSSL_sk_find(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
| 204 |
+
#define sk_void_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
| 205 |
+
#define sk_void_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), pnum)
|
| 206 |
+
#define sk_void_sort(sk) OPENSSL_sk_sort(ossl_check_void_sk_type(sk))
|
| 207 |
+
#define sk_void_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_void_sk_type(sk))
|
| 208 |
+
#define sk_void_dup(sk) ((STACK_OF(void) *)OPENSSL_sk_dup(ossl_check_const_void_sk_type(sk)))
|
| 209 |
+
#define sk_void_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(void) *)OPENSSL_sk_deep_copy(ossl_check_const_void_sk_type(sk), ossl_check_void_copyfunc_type(copyfunc), ossl_check_void_freefunc_type(freefunc)))
|
| 210 |
+
#define sk_void_set_cmp_func(sk, cmp) ((sk_void_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_void_sk_type(sk), ossl_check_void_compfunc_type(cmp)))
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
/*
|
| 215 |
+
* Per class, we have a STACK of function pointers.
|
| 216 |
+
*/
|
| 217 |
+
# define CRYPTO_EX_INDEX_SSL 0
|
| 218 |
+
# define CRYPTO_EX_INDEX_SSL_CTX 1
|
| 219 |
+
# define CRYPTO_EX_INDEX_SSL_SESSION 2
|
| 220 |
+
# define CRYPTO_EX_INDEX_X509 3
|
| 221 |
+
# define CRYPTO_EX_INDEX_X509_STORE 4
|
| 222 |
+
# define CRYPTO_EX_INDEX_X509_STORE_CTX 5
|
| 223 |
+
# define CRYPTO_EX_INDEX_DH 6
|
| 224 |
+
# define CRYPTO_EX_INDEX_DSA 7
|
| 225 |
+
# define CRYPTO_EX_INDEX_EC_KEY 8
|
| 226 |
+
# define CRYPTO_EX_INDEX_RSA 9
|
| 227 |
+
# define CRYPTO_EX_INDEX_ENGINE 10
|
| 228 |
+
# define CRYPTO_EX_INDEX_UI 11
|
| 229 |
+
# define CRYPTO_EX_INDEX_BIO 12
|
| 230 |
+
# define CRYPTO_EX_INDEX_APP 13
|
| 231 |
+
# define CRYPTO_EX_INDEX_UI_METHOD 14
|
| 232 |
+
# define CRYPTO_EX_INDEX_RAND_DRBG 15
|
| 233 |
+
# define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG
|
| 234 |
+
# define CRYPTO_EX_INDEX_OSSL_LIB_CTX 16
|
| 235 |
+
# define CRYPTO_EX_INDEX_EVP_PKEY 17
|
| 236 |
+
# define CRYPTO_EX_INDEX__COUNT 18
|
| 237 |
+
|
| 238 |
+
typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
| 239 |
+
int idx, long argl, void *argp);
|
| 240 |
+
typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
| 241 |
+
int idx, long argl, void *argp);
|
| 242 |
+
typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
| 243 |
+
void **from_d, int idx, long argl, void *argp);
|
| 244 |
+
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
| 245 |
+
CRYPTO_EX_new *new_func,
|
| 246 |
+
CRYPTO_EX_dup *dup_func,
|
| 247 |
+
CRYPTO_EX_free *free_func);
|
| 248 |
+
/* No longer use an index. */
|
| 249 |
+
int CRYPTO_free_ex_index(int class_index, int idx);
|
| 250 |
+
|
| 251 |
+
/*
|
| 252 |
+
* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a
|
| 253 |
+
* given class (invokes whatever per-class callbacks are applicable)
|
| 254 |
+
*/
|
| 255 |
+
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
| 256 |
+
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
| 257 |
+
const CRYPTO_EX_DATA *from);
|
| 258 |
+
|
| 259 |
+
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
| 260 |
+
|
| 261 |
+
/* Allocate a single item in the CRYPTO_EX_DATA variable */
|
| 262 |
+
int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad,
|
| 263 |
+
int idx);
|
| 264 |
+
|
| 265 |
+
/*
|
| 266 |
+
* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
|
| 267 |
+
* index (relative to the class type involved)
|
| 268 |
+
*/
|
| 269 |
+
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
|
| 270 |
+
void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
|
| 271 |
+
|
| 272 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 273 |
+
/*
|
| 274 |
+
* This function cleans up all "ex_data" state. It mustn't be called under
|
| 275 |
+
* potential race-conditions.
|
| 276 |
+
*/
|
| 277 |
+
# define CRYPTO_cleanup_all_ex_data() while(0) continue
|
| 278 |
+
|
| 279 |
+
/*
|
| 280 |
+
* The old locking functions have been removed completely without compatibility
|
| 281 |
+
* macros. This is because the old functions either could not properly report
|
| 282 |
+
* errors, or the returned error values were not clearly documented.
|
| 283 |
+
* Replacing the locking functions with no-ops would cause race condition
|
| 284 |
+
* issues in the affected applications. It is far better for them to fail at
|
| 285 |
+
* compile time.
|
| 286 |
+
* On the other hand, the locking callbacks are no longer used. Consequently,
|
| 287 |
+
* the callback management functions can be safely replaced with no-op macros.
|
| 288 |
+
*/
|
| 289 |
+
# define CRYPTO_num_locks() (1)
|
| 290 |
+
# define CRYPTO_set_locking_callback(func)
|
| 291 |
+
# define CRYPTO_get_locking_callback() (NULL)
|
| 292 |
+
# define CRYPTO_set_add_lock_callback(func)
|
| 293 |
+
# define CRYPTO_get_add_lock_callback() (NULL)
|
| 294 |
+
|
| 295 |
+
/*
|
| 296 |
+
* These defines where used in combination with the old locking callbacks,
|
| 297 |
+
* they are not called anymore, but old code that's not called might still
|
| 298 |
+
* use them.
|
| 299 |
+
*/
|
| 300 |
+
# define CRYPTO_LOCK 1
|
| 301 |
+
# define CRYPTO_UNLOCK 2
|
| 302 |
+
# define CRYPTO_READ 4
|
| 303 |
+
# define CRYPTO_WRITE 8
|
| 304 |
+
|
| 305 |
+
/* This structure is no longer used */
|
| 306 |
+
typedef struct crypto_threadid_st {
|
| 307 |
+
int dummy;
|
| 308 |
+
} CRYPTO_THREADID;
|
| 309 |
+
/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
|
| 310 |
+
# define CRYPTO_THREADID_set_numeric(id, val)
|
| 311 |
+
# define CRYPTO_THREADID_set_pointer(id, ptr)
|
| 312 |
+
# define CRYPTO_THREADID_set_callback(threadid_func) (0)
|
| 313 |
+
# define CRYPTO_THREADID_get_callback() (NULL)
|
| 314 |
+
# define CRYPTO_THREADID_current(id)
|
| 315 |
+
# define CRYPTO_THREADID_cmp(a, b) (-1)
|
| 316 |
+
# define CRYPTO_THREADID_cpy(dest, src)
|
| 317 |
+
# define CRYPTO_THREADID_hash(id) (0UL)
|
| 318 |
+
|
| 319 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
| 320 |
+
# define CRYPTO_set_id_callback(func)
|
| 321 |
+
# define CRYPTO_get_id_callback() (NULL)
|
| 322 |
+
# define CRYPTO_thread_id() (0UL)
|
| 323 |
+
# endif /* OPENSSL_NO_DEPRECATED_1_0_0 */
|
| 324 |
+
|
| 325 |
+
# define CRYPTO_set_dynlock_create_callback(dyn_create_function)
|
| 326 |
+
# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function)
|
| 327 |
+
# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function)
|
| 328 |
+
# define CRYPTO_get_dynlock_create_callback() (NULL)
|
| 329 |
+
# define CRYPTO_get_dynlock_lock_callback() (NULL)
|
| 330 |
+
# define CRYPTO_get_dynlock_destroy_callback() (NULL)
|
| 331 |
+
# endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
| 332 |
+
|
| 333 |
+
typedef void *(*CRYPTO_malloc_fn)(size_t num, const char *file, int line);
|
| 334 |
+
typedef void *(*CRYPTO_realloc_fn)(void *addr, size_t num, const char *file,
|
| 335 |
+
int line);
|
| 336 |
+
typedef void (*CRYPTO_free_fn)(void *addr, const char *file, int line);
|
| 337 |
+
int CRYPTO_set_mem_functions(CRYPTO_malloc_fn malloc_fn,
|
| 338 |
+
CRYPTO_realloc_fn realloc_fn,
|
| 339 |
+
CRYPTO_free_fn free_fn);
|
| 340 |
+
void CRYPTO_get_mem_functions(CRYPTO_malloc_fn *malloc_fn,
|
| 341 |
+
CRYPTO_realloc_fn *realloc_fn,
|
| 342 |
+
CRYPTO_free_fn *free_fn);
|
| 343 |
+
|
| 344 |
+
void *CRYPTO_malloc(size_t num, const char *file, int line);
|
| 345 |
+
void *CRYPTO_zalloc(size_t num, const char *file, int line);
|
| 346 |
+
void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
|
| 347 |
+
char *CRYPTO_strdup(const char *str, const char *file, int line);
|
| 348 |
+
char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
|
| 349 |
+
void CRYPTO_free(void *ptr, const char *file, int line);
|
| 350 |
+
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
|
| 351 |
+
void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
|
| 352 |
+
void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
|
| 353 |
+
const char *file, int line);
|
| 354 |
+
|
| 355 |
+
int CRYPTO_secure_malloc_init(size_t sz, size_t minsize);
|
| 356 |
+
int CRYPTO_secure_malloc_done(void);
|
| 357 |
+
void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
|
| 358 |
+
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
|
| 359 |
+
void CRYPTO_secure_free(void *ptr, const char *file, int line);
|
| 360 |
+
void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
| 361 |
+
const char *file, int line);
|
| 362 |
+
int CRYPTO_secure_allocated(const void *ptr);
|
| 363 |
+
int CRYPTO_secure_malloc_initialized(void);
|
| 364 |
+
size_t CRYPTO_secure_actual_size(void *ptr);
|
| 365 |
+
size_t CRYPTO_secure_used(void);
|
| 366 |
+
|
| 367 |
+
void OPENSSL_cleanse(void *ptr, size_t len);
|
| 368 |
+
|
| 369 |
+
# ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
| 370 |
+
/*
|
| 371 |
+
* The following can be used to detect memory leaks in the library. If
|
| 372 |
+
* used, it turns on malloc checking
|
| 373 |
+
*/
|
| 374 |
+
# define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
|
| 375 |
+
# define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
|
| 376 |
+
# define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
|
| 377 |
+
# define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
|
| 378 |
+
|
| 379 |
+
void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
|
| 380 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 381 |
+
# define OPENSSL_mem_debug_push(info) \
|
| 382 |
+
CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE)
|
| 383 |
+
# define OPENSSL_mem_debug_pop() \
|
| 384 |
+
CRYPTO_mem_debug_pop()
|
| 385 |
+
# endif
|
| 386 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 387 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_set_mem_debug(int flag);
|
| 388 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_ctrl(int mode);
|
| 389 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_push(const char *info,
|
| 390 |
+
const char *file, int line);
|
| 391 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_pop(void);
|
| 392 |
+
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_malloc(void *addr, size_t num,
|
| 393 |
+
int flag,
|
| 394 |
+
const char *file, int line);
|
| 395 |
+
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_realloc(void *addr1, void *addr2,
|
| 396 |
+
size_t num, int flag,
|
| 397 |
+
const char *file, int line);
|
| 398 |
+
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_free(void *addr, int flag,
|
| 399 |
+
const char *file, int line);
|
| 400 |
+
OSSL_DEPRECATEDIN_3_0
|
| 401 |
+
int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u),
|
| 402 |
+
void *u);
|
| 403 |
+
# endif
|
| 404 |
+
# ifndef OPENSSL_NO_STDIO
|
| 405 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 406 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks_fp(FILE *);
|
| 407 |
+
# endif
|
| 408 |
+
# endif
|
| 409 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 410 |
+
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks(BIO *bio);
|
| 411 |
+
# endif
|
| 412 |
+
# endif /* OPENSSL_NO_CRYPTO_MDEBUG */
|
| 413 |
+
|
| 414 |
+
/* die if we have to */
|
| 415 |
+
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line);
|
| 416 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 417 |
+
# define OpenSSLDie(f,l,a) OPENSSL_die((a),(f),(l))
|
| 418 |
+
# endif
|
| 419 |
+
# define OPENSSL_assert(e) \
|
| 420 |
+
(void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
|
| 421 |
+
|
| 422 |
+
int OPENSSL_isservice(void);
|
| 423 |
+
|
| 424 |
+
void OPENSSL_init(void);
|
| 425 |
+
# ifdef OPENSSL_SYS_UNIX
|
| 426 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 427 |
+
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_prepare(void);
|
| 428 |
+
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_parent(void);
|
| 429 |
+
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_child(void);
|
| 430 |
+
# endif
|
| 431 |
+
# endif
|
| 432 |
+
|
| 433 |
+
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
|
| 434 |
+
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec);
|
| 435 |
+
int OPENSSL_gmtime_diff(int *pday, int *psec,
|
| 436 |
+
const struct tm *from, const struct tm *to);
|
| 437 |
+
|
| 438 |
+
/*
|
| 439 |
+
* CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.
|
| 440 |
+
* It takes an amount of time dependent on |len|, but independent of the
|
| 441 |
+
* contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements
|
| 442 |
+
* into a defined order as the return value when a != b is undefined, other
|
| 443 |
+
* than to be non-zero.
|
| 444 |
+
*/
|
| 445 |
+
int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
|
| 446 |
+
|
| 447 |
+
/* Standard initialisation options */
|
| 448 |
+
# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
|
| 449 |
+
# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
|
| 450 |
+
# define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
|
| 451 |
+
# define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
|
| 452 |
+
# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L
|
| 453 |
+
# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L
|
| 454 |
+
# define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
|
| 455 |
+
# define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
|
| 456 |
+
# define OPENSSL_INIT_ASYNC 0x00000100L
|
| 457 |
+
# define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
|
| 458 |
+
# define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
|
| 459 |
+
# define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
|
| 460 |
+
# define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
|
| 461 |
+
# define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
|
| 462 |
+
# define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
|
| 463 |
+
# define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
|
| 464 |
+
/* FREE: 0x00010000L */
|
| 465 |
+
# define OPENSSL_INIT_ATFORK 0x00020000L
|
| 466 |
+
/* OPENSSL_INIT_BASE_ONLY 0x00040000L */
|
| 467 |
+
# define OPENSSL_INIT_NO_ATEXIT 0x00080000L
|
| 468 |
+
/* OPENSSL_INIT flag range 0x03f00000 reserved for OPENSSL_init_ssl() */
|
| 469 |
+
/* FREE: 0x04000000L */
|
| 470 |
+
/* FREE: 0x08000000L */
|
| 471 |
+
/* FREE: 0x10000000L */
|
| 472 |
+
/* FREE: 0x20000000L */
|
| 473 |
+
/* FREE: 0x40000000L */
|
| 474 |
+
/* FREE: 0x80000000L */
|
| 475 |
+
/* Max OPENSSL_INIT flag value is 0x80000000 */
|
| 476 |
+
|
| 477 |
+
/* openssl and dasync not counted as builtin */
|
| 478 |
+
# define OPENSSL_INIT_ENGINE_ALL_BUILTIN \
|
| 479 |
+
(OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
|
| 480 |
+
| OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
|
| 481 |
+
OPENSSL_INIT_ENGINE_PADLOCK)
|
| 482 |
+
|
| 483 |
+
/* Library initialisation functions */
|
| 484 |
+
void OPENSSL_cleanup(void);
|
| 485 |
+
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
|
| 486 |
+
int OPENSSL_atexit(void (*handler)(void));
|
| 487 |
+
void OPENSSL_thread_stop(void);
|
| 488 |
+
void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);
|
| 489 |
+
|
| 490 |
+
/* Low-level control of initialization */
|
| 491 |
+
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
|
| 492 |
+
# ifndef OPENSSL_NO_STDIO
|
| 493 |
+
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
|
| 494 |
+
const char *config_filename);
|
| 495 |
+
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings,
|
| 496 |
+
unsigned long flags);
|
| 497 |
+
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings,
|
| 498 |
+
const char *config_appname);
|
| 499 |
+
# endif
|
| 500 |
+
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings);
|
| 501 |
+
|
| 502 |
+
# if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
|
| 503 |
+
# if defined(_WIN32)
|
| 504 |
+
# if defined(BASETYPES) || defined(_WINDEF_H)
|
| 505 |
+
/* application has to include <windows.h> in order to use this */
|
| 506 |
+
typedef DWORD CRYPTO_THREAD_LOCAL;
|
| 507 |
+
typedef DWORD CRYPTO_THREAD_ID;
|
| 508 |
+
|
| 509 |
+
typedef LONG CRYPTO_ONCE;
|
| 510 |
+
# define CRYPTO_ONCE_STATIC_INIT 0
|
| 511 |
+
# endif
|
| 512 |
+
# else
|
| 513 |
+
# if defined(__TANDEM) && defined(_SPT_MODEL_)
|
| 514 |
+
# define SPT_THREAD_SIGNAL 1
|
| 515 |
+
# define SPT_THREAD_AWARE 1
|
| 516 |
+
# include <spthread.h>
|
| 517 |
+
# else
|
| 518 |
+
# include <pthread.h>
|
| 519 |
+
# endif
|
| 520 |
+
typedef pthread_once_t CRYPTO_ONCE;
|
| 521 |
+
typedef pthread_key_t CRYPTO_THREAD_LOCAL;
|
| 522 |
+
typedef pthread_t CRYPTO_THREAD_ID;
|
| 523 |
+
|
| 524 |
+
# define CRYPTO_ONCE_STATIC_INIT PTHREAD_ONCE_INIT
|
| 525 |
+
# endif
|
| 526 |
+
# endif
|
| 527 |
+
|
| 528 |
+
# if !defined(CRYPTO_ONCE_STATIC_INIT)
|
| 529 |
+
typedef unsigned int CRYPTO_ONCE;
|
| 530 |
+
typedef unsigned int CRYPTO_THREAD_LOCAL;
|
| 531 |
+
typedef unsigned int CRYPTO_THREAD_ID;
|
| 532 |
+
# define CRYPTO_ONCE_STATIC_INIT 0
|
| 533 |
+
# endif
|
| 534 |
+
|
| 535 |
+
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void));
|
| 536 |
+
|
| 537 |
+
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *));
|
| 538 |
+
void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key);
|
| 539 |
+
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val);
|
| 540 |
+
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
|
| 541 |
+
|
| 542 |
+
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
|
| 543 |
+
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
|
| 544 |
+
|
| 545 |
+
OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
|
| 546 |
+
OSSL_LIB_CTX *OSSL_LIB_CTX_new_from_dispatch(const OSSL_CORE_HANDLE *handle,
|
| 547 |
+
const OSSL_DISPATCH *in);
|
| 548 |
+
OSSL_LIB_CTX *OSSL_LIB_CTX_new_child(const OSSL_CORE_HANDLE *handle,
|
| 549 |
+
const OSSL_DISPATCH *in);
|
| 550 |
+
int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
|
| 551 |
+
void OSSL_LIB_CTX_free(OSSL_LIB_CTX *);
|
| 552 |
+
OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void);
|
| 553 |
+
OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx);
|
| 554 |
+
|
| 555 |
+
# ifdef __cplusplus
|
| 556 |
+
}
|
| 557 |
+
# endif
|
| 558 |
+
#endif
|
llava_next/include/openssl/cryptoerr_legacy.h
ADDED
|
@@ -0,0 +1,1466 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* This header file preserves symbols from pre-3.0 OpenSSL.
|
| 12 |
+
* It should never be included directly, as it's already included
|
| 13 |
+
* by the public {lib}err.h headers, and since it will go away some
|
| 14 |
+
* time in the future.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_CRYPTOERR_LEGACY_H
|
| 18 |
+
# define OPENSSL_CRYPTOERR_LEGACY_H
|
| 19 |
+
# pragma once
|
| 20 |
+
|
| 21 |
+
# include <openssl/macros.h>
|
| 22 |
+
# include <openssl/symhacks.h>
|
| 23 |
+
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 29 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_ASN1_strings(void);
|
| 30 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_ASYNC_strings(void);
|
| 31 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_BIO_strings(void);
|
| 32 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_BN_strings(void);
|
| 33 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_BUF_strings(void);
|
| 34 |
+
# ifndef OPENSSL_NO_CMS
|
| 35 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_CMS_strings(void);
|
| 36 |
+
# endif
|
| 37 |
+
# ifndef OPENSSL_NO_COMP
|
| 38 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_COMP_strings(void);
|
| 39 |
+
# endif
|
| 40 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_CONF_strings(void);
|
| 41 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_CRYPTO_strings(void);
|
| 42 |
+
# ifndef OPENSSL_NO_CT
|
| 43 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_CT_strings(void);
|
| 44 |
+
# endif
|
| 45 |
+
# ifndef OPENSSL_NO_DH
|
| 46 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_DH_strings(void);
|
| 47 |
+
# endif
|
| 48 |
+
# ifndef OPENSSL_NO_DSA
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_DSA_strings(void);
|
| 50 |
+
# endif
|
| 51 |
+
# ifndef OPENSSL_NO_EC
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_EC_strings(void);
|
| 53 |
+
# endif
|
| 54 |
+
# ifndef OPENSSL_NO_ENGINE
|
| 55 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_ENGINE_strings(void);
|
| 56 |
+
# endif
|
| 57 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_ERR_strings(void);
|
| 58 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_EVP_strings(void);
|
| 59 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_KDF_strings(void);
|
| 60 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_OBJ_strings(void);
|
| 61 |
+
# ifndef OPENSSL_NO_OCSP
|
| 62 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_OCSP_strings(void);
|
| 63 |
+
# endif
|
| 64 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_PEM_strings(void);
|
| 65 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS12_strings(void);
|
| 66 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS7_strings(void);
|
| 67 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_RAND_strings(void);
|
| 68 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_RSA_strings(void);
|
| 69 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_OSSL_STORE_strings(void);
|
| 70 |
+
# ifndef OPENSSL_NO_TS
|
| 71 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_TS_strings(void);
|
| 72 |
+
# endif
|
| 73 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_UI_strings(void);
|
| 74 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_X509_strings(void);
|
| 75 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_X509V3_strings(void);
|
| 76 |
+
|
| 77 |
+
/* Collected _F_ macros from OpenSSL 1.1.1 */
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* ASN1 function codes.
|
| 81 |
+
*/
|
| 82 |
+
# define ASN1_F_A2D_ASN1_OBJECT 0
|
| 83 |
+
# define ASN1_F_A2I_ASN1_INTEGER 0
|
| 84 |
+
# define ASN1_F_A2I_ASN1_STRING 0
|
| 85 |
+
# define ASN1_F_APPEND_EXP 0
|
| 86 |
+
# define ASN1_F_ASN1_BIO_INIT 0
|
| 87 |
+
# define ASN1_F_ASN1_BIT_STRING_SET_BIT 0
|
| 88 |
+
# define ASN1_F_ASN1_CB 0
|
| 89 |
+
# define ASN1_F_ASN1_CHECK_TLEN 0
|
| 90 |
+
# define ASN1_F_ASN1_COLLECT 0
|
| 91 |
+
# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 0
|
| 92 |
+
# define ASN1_F_ASN1_D2I_FP 0
|
| 93 |
+
# define ASN1_F_ASN1_D2I_READ_BIO 0
|
| 94 |
+
# define ASN1_F_ASN1_DIGEST 0
|
| 95 |
+
# define ASN1_F_ASN1_DO_ADB 0
|
| 96 |
+
# define ASN1_F_ASN1_DO_LOCK 0
|
| 97 |
+
# define ASN1_F_ASN1_DUP 0
|
| 98 |
+
# define ASN1_F_ASN1_ENC_SAVE 0
|
| 99 |
+
# define ASN1_F_ASN1_EX_C2I 0
|
| 100 |
+
# define ASN1_F_ASN1_FIND_END 0
|
| 101 |
+
# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 0
|
| 102 |
+
# define ASN1_F_ASN1_GENERATE_V3 0
|
| 103 |
+
# define ASN1_F_ASN1_GET_INT64 0
|
| 104 |
+
# define ASN1_F_ASN1_GET_OBJECT 0
|
| 105 |
+
# define ASN1_F_ASN1_GET_UINT64 0
|
| 106 |
+
# define ASN1_F_ASN1_I2D_BIO 0
|
| 107 |
+
# define ASN1_F_ASN1_I2D_FP 0
|
| 108 |
+
# define ASN1_F_ASN1_ITEM_D2I_FP 0
|
| 109 |
+
# define ASN1_F_ASN1_ITEM_DUP 0
|
| 110 |
+
# define ASN1_F_ASN1_ITEM_EMBED_D2I 0
|
| 111 |
+
# define ASN1_F_ASN1_ITEM_EMBED_NEW 0
|
| 112 |
+
# define ASN1_F_ASN1_ITEM_FLAGS_I2D 0
|
| 113 |
+
# define ASN1_F_ASN1_ITEM_I2D_BIO 0
|
| 114 |
+
# define ASN1_F_ASN1_ITEM_I2D_FP 0
|
| 115 |
+
# define ASN1_F_ASN1_ITEM_PACK 0
|
| 116 |
+
# define ASN1_F_ASN1_ITEM_SIGN 0
|
| 117 |
+
# define ASN1_F_ASN1_ITEM_SIGN_CTX 0
|
| 118 |
+
# define ASN1_F_ASN1_ITEM_UNPACK 0
|
| 119 |
+
# define ASN1_F_ASN1_ITEM_VERIFY 0
|
| 120 |
+
# define ASN1_F_ASN1_MBSTRING_NCOPY 0
|
| 121 |
+
# define ASN1_F_ASN1_OBJECT_NEW 0
|
| 122 |
+
# define ASN1_F_ASN1_OUTPUT_DATA 0
|
| 123 |
+
# define ASN1_F_ASN1_PCTX_NEW 0
|
| 124 |
+
# define ASN1_F_ASN1_PRIMITIVE_NEW 0
|
| 125 |
+
# define ASN1_F_ASN1_SCTX_NEW 0
|
| 126 |
+
# define ASN1_F_ASN1_SIGN 0
|
| 127 |
+
# define ASN1_F_ASN1_STR2TYPE 0
|
| 128 |
+
# define ASN1_F_ASN1_STRING_GET_INT64 0
|
| 129 |
+
# define ASN1_F_ASN1_STRING_GET_UINT64 0
|
| 130 |
+
# define ASN1_F_ASN1_STRING_SET 0
|
| 131 |
+
# define ASN1_F_ASN1_STRING_TABLE_ADD 0
|
| 132 |
+
# define ASN1_F_ASN1_STRING_TO_BN 0
|
| 133 |
+
# define ASN1_F_ASN1_STRING_TYPE_NEW 0
|
| 134 |
+
# define ASN1_F_ASN1_TEMPLATE_EX_D2I 0
|
| 135 |
+
# define ASN1_F_ASN1_TEMPLATE_NEW 0
|
| 136 |
+
# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 0
|
| 137 |
+
# define ASN1_F_ASN1_TIME_ADJ 0
|
| 138 |
+
# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 0
|
| 139 |
+
# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 0
|
| 140 |
+
# define ASN1_F_ASN1_UTCTIME_ADJ 0
|
| 141 |
+
# define ASN1_F_ASN1_VERIFY 0
|
| 142 |
+
# define ASN1_F_B64_READ_ASN1 0
|
| 143 |
+
# define ASN1_F_B64_WRITE_ASN1 0
|
| 144 |
+
# define ASN1_F_BIO_NEW_NDEF 0
|
| 145 |
+
# define ASN1_F_BITSTR_CB 0
|
| 146 |
+
# define ASN1_F_BN_TO_ASN1_STRING 0
|
| 147 |
+
# define ASN1_F_C2I_ASN1_BIT_STRING 0
|
| 148 |
+
# define ASN1_F_C2I_ASN1_INTEGER 0
|
| 149 |
+
# define ASN1_F_C2I_ASN1_OBJECT 0
|
| 150 |
+
# define ASN1_F_C2I_IBUF 0
|
| 151 |
+
# define ASN1_F_C2I_UINT64_INT 0
|
| 152 |
+
# define ASN1_F_COLLECT_DATA 0
|
| 153 |
+
# define ASN1_F_D2I_ASN1_OBJECT 0
|
| 154 |
+
# define ASN1_F_D2I_ASN1_UINTEGER 0
|
| 155 |
+
# define ASN1_F_D2I_AUTOPRIVATEKEY 0
|
| 156 |
+
# define ASN1_F_D2I_PRIVATEKEY 0
|
| 157 |
+
# define ASN1_F_D2I_PUBLICKEY 0
|
| 158 |
+
# define ASN1_F_DO_BUF 0
|
| 159 |
+
# define ASN1_F_DO_CREATE 0
|
| 160 |
+
# define ASN1_F_DO_DUMP 0
|
| 161 |
+
# define ASN1_F_DO_TCREATE 0
|
| 162 |
+
# define ASN1_F_I2A_ASN1_OBJECT 0
|
| 163 |
+
# define ASN1_F_I2D_ASN1_BIO_STREAM 0
|
| 164 |
+
# define ASN1_F_I2D_ASN1_OBJECT 0
|
| 165 |
+
# define ASN1_F_I2D_DSA_PUBKEY 0
|
| 166 |
+
# define ASN1_F_I2D_EC_PUBKEY 0
|
| 167 |
+
# define ASN1_F_I2D_PRIVATEKEY 0
|
| 168 |
+
# define ASN1_F_I2D_PUBLICKEY 0
|
| 169 |
+
# define ASN1_F_I2D_RSA_PUBKEY 0
|
| 170 |
+
# define ASN1_F_LONG_C2I 0
|
| 171 |
+
# define ASN1_F_NDEF_PREFIX 0
|
| 172 |
+
# define ASN1_F_NDEF_SUFFIX 0
|
| 173 |
+
# define ASN1_F_OID_MODULE_INIT 0
|
| 174 |
+
# define ASN1_F_PARSE_TAGGING 0
|
| 175 |
+
# define ASN1_F_PKCS5_PBE2_SET_IV 0
|
| 176 |
+
# define ASN1_F_PKCS5_PBE2_SET_SCRYPT 0
|
| 177 |
+
# define ASN1_F_PKCS5_PBE_SET 0
|
| 178 |
+
# define ASN1_F_PKCS5_PBE_SET0_ALGOR 0
|
| 179 |
+
# define ASN1_F_PKCS5_PBKDF2_SET 0
|
| 180 |
+
# define ASN1_F_PKCS5_SCRYPT_SET 0
|
| 181 |
+
# define ASN1_F_SMIME_READ_ASN1 0
|
| 182 |
+
# define ASN1_F_SMIME_TEXT 0
|
| 183 |
+
# define ASN1_F_STABLE_GET 0
|
| 184 |
+
# define ASN1_F_STBL_MODULE_INIT 0
|
| 185 |
+
# define ASN1_F_UINT32_C2I 0
|
| 186 |
+
# define ASN1_F_UINT32_NEW 0
|
| 187 |
+
# define ASN1_F_UINT64_C2I 0
|
| 188 |
+
# define ASN1_F_UINT64_NEW 0
|
| 189 |
+
# define ASN1_F_X509_CRL_ADD0_REVOKED 0
|
| 190 |
+
# define ASN1_F_X509_INFO_NEW 0
|
| 191 |
+
# define ASN1_F_X509_NAME_ENCODE 0
|
| 192 |
+
# define ASN1_F_X509_NAME_EX_D2I 0
|
| 193 |
+
# define ASN1_F_X509_NAME_EX_NEW 0
|
| 194 |
+
# define ASN1_F_X509_PKEY_NEW 0
|
| 195 |
+
|
| 196 |
+
/*
|
| 197 |
+
* ASYNC function codes.
|
| 198 |
+
*/
|
| 199 |
+
# define ASYNC_F_ASYNC_CTX_NEW 0
|
| 200 |
+
# define ASYNC_F_ASYNC_INIT_THREAD 0
|
| 201 |
+
# define ASYNC_F_ASYNC_JOB_NEW 0
|
| 202 |
+
# define ASYNC_F_ASYNC_PAUSE_JOB 0
|
| 203 |
+
# define ASYNC_F_ASYNC_START_FUNC 0
|
| 204 |
+
# define ASYNC_F_ASYNC_START_JOB 0
|
| 205 |
+
# define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 0
|
| 206 |
+
|
| 207 |
+
/*
|
| 208 |
+
* BIO function codes.
|
| 209 |
+
*/
|
| 210 |
+
# define BIO_F_ACPT_STATE 0
|
| 211 |
+
# define BIO_F_ADDRINFO_WRAP 0
|
| 212 |
+
# define BIO_F_ADDR_STRINGS 0
|
| 213 |
+
# define BIO_F_BIO_ACCEPT 0
|
| 214 |
+
# define BIO_F_BIO_ACCEPT_EX 0
|
| 215 |
+
# define BIO_F_BIO_ACCEPT_NEW 0
|
| 216 |
+
# define BIO_F_BIO_ADDR_NEW 0
|
| 217 |
+
# define BIO_F_BIO_BIND 0
|
| 218 |
+
# define BIO_F_BIO_CALLBACK_CTRL 0
|
| 219 |
+
# define BIO_F_BIO_CONNECT 0
|
| 220 |
+
# define BIO_F_BIO_CONNECT_NEW 0
|
| 221 |
+
# define BIO_F_BIO_CTRL 0
|
| 222 |
+
# define BIO_F_BIO_GETS 0
|
| 223 |
+
# define BIO_F_BIO_GET_HOST_IP 0
|
| 224 |
+
# define BIO_F_BIO_GET_NEW_INDEX 0
|
| 225 |
+
# define BIO_F_BIO_GET_PORT 0
|
| 226 |
+
# define BIO_F_BIO_LISTEN 0
|
| 227 |
+
# define BIO_F_BIO_LOOKUP 0
|
| 228 |
+
# define BIO_F_BIO_LOOKUP_EX 0
|
| 229 |
+
# define BIO_F_BIO_MAKE_PAIR 0
|
| 230 |
+
# define BIO_F_BIO_METH_NEW 0
|
| 231 |
+
# define BIO_F_BIO_NEW 0
|
| 232 |
+
# define BIO_F_BIO_NEW_DGRAM_SCTP 0
|
| 233 |
+
# define BIO_F_BIO_NEW_FILE 0
|
| 234 |
+
# define BIO_F_BIO_NEW_MEM_BUF 0
|
| 235 |
+
# define BIO_F_BIO_NREAD 0
|
| 236 |
+
# define BIO_F_BIO_NREAD0 0
|
| 237 |
+
# define BIO_F_BIO_NWRITE 0
|
| 238 |
+
# define BIO_F_BIO_NWRITE0 0
|
| 239 |
+
# define BIO_F_BIO_PARSE_HOSTSERV 0
|
| 240 |
+
# define BIO_F_BIO_PUTS 0
|
| 241 |
+
# define BIO_F_BIO_READ 0
|
| 242 |
+
# define BIO_F_BIO_READ_EX 0
|
| 243 |
+
# define BIO_F_BIO_READ_INTERN 0
|
| 244 |
+
# define BIO_F_BIO_SOCKET 0
|
| 245 |
+
# define BIO_F_BIO_SOCKET_NBIO 0
|
| 246 |
+
# define BIO_F_BIO_SOCK_INFO 0
|
| 247 |
+
# define BIO_F_BIO_SOCK_INIT 0
|
| 248 |
+
# define BIO_F_BIO_WRITE 0
|
| 249 |
+
# define BIO_F_BIO_WRITE_EX 0
|
| 250 |
+
# define BIO_F_BIO_WRITE_INTERN 0
|
| 251 |
+
# define BIO_F_BUFFER_CTRL 0
|
| 252 |
+
# define BIO_F_CONN_CTRL 0
|
| 253 |
+
# define BIO_F_CONN_STATE 0
|
| 254 |
+
# define BIO_F_DGRAM_SCTP_NEW 0
|
| 255 |
+
# define BIO_F_DGRAM_SCTP_READ 0
|
| 256 |
+
# define BIO_F_DGRAM_SCTP_WRITE 0
|
| 257 |
+
# define BIO_F_DOAPR_OUTCH 0
|
| 258 |
+
# define BIO_F_FILE_CTRL 0
|
| 259 |
+
# define BIO_F_FILE_READ 0
|
| 260 |
+
# define BIO_F_LINEBUFFER_CTRL 0
|
| 261 |
+
# define BIO_F_LINEBUFFER_NEW 0
|
| 262 |
+
# define BIO_F_MEM_WRITE 0
|
| 263 |
+
# define BIO_F_NBIOF_NEW 0
|
| 264 |
+
# define BIO_F_SLG_WRITE 0
|
| 265 |
+
# define BIO_F_SSL_NEW 0
|
| 266 |
+
|
| 267 |
+
/*
|
| 268 |
+
* BN function codes.
|
| 269 |
+
*/
|
| 270 |
+
# define BN_F_BNRAND 0
|
| 271 |
+
# define BN_F_BNRAND_RANGE 0
|
| 272 |
+
# define BN_F_BN_BLINDING_CONVERT_EX 0
|
| 273 |
+
# define BN_F_BN_BLINDING_CREATE_PARAM 0
|
| 274 |
+
# define BN_F_BN_BLINDING_INVERT_EX 0
|
| 275 |
+
# define BN_F_BN_BLINDING_NEW 0
|
| 276 |
+
# define BN_F_BN_BLINDING_UPDATE 0
|
| 277 |
+
# define BN_F_BN_BN2DEC 0
|
| 278 |
+
# define BN_F_BN_BN2HEX 0
|
| 279 |
+
# define BN_F_BN_COMPUTE_WNAF 0
|
| 280 |
+
# define BN_F_BN_CTX_GET 0
|
| 281 |
+
# define BN_F_BN_CTX_NEW 0
|
| 282 |
+
# define BN_F_BN_CTX_START 0
|
| 283 |
+
# define BN_F_BN_DIV 0
|
| 284 |
+
# define BN_F_BN_DIV_RECP 0
|
| 285 |
+
# define BN_F_BN_EXP 0
|
| 286 |
+
# define BN_F_BN_EXPAND_INTERNAL 0
|
| 287 |
+
# define BN_F_BN_GENCB_NEW 0
|
| 288 |
+
# define BN_F_BN_GENERATE_DSA_NONCE 0
|
| 289 |
+
# define BN_F_BN_GENERATE_PRIME_EX 0
|
| 290 |
+
# define BN_F_BN_GF2M_MOD 0
|
| 291 |
+
# define BN_F_BN_GF2M_MOD_EXP 0
|
| 292 |
+
# define BN_F_BN_GF2M_MOD_MUL 0
|
| 293 |
+
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 0
|
| 294 |
+
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 0
|
| 295 |
+
# define BN_F_BN_GF2M_MOD_SQR 0
|
| 296 |
+
# define BN_F_BN_GF2M_MOD_SQRT 0
|
| 297 |
+
# define BN_F_BN_LSHIFT 0
|
| 298 |
+
# define BN_F_BN_MOD_EXP2_MONT 0
|
| 299 |
+
# define BN_F_BN_MOD_EXP_MONT 0
|
| 300 |
+
# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 0
|
| 301 |
+
# define BN_F_BN_MOD_EXP_MONT_WORD 0
|
| 302 |
+
# define BN_F_BN_MOD_EXP_RECP 0
|
| 303 |
+
# define BN_F_BN_MOD_EXP_SIMPLE 0
|
| 304 |
+
# define BN_F_BN_MOD_INVERSE 0
|
| 305 |
+
# define BN_F_BN_MOD_INVERSE_NO_BRANCH 0
|
| 306 |
+
# define BN_F_BN_MOD_LSHIFT_QUICK 0
|
| 307 |
+
# define BN_F_BN_MOD_SQRT 0
|
| 308 |
+
# define BN_F_BN_MONT_CTX_NEW 0
|
| 309 |
+
# define BN_F_BN_MPI2BN 0
|
| 310 |
+
# define BN_F_BN_NEW 0
|
| 311 |
+
# define BN_F_BN_POOL_GET 0
|
| 312 |
+
# define BN_F_BN_RAND 0
|
| 313 |
+
# define BN_F_BN_RAND_RANGE 0
|
| 314 |
+
# define BN_F_BN_RECP_CTX_NEW 0
|
| 315 |
+
# define BN_F_BN_RSHIFT 0
|
| 316 |
+
# define BN_F_BN_SET_WORDS 0
|
| 317 |
+
# define BN_F_BN_STACK_PUSH 0
|
| 318 |
+
# define BN_F_BN_USUB 0
|
| 319 |
+
|
| 320 |
+
/*
|
| 321 |
+
* BUF function codes.
|
| 322 |
+
*/
|
| 323 |
+
# define BUF_F_BUF_MEM_GROW 0
|
| 324 |
+
# define BUF_F_BUF_MEM_GROW_CLEAN 0
|
| 325 |
+
# define BUF_F_BUF_MEM_NEW 0
|
| 326 |
+
|
| 327 |
+
# ifndef OPENSSL_NO_CMS
|
| 328 |
+
/*
|
| 329 |
+
* CMS function codes.
|
| 330 |
+
*/
|
| 331 |
+
# define CMS_F_CHECK_CONTENT 0
|
| 332 |
+
# define CMS_F_CMS_ADD0_CERT 0
|
| 333 |
+
# define CMS_F_CMS_ADD0_RECIPIENT_KEY 0
|
| 334 |
+
# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 0
|
| 335 |
+
# define CMS_F_CMS_ADD1_RECEIPTREQUEST 0
|
| 336 |
+
# define CMS_F_CMS_ADD1_RECIPIENT_CERT 0
|
| 337 |
+
# define CMS_F_CMS_ADD1_SIGNER 0
|
| 338 |
+
# define CMS_F_CMS_ADD1_SIGNINGTIME 0
|
| 339 |
+
# define CMS_F_CMS_COMPRESS 0
|
| 340 |
+
# define CMS_F_CMS_COMPRESSEDDATA_CREATE 0
|
| 341 |
+
# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 0
|
| 342 |
+
# define CMS_F_CMS_COPY_CONTENT 0
|
| 343 |
+
# define CMS_F_CMS_COPY_MESSAGEDIGEST 0
|
| 344 |
+
# define CMS_F_CMS_DATA 0
|
| 345 |
+
# define CMS_F_CMS_DATAFINAL 0
|
| 346 |
+
# define CMS_F_CMS_DATAINIT 0
|
| 347 |
+
# define CMS_F_CMS_DECRYPT 0
|
| 348 |
+
# define CMS_F_CMS_DECRYPT_SET1_KEY 0
|
| 349 |
+
# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 0
|
| 350 |
+
# define CMS_F_CMS_DECRYPT_SET1_PKEY 0
|
| 351 |
+
# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 0
|
| 352 |
+
# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 0
|
| 353 |
+
# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 0
|
| 354 |
+
# define CMS_F_CMS_DIGEST_VERIFY 0
|
| 355 |
+
# define CMS_F_CMS_ENCODE_RECEIPT 0
|
| 356 |
+
# define CMS_F_CMS_ENCRYPT 0
|
| 357 |
+
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT 0
|
| 358 |
+
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 0
|
| 359 |
+
# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 0
|
| 360 |
+
# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 0
|
| 361 |
+
# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 0
|
| 362 |
+
# define CMS_F_CMS_ENVELOPEDDATA_CREATE 0
|
| 363 |
+
# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 0
|
| 364 |
+
# define CMS_F_CMS_ENVELOPED_DATA_INIT 0
|
| 365 |
+
# define CMS_F_CMS_ENV_ASN1_CTRL 0
|
| 366 |
+
# define CMS_F_CMS_FINAL 0
|
| 367 |
+
# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 0
|
| 368 |
+
# define CMS_F_CMS_GET0_CONTENT 0
|
| 369 |
+
# define CMS_F_CMS_GET0_ECONTENT_TYPE 0
|
| 370 |
+
# define CMS_F_CMS_GET0_ENVELOPED 0
|
| 371 |
+
# define CMS_F_CMS_GET0_REVOCATION_CHOICES 0
|
| 372 |
+
# define CMS_F_CMS_GET0_SIGNED 0
|
| 373 |
+
# define CMS_F_CMS_MSGSIGDIGEST_ADD1 0
|
| 374 |
+
# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 0
|
| 375 |
+
# define CMS_F_CMS_RECEIPT_VERIFY 0
|
| 376 |
+
# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 0
|
| 377 |
+
# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 0
|
| 378 |
+
# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 0
|
| 379 |
+
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 0
|
| 380 |
+
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 0
|
| 381 |
+
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 0
|
| 382 |
+
# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 0
|
| 383 |
+
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 0
|
| 384 |
+
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 0
|
| 385 |
+
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 0
|
| 386 |
+
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 0
|
| 387 |
+
# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 0
|
| 388 |
+
# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 0
|
| 389 |
+
# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 0
|
| 390 |
+
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 0
|
| 391 |
+
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 0
|
| 392 |
+
# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 0
|
| 393 |
+
# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 0
|
| 394 |
+
# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 0
|
| 395 |
+
# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 0
|
| 396 |
+
# define CMS_F_CMS_SD_ASN1_CTRL 0
|
| 397 |
+
# define CMS_F_CMS_SET1_IAS 0
|
| 398 |
+
# define CMS_F_CMS_SET1_KEYID 0
|
| 399 |
+
# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 0
|
| 400 |
+
# define CMS_F_CMS_SET_DETACHED 0
|
| 401 |
+
# define CMS_F_CMS_SIGN 0
|
| 402 |
+
# define CMS_F_CMS_SIGNED_DATA_INIT 0
|
| 403 |
+
# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 0
|
| 404 |
+
# define CMS_F_CMS_SIGNERINFO_SIGN 0
|
| 405 |
+
# define CMS_F_CMS_SIGNERINFO_VERIFY 0
|
| 406 |
+
# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 0
|
| 407 |
+
# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 0
|
| 408 |
+
# define CMS_F_CMS_SIGN_RECEIPT 0
|
| 409 |
+
# define CMS_F_CMS_SI_CHECK_ATTRIBUTES 0
|
| 410 |
+
# define CMS_F_CMS_STREAM 0
|
| 411 |
+
# define CMS_F_CMS_UNCOMPRESS 0
|
| 412 |
+
# define CMS_F_CMS_VERIFY 0
|
| 413 |
+
# define CMS_F_KEK_UNWRAP_KEY 0
|
| 414 |
+
# endif
|
| 415 |
+
|
| 416 |
+
# ifndef OPENSSL_NO_COMP
|
| 417 |
+
/*
|
| 418 |
+
* COMP function codes.
|
| 419 |
+
*/
|
| 420 |
+
# define COMP_F_BIO_ZLIB_FLUSH 0
|
| 421 |
+
# define COMP_F_BIO_ZLIB_NEW 0
|
| 422 |
+
# define COMP_F_BIO_ZLIB_READ 0
|
| 423 |
+
# define COMP_F_BIO_ZLIB_WRITE 0
|
| 424 |
+
# define COMP_F_COMP_CTX_NEW 0
|
| 425 |
+
# endif
|
| 426 |
+
|
| 427 |
+
/*
|
| 428 |
+
* CONF function codes.
|
| 429 |
+
*/
|
| 430 |
+
# define CONF_F_CONF_DUMP_FP 0
|
| 431 |
+
# define CONF_F_CONF_LOAD 0
|
| 432 |
+
# define CONF_F_CONF_LOAD_FP 0
|
| 433 |
+
# define CONF_F_CONF_PARSE_LIST 0
|
| 434 |
+
# define CONF_F_DEF_LOAD 0
|
| 435 |
+
# define CONF_F_DEF_LOAD_BIO 0
|
| 436 |
+
# define CONF_F_GET_NEXT_FILE 0
|
| 437 |
+
# define CONF_F_MODULE_ADD 0
|
| 438 |
+
# define CONF_F_MODULE_INIT 0
|
| 439 |
+
# define CONF_F_MODULE_LOAD_DSO 0
|
| 440 |
+
# define CONF_F_MODULE_RUN 0
|
| 441 |
+
# define CONF_F_NCONF_DUMP_BIO 0
|
| 442 |
+
# define CONF_F_NCONF_DUMP_FP 0
|
| 443 |
+
# define CONF_F_NCONF_GET_NUMBER_E 0
|
| 444 |
+
# define CONF_F_NCONF_GET_SECTION 0
|
| 445 |
+
# define CONF_F_NCONF_GET_STRING 0
|
| 446 |
+
# define CONF_F_NCONF_LOAD 0
|
| 447 |
+
# define CONF_F_NCONF_LOAD_BIO 0
|
| 448 |
+
# define CONF_F_NCONF_LOAD_FP 0
|
| 449 |
+
# define CONF_F_NCONF_NEW 0
|
| 450 |
+
# define CONF_F_PROCESS_INCLUDE 0
|
| 451 |
+
# define CONF_F_SSL_MODULE_INIT 0
|
| 452 |
+
# define CONF_F_STR_COPY 0
|
| 453 |
+
|
| 454 |
+
/*
|
| 455 |
+
* CRYPTO function codes.
|
| 456 |
+
*/
|
| 457 |
+
# define CRYPTO_F_CMAC_CTX_NEW 0
|
| 458 |
+
# define CRYPTO_F_CRYPTO_DUP_EX_DATA 0
|
| 459 |
+
# define CRYPTO_F_CRYPTO_FREE_EX_DATA 0
|
| 460 |
+
# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 0
|
| 461 |
+
# define CRYPTO_F_CRYPTO_MEMDUP 0
|
| 462 |
+
# define CRYPTO_F_CRYPTO_NEW_EX_DATA 0
|
| 463 |
+
# define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 0
|
| 464 |
+
# define CRYPTO_F_CRYPTO_OCB128_INIT 0
|
| 465 |
+
# define CRYPTO_F_CRYPTO_SET_EX_DATA 0
|
| 466 |
+
# define CRYPTO_F_GET_AND_LOCK 0
|
| 467 |
+
# define CRYPTO_F_OPENSSL_ATEXIT 0
|
| 468 |
+
# define CRYPTO_F_OPENSSL_BUF2HEXSTR 0
|
| 469 |
+
# define CRYPTO_F_OPENSSL_FOPEN 0
|
| 470 |
+
# define CRYPTO_F_OPENSSL_HEXSTR2BUF 0
|
| 471 |
+
# define CRYPTO_F_OPENSSL_INIT_CRYPTO 0
|
| 472 |
+
# define CRYPTO_F_OPENSSL_LH_NEW 0
|
| 473 |
+
# define CRYPTO_F_OPENSSL_SK_DEEP_COPY 0
|
| 474 |
+
# define CRYPTO_F_OPENSSL_SK_DUP 0
|
| 475 |
+
# define CRYPTO_F_PKEY_HMAC_INIT 0
|
| 476 |
+
# define CRYPTO_F_PKEY_POLY1305_INIT 0
|
| 477 |
+
# define CRYPTO_F_PKEY_SIPHASH_INIT 0
|
| 478 |
+
# define CRYPTO_F_SK_RESERVE 0
|
| 479 |
+
|
| 480 |
+
# ifndef OPENSSL_NO_CT
|
| 481 |
+
/*
|
| 482 |
+
* CT function codes.
|
| 483 |
+
*/
|
| 484 |
+
# define CT_F_CTLOG_NEW 0
|
| 485 |
+
# define CT_F_CTLOG_NEW_FROM_BASE64 0
|
| 486 |
+
# define CT_F_CTLOG_NEW_FROM_CONF 0
|
| 487 |
+
# define CT_F_CTLOG_STORE_LOAD_CTX_NEW 0
|
| 488 |
+
# define CT_F_CTLOG_STORE_LOAD_FILE 0
|
| 489 |
+
# define CT_F_CTLOG_STORE_LOAD_LOG 0
|
| 490 |
+
# define CT_F_CTLOG_STORE_NEW 0
|
| 491 |
+
# define CT_F_CT_BASE64_DECODE 0
|
| 492 |
+
# define CT_F_CT_POLICY_EVAL_CTX_NEW 0
|
| 493 |
+
# define CT_F_CT_V1_LOG_ID_FROM_PKEY 0
|
| 494 |
+
# define CT_F_I2O_SCT 0
|
| 495 |
+
# define CT_F_I2O_SCT_LIST 0
|
| 496 |
+
# define CT_F_I2O_SCT_SIGNATURE 0
|
| 497 |
+
# define CT_F_O2I_SCT 0
|
| 498 |
+
# define CT_F_O2I_SCT_LIST 0
|
| 499 |
+
# define CT_F_O2I_SCT_SIGNATURE 0
|
| 500 |
+
# define CT_F_SCT_CTX_NEW 0
|
| 501 |
+
# define CT_F_SCT_CTX_VERIFY 0
|
| 502 |
+
# define CT_F_SCT_NEW 0
|
| 503 |
+
# define CT_F_SCT_NEW_FROM_BASE64 0
|
| 504 |
+
# define CT_F_SCT_SET0_LOG_ID 0
|
| 505 |
+
# define CT_F_SCT_SET1_EXTENSIONS 0
|
| 506 |
+
# define CT_F_SCT_SET1_LOG_ID 0
|
| 507 |
+
# define CT_F_SCT_SET1_SIGNATURE 0
|
| 508 |
+
# define CT_F_SCT_SET_LOG_ENTRY_TYPE 0
|
| 509 |
+
# define CT_F_SCT_SET_SIGNATURE_NID 0
|
| 510 |
+
# define CT_F_SCT_SET_VERSION 0
|
| 511 |
+
# endif
|
| 512 |
+
|
| 513 |
+
# ifndef OPENSSL_NO_DH
|
| 514 |
+
/*
|
| 515 |
+
* DH function codes.
|
| 516 |
+
*/
|
| 517 |
+
# define DH_F_COMPUTE_KEY 0
|
| 518 |
+
# define DH_F_DHPARAMS_PRINT_FP 0
|
| 519 |
+
# define DH_F_DH_BUILTIN_GENPARAMS 0
|
| 520 |
+
# define DH_F_DH_CHECK_EX 0
|
| 521 |
+
# define DH_F_DH_CHECK_PARAMS_EX 0
|
| 522 |
+
# define DH_F_DH_CHECK_PUB_KEY_EX 0
|
| 523 |
+
# define DH_F_DH_CMS_DECRYPT 0
|
| 524 |
+
# define DH_F_DH_CMS_SET_PEERKEY 0
|
| 525 |
+
# define DH_F_DH_CMS_SET_SHARED_INFO 0
|
| 526 |
+
# define DH_F_DH_METH_DUP 0
|
| 527 |
+
# define DH_F_DH_METH_NEW 0
|
| 528 |
+
# define DH_F_DH_METH_SET1_NAME 0
|
| 529 |
+
# define DH_F_DH_NEW_BY_NID 0
|
| 530 |
+
# define DH_F_DH_NEW_METHOD 0
|
| 531 |
+
# define DH_F_DH_PARAM_DECODE 0
|
| 532 |
+
# define DH_F_DH_PKEY_PUBLIC_CHECK 0
|
| 533 |
+
# define DH_F_DH_PRIV_DECODE 0
|
| 534 |
+
# define DH_F_DH_PRIV_ENCODE 0
|
| 535 |
+
# define DH_F_DH_PUB_DECODE 0
|
| 536 |
+
# define DH_F_DH_PUB_ENCODE 0
|
| 537 |
+
# define DH_F_DO_DH_PRINT 0
|
| 538 |
+
# define DH_F_GENERATE_KEY 0
|
| 539 |
+
# define DH_F_PKEY_DH_CTRL_STR 0
|
| 540 |
+
# define DH_F_PKEY_DH_DERIVE 0
|
| 541 |
+
# define DH_F_PKEY_DH_INIT 0
|
| 542 |
+
# define DH_F_PKEY_DH_KEYGEN 0
|
| 543 |
+
# endif
|
| 544 |
+
|
| 545 |
+
# ifndef OPENSSL_NO_DSA
|
| 546 |
+
/*
|
| 547 |
+
* DSA function codes.
|
| 548 |
+
*/
|
| 549 |
+
# define DSA_F_DSAPARAMS_PRINT 0
|
| 550 |
+
# define DSA_F_DSAPARAMS_PRINT_FP 0
|
| 551 |
+
# define DSA_F_DSA_BUILTIN_PARAMGEN 0
|
| 552 |
+
# define DSA_F_DSA_BUILTIN_PARAMGEN2 0
|
| 553 |
+
# define DSA_F_DSA_DO_SIGN 0
|
| 554 |
+
# define DSA_F_DSA_DO_VERIFY 0
|
| 555 |
+
# define DSA_F_DSA_METH_DUP 0
|
| 556 |
+
# define DSA_F_DSA_METH_NEW 0
|
| 557 |
+
# define DSA_F_DSA_METH_SET1_NAME 0
|
| 558 |
+
# define DSA_F_DSA_NEW_METHOD 0
|
| 559 |
+
# define DSA_F_DSA_PARAM_DECODE 0
|
| 560 |
+
# define DSA_F_DSA_PRINT_FP 0
|
| 561 |
+
# define DSA_F_DSA_PRIV_DECODE 0
|
| 562 |
+
# define DSA_F_DSA_PRIV_ENCODE 0
|
| 563 |
+
# define DSA_F_DSA_PUB_DECODE 0
|
| 564 |
+
# define DSA_F_DSA_PUB_ENCODE 0
|
| 565 |
+
# define DSA_F_DSA_SIGN 0
|
| 566 |
+
# define DSA_F_DSA_SIGN_SETUP 0
|
| 567 |
+
# define DSA_F_DSA_SIG_NEW 0
|
| 568 |
+
# define DSA_F_OLD_DSA_PRIV_DECODE 0
|
| 569 |
+
# define DSA_F_PKEY_DSA_CTRL 0
|
| 570 |
+
# define DSA_F_PKEY_DSA_CTRL_STR 0
|
| 571 |
+
# define DSA_F_PKEY_DSA_KEYGEN 0
|
| 572 |
+
# endif
|
| 573 |
+
|
| 574 |
+
# ifndef OPENSSL_NO_EC
|
| 575 |
+
/*
|
| 576 |
+
* EC function codes.
|
| 577 |
+
*/
|
| 578 |
+
# define EC_F_BN_TO_FELEM 0
|
| 579 |
+
# define EC_F_D2I_ECPARAMETERS 0
|
| 580 |
+
# define EC_F_D2I_ECPKPARAMETERS 0
|
| 581 |
+
# define EC_F_D2I_ECPRIVATEKEY 0
|
| 582 |
+
# define EC_F_DO_EC_KEY_PRINT 0
|
| 583 |
+
# define EC_F_ECDH_CMS_DECRYPT 0
|
| 584 |
+
# define EC_F_ECDH_CMS_SET_SHARED_INFO 0
|
| 585 |
+
# define EC_F_ECDH_COMPUTE_KEY 0
|
| 586 |
+
# define EC_F_ECDH_SIMPLE_COMPUTE_KEY 0
|
| 587 |
+
# define EC_F_ECDSA_DO_SIGN_EX 0
|
| 588 |
+
# define EC_F_ECDSA_DO_VERIFY 0
|
| 589 |
+
# define EC_F_ECDSA_SIGN_EX 0
|
| 590 |
+
# define EC_F_ECDSA_SIGN_SETUP 0
|
| 591 |
+
# define EC_F_ECDSA_SIG_NEW 0
|
| 592 |
+
# define EC_F_ECDSA_VERIFY 0
|
| 593 |
+
# define EC_F_ECD_ITEM_VERIFY 0
|
| 594 |
+
# define EC_F_ECKEY_PARAM2TYPE 0
|
| 595 |
+
# define EC_F_ECKEY_PARAM_DECODE 0
|
| 596 |
+
# define EC_F_ECKEY_PRIV_DECODE 0
|
| 597 |
+
# define EC_F_ECKEY_PRIV_ENCODE 0
|
| 598 |
+
# define EC_F_ECKEY_PUB_DECODE 0
|
| 599 |
+
# define EC_F_ECKEY_PUB_ENCODE 0
|
| 600 |
+
# define EC_F_ECKEY_TYPE2PARAM 0
|
| 601 |
+
# define EC_F_ECPARAMETERS_PRINT 0
|
| 602 |
+
# define EC_F_ECPARAMETERS_PRINT_FP 0
|
| 603 |
+
# define EC_F_ECPKPARAMETERS_PRINT 0
|
| 604 |
+
# define EC_F_ECPKPARAMETERS_PRINT_FP 0
|
| 605 |
+
# define EC_F_ECP_NISTZ256_GET_AFFINE 0
|
| 606 |
+
# define EC_F_ECP_NISTZ256_INV_MOD_ORD 0
|
| 607 |
+
# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 0
|
| 608 |
+
# define EC_F_ECP_NISTZ256_POINTS_MUL 0
|
| 609 |
+
# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 0
|
| 610 |
+
# define EC_F_ECP_NISTZ256_WINDOWED_MUL 0
|
| 611 |
+
# define EC_F_ECX_KEY_OP 0
|
| 612 |
+
# define EC_F_ECX_PRIV_ENCODE 0
|
| 613 |
+
# define EC_F_ECX_PUB_ENCODE 0
|
| 614 |
+
# define EC_F_EC_ASN1_GROUP2CURVE 0
|
| 615 |
+
# define EC_F_EC_ASN1_GROUP2FIELDID 0
|
| 616 |
+
# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 0
|
| 617 |
+
# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 0
|
| 618 |
+
# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 0
|
| 619 |
+
# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 0
|
| 620 |
+
# define EC_F_EC_GF2M_SIMPLE_LADDER_POST 0
|
| 621 |
+
# define EC_F_EC_GF2M_SIMPLE_LADDER_PRE 0
|
| 622 |
+
# define EC_F_EC_GF2M_SIMPLE_OCT2POINT 0
|
| 623 |
+
# define EC_F_EC_GF2M_SIMPLE_POINT2OCT 0
|
| 624 |
+
# define EC_F_EC_GF2M_SIMPLE_POINTS_MUL 0
|
| 625 |
+
# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 0
|
| 626 |
+
# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 0
|
| 627 |
+
# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 0
|
| 628 |
+
# define EC_F_EC_GFP_MONT_FIELD_DECODE 0
|
| 629 |
+
# define EC_F_EC_GFP_MONT_FIELD_ENCODE 0
|
| 630 |
+
# define EC_F_EC_GFP_MONT_FIELD_INV 0
|
| 631 |
+
# define EC_F_EC_GFP_MONT_FIELD_MUL 0
|
| 632 |
+
# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 0
|
| 633 |
+
# define EC_F_EC_GFP_MONT_FIELD_SQR 0
|
| 634 |
+
# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 0
|
| 635 |
+
# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 0
|
| 636 |
+
# define EC_F_EC_GFP_NISTP224_POINTS_MUL 0
|
| 637 |
+
# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 0
|
| 638 |
+
# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 0
|
| 639 |
+
# define EC_F_EC_GFP_NISTP256_POINTS_MUL 0
|
| 640 |
+
# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 0
|
| 641 |
+
# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 0
|
| 642 |
+
# define EC_F_EC_GFP_NISTP521_POINTS_MUL 0
|
| 643 |
+
# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 0
|
| 644 |
+
# define EC_F_EC_GFP_NIST_FIELD_MUL 0
|
| 645 |
+
# define EC_F_EC_GFP_NIST_FIELD_SQR 0
|
| 646 |
+
# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 0
|
| 647 |
+
# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 0
|
| 648 |
+
# define EC_F_EC_GFP_SIMPLE_FIELD_INV 0
|
| 649 |
+
# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 0
|
| 650 |
+
# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 0
|
| 651 |
+
# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 0
|
| 652 |
+
# define EC_F_EC_GFP_SIMPLE_OCT2POINT 0
|
| 653 |
+
# define EC_F_EC_GFP_SIMPLE_POINT2OCT 0
|
| 654 |
+
# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 0
|
| 655 |
+
# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 0
|
| 656 |
+
# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 0
|
| 657 |
+
# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 0
|
| 658 |
+
# define EC_F_EC_GROUP_CHECK 0
|
| 659 |
+
# define EC_F_EC_GROUP_CHECK_DISCRIMINANT 0
|
| 660 |
+
# define EC_F_EC_GROUP_COPY 0
|
| 661 |
+
# define EC_F_EC_GROUP_GET_CURVE 0
|
| 662 |
+
# define EC_F_EC_GROUP_GET_CURVE_GF2M 0
|
| 663 |
+
# define EC_F_EC_GROUP_GET_CURVE_GFP 0
|
| 664 |
+
# define EC_F_EC_GROUP_GET_DEGREE 0
|
| 665 |
+
# define EC_F_EC_GROUP_GET_ECPARAMETERS 0
|
| 666 |
+
# define EC_F_EC_GROUP_GET_ECPKPARAMETERS 0
|
| 667 |
+
# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 0
|
| 668 |
+
# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 0
|
| 669 |
+
# define EC_F_EC_GROUP_NEW 0
|
| 670 |
+
# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 0
|
| 671 |
+
# define EC_F_EC_GROUP_NEW_FROM_DATA 0
|
| 672 |
+
# define EC_F_EC_GROUP_NEW_FROM_ECPARAMETERS 0
|
| 673 |
+
# define EC_F_EC_GROUP_NEW_FROM_ECPKPARAMETERS 0
|
| 674 |
+
# define EC_F_EC_GROUP_SET_CURVE 0
|
| 675 |
+
# define EC_F_EC_GROUP_SET_CURVE_GF2M 0
|
| 676 |
+
# define EC_F_EC_GROUP_SET_CURVE_GFP 0
|
| 677 |
+
# define EC_F_EC_GROUP_SET_GENERATOR 0
|
| 678 |
+
# define EC_F_EC_GROUP_SET_SEED 0
|
| 679 |
+
# define EC_F_EC_KEY_CHECK_KEY 0
|
| 680 |
+
# define EC_F_EC_KEY_COPY 0
|
| 681 |
+
# define EC_F_EC_KEY_GENERATE_KEY 0
|
| 682 |
+
# define EC_F_EC_KEY_NEW 0
|
| 683 |
+
# define EC_F_EC_KEY_NEW_METHOD 0
|
| 684 |
+
# define EC_F_EC_KEY_OCT2PRIV 0
|
| 685 |
+
# define EC_F_EC_KEY_PRINT 0
|
| 686 |
+
# define EC_F_EC_KEY_PRINT_FP 0
|
| 687 |
+
# define EC_F_EC_KEY_PRIV2BUF 0
|
| 688 |
+
# define EC_F_EC_KEY_PRIV2OCT 0
|
| 689 |
+
# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 0
|
| 690 |
+
# define EC_F_EC_KEY_SIMPLE_CHECK_KEY 0
|
| 691 |
+
# define EC_F_EC_KEY_SIMPLE_OCT2PRIV 0
|
| 692 |
+
# define EC_F_EC_KEY_SIMPLE_PRIV2OCT 0
|
| 693 |
+
# define EC_F_EC_PKEY_CHECK 0
|
| 694 |
+
# define EC_F_EC_PKEY_PARAM_CHECK 0
|
| 695 |
+
# define EC_F_EC_POINTS_MAKE_AFFINE 0
|
| 696 |
+
# define EC_F_EC_POINTS_MUL 0
|
| 697 |
+
# define EC_F_EC_POINT_ADD 0
|
| 698 |
+
# define EC_F_EC_POINT_BN2POINT 0
|
| 699 |
+
# define EC_F_EC_POINT_CMP 0
|
| 700 |
+
# define EC_F_EC_POINT_COPY 0
|
| 701 |
+
# define EC_F_EC_POINT_DBL 0
|
| 702 |
+
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES 0
|
| 703 |
+
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 0
|
| 704 |
+
# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 0
|
| 705 |
+
# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 0
|
| 706 |
+
# define EC_F_EC_POINT_INVERT 0
|
| 707 |
+
# define EC_F_EC_POINT_IS_AT_INFINITY 0
|
| 708 |
+
# define EC_F_EC_POINT_IS_ON_CURVE 0
|
| 709 |
+
# define EC_F_EC_POINT_MAKE_AFFINE 0
|
| 710 |
+
# define EC_F_EC_POINT_NEW 0
|
| 711 |
+
# define EC_F_EC_POINT_OCT2POINT 0
|
| 712 |
+
# define EC_F_EC_POINT_POINT2BUF 0
|
| 713 |
+
# define EC_F_EC_POINT_POINT2OCT 0
|
| 714 |
+
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES 0
|
| 715 |
+
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 0
|
| 716 |
+
# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 0
|
| 717 |
+
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES 0
|
| 718 |
+
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 0
|
| 719 |
+
# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 0
|
| 720 |
+
# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 0
|
| 721 |
+
# define EC_F_EC_POINT_SET_TO_INFINITY 0
|
| 722 |
+
# define EC_F_EC_PRE_COMP_NEW 0
|
| 723 |
+
# define EC_F_EC_SCALAR_MUL_LADDER 0
|
| 724 |
+
# define EC_F_EC_WNAF_MUL 0
|
| 725 |
+
# define EC_F_EC_WNAF_PRECOMPUTE_MULT 0
|
| 726 |
+
# define EC_F_I2D_ECPARAMETERS 0
|
| 727 |
+
# define EC_F_I2D_ECPKPARAMETERS 0
|
| 728 |
+
# define EC_F_I2D_ECPRIVATEKEY 0
|
| 729 |
+
# define EC_F_I2O_ECPUBLICKEY 0
|
| 730 |
+
# define EC_F_NISTP224_PRE_COMP_NEW 0
|
| 731 |
+
# define EC_F_NISTP256_PRE_COMP_NEW 0
|
| 732 |
+
# define EC_F_NISTP521_PRE_COMP_NEW 0
|
| 733 |
+
# define EC_F_O2I_ECPUBLICKEY 0
|
| 734 |
+
# define EC_F_OLD_EC_PRIV_DECODE 0
|
| 735 |
+
# define EC_F_OSSL_ECDH_COMPUTE_KEY 0
|
| 736 |
+
# define EC_F_OSSL_ECDSA_SIGN_SIG 0
|
| 737 |
+
# define EC_F_OSSL_ECDSA_VERIFY_SIG 0
|
| 738 |
+
# define EC_F_PKEY_ECD_CTRL 0
|
| 739 |
+
# define EC_F_PKEY_ECD_DIGESTSIGN 0
|
| 740 |
+
# define EC_F_PKEY_ECD_DIGESTSIGN25519 0
|
| 741 |
+
# define EC_F_PKEY_ECD_DIGESTSIGN448 0
|
| 742 |
+
# define EC_F_PKEY_ECX_DERIVE 0
|
| 743 |
+
# define EC_F_PKEY_EC_CTRL 0
|
| 744 |
+
# define EC_F_PKEY_EC_CTRL_STR 0
|
| 745 |
+
# define EC_F_PKEY_EC_DERIVE 0
|
| 746 |
+
# define EC_F_PKEY_EC_INIT 0
|
| 747 |
+
# define EC_F_PKEY_EC_KDF_DERIVE 0
|
| 748 |
+
# define EC_F_PKEY_EC_KEYGEN 0
|
| 749 |
+
# define EC_F_PKEY_EC_PARAMGEN 0
|
| 750 |
+
# define EC_F_PKEY_EC_SIGN 0
|
| 751 |
+
# define EC_F_VALIDATE_ECX_DERIVE 0
|
| 752 |
+
# endif
|
| 753 |
+
|
| 754 |
+
# ifndef OPENSSL_NO_ENGINE
|
| 755 |
+
/*
|
| 756 |
+
* ENGINE function codes.
|
| 757 |
+
*/
|
| 758 |
+
# define ENGINE_F_DIGEST_UPDATE 0
|
| 759 |
+
# define ENGINE_F_DYNAMIC_CTRL 0
|
| 760 |
+
# define ENGINE_F_DYNAMIC_GET_DATA_CTX 0
|
| 761 |
+
# define ENGINE_F_DYNAMIC_LOAD 0
|
| 762 |
+
# define ENGINE_F_DYNAMIC_SET_DATA_CTX 0
|
| 763 |
+
# define ENGINE_F_ENGINE_ADD 0
|
| 764 |
+
# define ENGINE_F_ENGINE_BY_ID 0
|
| 765 |
+
# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 0
|
| 766 |
+
# define ENGINE_F_ENGINE_CTRL 0
|
| 767 |
+
# define ENGINE_F_ENGINE_CTRL_CMD 0
|
| 768 |
+
# define ENGINE_F_ENGINE_CTRL_CMD_STRING 0
|
| 769 |
+
# define ENGINE_F_ENGINE_FINISH 0
|
| 770 |
+
# define ENGINE_F_ENGINE_GET_CIPHER 0
|
| 771 |
+
# define ENGINE_F_ENGINE_GET_DIGEST 0
|
| 772 |
+
# define ENGINE_F_ENGINE_GET_FIRST 0
|
| 773 |
+
# define ENGINE_F_ENGINE_GET_LAST 0
|
| 774 |
+
# define ENGINE_F_ENGINE_GET_NEXT 0
|
| 775 |
+
# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 0
|
| 776 |
+
# define ENGINE_F_ENGINE_GET_PKEY_METH 0
|
| 777 |
+
# define ENGINE_F_ENGINE_GET_PREV 0
|
| 778 |
+
# define ENGINE_F_ENGINE_INIT 0
|
| 779 |
+
# define ENGINE_F_ENGINE_LIST_ADD 0
|
| 780 |
+
# define ENGINE_F_ENGINE_LIST_REMOVE 0
|
| 781 |
+
# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 0
|
| 782 |
+
# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 0
|
| 783 |
+
# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 0
|
| 784 |
+
# define ENGINE_F_ENGINE_NEW 0
|
| 785 |
+
# define ENGINE_F_ENGINE_PKEY_ASN1_FIND_STR 0
|
| 786 |
+
# define ENGINE_F_ENGINE_REMOVE 0
|
| 787 |
+
# define ENGINE_F_ENGINE_SET_DEFAULT_STRING 0
|
| 788 |
+
# define ENGINE_F_ENGINE_SET_ID 0
|
| 789 |
+
# define ENGINE_F_ENGINE_SET_NAME 0
|
| 790 |
+
# define ENGINE_F_ENGINE_TABLE_REGISTER 0
|
| 791 |
+
# define ENGINE_F_ENGINE_UNLOCKED_FINISH 0
|
| 792 |
+
# define ENGINE_F_ENGINE_UP_REF 0
|
| 793 |
+
# define ENGINE_F_INT_CLEANUP_ITEM 0
|
| 794 |
+
# define ENGINE_F_INT_CTRL_HELPER 0
|
| 795 |
+
# define ENGINE_F_INT_ENGINE_CONFIGURE 0
|
| 796 |
+
# define ENGINE_F_INT_ENGINE_MODULE_INIT 0
|
| 797 |
+
# define ENGINE_F_OSSL_HMAC_INIT 0
|
| 798 |
+
# endif
|
| 799 |
+
|
| 800 |
+
/*
|
| 801 |
+
* EVP function codes.
|
| 802 |
+
*/
|
| 803 |
+
# define EVP_F_AESNI_INIT_KEY 0
|
| 804 |
+
# define EVP_F_AESNI_XTS_INIT_KEY 0
|
| 805 |
+
# define EVP_F_AES_GCM_CTRL 0
|
| 806 |
+
# define EVP_F_AES_INIT_KEY 0
|
| 807 |
+
# define EVP_F_AES_OCB_CIPHER 0
|
| 808 |
+
# define EVP_F_AES_T4_INIT_KEY 0
|
| 809 |
+
# define EVP_F_AES_T4_XTS_INIT_KEY 0
|
| 810 |
+
# define EVP_F_AES_WRAP_CIPHER 0
|
| 811 |
+
# define EVP_F_AES_XTS_INIT_KEY 0
|
| 812 |
+
# define EVP_F_ALG_MODULE_INIT 0
|
| 813 |
+
# define EVP_F_ARIA_CCM_INIT_KEY 0
|
| 814 |
+
# define EVP_F_ARIA_GCM_CTRL 0
|
| 815 |
+
# define EVP_F_ARIA_GCM_INIT_KEY 0
|
| 816 |
+
# define EVP_F_ARIA_INIT_KEY 0
|
| 817 |
+
# define EVP_F_B64_NEW 0
|
| 818 |
+
# define EVP_F_CAMELLIA_INIT_KEY 0
|
| 819 |
+
# define EVP_F_CHACHA20_POLY1305_CTRL 0
|
| 820 |
+
# define EVP_F_CMLL_T4_INIT_KEY 0
|
| 821 |
+
# define EVP_F_DES_EDE3_WRAP_CIPHER 0
|
| 822 |
+
# define EVP_F_DO_SIGVER_INIT 0
|
| 823 |
+
# define EVP_F_ENC_NEW 0
|
| 824 |
+
# define EVP_F_EVP_CIPHERINIT_EX 0
|
| 825 |
+
# define EVP_F_EVP_CIPHER_ASN1_TO_PARAM 0
|
| 826 |
+
# define EVP_F_EVP_CIPHER_CTX_COPY 0
|
| 827 |
+
# define EVP_F_EVP_CIPHER_CTX_CTRL 0
|
| 828 |
+
# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 0
|
| 829 |
+
# define EVP_F_EVP_CIPHER_PARAM_TO_ASN1 0
|
| 830 |
+
# define EVP_F_EVP_DECRYPTFINAL_EX 0
|
| 831 |
+
# define EVP_F_EVP_DECRYPTUPDATE 0
|
| 832 |
+
# define EVP_F_EVP_DIGESTFINALXOF 0
|
| 833 |
+
# define EVP_F_EVP_DIGESTINIT_EX 0
|
| 834 |
+
# define EVP_F_EVP_ENCRYPTDECRYPTUPDATE 0
|
| 835 |
+
# define EVP_F_EVP_ENCRYPTFINAL_EX 0
|
| 836 |
+
# define EVP_F_EVP_ENCRYPTUPDATE 0
|
| 837 |
+
# define EVP_F_EVP_MD_CTX_COPY_EX 0
|
| 838 |
+
# define EVP_F_EVP_MD_SIZE 0
|
| 839 |
+
# define EVP_F_EVP_OPENINIT 0
|
| 840 |
+
# define EVP_F_EVP_PBE_ALG_ADD 0
|
| 841 |
+
# define EVP_F_EVP_PBE_ALG_ADD_TYPE 0
|
| 842 |
+
# define EVP_F_EVP_PBE_CIPHERINIT 0
|
| 843 |
+
# define EVP_F_EVP_PBE_SCRYPT 0
|
| 844 |
+
# define EVP_F_EVP_PKCS82PKEY 0
|
| 845 |
+
# define EVP_F_EVP_PKEY2PKCS8 0
|
| 846 |
+
# define EVP_F_EVP_PKEY_ASN1_ADD0 0
|
| 847 |
+
# define EVP_F_EVP_PKEY_CHECK 0
|
| 848 |
+
# define EVP_F_EVP_PKEY_COPY_PARAMETERS 0
|
| 849 |
+
# define EVP_F_EVP_PKEY_CTX_CTRL 0
|
| 850 |
+
# define EVP_F_EVP_PKEY_CTX_CTRL_STR 0
|
| 851 |
+
# define EVP_F_EVP_PKEY_CTX_DUP 0
|
| 852 |
+
# define EVP_F_EVP_PKEY_CTX_MD 0
|
| 853 |
+
# define EVP_F_EVP_PKEY_DECRYPT 0
|
| 854 |
+
# define EVP_F_EVP_PKEY_DECRYPT_INIT 0
|
| 855 |
+
# define EVP_F_EVP_PKEY_DECRYPT_OLD 0
|
| 856 |
+
# define EVP_F_EVP_PKEY_DERIVE 0
|
| 857 |
+
# define EVP_F_EVP_PKEY_DERIVE_INIT 0
|
| 858 |
+
# define EVP_F_EVP_PKEY_DERIVE_SET_PEER 0
|
| 859 |
+
# define EVP_F_EVP_PKEY_ENCRYPT 0
|
| 860 |
+
# define EVP_F_EVP_PKEY_ENCRYPT_INIT 0
|
| 861 |
+
# define EVP_F_EVP_PKEY_ENCRYPT_OLD 0
|
| 862 |
+
# define EVP_F_EVP_PKEY_GET0_DH 0
|
| 863 |
+
# define EVP_F_EVP_PKEY_GET0_DSA 0
|
| 864 |
+
# define EVP_F_EVP_PKEY_GET0_EC_KEY 0
|
| 865 |
+
# define EVP_F_EVP_PKEY_GET0_HMAC 0
|
| 866 |
+
# define EVP_F_EVP_PKEY_GET0_POLY1305 0
|
| 867 |
+
# define EVP_F_EVP_PKEY_GET0_RSA 0
|
| 868 |
+
# define EVP_F_EVP_PKEY_GET0_SIPHASH 0
|
| 869 |
+
# define EVP_F_EVP_PKEY_GET_RAW_PRIVATE_KEY 0
|
| 870 |
+
# define EVP_F_EVP_PKEY_GET_RAW_PUBLIC_KEY 0
|
| 871 |
+
# define EVP_F_EVP_PKEY_KEYGEN 0
|
| 872 |
+
# define EVP_F_EVP_PKEY_KEYGEN_INIT 0
|
| 873 |
+
# define EVP_F_EVP_PKEY_METH_ADD0 0
|
| 874 |
+
# define EVP_F_EVP_PKEY_METH_NEW 0
|
| 875 |
+
# define EVP_F_EVP_PKEY_NEW 0
|
| 876 |
+
# define EVP_F_EVP_PKEY_NEW_CMAC_KEY 0
|
| 877 |
+
# define EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY 0
|
| 878 |
+
# define EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY 0
|
| 879 |
+
# define EVP_F_EVP_PKEY_PARAMGEN 0
|
| 880 |
+
# define EVP_F_EVP_PKEY_PARAMGEN_INIT 0
|
| 881 |
+
# define EVP_F_EVP_PKEY_PARAM_CHECK 0
|
| 882 |
+
# define EVP_F_EVP_PKEY_PUBLIC_CHECK 0
|
| 883 |
+
# define EVP_F_EVP_PKEY_SET1_ENGINE 0
|
| 884 |
+
# define EVP_F_EVP_PKEY_SET_ALIAS_TYPE 0
|
| 885 |
+
# define EVP_F_EVP_PKEY_SIGN 0
|
| 886 |
+
# define EVP_F_EVP_PKEY_SIGN_INIT 0
|
| 887 |
+
# define EVP_F_EVP_PKEY_VERIFY 0
|
| 888 |
+
# define EVP_F_EVP_PKEY_VERIFY_INIT 0
|
| 889 |
+
# define EVP_F_EVP_PKEY_VERIFY_RECOVER 0
|
| 890 |
+
# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 0
|
| 891 |
+
# define EVP_F_EVP_SIGNFINAL 0
|
| 892 |
+
# define EVP_F_EVP_VERIFYFINAL 0
|
| 893 |
+
# define EVP_F_INT_CTX_NEW 0
|
| 894 |
+
# define EVP_F_OK_NEW 0
|
| 895 |
+
# define EVP_F_PKCS5_PBE_KEYIVGEN 0
|
| 896 |
+
# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 0
|
| 897 |
+
# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 0
|
| 898 |
+
# define EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN 0
|
| 899 |
+
# define EVP_F_PKEY_SET_TYPE 0
|
| 900 |
+
# define EVP_F_RC2_MAGIC_TO_METH 0
|
| 901 |
+
# define EVP_F_RC5_CTRL 0
|
| 902 |
+
# define EVP_F_R_32_12_16_INIT_KEY 0
|
| 903 |
+
# define EVP_F_S390X_AES_GCM_CTRL 0
|
| 904 |
+
# define EVP_F_UPDATE 0
|
| 905 |
+
|
| 906 |
+
/*
|
| 907 |
+
* KDF function codes.
|
| 908 |
+
*/
|
| 909 |
+
# define KDF_F_PKEY_HKDF_CTRL_STR 0
|
| 910 |
+
# define KDF_F_PKEY_HKDF_DERIVE 0
|
| 911 |
+
# define KDF_F_PKEY_HKDF_INIT 0
|
| 912 |
+
# define KDF_F_PKEY_SCRYPT_CTRL_STR 0
|
| 913 |
+
# define KDF_F_PKEY_SCRYPT_CTRL_UINT64 0
|
| 914 |
+
# define KDF_F_PKEY_SCRYPT_DERIVE 0
|
| 915 |
+
# define KDF_F_PKEY_SCRYPT_INIT 0
|
| 916 |
+
# define KDF_F_PKEY_SCRYPT_SET_MEMBUF 0
|
| 917 |
+
# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 0
|
| 918 |
+
# define KDF_F_PKEY_TLS1_PRF_DERIVE 0
|
| 919 |
+
# define KDF_F_PKEY_TLS1_PRF_INIT 0
|
| 920 |
+
# define KDF_F_TLS1_PRF_ALG 0
|
| 921 |
+
|
| 922 |
+
/*
|
| 923 |
+
* KDF reason codes.
|
| 924 |
+
*/
|
| 925 |
+
# define KDF_R_INVALID_DIGEST 0
|
| 926 |
+
# define KDF_R_MISSING_ITERATION_COUNT 0
|
| 927 |
+
# define KDF_R_MISSING_KEY 0
|
| 928 |
+
# define KDF_R_MISSING_MESSAGE_DIGEST 0
|
| 929 |
+
# define KDF_R_MISSING_PARAMETER 0
|
| 930 |
+
# define KDF_R_MISSING_PASS 0
|
| 931 |
+
# define KDF_R_MISSING_SALT 0
|
| 932 |
+
# define KDF_R_MISSING_SECRET 0
|
| 933 |
+
# define KDF_R_MISSING_SEED 0
|
| 934 |
+
# define KDF_R_UNKNOWN_PARAMETER_TYPE 0
|
| 935 |
+
# define KDF_R_VALUE_ERROR 0
|
| 936 |
+
# define KDF_R_VALUE_MISSING 0
|
| 937 |
+
|
| 938 |
+
/*
|
| 939 |
+
* OBJ function codes.
|
| 940 |
+
*/
|
| 941 |
+
# define OBJ_F_OBJ_ADD_OBJECT 0
|
| 942 |
+
# define OBJ_F_OBJ_ADD_SIGID 0
|
| 943 |
+
# define OBJ_F_OBJ_CREATE 0
|
| 944 |
+
# define OBJ_F_OBJ_DUP 0
|
| 945 |
+
# define OBJ_F_OBJ_NAME_NEW_INDEX 0
|
| 946 |
+
# define OBJ_F_OBJ_NID2LN 0
|
| 947 |
+
# define OBJ_F_OBJ_NID2OBJ 0
|
| 948 |
+
# define OBJ_F_OBJ_NID2SN 0
|
| 949 |
+
# define OBJ_F_OBJ_TXT2OBJ 0
|
| 950 |
+
|
| 951 |
+
# ifndef OPENSSL_NO_OCSP
|
| 952 |
+
/*
|
| 953 |
+
* OCSP function codes.
|
| 954 |
+
*/
|
| 955 |
+
# define OCSP_F_D2I_OCSP_NONCE 0
|
| 956 |
+
# define OCSP_F_OCSP_BASIC_ADD1_STATUS 0
|
| 957 |
+
# define OCSP_F_OCSP_BASIC_SIGN 0
|
| 958 |
+
# define OCSP_F_OCSP_BASIC_SIGN_CTX 0
|
| 959 |
+
# define OCSP_F_OCSP_BASIC_VERIFY 0
|
| 960 |
+
# define OCSP_F_OCSP_CERT_ID_NEW 0
|
| 961 |
+
# define OCSP_F_OCSP_CHECK_DELEGATED 0
|
| 962 |
+
# define OCSP_F_OCSP_CHECK_IDS 0
|
| 963 |
+
# define OCSP_F_OCSP_CHECK_ISSUER 0
|
| 964 |
+
# define OCSP_F_OCSP_CHECK_VALIDITY 0
|
| 965 |
+
# define OCSP_F_OCSP_MATCH_ISSUERID 0
|
| 966 |
+
# define OCSP_F_OCSP_PARSE_URL 0
|
| 967 |
+
# define OCSP_F_OCSP_REQUEST_SIGN 0
|
| 968 |
+
# define OCSP_F_OCSP_REQUEST_VERIFY 0
|
| 969 |
+
# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 0
|
| 970 |
+
# define OCSP_F_PARSE_HTTP_LINE1 0
|
| 971 |
+
# endif
|
| 972 |
+
|
| 973 |
+
/*
|
| 974 |
+
* PEM function codes.
|
| 975 |
+
*/
|
| 976 |
+
# define PEM_F_B2I_DSS 0
|
| 977 |
+
# define PEM_F_B2I_PVK_BIO 0
|
| 978 |
+
# define PEM_F_B2I_RSA 0
|
| 979 |
+
# define PEM_F_CHECK_BITLEN_DSA 0
|
| 980 |
+
# define PEM_F_CHECK_BITLEN_RSA 0
|
| 981 |
+
# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 0
|
| 982 |
+
# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 0
|
| 983 |
+
# define PEM_F_DO_B2I 0
|
| 984 |
+
# define PEM_F_DO_B2I_BIO 0
|
| 985 |
+
# define PEM_F_DO_BLOB_HEADER 0
|
| 986 |
+
# define PEM_F_DO_I2B 0
|
| 987 |
+
# define PEM_F_DO_PK8PKEY 0
|
| 988 |
+
# define PEM_F_DO_PK8PKEY_FP 0
|
| 989 |
+
# define PEM_F_DO_PVK_BODY 0
|
| 990 |
+
# define PEM_F_DO_PVK_HEADER 0
|
| 991 |
+
# define PEM_F_GET_HEADER_AND_DATA 0
|
| 992 |
+
# define PEM_F_GET_NAME 0
|
| 993 |
+
# define PEM_F_I2B_PVK 0
|
| 994 |
+
# define PEM_F_I2B_PVK_BIO 0
|
| 995 |
+
# define PEM_F_LOAD_IV 0
|
| 996 |
+
# define PEM_F_PEM_ASN1_READ 0
|
| 997 |
+
# define PEM_F_PEM_ASN1_READ_BIO 0
|
| 998 |
+
# define PEM_F_PEM_ASN1_WRITE 0
|
| 999 |
+
# define PEM_F_PEM_ASN1_WRITE_BIO 0
|
| 1000 |
+
# define PEM_F_PEM_DEF_CALLBACK 0
|
| 1001 |
+
# define PEM_F_PEM_DO_HEADER 0
|
| 1002 |
+
# define PEM_F_PEM_GET_EVP_CIPHER_INFO 0
|
| 1003 |
+
# define PEM_F_PEM_READ 0
|
| 1004 |
+
# define PEM_F_PEM_READ_BIO 0
|
| 1005 |
+
# define PEM_F_PEM_READ_BIO_DHPARAMS 0
|
| 1006 |
+
# define PEM_F_PEM_READ_BIO_EX 0
|
| 1007 |
+
# define PEM_F_PEM_READ_BIO_PARAMETERS 0
|
| 1008 |
+
# define PEM_F_PEM_READ_BIO_PRIVATEKEY 0
|
| 1009 |
+
# define PEM_F_PEM_READ_DHPARAMS 0
|
| 1010 |
+
# define PEM_F_PEM_READ_PRIVATEKEY 0
|
| 1011 |
+
# define PEM_F_PEM_SIGNFINAL 0
|
| 1012 |
+
# define PEM_F_PEM_WRITE 0
|
| 1013 |
+
# define PEM_F_PEM_WRITE_BIO 0
|
| 1014 |
+
# define PEM_F_PEM_WRITE_BIO_PRIVATEKEY_TRADITIONAL 0
|
| 1015 |
+
# define PEM_F_PEM_WRITE_PRIVATEKEY 0
|
| 1016 |
+
# define PEM_F_PEM_X509_INFO_READ 0
|
| 1017 |
+
# define PEM_F_PEM_X509_INFO_READ_BIO 0
|
| 1018 |
+
# define PEM_F_PEM_X509_INFO_WRITE_BIO 0
|
| 1019 |
+
|
| 1020 |
+
/*
|
| 1021 |
+
* PKCS12 function codes.
|
| 1022 |
+
*/
|
| 1023 |
+
# define PKCS12_F_OPENSSL_ASC2UNI 0
|
| 1024 |
+
# define PKCS12_F_OPENSSL_UNI2ASC 0
|
| 1025 |
+
# define PKCS12_F_OPENSSL_UNI2UTF8 0
|
| 1026 |
+
# define PKCS12_F_OPENSSL_UTF82UNI 0
|
| 1027 |
+
# define PKCS12_F_PKCS12_CREATE 0
|
| 1028 |
+
# define PKCS12_F_PKCS12_GEN_MAC 0
|
| 1029 |
+
# define PKCS12_F_PKCS12_INIT 0
|
| 1030 |
+
# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 0
|
| 1031 |
+
# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 0
|
| 1032 |
+
# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 0
|
| 1033 |
+
# define PKCS12_F_PKCS12_KEY_GEN_ASC 0
|
| 1034 |
+
# define PKCS12_F_PKCS12_KEY_GEN_UNI 0
|
| 1035 |
+
# define PKCS12_F_PKCS12_KEY_GEN_UTF8 0
|
| 1036 |
+
# define PKCS12_F_PKCS12_NEWPASS 0
|
| 1037 |
+
# define PKCS12_F_PKCS12_PACK_P7DATA 0
|
| 1038 |
+
# define PKCS12_F_PKCS12_PACK_P7ENCDATA 0
|
| 1039 |
+
# define PKCS12_F_PKCS12_PARSE 0
|
| 1040 |
+
# define PKCS12_F_PKCS12_PBE_CRYPT 0
|
| 1041 |
+
# define PKCS12_F_PKCS12_PBE_KEYIVGEN 0
|
| 1042 |
+
# define PKCS12_F_PKCS12_SAFEBAG_CREATE0_P8INF 0
|
| 1043 |
+
# define PKCS12_F_PKCS12_SAFEBAG_CREATE0_PKCS8 0
|
| 1044 |
+
# define PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT 0
|
| 1045 |
+
# define PKCS12_F_PKCS12_SETUP_MAC 0
|
| 1046 |
+
# define PKCS12_F_PKCS12_SET_MAC 0
|
| 1047 |
+
# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 0
|
| 1048 |
+
# define PKCS12_F_PKCS12_UNPACK_P7DATA 0
|
| 1049 |
+
# define PKCS12_F_PKCS12_VERIFY_MAC 0
|
| 1050 |
+
# define PKCS12_F_PKCS8_ENCRYPT 0
|
| 1051 |
+
# define PKCS12_F_PKCS8_SET0_PBE 0
|
| 1052 |
+
|
| 1053 |
+
/*
|
| 1054 |
+
* PKCS7 function codes.
|
| 1055 |
+
*/
|
| 1056 |
+
# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 0
|
| 1057 |
+
# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 0
|
| 1058 |
+
# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 0
|
| 1059 |
+
# define PKCS7_F_PKCS7_ADD_CERTIFICATE 0
|
| 1060 |
+
# define PKCS7_F_PKCS7_ADD_CRL 0
|
| 1061 |
+
# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 0
|
| 1062 |
+
# define PKCS7_F_PKCS7_ADD_SIGNATURE 0
|
| 1063 |
+
# define PKCS7_F_PKCS7_ADD_SIGNER 0
|
| 1064 |
+
# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 0
|
| 1065 |
+
# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 0
|
| 1066 |
+
# define PKCS7_F_PKCS7_CTRL 0
|
| 1067 |
+
# define PKCS7_F_PKCS7_DATADECODE 0
|
| 1068 |
+
# define PKCS7_F_PKCS7_DATAFINAL 0
|
| 1069 |
+
# define PKCS7_F_PKCS7_DATAINIT 0
|
| 1070 |
+
# define PKCS7_F_PKCS7_DATAVERIFY 0
|
| 1071 |
+
# define PKCS7_F_PKCS7_DECRYPT 0
|
| 1072 |
+
# define PKCS7_F_PKCS7_DECRYPT_RINFO 0
|
| 1073 |
+
# define PKCS7_F_PKCS7_ENCODE_RINFO 0
|
| 1074 |
+
# define PKCS7_F_PKCS7_ENCRYPT 0
|
| 1075 |
+
# define PKCS7_F_PKCS7_FINAL 0
|
| 1076 |
+
# define PKCS7_F_PKCS7_FIND_DIGEST 0
|
| 1077 |
+
# define PKCS7_F_PKCS7_GET0_SIGNERS 0
|
| 1078 |
+
# define PKCS7_F_PKCS7_RECIP_INFO_SET 0
|
| 1079 |
+
# define PKCS7_F_PKCS7_SET_CIPHER 0
|
| 1080 |
+
# define PKCS7_F_PKCS7_SET_CONTENT 0
|
| 1081 |
+
# define PKCS7_F_PKCS7_SET_DIGEST 0
|
| 1082 |
+
# define PKCS7_F_PKCS7_SET_TYPE 0
|
| 1083 |
+
# define PKCS7_F_PKCS7_SIGN 0
|
| 1084 |
+
# define PKCS7_F_PKCS7_SIGNATUREVERIFY 0
|
| 1085 |
+
# define PKCS7_F_PKCS7_SIGNER_INFO_SET 0
|
| 1086 |
+
# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 0
|
| 1087 |
+
# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 0
|
| 1088 |
+
# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 0
|
| 1089 |
+
# define PKCS7_F_PKCS7_VERIFY 0
|
| 1090 |
+
|
| 1091 |
+
/*
|
| 1092 |
+
* RAND function codes.
|
| 1093 |
+
*/
|
| 1094 |
+
# define RAND_F_DATA_COLLECT_METHOD 0
|
| 1095 |
+
# define RAND_F_DRBG_BYTES 0
|
| 1096 |
+
# define RAND_F_DRBG_GET_ENTROPY 0
|
| 1097 |
+
# define RAND_F_DRBG_SETUP 0
|
| 1098 |
+
# define RAND_F_GET_ENTROPY 0
|
| 1099 |
+
# define RAND_F_RAND_BYTES 0
|
| 1100 |
+
# define RAND_F_RAND_DRBG_ENABLE_LOCKING 0
|
| 1101 |
+
# define RAND_F_RAND_DRBG_GENERATE 0
|
| 1102 |
+
# define RAND_F_RAND_DRBG_GET_ENTROPY 0
|
| 1103 |
+
# define RAND_F_RAND_DRBG_GET_NONCE 0
|
| 1104 |
+
# define RAND_F_RAND_DRBG_INSTANTIATE 0
|
| 1105 |
+
# define RAND_F_RAND_DRBG_NEW 0
|
| 1106 |
+
# define RAND_F_RAND_DRBG_RESEED 0
|
| 1107 |
+
# define RAND_F_RAND_DRBG_RESTART 0
|
| 1108 |
+
# define RAND_F_RAND_DRBG_SET 0
|
| 1109 |
+
# define RAND_F_RAND_DRBG_SET_DEFAULTS 0
|
| 1110 |
+
# define RAND_F_RAND_DRBG_UNINSTANTIATE 0
|
| 1111 |
+
# define RAND_F_RAND_LOAD_FILE 0
|
| 1112 |
+
# define RAND_F_RAND_POOL_ACQUIRE_ENTROPY 0
|
| 1113 |
+
# define RAND_F_RAND_POOL_ADD 0
|
| 1114 |
+
# define RAND_F_RAND_POOL_ADD_BEGIN 0
|
| 1115 |
+
# define RAND_F_RAND_POOL_ADD_END 0
|
| 1116 |
+
# define RAND_F_RAND_POOL_ATTACH 0
|
| 1117 |
+
# define RAND_F_RAND_POOL_BYTES_NEEDED 0
|
| 1118 |
+
# define RAND_F_RAND_POOL_GROW 0
|
| 1119 |
+
# define RAND_F_RAND_POOL_NEW 0
|
| 1120 |
+
# define RAND_F_RAND_PSEUDO_BYTES 0
|
| 1121 |
+
# define RAND_F_RAND_WRITE_FILE 0
|
| 1122 |
+
|
| 1123 |
+
/*
|
| 1124 |
+
* RSA function codes.
|
| 1125 |
+
*/
|
| 1126 |
+
# define RSA_F_CHECK_PADDING_MD 0
|
| 1127 |
+
# define RSA_F_ENCODE_PKCS1 0
|
| 1128 |
+
# define RSA_F_INT_RSA_VERIFY 0
|
| 1129 |
+
# define RSA_F_OLD_RSA_PRIV_DECODE 0
|
| 1130 |
+
# define RSA_F_PKEY_PSS_INIT 0
|
| 1131 |
+
# define RSA_F_PKEY_RSA_CTRL 0
|
| 1132 |
+
# define RSA_F_PKEY_RSA_CTRL_STR 0
|
| 1133 |
+
# define RSA_F_PKEY_RSA_SIGN 0
|
| 1134 |
+
# define RSA_F_PKEY_RSA_VERIFY 0
|
| 1135 |
+
# define RSA_F_PKEY_RSA_VERIFYRECOVER 0
|
| 1136 |
+
# define RSA_F_RSA_ALGOR_TO_MD 0
|
| 1137 |
+
# define RSA_F_RSA_BUILTIN_KEYGEN 0
|
| 1138 |
+
# define RSA_F_RSA_CHECK_KEY 0
|
| 1139 |
+
# define RSA_F_RSA_CHECK_KEY_EX 0
|
| 1140 |
+
# define RSA_F_RSA_CMS_DECRYPT 0
|
| 1141 |
+
# define RSA_F_RSA_CMS_VERIFY 0
|
| 1142 |
+
# define RSA_F_RSA_ITEM_VERIFY 0
|
| 1143 |
+
# define RSA_F_RSA_METH_DUP 0
|
| 1144 |
+
# define RSA_F_RSA_METH_NEW 0
|
| 1145 |
+
# define RSA_F_RSA_METH_SET1_NAME 0
|
| 1146 |
+
# define RSA_F_RSA_MGF1_TO_MD 0
|
| 1147 |
+
# define RSA_F_RSA_MULTIP_INFO_NEW 0
|
| 1148 |
+
# define RSA_F_RSA_NEW_METHOD 0
|
| 1149 |
+
# define RSA_F_RSA_NULL 0
|
| 1150 |
+
# define RSA_F_RSA_NULL_PRIVATE_DECRYPT 0
|
| 1151 |
+
# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 0
|
| 1152 |
+
# define RSA_F_RSA_NULL_PUBLIC_DECRYPT 0
|
| 1153 |
+
# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 0
|
| 1154 |
+
# define RSA_F_RSA_OSSL_PRIVATE_DECRYPT 0
|
| 1155 |
+
# define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 0
|
| 1156 |
+
# define RSA_F_RSA_OSSL_PUBLIC_DECRYPT 0
|
| 1157 |
+
# define RSA_F_RSA_OSSL_PUBLIC_ENCRYPT 0
|
| 1158 |
+
# define RSA_F_RSA_PADDING_ADD_NONE 0
|
| 1159 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 0
|
| 1160 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 0
|
| 1161 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 0
|
| 1162 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 0
|
| 1163 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 0
|
| 1164 |
+
# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 0
|
| 1165 |
+
# define RSA_F_RSA_PADDING_ADD_SSLV23 0
|
| 1166 |
+
# define RSA_F_RSA_PADDING_ADD_X931 0
|
| 1167 |
+
# define RSA_F_RSA_PADDING_CHECK_NONE 0
|
| 1168 |
+
# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 0
|
| 1169 |
+
# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 0
|
| 1170 |
+
# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 0
|
| 1171 |
+
# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 0
|
| 1172 |
+
# define RSA_F_RSA_PADDING_CHECK_SSLV23 0
|
| 1173 |
+
# define RSA_F_RSA_PADDING_CHECK_X931 0
|
| 1174 |
+
# define RSA_F_RSA_PARAM_DECODE 0
|
| 1175 |
+
# define RSA_F_RSA_PRINT 0
|
| 1176 |
+
# define RSA_F_RSA_PRINT_FP 0
|
| 1177 |
+
# define RSA_F_RSA_PRIV_DECODE 0
|
| 1178 |
+
# define RSA_F_RSA_PRIV_ENCODE 0
|
| 1179 |
+
# define RSA_F_RSA_PSS_GET_PARAM 0
|
| 1180 |
+
# define RSA_F_RSA_PSS_TO_CTX 0
|
| 1181 |
+
# define RSA_F_RSA_PUB_DECODE 0
|
| 1182 |
+
# define RSA_F_RSA_SETUP_BLINDING 0
|
| 1183 |
+
# define RSA_F_RSA_SIGN 0
|
| 1184 |
+
# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 0
|
| 1185 |
+
# define RSA_F_RSA_VERIFY 0
|
| 1186 |
+
# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 0
|
| 1187 |
+
# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 0
|
| 1188 |
+
# define RSA_F_SETUP_TBUF 0
|
| 1189 |
+
|
| 1190 |
+
/*
|
| 1191 |
+
* OSSL_STORE function codes.
|
| 1192 |
+
*/
|
| 1193 |
+
# define OSSL_STORE_F_FILE_CTRL 0
|
| 1194 |
+
# define OSSL_STORE_F_FILE_FIND 0
|
| 1195 |
+
# define OSSL_STORE_F_FILE_GET_PASS 0
|
| 1196 |
+
# define OSSL_STORE_F_FILE_LOAD 0
|
| 1197 |
+
# define OSSL_STORE_F_FILE_LOAD_TRY_DECODE 0
|
| 1198 |
+
# define OSSL_STORE_F_FILE_NAME_TO_URI 0
|
| 1199 |
+
# define OSSL_STORE_F_FILE_OPEN 0
|
| 1200 |
+
# define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 0
|
| 1201 |
+
# define OSSL_STORE_F_OSSL_STORE_EXPECT 0
|
| 1202 |
+
# define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 0
|
| 1203 |
+
# define OSSL_STORE_F_OSSL_STORE_FIND 0
|
| 1204 |
+
# define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 0
|
| 1205 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 0
|
| 1206 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CRL 0
|
| 1207 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME 0
|
| 1208 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME_DESCRIPTION 0
|
| 1209 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PARAMS 0
|
| 1210 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PKEY 0
|
| 1211 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CERT 0
|
| 1212 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CRL 0
|
| 1213 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_EMBEDDED 0
|
| 1214 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_NAME 0
|
| 1215 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PARAMS 0
|
| 1216 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PKEY 0
|
| 1217 |
+
# define OSSL_STORE_F_OSSL_STORE_INFO_SET0_NAME_DESCRIPTION 0
|
| 1218 |
+
# define OSSL_STORE_F_OSSL_STORE_INIT_ONCE 0
|
| 1219 |
+
# define OSSL_STORE_F_OSSL_STORE_LOADER_NEW 0
|
| 1220 |
+
# define OSSL_STORE_F_OSSL_STORE_OPEN 0
|
| 1221 |
+
# define OSSL_STORE_F_OSSL_STORE_OPEN_INT 0
|
| 1222 |
+
# define OSSL_STORE_F_OSSL_STORE_REGISTER_LOADER_INT 0
|
| 1223 |
+
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ALIAS 0
|
| 1224 |
+
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 0
|
| 1225 |
+
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 0
|
| 1226 |
+
# define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_NAME 0
|
| 1227 |
+
# define OSSL_STORE_F_OSSL_STORE_UNREGISTER_LOADER_INT 0
|
| 1228 |
+
# define OSSL_STORE_F_TRY_DECODE_PARAMS 0
|
| 1229 |
+
# define OSSL_STORE_F_TRY_DECODE_PKCS12 0
|
| 1230 |
+
# define OSSL_STORE_F_TRY_DECODE_PKCS8ENCRYPTED 0
|
| 1231 |
+
|
| 1232 |
+
# ifndef OPENSSL_NO_TS
|
| 1233 |
+
/*
|
| 1234 |
+
* TS function codes.
|
| 1235 |
+
*/
|
| 1236 |
+
# define TS_F_DEF_SERIAL_CB 0
|
| 1237 |
+
# define TS_F_DEF_TIME_CB 0
|
| 1238 |
+
# define TS_F_ESS_ADD_SIGNING_CERT 0
|
| 1239 |
+
# define TS_F_ESS_ADD_SIGNING_CERT_V2 0
|
| 1240 |
+
# define TS_F_ESS_CERT_ID_NEW_INIT 0
|
| 1241 |
+
# define TS_F_ESS_CERT_ID_V2_NEW_INIT 0
|
| 1242 |
+
# define TS_F_ESS_SIGNING_CERT_NEW_INIT 0
|
| 1243 |
+
# define TS_F_ESS_SIGNING_CERT_V2_NEW_INIT 0
|
| 1244 |
+
# define TS_F_INT_TS_RESP_VERIFY_TOKEN 0
|
| 1245 |
+
# define TS_F_PKCS7_TO_TS_TST_INFO 0
|
| 1246 |
+
# define TS_F_TS_ACCURACY_SET_MICROS 0
|
| 1247 |
+
# define TS_F_TS_ACCURACY_SET_MILLIS 0
|
| 1248 |
+
# define TS_F_TS_ACCURACY_SET_SECONDS 0
|
| 1249 |
+
# define TS_F_TS_CHECK_IMPRINTS 0
|
| 1250 |
+
# define TS_F_TS_CHECK_NONCES 0
|
| 1251 |
+
# define TS_F_TS_CHECK_POLICY 0
|
| 1252 |
+
# define TS_F_TS_CHECK_SIGNING_CERTS 0
|
| 1253 |
+
# define TS_F_TS_CHECK_STATUS_INFO 0
|
| 1254 |
+
# define TS_F_TS_COMPUTE_IMPRINT 0
|
| 1255 |
+
# define TS_F_TS_CONF_INVALID 0
|
| 1256 |
+
# define TS_F_TS_CONF_LOAD_CERT 0
|
| 1257 |
+
# define TS_F_TS_CONF_LOAD_CERTS 0
|
| 1258 |
+
# define TS_F_TS_CONF_LOAD_KEY 0
|
| 1259 |
+
# define TS_F_TS_CONF_LOOKUP_FAIL 0
|
| 1260 |
+
# define TS_F_TS_CONF_SET_DEFAULT_ENGINE 0
|
| 1261 |
+
# define TS_F_TS_GET_STATUS_TEXT 0
|
| 1262 |
+
# define TS_F_TS_MSG_IMPRINT_SET_ALGO 0
|
| 1263 |
+
# define TS_F_TS_REQ_SET_MSG_IMPRINT 0
|
| 1264 |
+
# define TS_F_TS_REQ_SET_NONCE 0
|
| 1265 |
+
# define TS_F_TS_REQ_SET_POLICY_ID 0
|
| 1266 |
+
# define TS_F_TS_RESP_CREATE_RESPONSE 0
|
| 1267 |
+
# define TS_F_TS_RESP_CREATE_TST_INFO 0
|
| 1268 |
+
# define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 0
|
| 1269 |
+
# define TS_F_TS_RESP_CTX_ADD_MD 0
|
| 1270 |
+
# define TS_F_TS_RESP_CTX_ADD_POLICY 0
|
| 1271 |
+
# define TS_F_TS_RESP_CTX_NEW 0
|
| 1272 |
+
# define TS_F_TS_RESP_CTX_SET_ACCURACY 0
|
| 1273 |
+
# define TS_F_TS_RESP_CTX_SET_CERTS 0
|
| 1274 |
+
# define TS_F_TS_RESP_CTX_SET_DEF_POLICY 0
|
| 1275 |
+
# define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 0
|
| 1276 |
+
# define TS_F_TS_RESP_CTX_SET_STATUS_INFO 0
|
| 1277 |
+
# define TS_F_TS_RESP_GET_POLICY 0
|
| 1278 |
+
# define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 0
|
| 1279 |
+
# define TS_F_TS_RESP_SET_STATUS_INFO 0
|
| 1280 |
+
# define TS_F_TS_RESP_SET_TST_INFO 0
|
| 1281 |
+
# define TS_F_TS_RESP_SIGN 0
|
| 1282 |
+
# define TS_F_TS_RESP_VERIFY_SIGNATURE 0
|
| 1283 |
+
# define TS_F_TS_TST_INFO_SET_ACCURACY 0
|
| 1284 |
+
# define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 0
|
| 1285 |
+
# define TS_F_TS_TST_INFO_SET_NONCE 0
|
| 1286 |
+
# define TS_F_TS_TST_INFO_SET_POLICY_ID 0
|
| 1287 |
+
# define TS_F_TS_TST_INFO_SET_SERIAL 0
|
| 1288 |
+
# define TS_F_TS_TST_INFO_SET_TIME 0
|
| 1289 |
+
# define TS_F_TS_TST_INFO_SET_TSA 0
|
| 1290 |
+
# define TS_F_TS_VERIFY 0
|
| 1291 |
+
# define TS_F_TS_VERIFY_CERT 0
|
| 1292 |
+
# define TS_F_TS_VERIFY_CTX_NEW 0
|
| 1293 |
+
# endif
|
| 1294 |
+
|
| 1295 |
+
/*
|
| 1296 |
+
* UI function codes.
|
| 1297 |
+
*/
|
| 1298 |
+
# define UI_F_CLOSE_CONSOLE 0
|
| 1299 |
+
# define UI_F_ECHO_CONSOLE 0
|
| 1300 |
+
# define UI_F_GENERAL_ALLOCATE_BOOLEAN 0
|
| 1301 |
+
# define UI_F_GENERAL_ALLOCATE_PROMPT 0
|
| 1302 |
+
# define UI_F_NOECHO_CONSOLE 0
|
| 1303 |
+
# define UI_F_OPEN_CONSOLE 0
|
| 1304 |
+
# define UI_F_UI_CONSTRUCT_PROMPT 0
|
| 1305 |
+
# define UI_F_UI_CREATE_METHOD 0
|
| 1306 |
+
# define UI_F_UI_CTRL 0
|
| 1307 |
+
# define UI_F_UI_DUP_ERROR_STRING 0
|
| 1308 |
+
# define UI_F_UI_DUP_INFO_STRING 0
|
| 1309 |
+
# define UI_F_UI_DUP_INPUT_BOOLEAN 0
|
| 1310 |
+
# define UI_F_UI_DUP_INPUT_STRING 0
|
| 1311 |
+
# define UI_F_UI_DUP_USER_DATA 0
|
| 1312 |
+
# define UI_F_UI_DUP_VERIFY_STRING 0
|
| 1313 |
+
# define UI_F_UI_GET0_RESULT 0
|
| 1314 |
+
# define UI_F_UI_GET_RESULT_LENGTH 0
|
| 1315 |
+
# define UI_F_UI_NEW_METHOD 0
|
| 1316 |
+
# define UI_F_UI_PROCESS 0
|
| 1317 |
+
# define UI_F_UI_SET_RESULT 0
|
| 1318 |
+
# define UI_F_UI_SET_RESULT_EX 0
|
| 1319 |
+
|
| 1320 |
+
/*
|
| 1321 |
+
* X509 function codes.
|
| 1322 |
+
*/
|
| 1323 |
+
# define X509_F_ADD_CERT_DIR 0
|
| 1324 |
+
# define X509_F_BUILD_CHAIN 0
|
| 1325 |
+
# define X509_F_BY_FILE_CTRL 0
|
| 1326 |
+
# define X509_F_CHECK_NAME_CONSTRAINTS 0
|
| 1327 |
+
# define X509_F_CHECK_POLICY 0
|
| 1328 |
+
# define X509_F_DANE_I2D 0
|
| 1329 |
+
# define X509_F_DIR_CTRL 0
|
| 1330 |
+
# define X509_F_GET_CERT_BY_SUBJECT 0
|
| 1331 |
+
# define X509_F_I2D_X509_AUX 0
|
| 1332 |
+
# define X509_F_LOOKUP_CERTS_SK 0
|
| 1333 |
+
# define X509_F_NETSCAPE_SPKI_B64_DECODE 0
|
| 1334 |
+
# define X509_F_NETSCAPE_SPKI_B64_ENCODE 0
|
| 1335 |
+
# define X509_F_NEW_DIR 0
|
| 1336 |
+
# define X509_F_X509AT_ADD1_ATTR 0
|
| 1337 |
+
# define X509_F_X509V3_ADD_EXT 0
|
| 1338 |
+
# define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 0
|
| 1339 |
+
# define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 0
|
| 1340 |
+
# define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 0
|
| 1341 |
+
# define X509_F_X509_ATTRIBUTE_GET0_DATA 0
|
| 1342 |
+
# define X509_F_X509_ATTRIBUTE_SET1_DATA 0
|
| 1343 |
+
# define X509_F_X509_CHECK_PRIVATE_KEY 0
|
| 1344 |
+
# define X509_F_X509_CRL_DIFF 0
|
| 1345 |
+
# define X509_F_X509_CRL_METHOD_NEW 0
|
| 1346 |
+
# define X509_F_X509_CRL_PRINT_FP 0
|
| 1347 |
+
# define X509_F_X509_EXTENSION_CREATE_BY_NID 0
|
| 1348 |
+
# define X509_F_X509_EXTENSION_CREATE_BY_OBJ 0
|
| 1349 |
+
# define X509_F_X509_GET_PUBKEY_PARAMETERS 0
|
| 1350 |
+
# define X509_F_X509_LOAD_CERT_CRL_FILE 0
|
| 1351 |
+
# define X509_F_X509_LOAD_CERT_FILE 0
|
| 1352 |
+
# define X509_F_X509_LOAD_CRL_FILE 0
|
| 1353 |
+
# define X509_F_X509_LOOKUP_METH_NEW 0
|
| 1354 |
+
# define X509_F_X509_LOOKUP_NEW 0
|
| 1355 |
+
# define X509_F_X509_NAME_ADD_ENTRY 0
|
| 1356 |
+
# define X509_F_X509_NAME_CANON 0
|
| 1357 |
+
# define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 0
|
| 1358 |
+
# define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 0
|
| 1359 |
+
# define X509_F_X509_NAME_ENTRY_SET_OBJECT 0
|
| 1360 |
+
# define X509_F_X509_NAME_ONELINE 0
|
| 1361 |
+
# define X509_F_X509_NAME_PRINT 0
|
| 1362 |
+
# define X509_F_X509_OBJECT_NEW 0
|
| 1363 |
+
# define X509_F_X509_PRINT_EX_FP 0
|
| 1364 |
+
# define X509_F_X509_PUBKEY_DECODE 0
|
| 1365 |
+
# define X509_F_X509_PUBKEY_GET 0
|
| 1366 |
+
# define X509_F_X509_PUBKEY_GET0 0
|
| 1367 |
+
# define X509_F_X509_PUBKEY_SET 0
|
| 1368 |
+
# define X509_F_X509_REQ_CHECK_PRIVATE_KEY 0
|
| 1369 |
+
# define X509_F_X509_REQ_PRINT_EX 0
|
| 1370 |
+
# define X509_F_X509_REQ_PRINT_FP 0
|
| 1371 |
+
# define X509_F_X509_REQ_TO_X509 0
|
| 1372 |
+
# define X509_F_X509_STORE_ADD_CERT 0
|
| 1373 |
+
# define X509_F_X509_STORE_ADD_CRL 0
|
| 1374 |
+
# define X509_F_X509_STORE_ADD_LOOKUP 0
|
| 1375 |
+
# define X509_F_X509_STORE_CTX_GET1_ISSUER 0
|
| 1376 |
+
# define X509_F_X509_STORE_CTX_INIT 0
|
| 1377 |
+
# define X509_F_X509_STORE_CTX_NEW 0
|
| 1378 |
+
# define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 0
|
| 1379 |
+
# define X509_F_X509_STORE_NEW 0
|
| 1380 |
+
# define X509_F_X509_TO_X509_REQ 0
|
| 1381 |
+
# define X509_F_X509_TRUST_ADD 0
|
| 1382 |
+
# define X509_F_X509_TRUST_SET 0
|
| 1383 |
+
# define X509_F_X509_VERIFY_CERT 0
|
| 1384 |
+
# define X509_F_X509_VERIFY_PARAM_NEW 0
|
| 1385 |
+
|
| 1386 |
+
/*
|
| 1387 |
+
* X509V3 function codes.
|
| 1388 |
+
*/
|
| 1389 |
+
# define X509V3_F_A2I_GENERAL_NAME 0
|
| 1390 |
+
# define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 0
|
| 1391 |
+
# define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 0
|
| 1392 |
+
# define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 0
|
| 1393 |
+
# define X509V3_F_BIGNUM_TO_STRING 0
|
| 1394 |
+
# define X509V3_F_COPY_EMAIL 0
|
| 1395 |
+
# define X509V3_F_COPY_ISSUER 0
|
| 1396 |
+
# define X509V3_F_DO_DIRNAME 0
|
| 1397 |
+
# define X509V3_F_DO_EXT_I2D 0
|
| 1398 |
+
# define X509V3_F_DO_EXT_NCONF 0
|
| 1399 |
+
# define X509V3_F_GNAMES_FROM_SECTNAME 0
|
| 1400 |
+
# define X509V3_F_I2S_ASN1_ENUMERATED 0
|
| 1401 |
+
# define X509V3_F_I2S_ASN1_IA5STRING 0
|
| 1402 |
+
# define X509V3_F_I2S_ASN1_INTEGER 0
|
| 1403 |
+
# define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 0
|
| 1404 |
+
# define X509V3_F_LEVEL_ADD_NODE 0
|
| 1405 |
+
# define X509V3_F_NOTICE_SECTION 0
|
| 1406 |
+
# define X509V3_F_NREF_NOS 0
|
| 1407 |
+
# define X509V3_F_POLICY_CACHE_CREATE 0
|
| 1408 |
+
# define X509V3_F_POLICY_CACHE_NEW 0
|
| 1409 |
+
# define X509V3_F_POLICY_DATA_NEW 0
|
| 1410 |
+
# define X509V3_F_POLICY_SECTION 0
|
| 1411 |
+
# define X509V3_F_PROCESS_PCI_VALUE 0
|
| 1412 |
+
# define X509V3_F_R2I_CERTPOL 0
|
| 1413 |
+
# define X509V3_F_R2I_PCI 0
|
| 1414 |
+
# define X509V3_F_S2I_ASN1_IA5STRING 0
|
| 1415 |
+
# define X509V3_F_S2I_ASN1_INTEGER 0
|
| 1416 |
+
# define X509V3_F_S2I_ASN1_OCTET_STRING 0
|
| 1417 |
+
# define X509V3_F_S2I_SKEY_ID 0
|
| 1418 |
+
# define X509V3_F_SET_DIST_POINT_NAME 0
|
| 1419 |
+
# define X509V3_F_SXNET_ADD_ID_ASC 0
|
| 1420 |
+
# define X509V3_F_SXNET_ADD_ID_INTEGER 0
|
| 1421 |
+
# define X509V3_F_SXNET_ADD_ID_ULONG 0
|
| 1422 |
+
# define X509V3_F_SXNET_GET_ID_ASC 0
|
| 1423 |
+
# define X509V3_F_SXNET_GET_ID_ULONG 0
|
| 1424 |
+
# define X509V3_F_TREE_INIT 0
|
| 1425 |
+
# define X509V3_F_V2I_ASIDENTIFIERS 0
|
| 1426 |
+
# define X509V3_F_V2I_ASN1_BIT_STRING 0
|
| 1427 |
+
# define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 0
|
| 1428 |
+
# define X509V3_F_V2I_AUTHORITY_KEYID 0
|
| 1429 |
+
# define X509V3_F_V2I_BASIC_CONSTRAINTS 0
|
| 1430 |
+
# define X509V3_F_V2I_CRLD 0
|
| 1431 |
+
# define X509V3_F_V2I_EXTENDED_KEY_USAGE 0
|
| 1432 |
+
# define X509V3_F_V2I_GENERAL_NAMES 0
|
| 1433 |
+
# define X509V3_F_V2I_GENERAL_NAME_EX 0
|
| 1434 |
+
# define X509V3_F_V2I_IDP 0
|
| 1435 |
+
# define X509V3_F_V2I_IPADDRBLOCKS 0
|
| 1436 |
+
# define X509V3_F_V2I_ISSUER_ALT 0
|
| 1437 |
+
# define X509V3_F_V2I_NAME_CONSTRAINTS 0
|
| 1438 |
+
# define X509V3_F_V2I_POLICY_CONSTRAINTS 0
|
| 1439 |
+
# define X509V3_F_V2I_POLICY_MAPPINGS 0
|
| 1440 |
+
# define X509V3_F_V2I_SUBJECT_ALT 0
|
| 1441 |
+
# define X509V3_F_V2I_TLS_FEATURE 0
|
| 1442 |
+
# define X509V3_F_V3_GENERIC_EXTENSION 0
|
| 1443 |
+
# define X509V3_F_X509V3_ADD1_I2D 0
|
| 1444 |
+
# define X509V3_F_X509V3_ADD_VALUE 0
|
| 1445 |
+
# define X509V3_F_X509V3_EXT_ADD 0
|
| 1446 |
+
# define X509V3_F_X509V3_EXT_ADD_ALIAS 0
|
| 1447 |
+
# define X509V3_F_X509V3_EXT_I2D 0
|
| 1448 |
+
# define X509V3_F_X509V3_EXT_NCONF 0
|
| 1449 |
+
# define X509V3_F_X509V3_GET_SECTION 0
|
| 1450 |
+
# define X509V3_F_X509V3_GET_STRING 0
|
| 1451 |
+
# define X509V3_F_X509V3_GET_VALUE_BOOL 0
|
| 1452 |
+
# define X509V3_F_X509V3_PARSE_LIST 0
|
| 1453 |
+
# define X509V3_F_X509_PURPOSE_ADD 0
|
| 1454 |
+
# define X509V3_F_X509_PURPOSE_SET 0
|
| 1455 |
+
|
| 1456 |
+
/*
|
| 1457 |
+
* Compatibility defines.
|
| 1458 |
+
*/
|
| 1459 |
+
# define EVP_R_OPERATON_NOT_INITIALIZED EVP_R_OPERATION_NOT_INITIALIZED
|
| 1460 |
+
|
| 1461 |
+
# endif
|
| 1462 |
+
|
| 1463 |
+
# ifdef __cplusplus
|
| 1464 |
+
}
|
| 1465 |
+
# endif
|
| 1466 |
+
#endif
|
llava_next/include/openssl/cterr.h
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_CTERR_H
|
| 12 |
+
# define OPENSSL_CTERR_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_CT
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* CT reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define CT_R_BASE64_DECODE_ERROR 108
|
| 27 |
+
# define CT_R_INVALID_LOG_ID_LENGTH 100
|
| 28 |
+
# define CT_R_LOG_CONF_INVALID 109
|
| 29 |
+
# define CT_R_LOG_CONF_INVALID_KEY 110
|
| 30 |
+
# define CT_R_LOG_CONF_MISSING_DESCRIPTION 111
|
| 31 |
+
# define CT_R_LOG_CONF_MISSING_KEY 112
|
| 32 |
+
# define CT_R_LOG_KEY_INVALID 113
|
| 33 |
+
# define CT_R_SCT_FUTURE_TIMESTAMP 116
|
| 34 |
+
# define CT_R_SCT_INVALID 104
|
| 35 |
+
# define CT_R_SCT_INVALID_SIGNATURE 107
|
| 36 |
+
# define CT_R_SCT_LIST_INVALID 105
|
| 37 |
+
# define CT_R_SCT_LOG_ID_MISMATCH 114
|
| 38 |
+
# define CT_R_SCT_NOT_SET 106
|
| 39 |
+
# define CT_R_SCT_UNSUPPORTED_VERSION 115
|
| 40 |
+
# define CT_R_UNRECOGNIZED_SIGNATURE_NID 101
|
| 41 |
+
# define CT_R_UNSUPPORTED_ENTRY_TYPE 102
|
| 42 |
+
# define CT_R_UNSUPPORTED_VERSION 103
|
| 43 |
+
|
| 44 |
+
# endif
|
| 45 |
+
#endif
|
llava_next/include/openssl/decoder.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_DECODER_H
|
| 11 |
+
# define OPENSSL_DECODER_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/decodererr.h>
|
| 22 |
+
# include <openssl/types.h>
|
| 23 |
+
# include <openssl/core.h>
|
| 24 |
+
|
| 25 |
+
# ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
# endif
|
| 28 |
+
|
| 29 |
+
OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
|
| 30 |
+
const char *properties);
|
| 31 |
+
int OSSL_DECODER_up_ref(OSSL_DECODER *encoder);
|
| 32 |
+
void OSSL_DECODER_free(OSSL_DECODER *encoder);
|
| 33 |
+
|
| 34 |
+
const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *encoder);
|
| 35 |
+
const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *encoder);
|
| 36 |
+
const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder);
|
| 37 |
+
const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder);
|
| 38 |
+
int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name);
|
| 39 |
+
|
| 40 |
+
void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
|
| 41 |
+
void (*fn)(OSSL_DECODER *encoder, void *arg),
|
| 42 |
+
void *arg);
|
| 43 |
+
int OSSL_DECODER_names_do_all(const OSSL_DECODER *encoder,
|
| 44 |
+
void (*fn)(const char *name, void *data),
|
| 45 |
+
void *data);
|
| 46 |
+
const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder);
|
| 47 |
+
int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]);
|
| 48 |
+
|
| 49 |
+
const OSSL_PARAM *OSSL_DECODER_settable_ctx_params(OSSL_DECODER *encoder);
|
| 50 |
+
OSSL_DECODER_CTX *OSSL_DECODER_CTX_new(void);
|
| 51 |
+
int OSSL_DECODER_CTX_set_params(OSSL_DECODER_CTX *ctx,
|
| 52 |
+
const OSSL_PARAM params[]);
|
| 53 |
+
void OSSL_DECODER_CTX_free(OSSL_DECODER_CTX *ctx);
|
| 54 |
+
|
| 55 |
+
/* Utilities that help set specific parameters */
|
| 56 |
+
int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx,
|
| 57 |
+
const unsigned char *kstr, size_t klen);
|
| 58 |
+
int OSSL_DECODER_CTX_set_pem_password_cb(OSSL_DECODER_CTX *ctx,
|
| 59 |
+
pem_password_cb *cb, void *cbarg);
|
| 60 |
+
int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx,
|
| 61 |
+
OSSL_PASSPHRASE_CALLBACK *cb,
|
| 62 |
+
void *cbarg);
|
| 63 |
+
int OSSL_DECODER_CTX_set_passphrase_ui(OSSL_DECODER_CTX *ctx,
|
| 64 |
+
const UI_METHOD *ui_method,
|
| 65 |
+
void *ui_data);
|
| 66 |
+
|
| 67 |
+
/*
|
| 68 |
+
* Utilities to read the object to decode, with the result sent to cb.
|
| 69 |
+
* These will discover all provided methods
|
| 70 |
+
*/
|
| 71 |
+
|
| 72 |
+
int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection);
|
| 73 |
+
int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx,
|
| 74 |
+
const char *input_type);
|
| 75 |
+
int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx,
|
| 76 |
+
const char *input_structure);
|
| 77 |
+
int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder);
|
| 78 |
+
int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
|
| 79 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 80 |
+
int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx);
|
| 81 |
+
|
| 82 |
+
typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE;
|
| 83 |
+
OSSL_DECODER *
|
| 84 |
+
OSSL_DECODER_INSTANCE_get_decoder(OSSL_DECODER_INSTANCE *decoder_inst);
|
| 85 |
+
void *
|
| 86 |
+
OSSL_DECODER_INSTANCE_get_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst);
|
| 87 |
+
const char *
|
| 88 |
+
OSSL_DECODER_INSTANCE_get_input_type(OSSL_DECODER_INSTANCE *decoder_inst);
|
| 89 |
+
const char *
|
| 90 |
+
OSSL_DECODER_INSTANCE_get_input_structure(OSSL_DECODER_INSTANCE *decoder_inst,
|
| 91 |
+
int *was_set);
|
| 92 |
+
|
| 93 |
+
typedef int OSSL_DECODER_CONSTRUCT(OSSL_DECODER_INSTANCE *decoder_inst,
|
| 94 |
+
const OSSL_PARAM *params,
|
| 95 |
+
void *construct_data);
|
| 96 |
+
typedef void OSSL_DECODER_CLEANUP(void *construct_data);
|
| 97 |
+
|
| 98 |
+
int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx,
|
| 99 |
+
OSSL_DECODER_CONSTRUCT *construct);
|
| 100 |
+
int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx,
|
| 101 |
+
void *construct_data);
|
| 102 |
+
int OSSL_DECODER_CTX_set_cleanup(OSSL_DECODER_CTX *ctx,
|
| 103 |
+
OSSL_DECODER_CLEANUP *cleanup);
|
| 104 |
+
OSSL_DECODER_CONSTRUCT *OSSL_DECODER_CTX_get_construct(OSSL_DECODER_CTX *ctx);
|
| 105 |
+
void *OSSL_DECODER_CTX_get_construct_data(OSSL_DECODER_CTX *ctx);
|
| 106 |
+
OSSL_DECODER_CLEANUP *OSSL_DECODER_CTX_get_cleanup(OSSL_DECODER_CTX *ctx);
|
| 107 |
+
|
| 108 |
+
int OSSL_DECODER_export(OSSL_DECODER_INSTANCE *decoder_inst,
|
| 109 |
+
void *reference, size_t reference_sz,
|
| 110 |
+
OSSL_CALLBACK *export_cb, void *export_cbarg);
|
| 111 |
+
|
| 112 |
+
int OSSL_DECODER_from_bio(OSSL_DECODER_CTX *ctx, BIO *in);
|
| 113 |
+
#ifndef OPENSSL_NO_STDIO
|
| 114 |
+
int OSSL_DECODER_from_fp(OSSL_DECODER_CTX *ctx, FILE *in);
|
| 115 |
+
#endif
|
| 116 |
+
int OSSL_DECODER_from_data(OSSL_DECODER_CTX *ctx, const unsigned char **pdata,
|
| 117 |
+
size_t *pdata_len);
|
| 118 |
+
|
| 119 |
+
/*
|
| 120 |
+
* Create the OSSL_DECODER_CTX with an associated type. This will perform
|
| 121 |
+
* an implicit OSSL_DECODER_fetch(), suitable for the object of that type.
|
| 122 |
+
*/
|
| 123 |
+
OSSL_DECODER_CTX *
|
| 124 |
+
OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey,
|
| 125 |
+
const char *input_type,
|
| 126 |
+
const char *input_struct,
|
| 127 |
+
const char *keytype, int selection,
|
| 128 |
+
OSSL_LIB_CTX *libctx, const char *propquery);
|
| 129 |
+
|
| 130 |
+
# ifdef __cplusplus
|
| 131 |
+
}
|
| 132 |
+
# endif
|
| 133 |
+
#endif
|
llava_next/include/openssl/dtls1.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2005-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_DTLS1_H
|
| 11 |
+
# define OPENSSL_DTLS1_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_DTLS1_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/prov_ssl.h>
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#include <openssl/opensslconf.h>
|
| 26 |
+
|
| 27 |
+
/* DTLS*_VERSION constants are defined in prov_ssl.h */
|
| 28 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 29 |
+
# define DTLS_MIN_VERSION DTLS1_VERSION
|
| 30 |
+
# define DTLS_MAX_VERSION DTLS1_2_VERSION
|
| 31 |
+
# endif
|
| 32 |
+
# define DTLS1_VERSION_MAJOR 0xFE
|
| 33 |
+
|
| 34 |
+
/* Special value for method supporting multiple versions */
|
| 35 |
+
# define DTLS_ANY_VERSION 0x1FFFF
|
| 36 |
+
|
| 37 |
+
/* lengths of messages */
|
| 38 |
+
|
| 39 |
+
# define DTLS1_COOKIE_LENGTH 255
|
| 40 |
+
|
| 41 |
+
# define DTLS1_RT_HEADER_LENGTH 13
|
| 42 |
+
|
| 43 |
+
# define DTLS1_HM_HEADER_LENGTH 12
|
| 44 |
+
|
| 45 |
+
# define DTLS1_HM_BAD_FRAGMENT -2
|
| 46 |
+
# define DTLS1_HM_FRAGMENT_RETRY -3
|
| 47 |
+
|
| 48 |
+
# define DTLS1_CCS_HEADER_LENGTH 1
|
| 49 |
+
|
| 50 |
+
# define DTLS1_AL_HEADER_LENGTH 2
|
| 51 |
+
|
| 52 |
+
# define DTLS1_TMO_ALERT_COUNT 12
|
| 53 |
+
|
| 54 |
+
#ifdef __cplusplus
|
| 55 |
+
}
|
| 56 |
+
#endif
|
| 57 |
+
#endif
|
llava_next/include/openssl/ebcdic.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_EBCDIC_H
|
| 11 |
+
# define OPENSSL_EBCDIC_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_EBCDIC_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <stdlib.h>
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/* Avoid name clashes with other applications */
|
| 26 |
+
# define os_toascii _openssl_os_toascii
|
| 27 |
+
# define os_toebcdic _openssl_os_toebcdic
|
| 28 |
+
# define ebcdic2ascii _openssl_ebcdic2ascii
|
| 29 |
+
# define ascii2ebcdic _openssl_ascii2ebcdic
|
| 30 |
+
|
| 31 |
+
extern const unsigned char os_toascii[256];
|
| 32 |
+
extern const unsigned char os_toebcdic[256];
|
| 33 |
+
void *ebcdic2ascii(void *dest, const void *srce, size_t count);
|
| 34 |
+
void *ascii2ebcdic(void *dest, const void *srce, size_t count);
|
| 35 |
+
|
| 36 |
+
#ifdef __cplusplus
|
| 37 |
+
}
|
| 38 |
+
#endif
|
| 39 |
+
#endif
|
llava_next/include/openssl/ec.h
ADDED
|
@@ -0,0 +1,1569 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_EC_H
|
| 12 |
+
# define OPENSSL_EC_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/macros.h>
|
| 16 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 17 |
+
# define HEADER_EC_H
|
| 18 |
+
# endif
|
| 19 |
+
|
| 20 |
+
# include <openssl/opensslconf.h>
|
| 21 |
+
# include <openssl/types.h>
|
| 22 |
+
|
| 23 |
+
# include <string.h>
|
| 24 |
+
|
| 25 |
+
# ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
# endif
|
| 28 |
+
|
| 29 |
+
/* Values for EVP_PKEY_CTX_set_ec_param_enc() */
|
| 30 |
+
# define OPENSSL_EC_EXPLICIT_CURVE 0x000
|
| 31 |
+
# define OPENSSL_EC_NAMED_CURVE 0x001
|
| 32 |
+
|
| 33 |
+
int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid);
|
| 34 |
+
int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int param_enc);
|
| 35 |
+
int EVP_PKEY_CTX_set_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx, int cofactor_mode);
|
| 36 |
+
int EVP_PKEY_CTX_get_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx);
|
| 37 |
+
|
| 38 |
+
int EVP_PKEY_CTX_set_ecdh_kdf_type(EVP_PKEY_CTX *ctx, int kdf);
|
| 39 |
+
int EVP_PKEY_CTX_get_ecdh_kdf_type(EVP_PKEY_CTX *ctx);
|
| 40 |
+
|
| 41 |
+
int EVP_PKEY_CTX_set_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 42 |
+
int EVP_PKEY_CTX_get_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
| 43 |
+
|
| 44 |
+
int EVP_PKEY_CTX_set_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int len);
|
| 45 |
+
int EVP_PKEY_CTX_get_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len);
|
| 46 |
+
|
| 47 |
+
int EVP_PKEY_CTX_set0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm,
|
| 48 |
+
int len);
|
| 49 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0
|
| 51 |
+
int EVP_PKEY_CTX_get0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
|
| 52 |
+
# endif
|
| 53 |
+
|
| 54 |
+
# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
|
| 55 |
+
# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
|
| 56 |
+
# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
|
| 57 |
+
# define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
|
| 58 |
+
# define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
|
| 59 |
+
# define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
|
| 60 |
+
# define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
|
| 61 |
+
# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
|
| 62 |
+
# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
|
| 63 |
+
# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
|
| 64 |
+
|
| 65 |
+
/* KDF types */
|
| 66 |
+
# define EVP_PKEY_ECDH_KDF_NONE 1
|
| 67 |
+
# define EVP_PKEY_ECDH_KDF_X9_63 2
|
| 68 |
+
/*
|
| 69 |
+
* The old name for EVP_PKEY_ECDH_KDF_X9_63
|
| 70 |
+
* The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
|
| 71 |
+
* it is actually specified in ANSI X9.63.
|
| 72 |
+
* This identifier is retained for backwards compatibility
|
| 73 |
+
*/
|
| 74 |
+
# define EVP_PKEY_ECDH_KDF_X9_62 EVP_PKEY_ECDH_KDF_X9_63
|
| 75 |
+
|
| 76 |
+
/** Enum for the point conversion form as defined in X9.62 (ECDSA)
|
| 77 |
+
* for the encoding of a elliptic curve point (x,y) */
|
| 78 |
+
typedef enum {
|
| 79 |
+
/** the point is encoded as z||x, where the octet z specifies
|
| 80 |
+
* which solution of the quadratic equation y is */
|
| 81 |
+
POINT_CONVERSION_COMPRESSED = 2,
|
| 82 |
+
/** the point is encoded as z||x||y, where z is the octet 0x04 */
|
| 83 |
+
POINT_CONVERSION_UNCOMPRESSED = 4,
|
| 84 |
+
/** the point is encoded as z||x||y, where the octet z specifies
|
| 85 |
+
* which solution of the quadratic equation y is */
|
| 86 |
+
POINT_CONVERSION_HYBRID = 6
|
| 87 |
+
} point_conversion_form_t;
|
| 88 |
+
|
| 89 |
+
const char *OSSL_EC_curve_nid2name(int nid);
|
| 90 |
+
|
| 91 |
+
# ifndef OPENSSL_NO_EC
|
| 92 |
+
# include <openssl/asn1.h>
|
| 93 |
+
# include <openssl/symhacks.h>
|
| 94 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 95 |
+
# include <openssl/bn.h>
|
| 96 |
+
# endif
|
| 97 |
+
# include <openssl/ecerr.h>
|
| 98 |
+
|
| 99 |
+
# ifndef OPENSSL_ECC_MAX_FIELD_BITS
|
| 100 |
+
# define OPENSSL_ECC_MAX_FIELD_BITS 661
|
| 101 |
+
# endif
|
| 102 |
+
|
| 103 |
+
# include <openssl/params.h>
|
| 104 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 105 |
+
typedef struct ec_method_st EC_METHOD;
|
| 106 |
+
# endif
|
| 107 |
+
typedef struct ec_group_st EC_GROUP;
|
| 108 |
+
typedef struct ec_point_st EC_POINT;
|
| 109 |
+
typedef struct ecpk_parameters_st ECPKPARAMETERS;
|
| 110 |
+
typedef struct ec_parameters_st ECPARAMETERS;
|
| 111 |
+
|
| 112 |
+
/********************************************************************/
|
| 113 |
+
/* EC_METHODs for curves over GF(p) */
|
| 114 |
+
/********************************************************************/
|
| 115 |
+
|
| 116 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 117 |
+
/** Returns the basic GFp ec methods which provides the basis for the
|
| 118 |
+
* optimized methods.
|
| 119 |
+
* \return EC_METHOD object
|
| 120 |
+
*/
|
| 121 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_simple_method(void);
|
| 122 |
+
|
| 123 |
+
/** Returns GFp methods using montgomery multiplication.
|
| 124 |
+
* \return EC_METHOD object
|
| 125 |
+
*/
|
| 126 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_mont_method(void);
|
| 127 |
+
|
| 128 |
+
/** Returns GFp methods using optimized methods for NIST recommended curves
|
| 129 |
+
* \return EC_METHOD object
|
| 130 |
+
*/
|
| 131 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nist_method(void);
|
| 132 |
+
|
| 133 |
+
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
| 134 |
+
/** Returns 64-bit optimized methods for nistp224
|
| 135 |
+
* \return EC_METHOD object
|
| 136 |
+
*/
|
| 137 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp224_method(void);
|
| 138 |
+
|
| 139 |
+
/** Returns 64-bit optimized methods for nistp256
|
| 140 |
+
* \return EC_METHOD object
|
| 141 |
+
*/
|
| 142 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp256_method(void);
|
| 143 |
+
|
| 144 |
+
/** Returns 64-bit optimized methods for nistp521
|
| 145 |
+
* \return EC_METHOD object
|
| 146 |
+
*/
|
| 147 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp521_method(void);
|
| 148 |
+
# endif /* OPENSSL_NO_EC_NISTP_64_GCC_128 */
|
| 149 |
+
|
| 150 |
+
# ifndef OPENSSL_NO_EC2M
|
| 151 |
+
/********************************************************************/
|
| 152 |
+
/* EC_METHOD for curves over GF(2^m) */
|
| 153 |
+
/********************************************************************/
|
| 154 |
+
|
| 155 |
+
/** Returns the basic GF2m ec method
|
| 156 |
+
* \return EC_METHOD object
|
| 157 |
+
*/
|
| 158 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GF2m_simple_method(void);
|
| 159 |
+
|
| 160 |
+
# endif
|
| 161 |
+
|
| 162 |
+
/********************************************************************/
|
| 163 |
+
/* EC_GROUP functions */
|
| 164 |
+
/********************************************************************/
|
| 165 |
+
|
| 166 |
+
/**
|
| 167 |
+
* Creates a new EC_GROUP object
|
| 168 |
+
* \param meth EC_METHOD to use
|
| 169 |
+
* \return newly created EC_GROUP object or NULL in case of an error.
|
| 170 |
+
*/
|
| 171 |
+
OSSL_DEPRECATEDIN_3_0 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
|
| 172 |
+
|
| 173 |
+
/** Clears and frees a EC_GROUP object
|
| 174 |
+
* \param group EC_GROUP object to be cleared and freed.
|
| 175 |
+
*/
|
| 176 |
+
OSSL_DEPRECATEDIN_3_0 void EC_GROUP_clear_free(EC_GROUP *group);
|
| 177 |
+
|
| 178 |
+
/** Returns the EC_METHOD of the EC_GROUP object.
|
| 179 |
+
* \param group EC_GROUP object
|
| 180 |
+
* \return EC_METHOD used in this EC_GROUP object.
|
| 181 |
+
*/
|
| 182 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
|
| 183 |
+
|
| 184 |
+
/** Returns the field type of the EC_METHOD.
|
| 185 |
+
* \param meth EC_METHOD object
|
| 186 |
+
* \return NID of the underlying field type OID.
|
| 187 |
+
*/
|
| 188 |
+
OSSL_DEPRECATEDIN_3_0 int EC_METHOD_get_field_type(const EC_METHOD *meth);
|
| 189 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 190 |
+
|
| 191 |
+
/** Frees a EC_GROUP object
|
| 192 |
+
* \param group EC_GROUP object to be freed.
|
| 193 |
+
*/
|
| 194 |
+
void EC_GROUP_free(EC_GROUP *group);
|
| 195 |
+
|
| 196 |
+
/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.
|
| 197 |
+
* \param dst destination EC_GROUP object
|
| 198 |
+
* \param src source EC_GROUP object
|
| 199 |
+
* \return 1 on success and 0 if an error occurred.
|
| 200 |
+
*/
|
| 201 |
+
int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
|
| 202 |
+
|
| 203 |
+
/** Creates a new EC_GROUP object and copies the content
|
| 204 |
+
* form src to the newly created EC_KEY object
|
| 205 |
+
* \param src source EC_GROUP object
|
| 206 |
+
* \return newly created EC_GROUP object or NULL in case of an error.
|
| 207 |
+
*/
|
| 208 |
+
EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
|
| 209 |
+
|
| 210 |
+
/** Sets the generator and its order/cofactor of a EC_GROUP object.
|
| 211 |
+
* \param group EC_GROUP object
|
| 212 |
+
* \param generator EC_POINT object with the generator.
|
| 213 |
+
* \param order the order of the group generated by the generator.
|
| 214 |
+
* \param cofactor the index of the sub-group generated by the generator
|
| 215 |
+
* in the group of all points on the elliptic curve.
|
| 216 |
+
* \return 1 on success and 0 if an error occurred
|
| 217 |
+
*/
|
| 218 |
+
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
|
| 219 |
+
const BIGNUM *order, const BIGNUM *cofactor);
|
| 220 |
+
|
| 221 |
+
/** Returns the generator of a EC_GROUP object.
|
| 222 |
+
* \param group EC_GROUP object
|
| 223 |
+
* \return the currently used generator (possibly NULL).
|
| 224 |
+
*/
|
| 225 |
+
const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
|
| 226 |
+
|
| 227 |
+
/** Returns the montgomery data for order(Generator)
|
| 228 |
+
* \param group EC_GROUP object
|
| 229 |
+
* \return the currently used montgomery data (possibly NULL).
|
| 230 |
+
*/
|
| 231 |
+
BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
|
| 232 |
+
|
| 233 |
+
/** Gets the order of a EC_GROUP
|
| 234 |
+
* \param group EC_GROUP object
|
| 235 |
+
* \param order BIGNUM to which the order is copied
|
| 236 |
+
* \param ctx unused
|
| 237 |
+
* \return 1 on success and 0 if an error occurred
|
| 238 |
+
*/
|
| 239 |
+
int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
|
| 240 |
+
|
| 241 |
+
/** Gets the order of an EC_GROUP
|
| 242 |
+
* \param group EC_GROUP object
|
| 243 |
+
* \return the group order
|
| 244 |
+
*/
|
| 245 |
+
const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
|
| 246 |
+
|
| 247 |
+
/** Gets the number of bits of the order of an EC_GROUP
|
| 248 |
+
* \param group EC_GROUP object
|
| 249 |
+
* \return number of bits of group order.
|
| 250 |
+
*/
|
| 251 |
+
int EC_GROUP_order_bits(const EC_GROUP *group);
|
| 252 |
+
|
| 253 |
+
/** Gets the cofactor of a EC_GROUP
|
| 254 |
+
* \param group EC_GROUP object
|
| 255 |
+
* \param cofactor BIGNUM to which the cofactor is copied
|
| 256 |
+
* \param ctx unused
|
| 257 |
+
* \return 1 on success and 0 if an error occurred
|
| 258 |
+
*/
|
| 259 |
+
int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
|
| 260 |
+
BN_CTX *ctx);
|
| 261 |
+
|
| 262 |
+
/** Gets the cofactor of an EC_GROUP
|
| 263 |
+
* \param group EC_GROUP object
|
| 264 |
+
* \return the group cofactor
|
| 265 |
+
*/
|
| 266 |
+
const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group);
|
| 267 |
+
|
| 268 |
+
/** Sets the name of a EC_GROUP object
|
| 269 |
+
* \param group EC_GROUP object
|
| 270 |
+
* \param nid NID of the curve name OID
|
| 271 |
+
*/
|
| 272 |
+
void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
|
| 273 |
+
|
| 274 |
+
/** Returns the curve name of a EC_GROUP object
|
| 275 |
+
* \param group EC_GROUP object
|
| 276 |
+
* \return NID of the curve name OID or 0 if not set.
|
| 277 |
+
*/
|
| 278 |
+
int EC_GROUP_get_curve_name(const EC_GROUP *group);
|
| 279 |
+
|
| 280 |
+
/** Gets the field of an EC_GROUP
|
| 281 |
+
* \param group EC_GROUP object
|
| 282 |
+
* \return the group field
|
| 283 |
+
*/
|
| 284 |
+
const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
|
| 285 |
+
|
| 286 |
+
/** Returns the field type of the EC_GROUP.
|
| 287 |
+
* \param group EC_GROUP object
|
| 288 |
+
* \return NID of the underlying field type OID.
|
| 289 |
+
*/
|
| 290 |
+
int EC_GROUP_get_field_type(const EC_GROUP *group);
|
| 291 |
+
|
| 292 |
+
void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
|
| 293 |
+
int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
|
| 294 |
+
|
| 295 |
+
void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
|
| 296 |
+
point_conversion_form_t form);
|
| 297 |
+
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
|
| 298 |
+
|
| 299 |
+
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
|
| 300 |
+
size_t EC_GROUP_get_seed_len(const EC_GROUP *);
|
| 301 |
+
size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
|
| 302 |
+
|
| 303 |
+
/** Sets the parameters of an ec curve defined by y^2 = x^3 + a*x + b (for GFp)
|
| 304 |
+
* or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
|
| 305 |
+
* \param group EC_GROUP object
|
| 306 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 307 |
+
* defining the underlying field (GF2m)
|
| 308 |
+
* \param a BIGNUM with parameter a of the equation
|
| 309 |
+
* \param b BIGNUM with parameter b of the equation
|
| 310 |
+
* \param ctx BN_CTX object (optional)
|
| 311 |
+
* \return 1 on success and 0 if an error occurred
|
| 312 |
+
*/
|
| 313 |
+
int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
|
| 314 |
+
const BIGNUM *b, BN_CTX *ctx);
|
| 315 |
+
|
| 316 |
+
/** Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp)
|
| 317 |
+
* or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
|
| 318 |
+
* \param group EC_GROUP object
|
| 319 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 320 |
+
* defining the underlying field (GF2m)
|
| 321 |
+
* \param a BIGNUM for parameter a of the equation
|
| 322 |
+
* \param b BIGNUM for parameter b of the equation
|
| 323 |
+
* \param ctx BN_CTX object (optional)
|
| 324 |
+
* \return 1 on success and 0 if an error occurred
|
| 325 |
+
*/
|
| 326 |
+
int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
|
| 327 |
+
BN_CTX *ctx);
|
| 328 |
+
|
| 329 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 330 |
+
/** Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve
|
| 331 |
+
* \param group EC_GROUP object
|
| 332 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 333 |
+
* defining the underlying field (GF2m)
|
| 334 |
+
* \param a BIGNUM with parameter a of the equation
|
| 335 |
+
* \param b BIGNUM with parameter b of the equation
|
| 336 |
+
* \param ctx BN_CTX object (optional)
|
| 337 |
+
* \return 1 on success and 0 if an error occurred
|
| 338 |
+
*/
|
| 339 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GFp(EC_GROUP *group,
|
| 340 |
+
const BIGNUM *p,
|
| 341 |
+
const BIGNUM *a,
|
| 342 |
+
const BIGNUM *b,
|
| 343 |
+
BN_CTX *ctx);
|
| 344 |
+
|
| 345 |
+
/** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
|
| 346 |
+
* \param group EC_GROUP object
|
| 347 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 348 |
+
* defining the underlying field (GF2m)
|
| 349 |
+
* \param a BIGNUM for parameter a of the equation
|
| 350 |
+
* \param b BIGNUM for parameter b of the equation
|
| 351 |
+
* \param ctx BN_CTX object (optional)
|
| 352 |
+
* \return 1 on success and 0 if an error occurred
|
| 353 |
+
*/
|
| 354 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GFp(const EC_GROUP *group,
|
| 355 |
+
BIGNUM *p,
|
| 356 |
+
BIGNUM *a, BIGNUM *b,
|
| 357 |
+
BN_CTX *ctx);
|
| 358 |
+
|
| 359 |
+
# ifndef OPENSSL_NO_EC2M
|
| 360 |
+
/** Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve
|
| 361 |
+
* \param group EC_GROUP object
|
| 362 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 363 |
+
* defining the underlying field (GF2m)
|
| 364 |
+
* \param a BIGNUM with parameter a of the equation
|
| 365 |
+
* \param b BIGNUM with parameter b of the equation
|
| 366 |
+
* \param ctx BN_CTX object (optional)
|
| 367 |
+
* \return 1 on success and 0 if an error occurred
|
| 368 |
+
*/
|
| 369 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GF2m(EC_GROUP *group,
|
| 370 |
+
const BIGNUM *p,
|
| 371 |
+
const BIGNUM *a,
|
| 372 |
+
const BIGNUM *b,
|
| 373 |
+
BN_CTX *ctx);
|
| 374 |
+
|
| 375 |
+
/** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
|
| 376 |
+
* \param group EC_GROUP object
|
| 377 |
+
* \param p BIGNUM with the prime number (GFp) or the polynomial
|
| 378 |
+
* defining the underlying field (GF2m)
|
| 379 |
+
* \param a BIGNUM for parameter a of the equation
|
| 380 |
+
* \param b BIGNUM for parameter b of the equation
|
| 381 |
+
* \param ctx BN_CTX object (optional)
|
| 382 |
+
* \return 1 on success and 0 if an error occurred
|
| 383 |
+
*/
|
| 384 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group,
|
| 385 |
+
BIGNUM *p,
|
| 386 |
+
BIGNUM *a, BIGNUM *b,
|
| 387 |
+
BN_CTX *ctx);
|
| 388 |
+
# endif /* OPENSSL_NO_EC2M */
|
| 389 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 390 |
+
|
| 391 |
+
/** Returns the number of bits needed to represent a field element
|
| 392 |
+
* \param group EC_GROUP object
|
| 393 |
+
* \return number of bits needed to represent a field element
|
| 394 |
+
*/
|
| 395 |
+
int EC_GROUP_get_degree(const EC_GROUP *group);
|
| 396 |
+
|
| 397 |
+
/** Checks whether the parameter in the EC_GROUP define a valid ec group
|
| 398 |
+
* \param group EC_GROUP object
|
| 399 |
+
* \param ctx BN_CTX object (optional)
|
| 400 |
+
* \return 1 if group is a valid ec group and 0 otherwise
|
| 401 |
+
*/
|
| 402 |
+
int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
|
| 403 |
+
|
| 404 |
+
/** Checks whether the discriminant of the elliptic curve is zero or not
|
| 405 |
+
* \param group EC_GROUP object
|
| 406 |
+
* \param ctx BN_CTX object (optional)
|
| 407 |
+
* \return 1 if the discriminant is not zero and 0 otherwise
|
| 408 |
+
*/
|
| 409 |
+
int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
|
| 410 |
+
|
| 411 |
+
/** Compares two EC_GROUP objects
|
| 412 |
+
* \param a first EC_GROUP object
|
| 413 |
+
* \param b second EC_GROUP object
|
| 414 |
+
* \param ctx BN_CTX object (optional)
|
| 415 |
+
* \return 0 if the groups are equal, 1 if not, or -1 on error
|
| 416 |
+
*/
|
| 417 |
+
int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
|
| 418 |
+
|
| 419 |
+
/*
|
| 420 |
+
* EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
|
| 421 |
+
* choosing an appropriate EC_METHOD
|
| 422 |
+
*/
|
| 423 |
+
|
| 424 |
+
/** Creates a new EC_GROUP object with the specified parameters defined
|
| 425 |
+
* over GFp (defined by the equation y^2 = x^3 + a*x + b)
|
| 426 |
+
* \param p BIGNUM with the prime number
|
| 427 |
+
* \param a BIGNUM with the parameter a of the equation
|
| 428 |
+
* \param b BIGNUM with the parameter b of the equation
|
| 429 |
+
* \param ctx BN_CTX object (optional)
|
| 430 |
+
* \return newly created EC_GROUP object with the specified parameters
|
| 431 |
+
*/
|
| 432 |
+
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
|
| 433 |
+
const BIGNUM *b, BN_CTX *ctx);
|
| 434 |
+
# ifndef OPENSSL_NO_EC2M
|
| 435 |
+
/** Creates a new EC_GROUP object with the specified parameters defined
|
| 436 |
+
* over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
|
| 437 |
+
* \param p BIGNUM with the polynomial defining the underlying field
|
| 438 |
+
* \param a BIGNUM with the parameter a of the equation
|
| 439 |
+
* \param b BIGNUM with the parameter b of the equation
|
| 440 |
+
* \param ctx BN_CTX object (optional)
|
| 441 |
+
* \return newly created EC_GROUP object with the specified parameters
|
| 442 |
+
*/
|
| 443 |
+
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
|
| 444 |
+
const BIGNUM *b, BN_CTX *ctx);
|
| 445 |
+
# endif
|
| 446 |
+
|
| 447 |
+
/**
|
| 448 |
+
* Creates a EC_GROUP object with a curve specified by parameters.
|
| 449 |
+
* The parameters may be explicit or a named curve,
|
| 450 |
+
* \param params A list of parameters describing the group.
|
| 451 |
+
* \param libctx The associated library context or NULL for the default
|
| 452 |
+
* context
|
| 453 |
+
* \param propq A property query string
|
| 454 |
+
* \return newly created EC_GROUP object with specified parameters or NULL
|
| 455 |
+
* if an error occurred
|
| 456 |
+
*/
|
| 457 |
+
EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
|
| 458 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 459 |
+
|
| 460 |
+
/**
|
| 461 |
+
* Creates a EC_GROUP object with a curve specified by a NID
|
| 462 |
+
* \param libctx The associated library context or NULL for the default
|
| 463 |
+
* context
|
| 464 |
+
* \param propq A property query string
|
| 465 |
+
* \param nid NID of the OID of the curve name
|
| 466 |
+
* \return newly created EC_GROUP object with specified curve or NULL
|
| 467 |
+
* if an error occurred
|
| 468 |
+
*/
|
| 469 |
+
EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
|
| 470 |
+
int nid);
|
| 471 |
+
|
| 472 |
+
/**
|
| 473 |
+
* Creates a EC_GROUP object with a curve specified by a NID. Same as
|
| 474 |
+
* EC_GROUP_new_by_curve_name_ex but the libctx and propq are always
|
| 475 |
+
* NULL.
|
| 476 |
+
* \param nid NID of the OID of the curve name
|
| 477 |
+
* \return newly created EC_GROUP object with specified curve or NULL
|
| 478 |
+
* if an error occurred
|
| 479 |
+
*/
|
| 480 |
+
EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
|
| 481 |
+
|
| 482 |
+
/** Creates a new EC_GROUP object from an ECPARAMETERS object
|
| 483 |
+
* \param params pointer to the ECPARAMETERS object
|
| 484 |
+
* \return newly created EC_GROUP object with specified curve or NULL
|
| 485 |
+
* if an error occurred
|
| 486 |
+
*/
|
| 487 |
+
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
|
| 488 |
+
|
| 489 |
+
/** Creates an ECPARAMETERS object for the given EC_GROUP object.
|
| 490 |
+
* \param group pointer to the EC_GROUP object
|
| 491 |
+
* \param params pointer to an existing ECPARAMETERS object or NULL
|
| 492 |
+
* \return pointer to the new ECPARAMETERS object or NULL
|
| 493 |
+
* if an error occurred.
|
| 494 |
+
*/
|
| 495 |
+
ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
|
| 496 |
+
ECPARAMETERS *params);
|
| 497 |
+
|
| 498 |
+
/** Creates a new EC_GROUP object from an ECPKPARAMETERS object
|
| 499 |
+
* \param params pointer to an existing ECPKPARAMETERS object, or NULL
|
| 500 |
+
* \return newly created EC_GROUP object with specified curve, or NULL
|
| 501 |
+
* if an error occurred
|
| 502 |
+
*/
|
| 503 |
+
EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
|
| 504 |
+
|
| 505 |
+
/** Creates an ECPKPARAMETERS object for the given EC_GROUP object.
|
| 506 |
+
* \param group pointer to the EC_GROUP object
|
| 507 |
+
* \param params pointer to an existing ECPKPARAMETERS object or NULL
|
| 508 |
+
* \return pointer to the new ECPKPARAMETERS object or NULL
|
| 509 |
+
* if an error occurred.
|
| 510 |
+
*/
|
| 511 |
+
ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
|
| 512 |
+
ECPKPARAMETERS *params);
|
| 513 |
+
|
| 514 |
+
/********************************************************************/
|
| 515 |
+
/* handling of internal curves */
|
| 516 |
+
/********************************************************************/
|
| 517 |
+
|
| 518 |
+
typedef struct {
|
| 519 |
+
int nid;
|
| 520 |
+
const char *comment;
|
| 521 |
+
} EC_builtin_curve;
|
| 522 |
+
|
| 523 |
+
/*
|
| 524 |
+
* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
|
| 525 |
+
* available curves or zero if a error occurred. In case r is not zero,
|
| 526 |
+
* nitems EC_builtin_curve structures are filled with the data of the first
|
| 527 |
+
* nitems internal groups
|
| 528 |
+
*/
|
| 529 |
+
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
|
| 530 |
+
|
| 531 |
+
const char *EC_curve_nid2nist(int nid);
|
| 532 |
+
int EC_curve_nist2nid(const char *name);
|
| 533 |
+
int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
|
| 534 |
+
BN_CTX *ctx);
|
| 535 |
+
|
| 536 |
+
/********************************************************************/
|
| 537 |
+
/* EC_POINT functions */
|
| 538 |
+
/********************************************************************/
|
| 539 |
+
|
| 540 |
+
/** Creates a new EC_POINT object for the specified EC_GROUP
|
| 541 |
+
* \param group EC_GROUP the underlying EC_GROUP object
|
| 542 |
+
* \return newly created EC_POINT object or NULL if an error occurred
|
| 543 |
+
*/
|
| 544 |
+
EC_POINT *EC_POINT_new(const EC_GROUP *group);
|
| 545 |
+
|
| 546 |
+
/** Frees a EC_POINT object
|
| 547 |
+
* \param point EC_POINT object to be freed
|
| 548 |
+
*/
|
| 549 |
+
void EC_POINT_free(EC_POINT *point);
|
| 550 |
+
|
| 551 |
+
/** Clears and frees a EC_POINT object
|
| 552 |
+
* \param point EC_POINT object to be cleared and freed
|
| 553 |
+
*/
|
| 554 |
+
void EC_POINT_clear_free(EC_POINT *point);
|
| 555 |
+
|
| 556 |
+
/** Copies EC_POINT object
|
| 557 |
+
* \param dst destination EC_POINT object
|
| 558 |
+
* \param src source EC_POINT object
|
| 559 |
+
* \return 1 on success and 0 if an error occurred
|
| 560 |
+
*/
|
| 561 |
+
int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
|
| 562 |
+
|
| 563 |
+
/** Creates a new EC_POINT object and copies the content of the supplied
|
| 564 |
+
* EC_POINT
|
| 565 |
+
* \param src source EC_POINT object
|
| 566 |
+
* \param group underlying the EC_GROUP object
|
| 567 |
+
* \return newly created EC_POINT object or NULL if an error occurred
|
| 568 |
+
*/
|
| 569 |
+
EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
|
| 570 |
+
|
| 571 |
+
/** Sets a point to infinity (neutral element)
|
| 572 |
+
* \param group underlying EC_GROUP object
|
| 573 |
+
* \param point EC_POINT to set to infinity
|
| 574 |
+
* \return 1 on success and 0 if an error occurred
|
| 575 |
+
*/
|
| 576 |
+
int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
|
| 577 |
+
|
| 578 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 579 |
+
/** Returns the EC_METHOD used in EC_POINT object
|
| 580 |
+
* \param point EC_POINT object
|
| 581 |
+
* \return the EC_METHOD used
|
| 582 |
+
*/
|
| 583 |
+
OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
|
| 584 |
+
|
| 585 |
+
/** Sets the jacobian projective coordinates of a EC_POINT over GFp
|
| 586 |
+
* \param group underlying EC_GROUP object
|
| 587 |
+
* \param p EC_POINT object
|
| 588 |
+
* \param x BIGNUM with the x-coordinate
|
| 589 |
+
* \param y BIGNUM with the y-coordinate
|
| 590 |
+
* \param z BIGNUM with the z-coordinate
|
| 591 |
+
* \param ctx BN_CTX object (optional)
|
| 592 |
+
* \return 1 on success and 0 if an error occurred
|
| 593 |
+
*/
|
| 594 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_Jprojective_coordinates_GFp
|
| 595 |
+
(const EC_GROUP *group, EC_POINT *p,
|
| 596 |
+
const BIGNUM *x, const BIGNUM *y, const BIGNUM *z,
|
| 597 |
+
BN_CTX *ctx);
|
| 598 |
+
|
| 599 |
+
/** Gets the jacobian projective coordinates of a EC_POINT over GFp
|
| 600 |
+
* \param group underlying EC_GROUP object
|
| 601 |
+
* \param p EC_POINT object
|
| 602 |
+
* \param x BIGNUM for the x-coordinate
|
| 603 |
+
* \param y BIGNUM for the y-coordinate
|
| 604 |
+
* \param z BIGNUM for the z-coordinate
|
| 605 |
+
* \param ctx BN_CTX object (optional)
|
| 606 |
+
* \return 1 on success and 0 if an error occurred
|
| 607 |
+
*/
|
| 608 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_Jprojective_coordinates_GFp
|
| 609 |
+
(const EC_GROUP *group, const EC_POINT *p,
|
| 610 |
+
BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
|
| 611 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 612 |
+
|
| 613 |
+
/** Sets the affine coordinates of an EC_POINT
|
| 614 |
+
* \param group underlying EC_GROUP object
|
| 615 |
+
* \param p EC_POINT object
|
| 616 |
+
* \param x BIGNUM with the x-coordinate
|
| 617 |
+
* \param y BIGNUM with the y-coordinate
|
| 618 |
+
* \param ctx BN_CTX object (optional)
|
| 619 |
+
* \return 1 on success and 0 if an error occurred
|
| 620 |
+
*/
|
| 621 |
+
int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
|
| 622 |
+
const BIGNUM *x, const BIGNUM *y,
|
| 623 |
+
BN_CTX *ctx);
|
| 624 |
+
|
| 625 |
+
/** Gets the affine coordinates of an EC_POINT.
|
| 626 |
+
* \param group underlying EC_GROUP object
|
| 627 |
+
* \param p EC_POINT object
|
| 628 |
+
* \param x BIGNUM for the x-coordinate
|
| 629 |
+
* \param y BIGNUM for the y-coordinate
|
| 630 |
+
* \param ctx BN_CTX object (optional)
|
| 631 |
+
* \return 1 on success and 0 if an error occurred
|
| 632 |
+
*/
|
| 633 |
+
int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
|
| 634 |
+
BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
| 635 |
+
|
| 636 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 637 |
+
/** Sets the affine coordinates of an EC_POINT. A synonym of
|
| 638 |
+
* EC_POINT_set_affine_coordinates
|
| 639 |
+
* \param group underlying EC_GROUP object
|
| 640 |
+
* \param p EC_POINT object
|
| 641 |
+
* \param x BIGNUM with the x-coordinate
|
| 642 |
+
* \param y BIGNUM with the y-coordinate
|
| 643 |
+
* \param ctx BN_CTX object (optional)
|
| 644 |
+
* \return 1 on success and 0 if an error occurred
|
| 645 |
+
*/
|
| 646 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GFp
|
| 647 |
+
(const EC_GROUP *group, EC_POINT *p,
|
| 648 |
+
const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
|
| 649 |
+
|
| 650 |
+
/** Gets the affine coordinates of an EC_POINT. A synonym of
|
| 651 |
+
* EC_POINT_get_affine_coordinates
|
| 652 |
+
* \param group underlying EC_GROUP object
|
| 653 |
+
* \param p EC_POINT object
|
| 654 |
+
* \param x BIGNUM for the x-coordinate
|
| 655 |
+
* \param y BIGNUM for the y-coordinate
|
| 656 |
+
* \param ctx BN_CTX object (optional)
|
| 657 |
+
* \return 1 on success and 0 if an error occurred
|
| 658 |
+
*/
|
| 659 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GFp
|
| 660 |
+
(const EC_GROUP *group, const EC_POINT *p,
|
| 661 |
+
BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
| 662 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 663 |
+
|
| 664 |
+
/** Sets the x9.62 compressed coordinates of a EC_POINT
|
| 665 |
+
* \param group underlying EC_GROUP object
|
| 666 |
+
* \param p EC_POINT object
|
| 667 |
+
* \param x BIGNUM with x-coordinate
|
| 668 |
+
* \param y_bit integer with the y-Bit (either 0 or 1)
|
| 669 |
+
* \param ctx BN_CTX object (optional)
|
| 670 |
+
* \return 1 on success and 0 if an error occurred
|
| 671 |
+
*/
|
| 672 |
+
int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
|
| 673 |
+
const BIGNUM *x, int y_bit,
|
| 674 |
+
BN_CTX *ctx);
|
| 675 |
+
|
| 676 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 677 |
+
/** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
|
| 678 |
+
* EC_POINT_set_compressed_coordinates
|
| 679 |
+
* \param group underlying EC_GROUP object
|
| 680 |
+
* \param p EC_POINT object
|
| 681 |
+
* \param x BIGNUM with x-coordinate
|
| 682 |
+
* \param y_bit integer with the y-Bit (either 0 or 1)
|
| 683 |
+
* \param ctx BN_CTX object (optional)
|
| 684 |
+
* \return 1 on success and 0 if an error occurred
|
| 685 |
+
*/
|
| 686 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GFp
|
| 687 |
+
(const EC_GROUP *group, EC_POINT *p,
|
| 688 |
+
const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
| 689 |
+
# ifndef OPENSSL_NO_EC2M
|
| 690 |
+
/** Sets the affine coordinates of an EC_POINT. A synonym of
|
| 691 |
+
* EC_POINT_set_affine_coordinates
|
| 692 |
+
* \param group underlying EC_GROUP object
|
| 693 |
+
* \param p EC_POINT object
|
| 694 |
+
* \param x BIGNUM with the x-coordinate
|
| 695 |
+
* \param y BIGNUM with the y-coordinate
|
| 696 |
+
* \param ctx BN_CTX object (optional)
|
| 697 |
+
* \return 1 on success and 0 if an error occurred
|
| 698 |
+
*/
|
| 699 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GF2m
|
| 700 |
+
(const EC_GROUP *group, EC_POINT *p,
|
| 701 |
+
const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
|
| 702 |
+
|
| 703 |
+
/** Gets the affine coordinates of an EC_POINT. A synonym of
|
| 704 |
+
* EC_POINT_get_affine_coordinates
|
| 705 |
+
* \param group underlying EC_GROUP object
|
| 706 |
+
* \param p EC_POINT object
|
| 707 |
+
* \param x BIGNUM for the x-coordinate
|
| 708 |
+
* \param y BIGNUM for the y-coordinate
|
| 709 |
+
* \param ctx BN_CTX object (optional)
|
| 710 |
+
* \return 1 on success and 0 if an error occurred
|
| 711 |
+
*/
|
| 712 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GF2m
|
| 713 |
+
(const EC_GROUP *group, const EC_POINT *p,
|
| 714 |
+
BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
|
| 715 |
+
|
| 716 |
+
/** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
|
| 717 |
+
* EC_POINT_set_compressed_coordinates
|
| 718 |
+
* \param group underlying EC_GROUP object
|
| 719 |
+
* \param p EC_POINT object
|
| 720 |
+
* \param x BIGNUM with x-coordinate
|
| 721 |
+
* \param y_bit integer with the y-Bit (either 0 or 1)
|
| 722 |
+
* \param ctx BN_CTX object (optional)
|
| 723 |
+
* \return 1 on success and 0 if an error occurred
|
| 724 |
+
*/
|
| 725 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GF2m
|
| 726 |
+
(const EC_GROUP *group, EC_POINT *p,
|
| 727 |
+
const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
| 728 |
+
# endif
|
| 729 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 730 |
+
|
| 731 |
+
/** Encodes a EC_POINT object to a octet string
|
| 732 |
+
* \param group underlying EC_GROUP object
|
| 733 |
+
* \param p EC_POINT object
|
| 734 |
+
* \param form point conversion form
|
| 735 |
+
* \param buf memory buffer for the result. If NULL the function returns
|
| 736 |
+
* required buffer size.
|
| 737 |
+
* \param len length of the memory buffer
|
| 738 |
+
* \param ctx BN_CTX object (optional)
|
| 739 |
+
* \return the length of the encoded octet string or 0 if an error occurred
|
| 740 |
+
*/
|
| 741 |
+
size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
|
| 742 |
+
point_conversion_form_t form,
|
| 743 |
+
unsigned char *buf, size_t len, BN_CTX *ctx);
|
| 744 |
+
|
| 745 |
+
/** Decodes a EC_POINT from a octet string
|
| 746 |
+
* \param group underlying EC_GROUP object
|
| 747 |
+
* \param p EC_POINT object
|
| 748 |
+
* \param buf memory buffer with the encoded ec point
|
| 749 |
+
* \param len length of the encoded ec point
|
| 750 |
+
* \param ctx BN_CTX object (optional)
|
| 751 |
+
* \return 1 on success and 0 if an error occurred
|
| 752 |
+
*/
|
| 753 |
+
int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
|
| 754 |
+
const unsigned char *buf, size_t len, BN_CTX *ctx);
|
| 755 |
+
|
| 756 |
+
/** Encodes an EC_POINT object to an allocated octet string
|
| 757 |
+
* \param group underlying EC_GROUP object
|
| 758 |
+
* \param point EC_POINT object
|
| 759 |
+
* \param form point conversion form
|
| 760 |
+
* \param pbuf returns pointer to allocated buffer
|
| 761 |
+
* \param ctx BN_CTX object (optional)
|
| 762 |
+
* \return the length of the encoded octet string or 0 if an error occurred
|
| 763 |
+
*/
|
| 764 |
+
size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point,
|
| 765 |
+
point_conversion_form_t form,
|
| 766 |
+
unsigned char **pbuf, BN_CTX *ctx);
|
| 767 |
+
|
| 768 |
+
/* other interfaces to point2oct/oct2point: */
|
| 769 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 770 |
+
OSSL_DEPRECATEDIN_3_0 BIGNUM *EC_POINT_point2bn(const EC_GROUP *,
|
| 771 |
+
const EC_POINT *,
|
| 772 |
+
point_conversion_form_t form,
|
| 773 |
+
BIGNUM *, BN_CTX *);
|
| 774 |
+
OSSL_DEPRECATEDIN_3_0 EC_POINT *EC_POINT_bn2point(const EC_GROUP *,
|
| 775 |
+
const BIGNUM *,
|
| 776 |
+
EC_POINT *, BN_CTX *);
|
| 777 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 778 |
+
|
| 779 |
+
char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
|
| 780 |
+
point_conversion_form_t form, BN_CTX *);
|
| 781 |
+
EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
|
| 782 |
+
EC_POINT *, BN_CTX *);
|
| 783 |
+
|
| 784 |
+
/********************************************************************/
|
| 785 |
+
/* functions for doing EC_POINT arithmetic */
|
| 786 |
+
/********************************************************************/
|
| 787 |
+
|
| 788 |
+
/** Computes the sum of two EC_POINT
|
| 789 |
+
* \param group underlying EC_GROUP object
|
| 790 |
+
* \param r EC_POINT object for the result (r = a + b)
|
| 791 |
+
* \param a EC_POINT object with the first summand
|
| 792 |
+
* \param b EC_POINT object with the second summand
|
| 793 |
+
* \param ctx BN_CTX object (optional)
|
| 794 |
+
* \return 1 on success and 0 if an error occurred
|
| 795 |
+
*/
|
| 796 |
+
int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
|
| 797 |
+
const EC_POINT *b, BN_CTX *ctx);
|
| 798 |
+
|
| 799 |
+
/** Computes the double of a EC_POINT
|
| 800 |
+
* \param group underlying EC_GROUP object
|
| 801 |
+
* \param r EC_POINT object for the result (r = 2 * a)
|
| 802 |
+
* \param a EC_POINT object
|
| 803 |
+
* \param ctx BN_CTX object (optional)
|
| 804 |
+
* \return 1 on success and 0 if an error occurred
|
| 805 |
+
*/
|
| 806 |
+
int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
|
| 807 |
+
BN_CTX *ctx);
|
| 808 |
+
|
| 809 |
+
/** Computes the inverse of a EC_POINT
|
| 810 |
+
* \param group underlying EC_GROUP object
|
| 811 |
+
* \param a EC_POINT object to be inverted (it's used for the result as well)
|
| 812 |
+
* \param ctx BN_CTX object (optional)
|
| 813 |
+
* \return 1 on success and 0 if an error occurred
|
| 814 |
+
*/
|
| 815 |
+
int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
|
| 816 |
+
|
| 817 |
+
/** Checks whether the point is the neutral element of the group
|
| 818 |
+
* \param group the underlying EC_GROUP object
|
| 819 |
+
* \param p EC_POINT object
|
| 820 |
+
* \return 1 if the point is the neutral element and 0 otherwise
|
| 821 |
+
*/
|
| 822 |
+
int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
|
| 823 |
+
|
| 824 |
+
/** Checks whether the point is on the curve
|
| 825 |
+
* \param group underlying EC_GROUP object
|
| 826 |
+
* \param point EC_POINT object to check
|
| 827 |
+
* \param ctx BN_CTX object (optional)
|
| 828 |
+
* \return 1 if the point is on the curve, 0 if not, or -1 on error
|
| 829 |
+
*/
|
| 830 |
+
int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
|
| 831 |
+
BN_CTX *ctx);
|
| 832 |
+
|
| 833 |
+
/** Compares two EC_POINTs
|
| 834 |
+
* \param group underlying EC_GROUP object
|
| 835 |
+
* \param a first EC_POINT object
|
| 836 |
+
* \param b second EC_POINT object
|
| 837 |
+
* \param ctx BN_CTX object (optional)
|
| 838 |
+
* \return 1 if the points are not equal, 0 if they are, or -1 on error
|
| 839 |
+
*/
|
| 840 |
+
int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
|
| 841 |
+
BN_CTX *ctx);
|
| 842 |
+
|
| 843 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 844 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINT_make_affine(const EC_GROUP *group,
|
| 845 |
+
EC_POINT *point, BN_CTX *ctx);
|
| 846 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
|
| 847 |
+
EC_POINT *points[], BN_CTX *ctx);
|
| 848 |
+
|
| 849 |
+
/** Computes r = generator * n + sum_{i=0}^{num-1} p[i] * m[i]
|
| 850 |
+
* \param group underlying EC_GROUP object
|
| 851 |
+
* \param r EC_POINT object for the result
|
| 852 |
+
* \param n BIGNUM with the multiplier for the group generator (optional)
|
| 853 |
+
* \param num number further summands
|
| 854 |
+
* \param p array of size num of EC_POINT objects
|
| 855 |
+
* \param m array of size num of BIGNUM objects
|
| 856 |
+
* \param ctx BN_CTX object (optional)
|
| 857 |
+
* \return 1 on success and 0 if an error occurred
|
| 858 |
+
*/
|
| 859 |
+
OSSL_DEPRECATEDIN_3_0 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r,
|
| 860 |
+
const BIGNUM *n, size_t num,
|
| 861 |
+
const EC_POINT *p[], const BIGNUM *m[],
|
| 862 |
+
BN_CTX *ctx);
|
| 863 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 864 |
+
|
| 865 |
+
/** Computes r = generator * n + q * m
|
| 866 |
+
* \param group underlying EC_GROUP object
|
| 867 |
+
* \param r EC_POINT object for the result
|
| 868 |
+
* \param n BIGNUM with the multiplier for the group generator (optional)
|
| 869 |
+
* \param q EC_POINT object with the first factor of the second summand
|
| 870 |
+
* \param m BIGNUM with the second factor of the second summand
|
| 871 |
+
* \param ctx BN_CTX object (optional)
|
| 872 |
+
* \return 1 on success and 0 if an error occurred
|
| 873 |
+
*/
|
| 874 |
+
int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
|
| 875 |
+
const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
|
| 876 |
+
|
| 877 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 878 |
+
/** Stores multiples of generator for faster point multiplication
|
| 879 |
+
* \param group EC_GROUP object
|
| 880 |
+
* \param ctx BN_CTX object (optional)
|
| 881 |
+
* \return 1 on success and 0 if an error occurred
|
| 882 |
+
*/
|
| 883 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
|
| 884 |
+
|
| 885 |
+
/** Reports whether a precomputation has been done
|
| 886 |
+
* \param group EC_GROUP object
|
| 887 |
+
* \return 1 if a pre-computation has been done and 0 otherwise
|
| 888 |
+
*/
|
| 889 |
+
OSSL_DEPRECATEDIN_3_0 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
|
| 890 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 891 |
+
|
| 892 |
+
/********************************************************************/
|
| 893 |
+
/* ASN1 stuff */
|
| 894 |
+
/********************************************************************/
|
| 895 |
+
|
| 896 |
+
DECLARE_ASN1_ITEM(ECPKPARAMETERS)
|
| 897 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(ECPKPARAMETERS)
|
| 898 |
+
DECLARE_ASN1_ITEM(ECPARAMETERS)
|
| 899 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
|
| 900 |
+
|
| 901 |
+
/*
|
| 902 |
+
* EC_GROUP_get_basis_type() returns the NID of the basis type used to
|
| 903 |
+
* represent the field elements
|
| 904 |
+
*/
|
| 905 |
+
int EC_GROUP_get_basis_type(const EC_GROUP *);
|
| 906 |
+
# ifndef OPENSSL_NO_EC2M
|
| 907 |
+
int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
|
| 908 |
+
int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
|
| 909 |
+
unsigned int *k2, unsigned int *k3);
|
| 910 |
+
# endif
|
| 911 |
+
|
| 912 |
+
EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
|
| 913 |
+
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
|
| 914 |
+
|
| 915 |
+
# define d2i_ECPKParameters_bio(bp,x) \
|
| 916 |
+
ASN1_d2i_bio_of(EC_GROUP, NULL, d2i_ECPKParameters, bp, x)
|
| 917 |
+
# define i2d_ECPKParameters_bio(bp,x) \
|
| 918 |
+
ASN1_i2d_bio_of(EC_GROUP, i2d_ECPKParameters, bp, x)
|
| 919 |
+
# define d2i_ECPKParameters_fp(fp,x) \
|
| 920 |
+
(EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \
|
| 921 |
+
(void **)(x))
|
| 922 |
+
# define i2d_ECPKParameters_fp(fp,x) \
|
| 923 |
+
ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x))
|
| 924 |
+
|
| 925 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 926 |
+
OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print(BIO *bp, const EC_GROUP *x,
|
| 927 |
+
int off);
|
| 928 |
+
# ifndef OPENSSL_NO_STDIO
|
| 929 |
+
OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x,
|
| 930 |
+
int off);
|
| 931 |
+
# endif
|
| 932 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 933 |
+
|
| 934 |
+
/********************************************************************/
|
| 935 |
+
/* EC_KEY functions */
|
| 936 |
+
/********************************************************************/
|
| 937 |
+
|
| 938 |
+
/* some values for the encoding_flag */
|
| 939 |
+
# define EC_PKEY_NO_PARAMETERS 0x001
|
| 940 |
+
# define EC_PKEY_NO_PUBKEY 0x002
|
| 941 |
+
|
| 942 |
+
/* some values for the flags field */
|
| 943 |
+
# define EC_FLAG_SM2_RANGE 0x0004
|
| 944 |
+
# define EC_FLAG_COFACTOR_ECDH 0x1000
|
| 945 |
+
# define EC_FLAG_CHECK_NAMED_GROUP 0x2000
|
| 946 |
+
# define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
|
| 947 |
+
# define EC_FLAG_CHECK_NAMED_GROUP_MASK \
|
| 948 |
+
(EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
|
| 949 |
+
|
| 950 |
+
/* Deprecated flags - it was using 0x01..0x02 */
|
| 951 |
+
# define EC_FLAG_NON_FIPS_ALLOW 0x0000
|
| 952 |
+
# define EC_FLAG_FIPS_CHECKED 0x0000
|
| 953 |
+
|
| 954 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 955 |
+
/**
|
| 956 |
+
* Creates a new EC_KEY object.
|
| 957 |
+
* \param ctx The library context for to use for this EC_KEY. May be NULL in
|
| 958 |
+
* which case the default library context is used.
|
| 959 |
+
* \return EC_KEY object or NULL if an error occurred.
|
| 960 |
+
*/
|
| 961 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq);
|
| 962 |
+
|
| 963 |
+
/**
|
| 964 |
+
* Creates a new EC_KEY object. Same as calling EC_KEY_new_ex with a
|
| 965 |
+
* NULL library context
|
| 966 |
+
* \return EC_KEY object or NULL if an error occurred.
|
| 967 |
+
*/
|
| 968 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void);
|
| 969 |
+
|
| 970 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_get_flags(const EC_KEY *key);
|
| 971 |
+
|
| 972 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_flags(EC_KEY *key, int flags);
|
| 973 |
+
|
| 974 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_clear_flags(EC_KEY *key, int flags);
|
| 975 |
+
|
| 976 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_decoded_from_explicit_params(const EC_KEY *key);
|
| 977 |
+
|
| 978 |
+
/**
|
| 979 |
+
* Creates a new EC_KEY object using a named curve as underlying
|
| 980 |
+
* EC_GROUP object.
|
| 981 |
+
* \param ctx The library context for to use for this EC_KEY. May be NULL in
|
| 982 |
+
* which case the default library context is used.
|
| 983 |
+
* \param propq Any property query string
|
| 984 |
+
* \param nid NID of the named curve.
|
| 985 |
+
* \return EC_KEY object or NULL if an error occurred.
|
| 986 |
+
*/
|
| 987 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx,
|
| 988 |
+
const char *propq,
|
| 989 |
+
int nid);
|
| 990 |
+
|
| 991 |
+
/**
|
| 992 |
+
* Creates a new EC_KEY object using a named curve as underlying
|
| 993 |
+
* EC_GROUP object. Same as calling EC_KEY_new_by_curve_name_ex with a NULL
|
| 994 |
+
* library context and property query string.
|
| 995 |
+
* \param nid NID of the named curve.
|
| 996 |
+
* \return EC_KEY object or NULL if an error occurred.
|
| 997 |
+
*/
|
| 998 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
|
| 999 |
+
|
| 1000 |
+
/** Frees a EC_KEY object.
|
| 1001 |
+
* \param key EC_KEY object to be freed.
|
| 1002 |
+
*/
|
| 1003 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
|
| 1004 |
+
|
| 1005 |
+
/** Copies a EC_KEY object.
|
| 1006 |
+
* \param dst destination EC_KEY object
|
| 1007 |
+
* \param src src EC_KEY object
|
| 1008 |
+
* \return dst or NULL if an error occurred.
|
| 1009 |
+
*/
|
| 1010 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
|
| 1011 |
+
|
| 1012 |
+
/** Creates a new EC_KEY object and copies the content from src to it.
|
| 1013 |
+
* \param src the source EC_KEY object
|
| 1014 |
+
* \return newly created EC_KEY object or NULL if an error occurred.
|
| 1015 |
+
*/
|
| 1016 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_dup(const EC_KEY *src);
|
| 1017 |
+
|
| 1018 |
+
/** Increases the internal reference count of a EC_KEY object.
|
| 1019 |
+
* \param key EC_KEY object
|
| 1020 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1021 |
+
*/
|
| 1022 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_up_ref(EC_KEY *key);
|
| 1023 |
+
|
| 1024 |
+
/** Returns the ENGINE object of a EC_KEY object
|
| 1025 |
+
* \param eckey EC_KEY object
|
| 1026 |
+
* \return the ENGINE object (possibly NULL).
|
| 1027 |
+
*/
|
| 1028 |
+
OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
|
| 1029 |
+
|
| 1030 |
+
/** Returns the EC_GROUP object of a EC_KEY object
|
| 1031 |
+
* \param key EC_KEY object
|
| 1032 |
+
* \return the EC_GROUP object (possibly NULL).
|
| 1033 |
+
*/
|
| 1034 |
+
OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
|
| 1035 |
+
|
| 1036 |
+
/** Sets the EC_GROUP of a EC_KEY object.
|
| 1037 |
+
* \param key EC_KEY object
|
| 1038 |
+
* \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
|
| 1039 |
+
* object will use an own copy of the EC_GROUP).
|
| 1040 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1041 |
+
*/
|
| 1042 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
|
| 1043 |
+
|
| 1044 |
+
/** Returns the private key of a EC_KEY object.
|
| 1045 |
+
* \param key EC_KEY object
|
| 1046 |
+
* \return a BIGNUM with the private key (possibly NULL).
|
| 1047 |
+
*/
|
| 1048 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
|
| 1049 |
+
|
| 1050 |
+
/** Sets the private key of a EC_KEY object.
|
| 1051 |
+
* \param key EC_KEY object
|
| 1052 |
+
* \param prv BIGNUM with the private key (note: the EC_KEY object
|
| 1053 |
+
* will use an own copy of the BIGNUM).
|
| 1054 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1055 |
+
*/
|
| 1056 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
|
| 1057 |
+
|
| 1058 |
+
/** Returns the public key of a EC_KEY object.
|
| 1059 |
+
* \param key the EC_KEY object
|
| 1060 |
+
* \return a EC_POINT object with the public key (possibly NULL)
|
| 1061 |
+
*/
|
| 1062 |
+
OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
|
| 1063 |
+
|
| 1064 |
+
/** Sets the public key of a EC_KEY object.
|
| 1065 |
+
* \param key EC_KEY object
|
| 1066 |
+
* \param pub EC_POINT object with the public key (note: the EC_KEY object
|
| 1067 |
+
* will use an own copy of the EC_POINT object).
|
| 1068 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1069 |
+
*/
|
| 1070 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
|
| 1071 |
+
|
| 1072 |
+
OSSL_DEPRECATEDIN_3_0 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
|
| 1073 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
|
| 1074 |
+
OSSL_DEPRECATEDIN_3_0 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
|
| 1075 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey,
|
| 1076 |
+
point_conversion_form_t cform);
|
| 1077 |
+
# endif /*OPENSSL_NO_DEPRECATED_3_0 */
|
| 1078 |
+
|
| 1079 |
+
# define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 1080 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
|
| 1081 |
+
|
| 1082 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 1083 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
|
| 1084 |
+
OSSL_DEPRECATEDIN_3_0 void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
|
| 1085 |
+
|
| 1086 |
+
/* wrapper functions for the underlying EC_GROUP object */
|
| 1087 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
|
| 1088 |
+
|
| 1089 |
+
/** Creates a table of pre-computed multiples of the generator to
|
| 1090 |
+
* accelerate further EC_KEY operations.
|
| 1091 |
+
* \param key EC_KEY object
|
| 1092 |
+
* \param ctx BN_CTX object (optional)
|
| 1093 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1094 |
+
*/
|
| 1095 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
|
| 1096 |
+
|
| 1097 |
+
/** Creates a new ec private (and optional a new public) key.
|
| 1098 |
+
* \param key EC_KEY object
|
| 1099 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1100 |
+
*/
|
| 1101 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
|
| 1102 |
+
|
| 1103 |
+
/** Verifies that a private and/or public key is valid.
|
| 1104 |
+
* \param key the EC_KEY object
|
| 1105 |
+
* \return 1 on success and 0 otherwise.
|
| 1106 |
+
*/
|
| 1107 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
|
| 1108 |
+
|
| 1109 |
+
/** Indicates if an EC_KEY can be used for signing.
|
| 1110 |
+
* \param eckey the EC_KEY object
|
| 1111 |
+
* \return 1 if can can sign and 0 otherwise.
|
| 1112 |
+
*/
|
| 1113 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey);
|
| 1114 |
+
|
| 1115 |
+
/** Sets a public key from affine coordinates performing
|
| 1116 |
+
* necessary NIST PKV tests.
|
| 1117 |
+
* \param key the EC_KEY object
|
| 1118 |
+
* \param x public key x coordinate
|
| 1119 |
+
* \param y public key y coordinate
|
| 1120 |
+
* \return 1 on success and 0 otherwise.
|
| 1121 |
+
*/
|
| 1122 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key,
|
| 1123 |
+
BIGNUM *x,
|
| 1124 |
+
BIGNUM *y);
|
| 1125 |
+
|
| 1126 |
+
/** Encodes an EC_KEY public key to an allocated octet string
|
| 1127 |
+
* \param key key to encode
|
| 1128 |
+
* \param form point conversion form
|
| 1129 |
+
* \param pbuf returns pointer to allocated buffer
|
| 1130 |
+
* \param ctx BN_CTX object (optional)
|
| 1131 |
+
* \return the length of the encoded octet string or 0 if an error occurred
|
| 1132 |
+
*/
|
| 1133 |
+
OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_key2buf(const EC_KEY *key,
|
| 1134 |
+
point_conversion_form_t form,
|
| 1135 |
+
unsigned char **pbuf, BN_CTX *ctx);
|
| 1136 |
+
|
| 1137 |
+
/** Decodes a EC_KEY public key from a octet string
|
| 1138 |
+
* \param key key to decode
|
| 1139 |
+
* \param buf memory buffer with the encoded ec point
|
| 1140 |
+
* \param len length of the encoded ec point
|
| 1141 |
+
* \param ctx BN_CTX object (optional)
|
| 1142 |
+
* \return 1 on success and 0 if an error occurred
|
| 1143 |
+
*/
|
| 1144 |
+
|
| 1145 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf,
|
| 1146 |
+
size_t len, BN_CTX *ctx);
|
| 1147 |
+
|
| 1148 |
+
/** Decodes an EC_KEY private key from an octet string
|
| 1149 |
+
* \param key key to decode
|
| 1150 |
+
* \param buf memory buffer with the encoded private key
|
| 1151 |
+
* \param len length of the encoded key
|
| 1152 |
+
* \return 1 on success and 0 if an error occurred
|
| 1153 |
+
*/
|
| 1154 |
+
|
| 1155 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf,
|
| 1156 |
+
size_t len);
|
| 1157 |
+
|
| 1158 |
+
/** Encodes a EC_KEY private key to an octet string
|
| 1159 |
+
* \param key key to encode
|
| 1160 |
+
* \param buf memory buffer for the result. If NULL the function returns
|
| 1161 |
+
* required buffer size.
|
| 1162 |
+
* \param len length of the memory buffer
|
| 1163 |
+
* \return the length of the encoded octet string or 0 if an error occurred
|
| 1164 |
+
*/
|
| 1165 |
+
|
| 1166 |
+
OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2oct(const EC_KEY *key,
|
| 1167 |
+
unsigned char *buf, size_t len);
|
| 1168 |
+
|
| 1169 |
+
/** Encodes an EC_KEY private key to an allocated octet string
|
| 1170 |
+
* \param eckey key to encode
|
| 1171 |
+
* \param pbuf returns pointer to allocated buffer
|
| 1172 |
+
* \return the length of the encoded octet string or 0 if an error occurred
|
| 1173 |
+
*/
|
| 1174 |
+
OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey,
|
| 1175 |
+
unsigned char **pbuf);
|
| 1176 |
+
|
| 1177 |
+
/********************************************************************/
|
| 1178 |
+
/* de- and encoding functions for SEC1 ECPrivateKey */
|
| 1179 |
+
/********************************************************************/
|
| 1180 |
+
|
| 1181 |
+
/** Decodes a private key from a memory buffer.
|
| 1182 |
+
* \param key a pointer to a EC_KEY object which should be used (or NULL)
|
| 1183 |
+
* \param in pointer to memory with the DER encoded private key
|
| 1184 |
+
* \param len length of the DER encoded private key
|
| 1185 |
+
* \return the decoded private key or NULL if an error occurred.
|
| 1186 |
+
*/
|
| 1187 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
|
| 1188 |
+
const unsigned char **in,
|
| 1189 |
+
long len);
|
| 1190 |
+
|
| 1191 |
+
/** Encodes a private key object and stores the result in a buffer.
|
| 1192 |
+
* \param key the EC_KEY object to encode
|
| 1193 |
+
* \param out the buffer for the result (if NULL the function returns number
|
| 1194 |
+
* of bytes needed).
|
| 1195 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1196 |
+
*/
|
| 1197 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey(const EC_KEY *key,
|
| 1198 |
+
unsigned char **out);
|
| 1199 |
+
|
| 1200 |
+
/********************************************************************/
|
| 1201 |
+
/* de- and encoding functions for EC parameters */
|
| 1202 |
+
/********************************************************************/
|
| 1203 |
+
|
| 1204 |
+
/** Decodes ec parameter from a memory buffer.
|
| 1205 |
+
* \param key a pointer to a EC_KEY object which should be used (or NULL)
|
| 1206 |
+
* \param in pointer to memory with the DER encoded ec parameters
|
| 1207 |
+
* \param len length of the DER encoded ec parameters
|
| 1208 |
+
* \return a EC_KEY object with the decoded parameters or NULL if an error
|
| 1209 |
+
* occurred.
|
| 1210 |
+
*/
|
| 1211 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECParameters(EC_KEY **key,
|
| 1212 |
+
const unsigned char **in,
|
| 1213 |
+
long len);
|
| 1214 |
+
|
| 1215 |
+
/** Encodes ec parameter and stores the result in a buffer.
|
| 1216 |
+
* \param key the EC_KEY object with ec parameters to encode
|
| 1217 |
+
* \param out the buffer for the result (if NULL the function returns number
|
| 1218 |
+
* of bytes needed).
|
| 1219 |
+
* \return 1 on success and 0 if an error occurred.
|
| 1220 |
+
*/
|
| 1221 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECParameters(const EC_KEY *key,
|
| 1222 |
+
unsigned char **out);
|
| 1223 |
+
|
| 1224 |
+
/********************************************************************/
|
| 1225 |
+
/* de- and encoding functions for EC public key */
|
| 1226 |
+
/* (octet string, not DER -- hence 'o2i' and 'i2o') */
|
| 1227 |
+
/********************************************************************/
|
| 1228 |
+
|
| 1229 |
+
/** Decodes an ec public key from a octet string.
|
| 1230 |
+
* \param key a pointer to a EC_KEY object which should be used
|
| 1231 |
+
* \param in memory buffer with the encoded public key
|
| 1232 |
+
* \param len length of the encoded public key
|
| 1233 |
+
* \return EC_KEY object with decoded public key or NULL if an error
|
| 1234 |
+
* occurred.
|
| 1235 |
+
*/
|
| 1236 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key,
|
| 1237 |
+
const unsigned char **in, long len);
|
| 1238 |
+
|
| 1239 |
+
/** Encodes an ec public key in an octet string.
|
| 1240 |
+
* \param key the EC_KEY object with the public key
|
| 1241 |
+
* \param out the buffer for the result (if NULL the function returns number
|
| 1242 |
+
* of bytes needed).
|
| 1243 |
+
* \return 1 on success and 0 if an error occurred
|
| 1244 |
+
*/
|
| 1245 |
+
OSSL_DEPRECATEDIN_3_0 int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);
|
| 1246 |
+
|
| 1247 |
+
/** Prints out the ec parameters on human readable form.
|
| 1248 |
+
* \param bp BIO object to which the information is printed
|
| 1249 |
+
* \param key EC_KEY object
|
| 1250 |
+
* \return 1 on success and 0 if an error occurred
|
| 1251 |
+
*/
|
| 1252 |
+
OSSL_DEPRECATEDIN_3_0 int ECParameters_print(BIO *bp, const EC_KEY *key);
|
| 1253 |
+
|
| 1254 |
+
/** Prints out the contents of a EC_KEY object
|
| 1255 |
+
* \param bp BIO object to which the information is printed
|
| 1256 |
+
* \param key EC_KEY object
|
| 1257 |
+
* \param off line offset
|
| 1258 |
+
* \return 1 on success and 0 if an error occurred
|
| 1259 |
+
*/
|
| 1260 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
|
| 1261 |
+
|
| 1262 |
+
# ifndef OPENSSL_NO_STDIO
|
| 1263 |
+
/** Prints out the ec parameters on human readable form.
|
| 1264 |
+
* \param fp file descriptor to which the information is printed
|
| 1265 |
+
* \param key EC_KEY object
|
| 1266 |
+
* \return 1 on success and 0 if an error occurred
|
| 1267 |
+
*/
|
| 1268 |
+
OSSL_DEPRECATEDIN_3_0 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
|
| 1269 |
+
|
| 1270 |
+
/** Prints out the contents of a EC_KEY object
|
| 1271 |
+
* \param fp file descriptor to which the information is printed
|
| 1272 |
+
* \param key EC_KEY object
|
| 1273 |
+
* \param off line offset
|
| 1274 |
+
* \return 1 on success and 0 if an error occurred
|
| 1275 |
+
*/
|
| 1276 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
|
| 1277 |
+
# endif /* OPENSSL_NO_STDIO */
|
| 1278 |
+
|
| 1279 |
+
OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
|
| 1280 |
+
OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_default_method(void);
|
| 1281 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
|
| 1282 |
+
OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
|
| 1283 |
+
OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
|
| 1284 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_method(ENGINE *engine);
|
| 1285 |
+
|
| 1286 |
+
/** The old name for ecdh_KDF_X9_63
|
| 1287 |
+
* The ECDH KDF specification has been mistakingly attributed to ANSI X9.62,
|
| 1288 |
+
* it is actually specified in ANSI X9.63.
|
| 1289 |
+
* This identifier is retained for backwards compatibility
|
| 1290 |
+
*/
|
| 1291 |
+
OSSL_DEPRECATEDIN_3_0 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
| 1292 |
+
const unsigned char *Z, size_t Zlen,
|
| 1293 |
+
const unsigned char *sinfo,
|
| 1294 |
+
size_t sinfolen, const EVP_MD *md);
|
| 1295 |
+
|
| 1296 |
+
OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
|
| 1297 |
+
const EC_POINT *pub_key,
|
| 1298 |
+
const EC_KEY *ecdh,
|
| 1299 |
+
void *(*KDF)(const void *in,
|
| 1300 |
+
size_t inlen, void *out,
|
| 1301 |
+
size_t *outlen));
|
| 1302 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 1303 |
+
|
| 1304 |
+
typedef struct ECDSA_SIG_st ECDSA_SIG;
|
| 1305 |
+
|
| 1306 |
+
/** Allocates and initialize a ECDSA_SIG structure
|
| 1307 |
+
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
|
| 1308 |
+
*/
|
| 1309 |
+
ECDSA_SIG *ECDSA_SIG_new(void);
|
| 1310 |
+
|
| 1311 |
+
/** frees a ECDSA_SIG structure
|
| 1312 |
+
* \param sig pointer to the ECDSA_SIG structure
|
| 1313 |
+
*/
|
| 1314 |
+
void ECDSA_SIG_free(ECDSA_SIG *sig);
|
| 1315 |
+
|
| 1316 |
+
/** i2d_ECDSA_SIG encodes content of ECDSA_SIG (note: this function modifies *pp
|
| 1317 |
+
* (*pp += length of the DER encoded signature)).
|
| 1318 |
+
* \param sig pointer to the ECDSA_SIG object
|
| 1319 |
+
* \param pp pointer to a unsigned char pointer for the output or NULL
|
| 1320 |
+
* \return the length of the DER encoded ECDSA_SIG object or a negative value
|
| 1321 |
+
* on error
|
| 1322 |
+
*/
|
| 1323 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(ECDSA_SIG, ECDSA_SIG)
|
| 1324 |
+
|
| 1325 |
+
/** d2i_ECDSA_SIG decodes an ECDSA signature (note: this function modifies *pp
|
| 1326 |
+
* (*pp += len)).
|
| 1327 |
+
* \param sig pointer to ECDSA_SIG pointer (may be NULL)
|
| 1328 |
+
* \param pp memory buffer with the DER encoded signature
|
| 1329 |
+
* \param len length of the buffer
|
| 1330 |
+
* \return pointer to the decoded ECDSA_SIG structure (or NULL)
|
| 1331 |
+
*/
|
| 1332 |
+
|
| 1333 |
+
/** Accessor for r and s fields of ECDSA_SIG
|
| 1334 |
+
* \param sig pointer to ECDSA_SIG structure
|
| 1335 |
+
* \param pr pointer to BIGNUM pointer for r (may be NULL)
|
| 1336 |
+
* \param ps pointer to BIGNUM pointer for s (may be NULL)
|
| 1337 |
+
*/
|
| 1338 |
+
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
|
| 1339 |
+
|
| 1340 |
+
/** Accessor for r field of ECDSA_SIG
|
| 1341 |
+
* \param sig pointer to ECDSA_SIG structure
|
| 1342 |
+
*/
|
| 1343 |
+
const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
|
| 1344 |
+
|
| 1345 |
+
/** Accessor for s field of ECDSA_SIG
|
| 1346 |
+
* \param sig pointer to ECDSA_SIG structure
|
| 1347 |
+
*/
|
| 1348 |
+
const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
|
| 1349 |
+
|
| 1350 |
+
/** Setter for r and s fields of ECDSA_SIG
|
| 1351 |
+
* \param sig pointer to ECDSA_SIG structure
|
| 1352 |
+
* \param r pointer to BIGNUM for r
|
| 1353 |
+
* \param s pointer to BIGNUM for s
|
| 1354 |
+
*/
|
| 1355 |
+
int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
|
| 1356 |
+
|
| 1357 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 1358 |
+
/** Computes the ECDSA signature of the given hash value using
|
| 1359 |
+
* the supplied private key and returns the created signature.
|
| 1360 |
+
* \param dgst pointer to the hash value
|
| 1361 |
+
* \param dgst_len length of the hash value
|
| 1362 |
+
* \param eckey EC_KEY object containing a private EC key
|
| 1363 |
+
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
|
| 1364 |
+
*/
|
| 1365 |
+
OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,
|
| 1366 |
+
int dgst_len, EC_KEY *eckey);
|
| 1367 |
+
|
| 1368 |
+
/** Computes ECDSA signature of a given hash value using the supplied
|
| 1369 |
+
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
|
| 1370 |
+
* \param dgst pointer to the hash value to sign
|
| 1371 |
+
* \param dgstlen length of the hash value
|
| 1372 |
+
* \param kinv BIGNUM with a pre-computed inverse k (optional)
|
| 1373 |
+
* \param rp BIGNUM with a pre-computed rp value (optional),
|
| 1374 |
+
* see ECDSA_sign_setup
|
| 1375 |
+
* \param eckey EC_KEY object containing a private EC key
|
| 1376 |
+
* \return pointer to a ECDSA_SIG structure or NULL if an error occurred
|
| 1377 |
+
*/
|
| 1378 |
+
OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst,
|
| 1379 |
+
int dgstlen, const BIGNUM *kinv,
|
| 1380 |
+
const BIGNUM *rp, EC_KEY *eckey);
|
| 1381 |
+
|
| 1382 |
+
/** Verifies that the supplied signature is a valid ECDSA
|
| 1383 |
+
* signature of the supplied hash value using the supplied public key.
|
| 1384 |
+
* \param dgst pointer to the hash value
|
| 1385 |
+
* \param dgst_len length of the hash value
|
| 1386 |
+
* \param sig ECDSA_SIG structure
|
| 1387 |
+
* \param eckey EC_KEY object containing a public EC key
|
| 1388 |
+
* \return 1 if the signature is valid, 0 if the signature is invalid
|
| 1389 |
+
* and -1 on error
|
| 1390 |
+
*/
|
| 1391 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
|
| 1392 |
+
const ECDSA_SIG *sig, EC_KEY *eckey);
|
| 1393 |
+
|
| 1394 |
+
/** Precompute parts of the signing operation
|
| 1395 |
+
* \param eckey EC_KEY object containing a private EC key
|
| 1396 |
+
* \param ctx BN_CTX object (optional)
|
| 1397 |
+
* \param kinv BIGNUM pointer for the inverse of k
|
| 1398 |
+
* \param rp BIGNUM pointer for x coordinate of k * generator
|
| 1399 |
+
* \return 1 on success and 0 otherwise
|
| 1400 |
+
*/
|
| 1401 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
|
| 1402 |
+
BIGNUM **kinv, BIGNUM **rp);
|
| 1403 |
+
|
| 1404 |
+
/** Computes ECDSA signature of a given hash value using the supplied
|
| 1405 |
+
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
|
| 1406 |
+
* \param type this parameter is ignored
|
| 1407 |
+
* \param dgst pointer to the hash value to sign
|
| 1408 |
+
* \param dgstlen length of the hash value
|
| 1409 |
+
* \param sig memory for the DER encoded created signature
|
| 1410 |
+
* \param siglen pointer to the length of the returned signature
|
| 1411 |
+
* \param eckey EC_KEY object containing a private EC key
|
| 1412 |
+
* \return 1 on success and 0 otherwise
|
| 1413 |
+
*/
|
| 1414 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
|
| 1415 |
+
int dgstlen, unsigned char *sig,
|
| 1416 |
+
unsigned int *siglen, EC_KEY *eckey);
|
| 1417 |
+
|
| 1418 |
+
/** Computes ECDSA signature of a given hash value using the supplied
|
| 1419 |
+
* private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
|
| 1420 |
+
* \param type this parameter is ignored
|
| 1421 |
+
* \param dgst pointer to the hash value to sign
|
| 1422 |
+
* \param dgstlen length of the hash value
|
| 1423 |
+
* \param sig buffer to hold the DER encoded signature
|
| 1424 |
+
* \param siglen pointer to the length of the returned signature
|
| 1425 |
+
* \param kinv BIGNUM with a pre-computed inverse k (optional)
|
| 1426 |
+
* \param rp BIGNUM with a pre-computed rp value (optional),
|
| 1427 |
+
* see ECDSA_sign_setup
|
| 1428 |
+
* \param eckey EC_KEY object containing a private EC key
|
| 1429 |
+
* \return 1 on success and 0 otherwise
|
| 1430 |
+
*/
|
| 1431 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_ex(int type, const unsigned char *dgst,
|
| 1432 |
+
int dgstlen, unsigned char *sig,
|
| 1433 |
+
unsigned int *siglen, const BIGNUM *kinv,
|
| 1434 |
+
const BIGNUM *rp, EC_KEY *eckey);
|
| 1435 |
+
|
| 1436 |
+
/** Verifies that the given signature is valid ECDSA signature
|
| 1437 |
+
* of the supplied hash value using the specified public key.
|
| 1438 |
+
* \param type this parameter is ignored
|
| 1439 |
+
* \param dgst pointer to the hash value
|
| 1440 |
+
* \param dgstlen length of the hash value
|
| 1441 |
+
* \param sig pointer to the DER encoded signature
|
| 1442 |
+
* \param siglen length of the DER encoded signature
|
| 1443 |
+
* \param eckey EC_KEY object containing a public EC key
|
| 1444 |
+
* \return 1 if the signature is valid, 0 if the signature is invalid
|
| 1445 |
+
* and -1 on error
|
| 1446 |
+
*/
|
| 1447 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
|
| 1448 |
+
int dgstlen, const unsigned char *sig,
|
| 1449 |
+
int siglen, EC_KEY *eckey);
|
| 1450 |
+
|
| 1451 |
+
/** Returns the maximum length of the DER encoded signature
|
| 1452 |
+
* \param eckey EC_KEY object
|
| 1453 |
+
* \return numbers of bytes required for the DER encoded signature
|
| 1454 |
+
*/
|
| 1455 |
+
OSSL_DEPRECATEDIN_3_0 int ECDSA_size(const EC_KEY *eckey);
|
| 1456 |
+
|
| 1457 |
+
/********************************************************************/
|
| 1458 |
+
/* EC_KEY_METHOD constructors, destructors, writers and accessors */
|
| 1459 |
+
/********************************************************************/
|
| 1460 |
+
|
| 1461 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
|
| 1462 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
|
| 1463 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_init
|
| 1464 |
+
(EC_KEY_METHOD *meth,
|
| 1465 |
+
int (*init)(EC_KEY *key),
|
| 1466 |
+
void (*finish)(EC_KEY *key),
|
| 1467 |
+
int (*copy)(EC_KEY *dest, const EC_KEY *src),
|
| 1468 |
+
int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
|
| 1469 |
+
int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
|
| 1470 |
+
int (*set_public)(EC_KEY *key, const EC_POINT *pub_key));
|
| 1471 |
+
|
| 1472 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
|
| 1473 |
+
int (*keygen)(EC_KEY *key));
|
| 1474 |
+
|
| 1475 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_compute_key
|
| 1476 |
+
(EC_KEY_METHOD *meth,
|
| 1477 |
+
int (*ckey)(unsigned char **psec, size_t *pseclen,
|
| 1478 |
+
const EC_POINT *pub_key, const EC_KEY *ecdh));
|
| 1479 |
+
|
| 1480 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_sign
|
| 1481 |
+
(EC_KEY_METHOD *meth,
|
| 1482 |
+
int (*sign)(int type, const unsigned char *dgst,
|
| 1483 |
+
int dlen, unsigned char *sig,
|
| 1484 |
+
unsigned int *siglen,
|
| 1485 |
+
const BIGNUM *kinv, const BIGNUM *r,
|
| 1486 |
+
EC_KEY *eckey),
|
| 1487 |
+
int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
|
| 1488 |
+
BIGNUM **kinvp, BIGNUM **rp),
|
| 1489 |
+
ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
|
| 1490 |
+
int dgst_len,
|
| 1491 |
+
const BIGNUM *in_kinv,
|
| 1492 |
+
const BIGNUM *in_r,
|
| 1493 |
+
EC_KEY *eckey));
|
| 1494 |
+
|
| 1495 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_verify
|
| 1496 |
+
(EC_KEY_METHOD *meth,
|
| 1497 |
+
int (*verify)(int type, const unsigned
|
| 1498 |
+
char *dgst, int dgst_len,
|
| 1499 |
+
const unsigned char *sigbuf,
|
| 1500 |
+
int sig_len, EC_KEY *eckey),
|
| 1501 |
+
int (*verify_sig)(const unsigned char *dgst,
|
| 1502 |
+
int dgst_len, const ECDSA_SIG *sig,
|
| 1503 |
+
EC_KEY *eckey));
|
| 1504 |
+
|
| 1505 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_init
|
| 1506 |
+
(const EC_KEY_METHOD *meth,
|
| 1507 |
+
int (**pinit)(EC_KEY *key),
|
| 1508 |
+
void (**pfinish)(EC_KEY *key),
|
| 1509 |
+
int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
|
| 1510 |
+
int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
|
| 1511 |
+
int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
|
| 1512 |
+
int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key));
|
| 1513 |
+
|
| 1514 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_keygen
|
| 1515 |
+
(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key));
|
| 1516 |
+
|
| 1517 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_compute_key
|
| 1518 |
+
(const EC_KEY_METHOD *meth,
|
| 1519 |
+
int (**pck)(unsigned char **psec,
|
| 1520 |
+
size_t *pseclen,
|
| 1521 |
+
const EC_POINT *pub_key,
|
| 1522 |
+
const EC_KEY *ecdh));
|
| 1523 |
+
|
| 1524 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_sign
|
| 1525 |
+
(const EC_KEY_METHOD *meth,
|
| 1526 |
+
int (**psign)(int type, const unsigned char *dgst,
|
| 1527 |
+
int dlen, unsigned char *sig,
|
| 1528 |
+
unsigned int *siglen,
|
| 1529 |
+
const BIGNUM *kinv, const BIGNUM *r,
|
| 1530 |
+
EC_KEY *eckey),
|
| 1531 |
+
int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
|
| 1532 |
+
BIGNUM **kinvp, BIGNUM **rp),
|
| 1533 |
+
ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
|
| 1534 |
+
int dgst_len,
|
| 1535 |
+
const BIGNUM *in_kinv,
|
| 1536 |
+
const BIGNUM *in_r,
|
| 1537 |
+
EC_KEY *eckey));
|
| 1538 |
+
|
| 1539 |
+
OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify
|
| 1540 |
+
(const EC_KEY_METHOD *meth,
|
| 1541 |
+
int (**pverify)(int type, const unsigned
|
| 1542 |
+
char *dgst, int dgst_len,
|
| 1543 |
+
const unsigned char *sigbuf,
|
| 1544 |
+
int sig_len, EC_KEY *eckey),
|
| 1545 |
+
int (**pverify_sig)(const unsigned char *dgst,
|
| 1546 |
+
int dgst_len,
|
| 1547 |
+
const ECDSA_SIG *sig,
|
| 1548 |
+
EC_KEY *eckey));
|
| 1549 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 1550 |
+
|
| 1551 |
+
# define EVP_EC_gen(curve) \
|
| 1552 |
+
EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, "")))
|
| 1553 |
+
/* strstr is used to enable type checking for the variadic string arg */
|
| 1554 |
+
# define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \
|
| 1555 |
+
d2i_ECParameters, x)
|
| 1556 |
+
|
| 1557 |
+
# ifndef __cplusplus
|
| 1558 |
+
# if defined(__SUNPRO_C)
|
| 1559 |
+
# if __SUNPRO_C >= 0x520
|
| 1560 |
+
# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
|
| 1561 |
+
# endif
|
| 1562 |
+
# endif
|
| 1563 |
+
# endif
|
| 1564 |
+
|
| 1565 |
+
# endif
|
| 1566 |
+
# ifdef __cplusplus
|
| 1567 |
+
}
|
| 1568 |
+
# endif
|
| 1569 |
+
#endif
|
llava_next/include/openssl/fips_names.h
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_FIPS_NAMES_H
|
| 11 |
+
# define OPENSSL_FIPS_NAMES_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
# endif
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* Parameter names that the FIPS Provider defines
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/*
|
| 23 |
+
* The calculated MAC of the module file (Used for FIPS Self Testing)
|
| 24 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 25 |
+
*/
|
| 26 |
+
# define OSSL_PROV_FIPS_PARAM_MODULE_MAC "module-mac"
|
| 27 |
+
/*
|
| 28 |
+
* A version number for the fips install process (Used for FIPS Self Testing)
|
| 29 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 30 |
+
*/
|
| 31 |
+
# define OSSL_PROV_FIPS_PARAM_INSTALL_VERSION "install-version"
|
| 32 |
+
/*
|
| 33 |
+
* The calculated MAC of the install status indicator (Used for FIPS Self Testing)
|
| 34 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 35 |
+
*/
|
| 36 |
+
# define OSSL_PROV_FIPS_PARAM_INSTALL_MAC "install-mac"
|
| 37 |
+
/*
|
| 38 |
+
* The install status indicator (Used for FIPS Self Testing)
|
| 39 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 40 |
+
*/
|
| 41 |
+
# define OSSL_PROV_FIPS_PARAM_INSTALL_STATUS "install-status"
|
| 42 |
+
|
| 43 |
+
/*
|
| 44 |
+
* A boolean that determines if the FIPS conditional test errors result in
|
| 45 |
+
* the module entering an error state.
|
| 46 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 47 |
+
*/
|
| 48 |
+
# define OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS "conditional-errors"
|
| 49 |
+
|
| 50 |
+
/*
|
| 51 |
+
* A boolean that determines if the runtime FIPS security checks are performed.
|
| 52 |
+
* Type: OSSL_PARAM_UTF8_STRING
|
| 53 |
+
*/
|
| 54 |
+
# define OSSL_PROV_FIPS_PARAM_SECURITY_CHECKS "security-checks"
|
| 55 |
+
|
| 56 |
+
# ifdef __cplusplus
|
| 57 |
+
}
|
| 58 |
+
# endif
|
| 59 |
+
|
| 60 |
+
#endif /* OPENSSL_FIPS_NAMES_H */
|
llava_next/include/openssl/idea.h
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_IDEA_H
|
| 11 |
+
# define OPENSSL_IDEA_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_IDEA_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_IDEA
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
# define IDEA_BLOCK 8
|
| 27 |
+
# define IDEA_KEY_LENGTH 16
|
| 28 |
+
|
| 29 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 30 |
+
|
| 31 |
+
typedef unsigned int IDEA_INT;
|
| 32 |
+
|
| 33 |
+
# define IDEA_ENCRYPT 1
|
| 34 |
+
# define IDEA_DECRYPT 0
|
| 35 |
+
|
| 36 |
+
typedef struct idea_key_st {
|
| 37 |
+
IDEA_INT data[9][6];
|
| 38 |
+
} IDEA_KEY_SCHEDULE;
|
| 39 |
+
#endif
|
| 40 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 41 |
+
OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void);
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in,
|
| 43 |
+
unsigned char *out,
|
| 44 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key,
|
| 46 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 47 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
|
| 48 |
+
IDEA_KEY_SCHEDULE *dk);
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in,
|
| 50 |
+
unsigned char *out, long length,
|
| 51 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 52 |
+
unsigned char *iv, int enc);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in,
|
| 54 |
+
unsigned char *out, long length,
|
| 55 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 56 |
+
unsigned char *iv, int *num,
|
| 57 |
+
int enc);
|
| 58 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in,
|
| 59 |
+
unsigned char *out, long length,
|
| 60 |
+
IDEA_KEY_SCHEDULE *ks,
|
| 61 |
+
unsigned char *iv, int *num);
|
| 62 |
+
OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in,
|
| 63 |
+
IDEA_KEY_SCHEDULE *ks);
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 67 |
+
# define idea_options IDEA_options
|
| 68 |
+
# define idea_ecb_encrypt IDEA_ecb_encrypt
|
| 69 |
+
# define idea_set_encrypt_key IDEA_set_encrypt_key
|
| 70 |
+
# define idea_set_decrypt_key IDEA_set_decrypt_key
|
| 71 |
+
# define idea_cbc_encrypt IDEA_cbc_encrypt
|
| 72 |
+
# define idea_cfb64_encrypt IDEA_cfb64_encrypt
|
| 73 |
+
# define idea_ofb64_encrypt IDEA_ofb64_encrypt
|
| 74 |
+
# define idea_encrypt IDEA_encrypt
|
| 75 |
+
# endif
|
| 76 |
+
|
| 77 |
+
# ifdef __cplusplus
|
| 78 |
+
}
|
| 79 |
+
# endif
|
| 80 |
+
# endif
|
| 81 |
+
|
| 82 |
+
#endif
|
llava_next/include/openssl/kdf.h
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2016-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_KDF_H
|
| 11 |
+
# define OPENSSL_KDF_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_KDF_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <stdarg.h>
|
| 20 |
+
# include <stddef.h>
|
| 21 |
+
# include <openssl/types.h>
|
| 22 |
+
# include <openssl/core.h>
|
| 23 |
+
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
int EVP_KDF_up_ref(EVP_KDF *kdf);
|
| 29 |
+
void EVP_KDF_free(EVP_KDF *kdf);
|
| 30 |
+
EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
|
| 31 |
+
const char *properties);
|
| 32 |
+
|
| 33 |
+
EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf);
|
| 34 |
+
void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
|
| 35 |
+
EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src);
|
| 36 |
+
const char *EVP_KDF_get0_description(const EVP_KDF *kdf);
|
| 37 |
+
int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name);
|
| 38 |
+
const char *EVP_KDF_get0_name(const EVP_KDF *kdf);
|
| 39 |
+
const OSSL_PROVIDER *EVP_KDF_get0_provider(const EVP_KDF *kdf);
|
| 40 |
+
const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx);
|
| 41 |
+
|
| 42 |
+
void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx);
|
| 43 |
+
size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx);
|
| 44 |
+
int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen,
|
| 45 |
+
const OSSL_PARAM params[]);
|
| 46 |
+
int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
|
| 47 |
+
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
|
| 48 |
+
int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
|
| 49 |
+
const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
|
| 50 |
+
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
|
| 51 |
+
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
|
| 52 |
+
const OSSL_PARAM *EVP_KDF_CTX_gettable_params(EVP_KDF_CTX *ctx);
|
| 53 |
+
const OSSL_PARAM *EVP_KDF_CTX_settable_params(EVP_KDF_CTX *ctx);
|
| 54 |
+
|
| 55 |
+
void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,
|
| 56 |
+
void (*fn)(EVP_KDF *kdf, void *arg),
|
| 57 |
+
void *arg);
|
| 58 |
+
int EVP_KDF_names_do_all(const EVP_KDF *kdf,
|
| 59 |
+
void (*fn)(const char *name, void *data),
|
| 60 |
+
void *data);
|
| 61 |
+
|
| 62 |
+
# define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND 0
|
| 63 |
+
# define EVP_KDF_HKDF_MODE_EXTRACT_ONLY 1
|
| 64 |
+
# define EVP_KDF_HKDF_MODE_EXPAND_ONLY 2
|
| 65 |
+
|
| 66 |
+
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65
|
| 67 |
+
#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66
|
| 68 |
+
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 67
|
| 69 |
+
#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI 68
|
| 70 |
+
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 69
|
| 71 |
+
#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 70
|
| 72 |
+
|
| 73 |
+
/**** The legacy PKEY-based KDF API follows. ****/
|
| 74 |
+
|
| 75 |
+
# define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
|
| 76 |
+
# define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
|
| 77 |
+
# define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
|
| 78 |
+
# define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
|
| 79 |
+
# define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
|
| 80 |
+
# define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
|
| 81 |
+
# define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
|
| 82 |
+
# define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7)
|
| 83 |
+
# define EVP_PKEY_CTRL_PASS (EVP_PKEY_ALG_CTRL + 8)
|
| 84 |
+
# define EVP_PKEY_CTRL_SCRYPT_SALT (EVP_PKEY_ALG_CTRL + 9)
|
| 85 |
+
# define EVP_PKEY_CTRL_SCRYPT_N (EVP_PKEY_ALG_CTRL + 10)
|
| 86 |
+
# define EVP_PKEY_CTRL_SCRYPT_R (EVP_PKEY_ALG_CTRL + 11)
|
| 87 |
+
# define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12)
|
| 88 |
+
# define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13)
|
| 89 |
+
|
| 90 |
+
# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND \
|
| 91 |
+
EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND
|
| 92 |
+
# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY \
|
| 93 |
+
EVP_KDF_HKDF_MODE_EXTRACT_ONLY
|
| 94 |
+
# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY \
|
| 95 |
+
EVP_KDF_HKDF_MODE_EXPAND_ONLY
|
| 96 |
+
|
| 97 |
+
int EVP_PKEY_CTX_set_tls1_prf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 98 |
+
|
| 99 |
+
int EVP_PKEY_CTX_set1_tls1_prf_secret(EVP_PKEY_CTX *pctx,
|
| 100 |
+
const unsigned char *sec, int seclen);
|
| 101 |
+
|
| 102 |
+
int EVP_PKEY_CTX_add1_tls1_prf_seed(EVP_PKEY_CTX *pctx,
|
| 103 |
+
const unsigned char *seed, int seedlen);
|
| 104 |
+
|
| 105 |
+
int EVP_PKEY_CTX_set_hkdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 106 |
+
|
| 107 |
+
int EVP_PKEY_CTX_set1_hkdf_salt(EVP_PKEY_CTX *ctx,
|
| 108 |
+
const unsigned char *salt, int saltlen);
|
| 109 |
+
|
| 110 |
+
int EVP_PKEY_CTX_set1_hkdf_key(EVP_PKEY_CTX *ctx,
|
| 111 |
+
const unsigned char *key, int keylen);
|
| 112 |
+
|
| 113 |
+
int EVP_PKEY_CTX_add1_hkdf_info(EVP_PKEY_CTX *ctx,
|
| 114 |
+
const unsigned char *info, int infolen);
|
| 115 |
+
|
| 116 |
+
int EVP_PKEY_CTX_set_hkdf_mode(EVP_PKEY_CTX *ctx, int mode);
|
| 117 |
+
# define EVP_PKEY_CTX_hkdf_mode EVP_PKEY_CTX_set_hkdf_mode
|
| 118 |
+
|
| 119 |
+
int EVP_PKEY_CTX_set1_pbe_pass(EVP_PKEY_CTX *ctx, const char *pass,
|
| 120 |
+
int passlen);
|
| 121 |
+
|
| 122 |
+
int EVP_PKEY_CTX_set1_scrypt_salt(EVP_PKEY_CTX *ctx,
|
| 123 |
+
const unsigned char *salt, int saltlen);
|
| 124 |
+
|
| 125 |
+
int EVP_PKEY_CTX_set_scrypt_N(EVP_PKEY_CTX *ctx, uint64_t n);
|
| 126 |
+
|
| 127 |
+
int EVP_PKEY_CTX_set_scrypt_r(EVP_PKEY_CTX *ctx, uint64_t r);
|
| 128 |
+
|
| 129 |
+
int EVP_PKEY_CTX_set_scrypt_p(EVP_PKEY_CTX *ctx, uint64_t p);
|
| 130 |
+
|
| 131 |
+
int EVP_PKEY_CTX_set_scrypt_maxmem_bytes(EVP_PKEY_CTX *ctx,
|
| 132 |
+
uint64_t maxmem_bytes);
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
# ifdef __cplusplus
|
| 136 |
+
}
|
| 137 |
+
# endif
|
| 138 |
+
#endif
|
llava_next/include/openssl/lhash.h
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 11 |
+
|
| 12 |
+
/*
|
| 13 |
+
* Header for dynamic hash table routines Author - Eric Young
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef OPENSSL_LHASH_H
|
| 17 |
+
# define OPENSSL_LHASH_H
|
| 18 |
+
# pragma once
|
| 19 |
+
|
| 20 |
+
# include <openssl/macros.h>
|
| 21 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
# define HEADER_LHASH_H
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/bio.h>
|
| 27 |
+
|
| 28 |
+
#ifdef __cplusplus
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
typedef struct lhash_node_st OPENSSL_LH_NODE;
|
| 33 |
+
typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
|
| 34 |
+
typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
|
| 35 |
+
typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
|
| 36 |
+
typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
|
| 37 |
+
typedef struct lhash_st OPENSSL_LHASH;
|
| 38 |
+
|
| 39 |
+
/*
|
| 40 |
+
* Macros for declaring and implementing type-safe wrappers for LHASH
|
| 41 |
+
* callbacks. This way, callbacks can be provided to LHASH structures without
|
| 42 |
+
* function pointer casting and the macro-defined callbacks provide
|
| 43 |
+
* per-variable casting before deferring to the underlying type-specific
|
| 44 |
+
* callbacks. NB: It is possible to place a "static" in front of both the
|
| 45 |
+
* DECLARE and IMPLEMENT macros if the functions are strictly internal.
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
/* First: "hash" functions */
|
| 49 |
+
# define DECLARE_LHASH_HASH_FN(name, o_type) \
|
| 50 |
+
unsigned long name##_LHASH_HASH(const void *);
|
| 51 |
+
# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
|
| 52 |
+
unsigned long name##_LHASH_HASH(const void *arg) { \
|
| 53 |
+
const o_type *a = arg; \
|
| 54 |
+
return name##_hash(a); }
|
| 55 |
+
# define LHASH_HASH_FN(name) name##_LHASH_HASH
|
| 56 |
+
|
| 57 |
+
/* Second: "compare" functions */
|
| 58 |
+
# define DECLARE_LHASH_COMP_FN(name, o_type) \
|
| 59 |
+
int name##_LHASH_COMP(const void *, const void *);
|
| 60 |
+
# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
|
| 61 |
+
int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
|
| 62 |
+
const o_type *a = arg1; \
|
| 63 |
+
const o_type *b = arg2; \
|
| 64 |
+
return name##_cmp(a,b); }
|
| 65 |
+
# define LHASH_COMP_FN(name) name##_LHASH_COMP
|
| 66 |
+
|
| 67 |
+
/* Fourth: "doall_arg" functions */
|
| 68 |
+
# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 69 |
+
void name##_LHASH_DOALL_ARG(void *, void *);
|
| 70 |
+
# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 71 |
+
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
|
| 72 |
+
o_type *a = arg1; \
|
| 73 |
+
a_type *b = arg2; \
|
| 74 |
+
name##_doall_arg(a, b); }
|
| 75 |
+
# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
# define LH_LOAD_MULT 256
|
| 79 |
+
|
| 80 |
+
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
| 81 |
+
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
| 82 |
+
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
| 83 |
+
void OPENSSL_LH_flush(OPENSSL_LHASH *lh);
|
| 84 |
+
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
| 85 |
+
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
| 86 |
+
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
| 87 |
+
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
|
| 88 |
+
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg);
|
| 89 |
+
unsigned long OPENSSL_LH_strhash(const char *c);
|
| 90 |
+
unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
|
| 91 |
+
unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
|
| 92 |
+
void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
|
| 93 |
+
|
| 94 |
+
# ifndef OPENSSL_NO_STDIO
|
| 95 |
+
void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 96 |
+
void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 97 |
+
void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 98 |
+
# endif
|
| 99 |
+
void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 100 |
+
void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 101 |
+
void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 102 |
+
|
| 103 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 104 |
+
# define _LHASH OPENSSL_LHASH
|
| 105 |
+
# define LHASH_NODE OPENSSL_LH_NODE
|
| 106 |
+
# define lh_error OPENSSL_LH_error
|
| 107 |
+
# define lh_new OPENSSL_LH_new
|
| 108 |
+
# define lh_free OPENSSL_LH_free
|
| 109 |
+
# define lh_insert OPENSSL_LH_insert
|
| 110 |
+
# define lh_delete OPENSSL_LH_delete
|
| 111 |
+
# define lh_retrieve OPENSSL_LH_retrieve
|
| 112 |
+
# define lh_doall OPENSSL_LH_doall
|
| 113 |
+
# define lh_doall_arg OPENSSL_LH_doall_arg
|
| 114 |
+
# define lh_strhash OPENSSL_LH_strhash
|
| 115 |
+
# define lh_num_items OPENSSL_LH_num_items
|
| 116 |
+
# ifndef OPENSSL_NO_STDIO
|
| 117 |
+
# define lh_stats OPENSSL_LH_stats
|
| 118 |
+
# define lh_node_stats OPENSSL_LH_node_stats
|
| 119 |
+
# define lh_node_usage_stats OPENSSL_LH_node_usage_stats
|
| 120 |
+
# endif
|
| 121 |
+
# define lh_stats_bio OPENSSL_LH_stats_bio
|
| 122 |
+
# define lh_node_stats_bio OPENSSL_LH_node_stats_bio
|
| 123 |
+
# define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
|
| 124 |
+
# endif
|
| 125 |
+
|
| 126 |
+
/* Type checking... */
|
| 127 |
+
|
| 128 |
+
# define LHASH_OF(type) struct lhash_st_##type
|
| 129 |
+
|
| 130 |
+
/* Helper macro for internal use */
|
| 131 |
+
# define DEFINE_LHASH_OF_INTERNAL(type) \
|
| 132 |
+
LHASH_OF(type) { union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; }; \
|
| 133 |
+
typedef int (*lh_##type##_compfunc)(const type *a, const type *b); \
|
| 134 |
+
typedef unsigned long (*lh_##type##_hashfunc)(const type *a); \
|
| 135 |
+
typedef void (*lh_##type##_doallfunc)(type *a); \
|
| 136 |
+
static ossl_unused ossl_inline type *ossl_check_##type##_lh_plain_type(type *ptr) \
|
| 137 |
+
{ \
|
| 138 |
+
return ptr; \
|
| 139 |
+
} \
|
| 140 |
+
static ossl_unused ossl_inline const type *ossl_check_const_##type##_lh_plain_type(const type *ptr) \
|
| 141 |
+
{ \
|
| 142 |
+
return ptr; \
|
| 143 |
+
} \
|
| 144 |
+
static ossl_unused ossl_inline const OPENSSL_LHASH *ossl_check_const_##type##_lh_type(const LHASH_OF(type) *lh) \
|
| 145 |
+
{ \
|
| 146 |
+
return (const OPENSSL_LHASH *)lh; \
|
| 147 |
+
} \
|
| 148 |
+
static ossl_unused ossl_inline OPENSSL_LHASH *ossl_check_##type##_lh_type(LHASH_OF(type) *lh) \
|
| 149 |
+
{ \
|
| 150 |
+
return (OPENSSL_LHASH *)lh; \
|
| 151 |
+
} \
|
| 152 |
+
static ossl_unused ossl_inline OPENSSL_LH_COMPFUNC ossl_check_##type##_lh_compfunc_type(lh_##type##_compfunc cmp) \
|
| 153 |
+
{ \
|
| 154 |
+
return (OPENSSL_LH_COMPFUNC)cmp; \
|
| 155 |
+
} \
|
| 156 |
+
static ossl_unused ossl_inline OPENSSL_LH_HASHFUNC ossl_check_##type##_lh_hashfunc_type(lh_##type##_hashfunc hfn) \
|
| 157 |
+
{ \
|
| 158 |
+
return (OPENSSL_LH_HASHFUNC)hfn; \
|
| 159 |
+
} \
|
| 160 |
+
static ossl_unused ossl_inline OPENSSL_LH_DOALL_FUNC ossl_check_##type##_lh_doallfunc_type(lh_##type##_doallfunc dfn) \
|
| 161 |
+
{ \
|
| 162 |
+
return (OPENSSL_LH_DOALL_FUNC)dfn; \
|
| 163 |
+
} \
|
| 164 |
+
LHASH_OF(type)
|
| 165 |
+
|
| 166 |
+
# define DEFINE_LHASH_OF(type) \
|
| 167 |
+
LHASH_OF(type) { union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; }; \
|
| 168 |
+
static ossl_unused ossl_inline LHASH_OF(type) *lh_##type##_new(unsigned long (*hfn)(const type *), \
|
| 169 |
+
int (*cfn)(const type *, const type *)) \
|
| 170 |
+
{ \
|
| 171 |
+
return (LHASH_OF(type) *) \
|
| 172 |
+
OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
|
| 173 |
+
} \
|
| 174 |
+
static ossl_unused ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \
|
| 175 |
+
{ \
|
| 176 |
+
OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
|
| 177 |
+
} \
|
| 178 |
+
static ossl_unused ossl_inline void lh_##type##_flush(LHASH_OF(type) *lh) \
|
| 179 |
+
{ \
|
| 180 |
+
OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
|
| 181 |
+
} \
|
| 182 |
+
static ossl_unused ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
| 183 |
+
{ \
|
| 184 |
+
return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
|
| 185 |
+
} \
|
| 186 |
+
static ossl_unused ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
| 187 |
+
{ \
|
| 188 |
+
return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
|
| 189 |
+
} \
|
| 190 |
+
static ossl_unused ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
| 191 |
+
{ \
|
| 192 |
+
return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
|
| 193 |
+
} \
|
| 194 |
+
static ossl_unused ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \
|
| 195 |
+
{ \
|
| 196 |
+
return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
|
| 197 |
+
} \
|
| 198 |
+
static ossl_unused ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \
|
| 199 |
+
{ \
|
| 200 |
+
return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
|
| 201 |
+
} \
|
| 202 |
+
static ossl_unused ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 203 |
+
{ \
|
| 204 |
+
OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 205 |
+
} \
|
| 206 |
+
static ossl_unused ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 207 |
+
{ \
|
| 208 |
+
OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 209 |
+
} \
|
| 210 |
+
static ossl_unused ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 211 |
+
{ \
|
| 212 |
+
OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 213 |
+
} \
|
| 214 |
+
static ossl_unused ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
| 215 |
+
{ \
|
| 216 |
+
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
|
| 217 |
+
} \
|
| 218 |
+
static ossl_unused ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
| 219 |
+
{ \
|
| 220 |
+
OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
|
| 221 |
+
} \
|
| 222 |
+
static ossl_unused ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \
|
| 223 |
+
void (*doall)(type *)) \
|
| 224 |
+
{ \
|
| 225 |
+
OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
|
| 226 |
+
} \
|
| 227 |
+
static ossl_unused ossl_inline void lh_##type##_doall_arg(LHASH_OF(type) *lh, \
|
| 228 |
+
void (*doallarg)(type *, void *), \
|
| 229 |
+
void *arg) \
|
| 230 |
+
{ \
|
| 231 |
+
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
|
| 232 |
+
(OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
|
| 233 |
+
} \
|
| 234 |
+
LHASH_OF(type)
|
| 235 |
+
|
| 236 |
+
#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
|
| 237 |
+
int_implement_lhash_doall(type, argtype, const type)
|
| 238 |
+
|
| 239 |
+
#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
|
| 240 |
+
int_implement_lhash_doall(type, argtype, type)
|
| 241 |
+
|
| 242 |
+
#define int_implement_lhash_doall(type, argtype, cbargtype) \
|
| 243 |
+
static ossl_unused ossl_inline void \
|
| 244 |
+
lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
|
| 245 |
+
void (*fn)(cbargtype *, argtype *), \
|
| 246 |
+
argtype *arg) \
|
| 247 |
+
{ \
|
| 248 |
+
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
|
| 249 |
+
} \
|
| 250 |
+
LHASH_OF(type)
|
| 251 |
+
|
| 252 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_STRING);
|
| 253 |
+
#define lh_OPENSSL_STRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_STRING) *)OPENSSL_LH_new(ossl_check_OPENSSL_STRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_STRING_lh_compfunc_type(cmp)))
|
| 254 |
+
#define lh_OPENSSL_STRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 255 |
+
#define lh_OPENSSL_STRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 256 |
+
#define lh_OPENSSL_STRING_insert(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 257 |
+
#define lh_OPENSSL_STRING_delete(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 258 |
+
#define lh_OPENSSL_STRING_retrieve(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 259 |
+
#define lh_OPENSSL_STRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 260 |
+
#define lh_OPENSSL_STRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 261 |
+
#define lh_OPENSSL_STRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 262 |
+
#define lh_OPENSSL_STRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 263 |
+
#define lh_OPENSSL_STRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 264 |
+
#define lh_OPENSSL_STRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 265 |
+
#define lh_OPENSSL_STRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_STRING_lh_type(lh), dl)
|
| 266 |
+
#define lh_OPENSSL_STRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_doallfunc_type(dfn))
|
| 267 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_CSTRING);
|
| 268 |
+
#define lh_OPENSSL_CSTRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_CSTRING) *)OPENSSL_LH_new(ossl_check_OPENSSL_CSTRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_CSTRING_lh_compfunc_type(cmp)))
|
| 269 |
+
#define lh_OPENSSL_CSTRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 270 |
+
#define lh_OPENSSL_CSTRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 271 |
+
#define lh_OPENSSL_CSTRING_insert(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 272 |
+
#define lh_OPENSSL_CSTRING_delete(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 273 |
+
#define lh_OPENSSL_CSTRING_retrieve(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 274 |
+
#define lh_OPENSSL_CSTRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 275 |
+
#define lh_OPENSSL_CSTRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 276 |
+
#define lh_OPENSSL_CSTRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 277 |
+
#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 278 |
+
#define lh_OPENSSL_CSTRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 279 |
+
#define lh_OPENSSL_CSTRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 280 |
+
#define lh_OPENSSL_CSTRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh), dl)
|
| 281 |
+
#define lh_OPENSSL_CSTRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_doallfunc_type(dfn))
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
#ifdef __cplusplus
|
| 285 |
+
}
|
| 286 |
+
#endif
|
| 287 |
+
|
| 288 |
+
#endif
|
llava_next/include/openssl/md5.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MD5_H
|
| 11 |
+
# define OPENSSL_MD5_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_MD5_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_MD5
|
| 22 |
+
# include <openssl/e_os2.h>
|
| 23 |
+
# include <stddef.h>
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# define MD5_DIGEST_LENGTH 16
|
| 29 |
+
|
| 30 |
+
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
/*
|
| 32 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 33 |
+
* ! MD5_LONG has to be at least 32 bits wide. !
|
| 34 |
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
| 35 |
+
*/
|
| 36 |
+
# define MD5_LONG unsigned int
|
| 37 |
+
|
| 38 |
+
# define MD5_CBLOCK 64
|
| 39 |
+
# define MD5_LBLOCK (MD5_CBLOCK/4)
|
| 40 |
+
|
| 41 |
+
typedef struct MD5state_st {
|
| 42 |
+
MD5_LONG A, B, C, D;
|
| 43 |
+
MD5_LONG Nl, Nh;
|
| 44 |
+
MD5_LONG data[MD5_LBLOCK];
|
| 45 |
+
unsigned int num;
|
| 46 |
+
} MD5_CTX;
|
| 47 |
+
# endif
|
| 48 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 49 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
|
| 51 |
+
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
|
| 53 |
+
unsigned char *md);
|
| 54 |
+
OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
|
| 55 |
+
# endif
|
| 56 |
+
|
| 57 |
+
# ifdef __cplusplus
|
| 58 |
+
}
|
| 59 |
+
# endif
|
| 60 |
+
# endif
|
| 61 |
+
|
| 62 |
+
#endif
|
llava_next/include/openssl/mdc2.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MDC2_H
|
| 11 |
+
# define OPENSSL_MDC2_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_MDC2_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_MDC2
|
| 22 |
+
# include <stdlib.h>
|
| 23 |
+
# include <openssl/des.h>
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# define MDC2_DIGEST_LENGTH 16
|
| 29 |
+
|
| 30 |
+
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
|
| 32 |
+
# define MDC2_BLOCK 8
|
| 33 |
+
|
| 34 |
+
typedef struct mdc2_ctx_st {
|
| 35 |
+
unsigned int num;
|
| 36 |
+
unsigned char data[MDC2_BLOCK];
|
| 37 |
+
DES_cblock h, hh;
|
| 38 |
+
unsigned int pad_type; /* either 1 or 2, default 1 */
|
| 39 |
+
} MDC2_CTX;
|
| 40 |
+
# endif
|
| 41 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 42 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Init(MDC2_CTX *c);
|
| 43 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
|
| 44 |
+
size_t len);
|
| 45 |
+
OSSL_DEPRECATEDIN_3_0 int MDC2_Final(unsigned char *md, MDC2_CTX *c);
|
| 46 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *MDC2(const unsigned char *d, size_t n,
|
| 47 |
+
unsigned char *md);
|
| 48 |
+
# endif
|
| 49 |
+
|
| 50 |
+
# ifdef __cplusplus
|
| 51 |
+
}
|
| 52 |
+
# endif
|
| 53 |
+
# endif
|
| 54 |
+
|
| 55 |
+
#endif
|
llava_next/include/openssl/modes.h
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_MODES_H
|
| 11 |
+
# define OPENSSL_MODES_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_MODES_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <stddef.h>
|
| 20 |
+
# include <openssl/types.h>
|
| 21 |
+
|
| 22 |
+
# ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
# endif
|
| 25 |
+
typedef void (*block128_f) (const unsigned char in[16],
|
| 26 |
+
unsigned char out[16], const void *key);
|
| 27 |
+
|
| 28 |
+
typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
|
| 29 |
+
size_t len, const void *key,
|
| 30 |
+
unsigned char ivec[16], int enc);
|
| 31 |
+
|
| 32 |
+
typedef void (*ecb128_f) (const unsigned char *in, unsigned char *out,
|
| 33 |
+
size_t len, const void *key,
|
| 34 |
+
int enc);
|
| 35 |
+
|
| 36 |
+
typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
|
| 37 |
+
size_t blocks, const void *key,
|
| 38 |
+
const unsigned char ivec[16]);
|
| 39 |
+
|
| 40 |
+
typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
|
| 41 |
+
size_t blocks, const void *key,
|
| 42 |
+
const unsigned char ivec[16],
|
| 43 |
+
unsigned char cmac[16]);
|
| 44 |
+
|
| 45 |
+
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
|
| 46 |
+
size_t len, const void *key,
|
| 47 |
+
unsigned char ivec[16], block128_f block);
|
| 48 |
+
void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
|
| 49 |
+
size_t len, const void *key,
|
| 50 |
+
unsigned char ivec[16], block128_f block);
|
| 51 |
+
|
| 52 |
+
void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
| 53 |
+
size_t len, const void *key,
|
| 54 |
+
unsigned char ivec[16],
|
| 55 |
+
unsigned char ecount_buf[16], unsigned int *num,
|
| 56 |
+
block128_f block);
|
| 57 |
+
|
| 58 |
+
void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
|
| 59 |
+
size_t len, const void *key,
|
| 60 |
+
unsigned char ivec[16],
|
| 61 |
+
unsigned char ecount_buf[16],
|
| 62 |
+
unsigned int *num, ctr128_f ctr);
|
| 63 |
+
|
| 64 |
+
void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 65 |
+
size_t len, const void *key,
|
| 66 |
+
unsigned char ivec[16], int *num,
|
| 67 |
+
block128_f block);
|
| 68 |
+
|
| 69 |
+
void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
| 70 |
+
size_t len, const void *key,
|
| 71 |
+
unsigned char ivec[16], int *num,
|
| 72 |
+
int enc, block128_f block);
|
| 73 |
+
void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
|
| 74 |
+
size_t length, const void *key,
|
| 75 |
+
unsigned char ivec[16], int *num,
|
| 76 |
+
int enc, block128_f block);
|
| 77 |
+
void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
|
| 78 |
+
size_t bits, const void *key,
|
| 79 |
+
unsigned char ivec[16], int *num,
|
| 80 |
+
int enc, block128_f block);
|
| 81 |
+
|
| 82 |
+
size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
|
| 83 |
+
unsigned char *out, size_t len,
|
| 84 |
+
const void *key, unsigned char ivec[16],
|
| 85 |
+
block128_f block);
|
| 86 |
+
size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
|
| 87 |
+
size_t len, const void *key,
|
| 88 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 89 |
+
size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
|
| 90 |
+
unsigned char *out, size_t len,
|
| 91 |
+
const void *key, unsigned char ivec[16],
|
| 92 |
+
block128_f block);
|
| 93 |
+
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
|
| 94 |
+
size_t len, const void *key,
|
| 95 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 96 |
+
|
| 97 |
+
size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
|
| 98 |
+
unsigned char *out, size_t len,
|
| 99 |
+
const void *key,
|
| 100 |
+
unsigned char ivec[16],
|
| 101 |
+
block128_f block);
|
| 102 |
+
size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
|
| 103 |
+
size_t len, const void *key,
|
| 104 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 105 |
+
size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
|
| 106 |
+
unsigned char *out, size_t len,
|
| 107 |
+
const void *key,
|
| 108 |
+
unsigned char ivec[16],
|
| 109 |
+
block128_f block);
|
| 110 |
+
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
|
| 111 |
+
size_t len, const void *key,
|
| 112 |
+
unsigned char ivec[16], cbc128_f cbc);
|
| 113 |
+
|
| 114 |
+
typedef struct gcm128_context GCM128_CONTEXT;
|
| 115 |
+
|
| 116 |
+
GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
|
| 117 |
+
void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
|
| 118 |
+
void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
|
| 119 |
+
size_t len);
|
| 120 |
+
int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
|
| 121 |
+
size_t len);
|
| 122 |
+
int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
|
| 123 |
+
const unsigned char *in, unsigned char *out,
|
| 124 |
+
size_t len);
|
| 125 |
+
int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
|
| 126 |
+
const unsigned char *in, unsigned char *out,
|
| 127 |
+
size_t len);
|
| 128 |
+
int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
|
| 129 |
+
const unsigned char *in, unsigned char *out,
|
| 130 |
+
size_t len, ctr128_f stream);
|
| 131 |
+
int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
|
| 132 |
+
const unsigned char *in, unsigned char *out,
|
| 133 |
+
size_t len, ctr128_f stream);
|
| 134 |
+
int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
|
| 135 |
+
size_t len);
|
| 136 |
+
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 137 |
+
void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
|
| 138 |
+
|
| 139 |
+
typedef struct ccm128_context CCM128_CONTEXT;
|
| 140 |
+
|
| 141 |
+
void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
|
| 142 |
+
unsigned int M, unsigned int L, void *key,
|
| 143 |
+
block128_f block);
|
| 144 |
+
int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
|
| 145 |
+
size_t nlen, size_t mlen);
|
| 146 |
+
void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
|
| 147 |
+
size_t alen);
|
| 148 |
+
int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 149 |
+
unsigned char *out, size_t len);
|
| 150 |
+
int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 151 |
+
unsigned char *out, size_t len);
|
| 152 |
+
int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 153 |
+
unsigned char *out, size_t len,
|
| 154 |
+
ccm128_f stream);
|
| 155 |
+
int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
|
| 156 |
+
unsigned char *out, size_t len,
|
| 157 |
+
ccm128_f stream);
|
| 158 |
+
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 159 |
+
|
| 160 |
+
typedef struct xts128_context XTS128_CONTEXT;
|
| 161 |
+
|
| 162 |
+
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
|
| 163 |
+
const unsigned char iv[16],
|
| 164 |
+
const unsigned char *inp, unsigned char *out,
|
| 165 |
+
size_t len, int enc);
|
| 166 |
+
|
| 167 |
+
size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
|
| 168 |
+
unsigned char *out,
|
| 169 |
+
const unsigned char *in, size_t inlen,
|
| 170 |
+
block128_f block);
|
| 171 |
+
|
| 172 |
+
size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
|
| 173 |
+
unsigned char *out,
|
| 174 |
+
const unsigned char *in, size_t inlen,
|
| 175 |
+
block128_f block);
|
| 176 |
+
size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv,
|
| 177 |
+
unsigned char *out, const unsigned char *in,
|
| 178 |
+
size_t inlen, block128_f block);
|
| 179 |
+
size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
|
| 180 |
+
unsigned char *out, const unsigned char *in,
|
| 181 |
+
size_t inlen, block128_f block);
|
| 182 |
+
|
| 183 |
+
# ifndef OPENSSL_NO_OCB
|
| 184 |
+
typedef struct ocb128_context OCB128_CONTEXT;
|
| 185 |
+
|
| 186 |
+
typedef void (*ocb128_f) (const unsigned char *in, unsigned char *out,
|
| 187 |
+
size_t blocks, const void *key,
|
| 188 |
+
size_t start_block_num,
|
| 189 |
+
unsigned char offset_i[16],
|
| 190 |
+
const unsigned char L_[][16],
|
| 191 |
+
unsigned char checksum[16]);
|
| 192 |
+
|
| 193 |
+
OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec,
|
| 194 |
+
block128_f encrypt, block128_f decrypt,
|
| 195 |
+
ocb128_f stream);
|
| 196 |
+
int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
|
| 197 |
+
block128_f encrypt, block128_f decrypt,
|
| 198 |
+
ocb128_f stream);
|
| 199 |
+
int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
|
| 200 |
+
void *keyenc, void *keydec);
|
| 201 |
+
int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
|
| 202 |
+
size_t len, size_t taglen);
|
| 203 |
+
int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad,
|
| 204 |
+
size_t len);
|
| 205 |
+
int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
|
| 206 |
+
unsigned char *out, size_t len);
|
| 207 |
+
int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in,
|
| 208 |
+
unsigned char *out, size_t len);
|
| 209 |
+
int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag,
|
| 210 |
+
size_t len);
|
| 211 |
+
int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
| 212 |
+
void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx);
|
| 213 |
+
# endif /* OPENSSL_NO_OCB */
|
| 214 |
+
|
| 215 |
+
# ifdef __cplusplus
|
| 216 |
+
}
|
| 217 |
+
# endif
|
| 218 |
+
|
| 219 |
+
#endif
|
llava_next/include/openssl/objects.h
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_OBJECTS_H
|
| 11 |
+
# define OPENSSL_OBJECTS_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_OBJECTS_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/obj_mac.h>
|
| 20 |
+
# include <openssl/bio.h>
|
| 21 |
+
# include <openssl/asn1.h>
|
| 22 |
+
# include <openssl/objectserr.h>
|
| 23 |
+
|
| 24 |
+
# define OBJ_NAME_TYPE_UNDEF 0x00
|
| 25 |
+
# define OBJ_NAME_TYPE_MD_METH 0x01
|
| 26 |
+
# define OBJ_NAME_TYPE_CIPHER_METH 0x02
|
| 27 |
+
# define OBJ_NAME_TYPE_PKEY_METH 0x03
|
| 28 |
+
# define OBJ_NAME_TYPE_COMP_METH 0x04
|
| 29 |
+
# define OBJ_NAME_TYPE_MAC_METH 0x05
|
| 30 |
+
# define OBJ_NAME_TYPE_KDF_METH 0x06
|
| 31 |
+
# define OBJ_NAME_TYPE_NUM 0x07
|
| 32 |
+
|
| 33 |
+
# define OBJ_NAME_ALIAS 0x8000
|
| 34 |
+
|
| 35 |
+
# define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
|
| 36 |
+
# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
#ifdef __cplusplus
|
| 40 |
+
extern "C" {
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
typedef struct obj_name_st {
|
| 44 |
+
int type;
|
| 45 |
+
int alias;
|
| 46 |
+
const char *name;
|
| 47 |
+
const char *data;
|
| 48 |
+
} OBJ_NAME;
|
| 49 |
+
|
| 50 |
+
# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
|
| 51 |
+
|
| 52 |
+
int OBJ_NAME_init(void);
|
| 53 |
+
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
|
| 54 |
+
int (*cmp_func) (const char *, const char *),
|
| 55 |
+
void (*free_func) (const char *, int, const char *));
|
| 56 |
+
const char *OBJ_NAME_get(const char *name, int type);
|
| 57 |
+
int OBJ_NAME_add(const char *name, int type, const char *data);
|
| 58 |
+
int OBJ_NAME_remove(const char *name, int type);
|
| 59 |
+
void OBJ_NAME_cleanup(int type); /* -1 for everything */
|
| 60 |
+
void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
|
| 61 |
+
void *arg);
|
| 62 |
+
void OBJ_NAME_do_all_sorted(int type,
|
| 63 |
+
void (*fn) (const OBJ_NAME *, void *arg),
|
| 64 |
+
void *arg);
|
| 65 |
+
|
| 66 |
+
DECLARE_ASN1_DUP_FUNCTION_name(ASN1_OBJECT, OBJ)
|
| 67 |
+
ASN1_OBJECT *OBJ_nid2obj(int n);
|
| 68 |
+
const char *OBJ_nid2ln(int n);
|
| 69 |
+
const char *OBJ_nid2sn(int n);
|
| 70 |
+
int OBJ_obj2nid(const ASN1_OBJECT *o);
|
| 71 |
+
ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
|
| 72 |
+
int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
|
| 73 |
+
int OBJ_txt2nid(const char *s);
|
| 74 |
+
int OBJ_ln2nid(const char *s);
|
| 75 |
+
int OBJ_sn2nid(const char *s);
|
| 76 |
+
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
|
| 77 |
+
const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
|
| 78 |
+
int (*cmp) (const void *, const void *));
|
| 79 |
+
const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
|
| 80 |
+
int size,
|
| 81 |
+
int (*cmp) (const void *, const void *),
|
| 82 |
+
int flags);
|
| 83 |
+
|
| 84 |
+
# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \
|
| 85 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
|
| 86 |
+
static int nm##_cmp(type1 const *, type2 const *); \
|
| 87 |
+
scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
| 88 |
+
|
| 89 |
+
# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
|
| 90 |
+
_DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
|
| 91 |
+
# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
| 92 |
+
type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
|
| 93 |
+
|
| 94 |
+
/*-
|
| 95 |
+
* Unsolved problem: if a type is actually a pointer type, like
|
| 96 |
+
* nid_triple is, then its impossible to get a const where you need
|
| 97 |
+
* it. Consider:
|
| 98 |
+
*
|
| 99 |
+
* typedef int nid_triple[3];
|
| 100 |
+
* const void *a_;
|
| 101 |
+
* const nid_triple const *a = a_;
|
| 102 |
+
*
|
| 103 |
+
* The assignment discards a const because what you really want is:
|
| 104 |
+
*
|
| 105 |
+
* const int const * const *a = a_;
|
| 106 |
+
*
|
| 107 |
+
* But if you do that, you lose the fact that a is an array of 3 ints,
|
| 108 |
+
* which breaks comparison functions.
|
| 109 |
+
*
|
| 110 |
+
* Thus we end up having to cast, sadly, or unpack the
|
| 111 |
+
* declarations. Or, as I finally did in this case, declare nid_triple
|
| 112 |
+
* to be a struct, which it should have been in the first place.
|
| 113 |
+
*
|
| 114 |
+
* Ben, August 2008.
|
| 115 |
+
*
|
| 116 |
+
* Also, strictly speaking not all types need be const, but handling
|
| 117 |
+
* the non-constness means a lot of complication, and in practice
|
| 118 |
+
* comparison routines do always not touch their arguments.
|
| 119 |
+
*/
|
| 120 |
+
|
| 121 |
+
# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \
|
| 122 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
| 123 |
+
{ \
|
| 124 |
+
type1 const *a = a_; \
|
| 125 |
+
type2 const *b = b_; \
|
| 126 |
+
return nm##_cmp(a,b); \
|
| 127 |
+
} \
|
| 128 |
+
static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
| 129 |
+
{ \
|
| 130 |
+
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
| 131 |
+
nm##_cmp_BSEARCH_CMP_FN); \
|
| 132 |
+
} \
|
| 133 |
+
extern void dummy_prototype(void)
|
| 134 |
+
|
| 135 |
+
# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
|
| 136 |
+
static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
|
| 137 |
+
{ \
|
| 138 |
+
type1 const *a = a_; \
|
| 139 |
+
type2 const *b = b_; \
|
| 140 |
+
return nm##_cmp(a,b); \
|
| 141 |
+
} \
|
| 142 |
+
type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
|
| 143 |
+
{ \
|
| 144 |
+
return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
|
| 145 |
+
nm##_cmp_BSEARCH_CMP_FN); \
|
| 146 |
+
} \
|
| 147 |
+
extern void dummy_prototype(void)
|
| 148 |
+
|
| 149 |
+
# define OBJ_bsearch(type1,key,type2,base,num,cmp) \
|
| 150 |
+
((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
|
| 151 |
+
num,sizeof(type2), \
|
| 152 |
+
((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
|
| 153 |
+
(void)CHECKED_PTR_OF(type2,cmp##_type_2), \
|
| 154 |
+
cmp##_BSEARCH_CMP_FN)))
|
| 155 |
+
|
| 156 |
+
# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \
|
| 157 |
+
((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
|
| 158 |
+
num,sizeof(type2), \
|
| 159 |
+
((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
|
| 160 |
+
(void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
|
| 161 |
+
cmp##_BSEARCH_CMP_FN)),flags)
|
| 162 |
+
|
| 163 |
+
int OBJ_new_nid(int num);
|
| 164 |
+
int OBJ_add_object(const ASN1_OBJECT *obj);
|
| 165 |
+
int OBJ_create(const char *oid, const char *sn, const char *ln);
|
| 166 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 167 |
+
# define OBJ_cleanup() while(0) continue
|
| 168 |
+
#endif
|
| 169 |
+
int OBJ_create_objects(BIO *in);
|
| 170 |
+
|
| 171 |
+
size_t OBJ_length(const ASN1_OBJECT *obj);
|
| 172 |
+
const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
|
| 173 |
+
|
| 174 |
+
int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
|
| 175 |
+
int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
|
| 176 |
+
int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
|
| 177 |
+
void OBJ_sigid_free(void);
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
# ifdef __cplusplus
|
| 181 |
+
}
|
| 182 |
+
# endif
|
| 183 |
+
#endif
|
llava_next/include/openssl/ocsperr.h
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_OCSPERR_H
|
| 12 |
+
# define OPENSSL_OCSPERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# ifndef OPENSSL_NO_OCSP
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
/*
|
| 24 |
+
* OCSP reason codes.
|
| 25 |
+
*/
|
| 26 |
+
# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
|
| 27 |
+
# define OCSP_R_DIGEST_ERR 102
|
| 28 |
+
# define OCSP_R_DIGEST_NAME_ERR 106
|
| 29 |
+
# define OCSP_R_DIGEST_SIZE_ERR 107
|
| 30 |
+
# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
|
| 31 |
+
# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
|
| 32 |
+
# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
|
| 33 |
+
# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
|
| 34 |
+
# define OCSP_R_NOT_BASIC_RESPONSE 104
|
| 35 |
+
# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
|
| 36 |
+
# define OCSP_R_NO_RESPONSE_DATA 108
|
| 37 |
+
# define OCSP_R_NO_REVOKED_TIME 109
|
| 38 |
+
# define OCSP_R_NO_SIGNER_KEY 130
|
| 39 |
+
# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
|
| 40 |
+
# define OCSP_R_REQUEST_NOT_SIGNED 128
|
| 41 |
+
# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
|
| 42 |
+
# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
|
| 43 |
+
# define OCSP_R_SIGNATURE_FAILURE 117
|
| 44 |
+
# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
|
| 45 |
+
# define OCSP_R_STATUS_EXPIRED 125
|
| 46 |
+
# define OCSP_R_STATUS_NOT_YET_VALID 126
|
| 47 |
+
# define OCSP_R_STATUS_TOO_OLD 127
|
| 48 |
+
# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
|
| 49 |
+
# define OCSP_R_UNKNOWN_NID 120
|
| 50 |
+
# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
|
| 51 |
+
|
| 52 |
+
# endif
|
| 53 |
+
#endif
|
llava_next/include/openssl/ossl_typ.h
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* The original <openssl/ossl_typ.h> was renamed to <openssl/types.h>
|
| 12 |
+
*
|
| 13 |
+
* This header file only exists for compatibility reasons with older
|
| 14 |
+
* applications which #include <openssl/ossl_typ.h>.
|
| 15 |
+
*/
|
| 16 |
+
# include <openssl/types.h>
|
llava_next/include/openssl/param_build.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PARAM_BUILD_H
|
| 12 |
+
# define OPENSSL_PARAM_BUILD_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/params.h>
|
| 16 |
+
# include <openssl/types.h>
|
| 17 |
+
|
| 18 |
+
# ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
# endif
|
| 21 |
+
|
| 22 |
+
OSSL_PARAM_BLD *OSSL_PARAM_BLD_new(void);
|
| 23 |
+
OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld);
|
| 24 |
+
void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld);
|
| 25 |
+
|
| 26 |
+
int OSSL_PARAM_BLD_push_int(OSSL_PARAM_BLD *bld, const char *key, int val);
|
| 27 |
+
int OSSL_PARAM_BLD_push_uint(OSSL_PARAM_BLD *bld, const char *key,
|
| 28 |
+
unsigned int val);
|
| 29 |
+
int OSSL_PARAM_BLD_push_long(OSSL_PARAM_BLD *bld, const char *key,
|
| 30 |
+
long int val);
|
| 31 |
+
int OSSL_PARAM_BLD_push_ulong(OSSL_PARAM_BLD *bld, const char *key,
|
| 32 |
+
unsigned long int val);
|
| 33 |
+
int OSSL_PARAM_BLD_push_int32(OSSL_PARAM_BLD *bld, const char *key,
|
| 34 |
+
int32_t val);
|
| 35 |
+
int OSSL_PARAM_BLD_push_uint32(OSSL_PARAM_BLD *bld, const char *key,
|
| 36 |
+
uint32_t val);
|
| 37 |
+
int OSSL_PARAM_BLD_push_int64(OSSL_PARAM_BLD *bld, const char *key,
|
| 38 |
+
int64_t val);
|
| 39 |
+
int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key,
|
| 40 |
+
uint64_t val);
|
| 41 |
+
int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key,
|
| 42 |
+
size_t val);
|
| 43 |
+
int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key,
|
| 44 |
+
time_t val);
|
| 45 |
+
int OSSL_PARAM_BLD_push_double(OSSL_PARAM_BLD *bld, const char *key,
|
| 46 |
+
double val);
|
| 47 |
+
int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key,
|
| 48 |
+
const BIGNUM *bn);
|
| 49 |
+
int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key,
|
| 50 |
+
const BIGNUM *bn, size_t sz);
|
| 51 |
+
int OSSL_PARAM_BLD_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key,
|
| 52 |
+
const char *buf, size_t bsize);
|
| 53 |
+
int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key,
|
| 54 |
+
char *buf, size_t bsize);
|
| 55 |
+
int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key,
|
| 56 |
+
const void *buf, size_t bsize);
|
| 57 |
+
int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key,
|
| 58 |
+
void *buf, size_t bsize);
|
| 59 |
+
|
| 60 |
+
# ifdef __cplusplus
|
| 61 |
+
}
|
| 62 |
+
# endif
|
| 63 |
+
#endif /* OPENSSL_PARAM_BUILD_H */
|
llava_next/include/openssl/pkcs7.h
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs7.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2023 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_PKCS7_H
|
| 16 |
+
# define OPENSSL_PKCS7_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_PKCS7_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/asn1.h>
|
| 25 |
+
# include <openssl/bio.h>
|
| 26 |
+
# include <openssl/e_os2.h>
|
| 27 |
+
|
| 28 |
+
# include <openssl/symhacks.h>
|
| 29 |
+
# include <openssl/types.h>
|
| 30 |
+
# include <openssl/pkcs7err.h>
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
extern "C" {
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
/*-
|
| 38 |
+
Encryption_ID DES-CBC
|
| 39 |
+
Digest_ID MD5
|
| 40 |
+
Digest_Encryption_ID rsaEncryption
|
| 41 |
+
Key_Encryption_ID rsaEncryption
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
typedef struct PKCS7_CTX_st {
|
| 45 |
+
OSSL_LIB_CTX *libctx;
|
| 46 |
+
char *propq;
|
| 47 |
+
} PKCS7_CTX;
|
| 48 |
+
|
| 49 |
+
typedef struct pkcs7_issuer_and_serial_st {
|
| 50 |
+
X509_NAME *issuer;
|
| 51 |
+
ASN1_INTEGER *serial;
|
| 52 |
+
} PKCS7_ISSUER_AND_SERIAL;
|
| 53 |
+
|
| 54 |
+
typedef struct pkcs7_signer_info_st {
|
| 55 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 56 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 57 |
+
X509_ALGOR *digest_alg;
|
| 58 |
+
STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
|
| 59 |
+
X509_ALGOR *digest_enc_alg; /* confusing name, actually used for signing */
|
| 60 |
+
ASN1_OCTET_STRING *enc_digest; /* confusing name, actually signature */
|
| 61 |
+
STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
|
| 62 |
+
/* The private key to sign with */
|
| 63 |
+
EVP_PKEY *pkey;
|
| 64 |
+
const PKCS7_CTX *ctx;
|
| 65 |
+
} PKCS7_SIGNER_INFO;
|
| 66 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
|
| 67 |
+
#define sk_PKCS7_SIGNER_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 68 |
+
#define sk_PKCS7_SIGNER_INFO_value(sk, idx) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), (idx)))
|
| 69 |
+
#define sk_PKCS7_SIGNER_INFO_new(cmp) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
| 70 |
+
#define sk_PKCS7_SIGNER_INFO_new_null() ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_null())
|
| 71 |
+
#define sk_PKCS7_SIGNER_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp), (n)))
|
| 72 |
+
#define sk_PKCS7_SIGNER_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (n))
|
| 73 |
+
#define sk_PKCS7_SIGNER_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 74 |
+
#define sk_PKCS7_SIGNER_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 75 |
+
#define sk_PKCS7_SIGNER_INFO_delete(sk, i) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (i)))
|
| 76 |
+
#define sk_PKCS7_SIGNER_INFO_delete_ptr(sk, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
| 77 |
+
#define sk_PKCS7_SIGNER_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 78 |
+
#define sk_PKCS7_SIGNER_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 79 |
+
#define sk_PKCS7_SIGNER_INFO_pop(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 80 |
+
#define sk_PKCS7_SIGNER_INFO_shift(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 81 |
+
#define sk_PKCS7_SIGNER_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk),ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc))
|
| 82 |
+
#define sk_PKCS7_SIGNER_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), (idx))
|
| 83 |
+
#define sk_PKCS7_SIGNER_INFO_set(sk, idx, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (idx), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
| 84 |
+
#define sk_PKCS7_SIGNER_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 85 |
+
#define sk_PKCS7_SIGNER_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 86 |
+
#define sk_PKCS7_SIGNER_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), pnum)
|
| 87 |
+
#define sk_PKCS7_SIGNER_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 88 |
+
#define sk_PKCS7_SIGNER_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 89 |
+
#define sk_PKCS7_SIGNER_INFO_dup(sk) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 90 |
+
#define sk_PKCS7_SIGNER_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc)))
|
| 91 |
+
#define sk_PKCS7_SIGNER_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_SIGNER_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
typedef struct pkcs7_recip_info_st {
|
| 95 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 96 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 97 |
+
X509_ALGOR *key_enc_algor;
|
| 98 |
+
ASN1_OCTET_STRING *enc_key;
|
| 99 |
+
X509 *cert; /* get the pub-key from this */
|
| 100 |
+
const PKCS7_CTX *ctx;
|
| 101 |
+
} PKCS7_RECIP_INFO;
|
| 102 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
|
| 103 |
+
#define sk_PKCS7_RECIP_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 104 |
+
#define sk_PKCS7_RECIP_INFO_value(sk, idx) ((PKCS7_RECIP_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), (idx)))
|
| 105 |
+
#define sk_PKCS7_RECIP_INFO_new(cmp) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
| 106 |
+
#define sk_PKCS7_RECIP_INFO_new_null() ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_null())
|
| 107 |
+
#define sk_PKCS7_RECIP_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp), (n)))
|
| 108 |
+
#define sk_PKCS7_RECIP_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (n))
|
| 109 |
+
#define sk_PKCS7_RECIP_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 110 |
+
#define sk_PKCS7_RECIP_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 111 |
+
#define sk_PKCS7_RECIP_INFO_delete(sk, i) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (i)))
|
| 112 |
+
#define sk_PKCS7_RECIP_INFO_delete_ptr(sk, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
| 113 |
+
#define sk_PKCS7_RECIP_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 114 |
+
#define sk_PKCS7_RECIP_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 115 |
+
#define sk_PKCS7_RECIP_INFO_pop(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 116 |
+
#define sk_PKCS7_RECIP_INFO_shift(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 117 |
+
#define sk_PKCS7_RECIP_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk),ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc))
|
| 118 |
+
#define sk_PKCS7_RECIP_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), (idx))
|
| 119 |
+
#define sk_PKCS7_RECIP_INFO_set(sk, idx, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (idx), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
| 120 |
+
#define sk_PKCS7_RECIP_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 121 |
+
#define sk_PKCS7_RECIP_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 122 |
+
#define sk_PKCS7_RECIP_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), pnum)
|
| 123 |
+
#define sk_PKCS7_RECIP_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 124 |
+
#define sk_PKCS7_RECIP_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 125 |
+
#define sk_PKCS7_RECIP_INFO_dup(sk) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 126 |
+
#define sk_PKCS7_RECIP_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc)))
|
| 127 |
+
#define sk_PKCS7_RECIP_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_RECIP_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
typedef struct pkcs7_signed_st {
|
| 132 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 133 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 134 |
+
STACK_OF(X509) *cert; /* [ 0 ] */
|
| 135 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
|
| 136 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 137 |
+
struct pkcs7_st *contents;
|
| 138 |
+
} PKCS7_SIGNED;
|
| 139 |
+
/*
|
| 140 |
+
* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
|
| 141 |
+
* merging the two
|
| 142 |
+
*/
|
| 143 |
+
|
| 144 |
+
typedef struct pkcs7_enc_content_st {
|
| 145 |
+
ASN1_OBJECT *content_type;
|
| 146 |
+
X509_ALGOR *algorithm;
|
| 147 |
+
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
|
| 148 |
+
const EVP_CIPHER *cipher;
|
| 149 |
+
const PKCS7_CTX *ctx;
|
| 150 |
+
} PKCS7_ENC_CONTENT;
|
| 151 |
+
|
| 152 |
+
typedef struct pkcs7_enveloped_st {
|
| 153 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 154 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 155 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 156 |
+
} PKCS7_ENVELOPE;
|
| 157 |
+
|
| 158 |
+
typedef struct pkcs7_signedandenveloped_st {
|
| 159 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 160 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 161 |
+
STACK_OF(X509) *cert; /* [ 0 ] */
|
| 162 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
|
| 163 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 164 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 165 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 166 |
+
} PKCS7_SIGN_ENVELOPE;
|
| 167 |
+
|
| 168 |
+
typedef struct pkcs7_digest_st {
|
| 169 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 170 |
+
X509_ALGOR *md; /* md used */
|
| 171 |
+
struct pkcs7_st *contents;
|
| 172 |
+
ASN1_OCTET_STRING *digest;
|
| 173 |
+
} PKCS7_DIGEST;
|
| 174 |
+
|
| 175 |
+
typedef struct pkcs7_encrypted_st {
|
| 176 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 177 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 178 |
+
} PKCS7_ENCRYPT;
|
| 179 |
+
|
| 180 |
+
typedef struct pkcs7_st {
|
| 181 |
+
/*
|
| 182 |
+
* The following is non NULL if it contains ASN1 encoding of this
|
| 183 |
+
* structure
|
| 184 |
+
*/
|
| 185 |
+
unsigned char *asn1;
|
| 186 |
+
long length;
|
| 187 |
+
# define PKCS7_S_HEADER 0
|
| 188 |
+
# define PKCS7_S_BODY 1
|
| 189 |
+
# define PKCS7_S_TAIL 2
|
| 190 |
+
int state; /* used during processing */
|
| 191 |
+
int detached;
|
| 192 |
+
ASN1_OBJECT *type;
|
| 193 |
+
/* content as defined by the type */
|
| 194 |
+
/*
|
| 195 |
+
* all encryption/message digests are applied to the 'contents', leaving
|
| 196 |
+
* out the 'type' field.
|
| 197 |
+
*/
|
| 198 |
+
union {
|
| 199 |
+
char *ptr;
|
| 200 |
+
/* NID_pkcs7_data */
|
| 201 |
+
ASN1_OCTET_STRING *data;
|
| 202 |
+
/* NID_pkcs7_signed */
|
| 203 |
+
PKCS7_SIGNED *sign;
|
| 204 |
+
/* NID_pkcs7_enveloped */
|
| 205 |
+
PKCS7_ENVELOPE *enveloped;
|
| 206 |
+
/* NID_pkcs7_signedAndEnveloped */
|
| 207 |
+
PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
|
| 208 |
+
/* NID_pkcs7_digest */
|
| 209 |
+
PKCS7_DIGEST *digest;
|
| 210 |
+
/* NID_pkcs7_encrypted */
|
| 211 |
+
PKCS7_ENCRYPT *encrypted;
|
| 212 |
+
/* Anything else */
|
| 213 |
+
ASN1_TYPE *other;
|
| 214 |
+
} d;
|
| 215 |
+
PKCS7_CTX ctx;
|
| 216 |
+
} PKCS7;
|
| 217 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7, PKCS7, PKCS7)
|
| 218 |
+
#define sk_PKCS7_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_sk_type(sk))
|
| 219 |
+
#define sk_PKCS7_value(sk, idx) ((PKCS7 *)OPENSSL_sk_value(ossl_check_const_PKCS7_sk_type(sk), (idx)))
|
| 220 |
+
#define sk_PKCS7_new(cmp) ((STACK_OF(PKCS7) *)OPENSSL_sk_new(ossl_check_PKCS7_compfunc_type(cmp)))
|
| 221 |
+
#define sk_PKCS7_new_null() ((STACK_OF(PKCS7) *)OPENSSL_sk_new_null())
|
| 222 |
+
#define sk_PKCS7_new_reserve(cmp, n) ((STACK_OF(PKCS7) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_compfunc_type(cmp), (n)))
|
| 223 |
+
#define sk_PKCS7_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_sk_type(sk), (n))
|
| 224 |
+
#define sk_PKCS7_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_sk_type(sk))
|
| 225 |
+
#define sk_PKCS7_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_sk_type(sk))
|
| 226 |
+
#define sk_PKCS7_delete(sk, i) ((PKCS7 *)OPENSSL_sk_delete(ossl_check_PKCS7_sk_type(sk), (i)))
|
| 227 |
+
#define sk_PKCS7_delete_ptr(sk, ptr) ((PKCS7 *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)))
|
| 228 |
+
#define sk_PKCS7_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 229 |
+
#define sk_PKCS7_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 230 |
+
#define sk_PKCS7_pop(sk) ((PKCS7 *)OPENSSL_sk_pop(ossl_check_PKCS7_sk_type(sk)))
|
| 231 |
+
#define sk_PKCS7_shift(sk) ((PKCS7 *)OPENSSL_sk_shift(ossl_check_PKCS7_sk_type(sk)))
|
| 232 |
+
#define sk_PKCS7_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_sk_type(sk),ossl_check_PKCS7_freefunc_type(freefunc))
|
| 233 |
+
#define sk_PKCS7_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), (idx))
|
| 234 |
+
#define sk_PKCS7_set(sk, idx, ptr) ((PKCS7 *)OPENSSL_sk_set(ossl_check_PKCS7_sk_type(sk), (idx), ossl_check_PKCS7_type(ptr)))
|
| 235 |
+
#define sk_PKCS7_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 236 |
+
#define sk_PKCS7_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 237 |
+
#define sk_PKCS7_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), pnum)
|
| 238 |
+
#define sk_PKCS7_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_sk_type(sk))
|
| 239 |
+
#define sk_PKCS7_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_sk_type(sk))
|
| 240 |
+
#define sk_PKCS7_dup(sk) ((STACK_OF(PKCS7) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_sk_type(sk)))
|
| 241 |
+
#define sk_PKCS7_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_sk_type(sk), ossl_check_PKCS7_copyfunc_type(copyfunc), ossl_check_PKCS7_freefunc_type(freefunc)))
|
| 242 |
+
#define sk_PKCS7_set_cmp_func(sk, cmp) ((sk_PKCS7_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_compfunc_type(cmp)))
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
|
| 247 |
+
# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
|
| 248 |
+
|
| 249 |
+
# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
|
| 250 |
+
# define PKCS7_get_attributes(si) ((si)->unauth_attr)
|
| 251 |
+
|
| 252 |
+
# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
|
| 253 |
+
# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
|
| 254 |
+
# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
|
| 255 |
+
# define PKCS7_type_is_signedAndEnveloped(a) \
|
| 256 |
+
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
|
| 257 |
+
# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
|
| 258 |
+
# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
|
| 259 |
+
|
| 260 |
+
# define PKCS7_set_detached(p,v) \
|
| 261 |
+
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
|
| 262 |
+
# define PKCS7_get_detached(p) \
|
| 263 |
+
PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
|
| 264 |
+
|
| 265 |
+
# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
|
| 266 |
+
|
| 267 |
+
/* S/MIME related flags */
|
| 268 |
+
|
| 269 |
+
# define PKCS7_TEXT 0x1
|
| 270 |
+
# define PKCS7_NOCERTS 0x2
|
| 271 |
+
# define PKCS7_NOSIGS 0x4
|
| 272 |
+
# define PKCS7_NOCHAIN 0x8
|
| 273 |
+
# define PKCS7_NOINTERN 0x10
|
| 274 |
+
# define PKCS7_NOVERIFY 0x20
|
| 275 |
+
# define PKCS7_DETACHED 0x40
|
| 276 |
+
# define PKCS7_BINARY 0x80
|
| 277 |
+
# define PKCS7_NOATTR 0x100
|
| 278 |
+
# define PKCS7_NOSMIMECAP 0x200
|
| 279 |
+
# define PKCS7_NOOLDMIMETYPE 0x400
|
| 280 |
+
# define PKCS7_CRLFEOL 0x800
|
| 281 |
+
# define PKCS7_STREAM 0x1000
|
| 282 |
+
# define PKCS7_NOCRL 0x2000
|
| 283 |
+
# define PKCS7_PARTIAL 0x4000
|
| 284 |
+
# define PKCS7_REUSE_DIGEST 0x8000
|
| 285 |
+
# define PKCS7_NO_DUAL_CONTENT 0x10000
|
| 286 |
+
|
| 287 |
+
/* Flags: for compatibility with older code */
|
| 288 |
+
|
| 289 |
+
# define SMIME_TEXT PKCS7_TEXT
|
| 290 |
+
# define SMIME_NOCERTS PKCS7_NOCERTS
|
| 291 |
+
# define SMIME_NOSIGS PKCS7_NOSIGS
|
| 292 |
+
# define SMIME_NOCHAIN PKCS7_NOCHAIN
|
| 293 |
+
# define SMIME_NOINTERN PKCS7_NOINTERN
|
| 294 |
+
# define SMIME_NOVERIFY PKCS7_NOVERIFY
|
| 295 |
+
# define SMIME_DETACHED PKCS7_DETACHED
|
| 296 |
+
# define SMIME_BINARY PKCS7_BINARY
|
| 297 |
+
# define SMIME_NOATTR PKCS7_NOATTR
|
| 298 |
+
|
| 299 |
+
/* CRLF ASCII canonicalisation */
|
| 300 |
+
# define SMIME_ASCIICRLF 0x80000
|
| 301 |
+
|
| 302 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
|
| 303 |
+
|
| 304 |
+
int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
|
| 305 |
+
const EVP_MD *type, unsigned char *md,
|
| 306 |
+
unsigned int *len);
|
| 307 |
+
# ifndef OPENSSL_NO_STDIO
|
| 308 |
+
PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
|
| 309 |
+
int i2d_PKCS7_fp(FILE *fp, const PKCS7 *p7);
|
| 310 |
+
# endif
|
| 311 |
+
DECLARE_ASN1_DUP_FUNCTION(PKCS7)
|
| 312 |
+
PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
|
| 313 |
+
int i2d_PKCS7_bio(BIO *bp, const PKCS7 *p7);
|
| 314 |
+
int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 315 |
+
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 316 |
+
|
| 317 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
|
| 318 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
|
| 319 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
|
| 320 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
|
| 321 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
|
| 322 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
|
| 323 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
|
| 324 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
|
| 325 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7)
|
| 326 |
+
PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 327 |
+
|
| 328 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
|
| 329 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
|
| 330 |
+
|
| 331 |
+
DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
|
| 332 |
+
DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
|
| 333 |
+
|
| 334 |
+
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
|
| 335 |
+
|
| 336 |
+
int PKCS7_type_is_other(PKCS7 *p7);
|
| 337 |
+
int PKCS7_set_type(PKCS7 *p7, int type);
|
| 338 |
+
int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
|
| 339 |
+
int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
|
| 340 |
+
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
|
| 341 |
+
const EVP_MD *dgst);
|
| 342 |
+
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
|
| 343 |
+
int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
|
| 344 |
+
int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
|
| 345 |
+
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
|
| 346 |
+
int PKCS7_content_new(PKCS7 *p7, int nid);
|
| 347 |
+
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
|
| 348 |
+
BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 349 |
+
int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
|
| 350 |
+
X509 *x509);
|
| 351 |
+
|
| 352 |
+
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
|
| 353 |
+
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
|
| 354 |
+
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
|
| 355 |
+
|
| 356 |
+
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
|
| 357 |
+
EVP_PKEY *pkey, const EVP_MD *dgst);
|
| 358 |
+
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 359 |
+
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
|
| 360 |
+
STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
|
| 361 |
+
|
| 362 |
+
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
|
| 363 |
+
void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
|
| 364 |
+
X509_ALGOR **pdig, X509_ALGOR **psig);
|
| 365 |
+
void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
|
| 366 |
+
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
|
| 367 |
+
int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
|
| 368 |
+
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
|
| 369 |
+
int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
|
| 370 |
+
|
| 371 |
+
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
|
| 372 |
+
ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
|
| 373 |
+
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
|
| 374 |
+
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
|
| 375 |
+
void *data);
|
| 376 |
+
int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
|
| 377 |
+
void *value);
|
| 378 |
+
ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 379 |
+
ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 380 |
+
int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 381 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 382 |
+
int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 383 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 384 |
+
|
| 385 |
+
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 386 |
+
BIO *data, int flags);
|
| 387 |
+
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 388 |
+
BIO *data, int flags, OSSL_LIB_CTX *libctx,
|
| 389 |
+
const char *propq);
|
| 390 |
+
|
| 391 |
+
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
|
| 392 |
+
X509 *signcert, EVP_PKEY *pkey,
|
| 393 |
+
const EVP_MD *md, int flags);
|
| 394 |
+
|
| 395 |
+
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
|
| 396 |
+
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
| 397 |
+
BIO *indata, BIO *out, int flags);
|
| 398 |
+
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
|
| 399 |
+
int flags);
|
| 400 |
+
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
|
| 401 |
+
int flags);
|
| 402 |
+
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
| 403 |
+
const EVP_CIPHER *cipher, int flags,
|
| 404 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 405 |
+
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
|
| 406 |
+
int flags);
|
| 407 |
+
|
| 408 |
+
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
|
| 409 |
+
STACK_OF(X509_ALGOR) *cap);
|
| 410 |
+
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
|
| 411 |
+
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
|
| 412 |
+
|
| 413 |
+
int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
|
| 414 |
+
int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
|
| 415 |
+
int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
|
| 416 |
+
const unsigned char *md, int mdlen);
|
| 417 |
+
|
| 418 |
+
int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
|
| 419 |
+
PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7);
|
| 420 |
+
PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
|
| 421 |
+
|
| 422 |
+
BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
|
| 423 |
+
|
| 424 |
+
# ifdef __cplusplus
|
| 425 |
+
}
|
| 426 |
+
# endif
|
| 427 |
+
#endif
|
llava_next/include/openssl/pkcs7err.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Generated by util/mkerr.pl DO NOT EDIT
|
| 3 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 6 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 7 |
+
* in the file LICENSE in the source distribution or at
|
| 8 |
+
* https://www.openssl.org/source/license.html
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef OPENSSL_PKCS7ERR_H
|
| 12 |
+
# define OPENSSL_PKCS7ERR_H
|
| 13 |
+
# pragma once
|
| 14 |
+
|
| 15 |
+
# include <openssl/opensslconf.h>
|
| 16 |
+
# include <openssl/symhacks.h>
|
| 17 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* PKCS7 reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
|
| 25 |
+
# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
|
| 26 |
+
# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
|
| 27 |
+
# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
|
| 28 |
+
# define PKCS7_R_CTRL_ERROR 152
|
| 29 |
+
# define PKCS7_R_DECRYPT_ERROR 119
|
| 30 |
+
# define PKCS7_R_DIGEST_FAILURE 101
|
| 31 |
+
# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
|
| 32 |
+
# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
|
| 33 |
+
# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
|
| 34 |
+
# define PKCS7_R_ERROR_SETTING_CIPHER 121
|
| 35 |
+
# define PKCS7_R_INVALID_NULL_POINTER 143
|
| 36 |
+
# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
|
| 37 |
+
# define PKCS7_R_NO_CONTENT 122
|
| 38 |
+
# define PKCS7_R_NO_DEFAULT_DIGEST 151
|
| 39 |
+
# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
|
| 40 |
+
# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
|
| 41 |
+
# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
|
| 42 |
+
# define PKCS7_R_NO_SIGNERS 142
|
| 43 |
+
# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
|
| 44 |
+
# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
|
| 45 |
+
# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
|
| 46 |
+
# define PKCS7_R_PKCS7_DATASIGN 145
|
| 47 |
+
# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
|
| 48 |
+
# define PKCS7_R_SIGNATURE_FAILURE 105
|
| 49 |
+
# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
|
| 50 |
+
# define PKCS7_R_SIGNING_CTRL_FAILURE 147
|
| 51 |
+
# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
|
| 52 |
+
# define PKCS7_R_SMIME_TEXT_ERROR 129
|
| 53 |
+
# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
|
| 54 |
+
# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
|
| 55 |
+
# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
|
| 56 |
+
# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
|
| 57 |
+
# define PKCS7_R_UNKNOWN_OPERATION 110
|
| 58 |
+
# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
|
| 59 |
+
# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
|
| 60 |
+
# define PKCS7_R_WRONG_CONTENT_TYPE 113
|
| 61 |
+
# define PKCS7_R_WRONG_PKCS7_TYPE 114
|
| 62 |
+
|
| 63 |
+
#endif
|
llava_next/include/openssl/prov_ssl.h
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 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_PROV_SSL_H
|
| 11 |
+
# define OPENSSL_PROV_SSL_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
# endif
|
| 17 |
+
|
| 18 |
+
/* SSL/TLS related defines useful to providers */
|
| 19 |
+
|
| 20 |
+
# define SSL_MAX_MASTER_KEY_LENGTH 48
|
| 21 |
+
|
| 22 |
+
# define SSL3_VERSION 0x0300
|
| 23 |
+
# define TLS1_VERSION 0x0301
|
| 24 |
+
# define TLS1_1_VERSION 0x0302
|
| 25 |
+
# define TLS1_2_VERSION 0x0303
|
| 26 |
+
# define TLS1_3_VERSION 0x0304
|
| 27 |
+
# define DTLS1_VERSION 0xFEFF
|
| 28 |
+
# define DTLS1_2_VERSION 0xFEFD
|
| 29 |
+
# define DTLS1_BAD_VER 0x0100
|
| 30 |
+
|
| 31 |
+
# ifdef __cplusplus
|
| 32 |
+
}
|
| 33 |
+
# endif
|
| 34 |
+
#endif /* OPENSSL_PROV_SSL_H */
|
llava_next/include/openssl/rsa.h
ADDED
|
@@ -0,0 +1,604 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_RSA_H
|
| 11 |
+
# define OPENSSL_RSA_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_RSA_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# include <openssl/asn1.h>
|
| 22 |
+
# include <openssl/bio.h>
|
| 23 |
+
# include <openssl/crypto.h>
|
| 24 |
+
# include <openssl/types.h>
|
| 25 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 26 |
+
# include <openssl/bn.h>
|
| 27 |
+
# endif
|
| 28 |
+
# include <openssl/rsaerr.h>
|
| 29 |
+
# include <openssl/safestack.h>
|
| 30 |
+
|
| 31 |
+
# ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
# endif
|
| 34 |
+
|
| 35 |
+
# ifndef OPENSSL_RSA_MAX_MODULUS_BITS
|
| 36 |
+
# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
|
| 37 |
+
# endif
|
| 38 |
+
|
| 39 |
+
# define RSA_3 0x3L
|
| 40 |
+
# define RSA_F4 0x10001L
|
| 41 |
+
|
| 42 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 43 |
+
/* The types RSA and RSA_METHOD are defined in ossl_typ.h */
|
| 44 |
+
|
| 45 |
+
# define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048
|
| 46 |
+
|
| 47 |
+
# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
|
| 48 |
+
# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
|
| 49 |
+
# endif
|
| 50 |
+
|
| 51 |
+
/* exponent limit enforced for "large" modulus only */
|
| 52 |
+
# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
|
| 53 |
+
# define OPENSSL_RSA_MAX_PUBEXP_BITS 64
|
| 54 |
+
# endif
|
| 55 |
+
/* based on RFC 8017 appendix A.1.2 */
|
| 56 |
+
# define RSA_ASN1_VERSION_DEFAULT 0
|
| 57 |
+
# define RSA_ASN1_VERSION_MULTI 1
|
| 58 |
+
|
| 59 |
+
# define RSA_DEFAULT_PRIME_NUM 2
|
| 60 |
+
|
| 61 |
+
# define RSA_METHOD_FLAG_NO_CHECK 0x0001
|
| 62 |
+
# define RSA_FLAG_CACHE_PUBLIC 0x0002
|
| 63 |
+
# define RSA_FLAG_CACHE_PRIVATE 0x0004
|
| 64 |
+
# define RSA_FLAG_BLINDING 0x0008
|
| 65 |
+
# define RSA_FLAG_THREAD_SAFE 0x0010
|
| 66 |
+
/*
|
| 67 |
+
* This flag means the private key operations will be handled by rsa_mod_exp
|
| 68 |
+
* and that they do not depend on the private key components being present:
|
| 69 |
+
* for example a key stored in external hardware. Without this flag
|
| 70 |
+
* bn_mod_exp gets called when private key components are absent.
|
| 71 |
+
*/
|
| 72 |
+
# define RSA_FLAG_EXT_PKEY 0x0020
|
| 73 |
+
|
| 74 |
+
/*
|
| 75 |
+
* new with 0.9.6j and 0.9.7b; the built-in
|
| 76 |
+
* RSA implementation now uses blinding by
|
| 77 |
+
* default (ignoring RSA_FLAG_BLINDING),
|
| 78 |
+
* but other engines might not need it
|
| 79 |
+
*/
|
| 80 |
+
# define RSA_FLAG_NO_BLINDING 0x0080
|
| 81 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 82 |
+
/*
|
| 83 |
+
* Does nothing. Previously this switched off constant time behaviour.
|
| 84 |
+
*/
|
| 85 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 86 |
+
# define RSA_FLAG_NO_CONSTTIME 0x0000
|
| 87 |
+
# endif
|
| 88 |
+
/* deprecated name for the flag*/
|
| 89 |
+
/*
|
| 90 |
+
* new with 0.9.7h; the built-in RSA
|
| 91 |
+
* implementation now uses constant time
|
| 92 |
+
* modular exponentiation for secret exponents
|
| 93 |
+
* by default. This flag causes the
|
| 94 |
+
* faster variable sliding window method to
|
| 95 |
+
* be used for all exponents.
|
| 96 |
+
*/
|
| 97 |
+
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
| 98 |
+
# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
|
| 99 |
+
# endif
|
| 100 |
+
|
| 101 |
+
/*-
|
| 102 |
+
* New with 3.0: use part of the flags to denote exact type of RSA key,
|
| 103 |
+
* some of which are limited to specific signature and encryption schemes.
|
| 104 |
+
* These different types share the same RSA structure, but indicate the
|
| 105 |
+
* use of certain fields in that structure.
|
| 106 |
+
* Currently known are:
|
| 107 |
+
* RSA - this is the "normal" unlimited RSA structure (typenum 0)
|
| 108 |
+
* RSASSA-PSS - indicates that the PSS parameters are used.
|
| 109 |
+
* RSAES-OAEP - no specific field used for the moment, but OAEP padding
|
| 110 |
+
* is expected. (currently unused)
|
| 111 |
+
*
|
| 112 |
+
* 4 bits allow for 16 types
|
| 113 |
+
*/
|
| 114 |
+
# define RSA_FLAG_TYPE_MASK 0xF000
|
| 115 |
+
# define RSA_FLAG_TYPE_RSA 0x0000
|
| 116 |
+
# define RSA_FLAG_TYPE_RSASSAPSS 0x1000
|
| 117 |
+
# define RSA_FLAG_TYPE_RSAESOAEP 0x2000
|
| 118 |
+
|
| 119 |
+
int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
|
| 120 |
+
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);
|
| 121 |
+
|
| 122 |
+
int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
| 123 |
+
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
|
| 124 |
+
|
| 125 |
+
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
|
| 126 |
+
int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
| 127 |
+
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
|
| 128 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
|
| 129 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 130 |
+
OSSL_DEPRECATEDIN_3_0
|
| 131 |
+
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
| 132 |
+
# endif
|
| 133 |
+
|
| 134 |
+
/* Salt length matches digest */
|
| 135 |
+
# define RSA_PSS_SALTLEN_DIGEST -1
|
| 136 |
+
/* Verify only: auto detect salt length */
|
| 137 |
+
# define RSA_PSS_SALTLEN_AUTO -2
|
| 138 |
+
/* Set salt length to maximum possible */
|
| 139 |
+
# define RSA_PSS_SALTLEN_MAX -3
|
| 140 |
+
/* Old compatible max salt length for sign only */
|
| 141 |
+
# define RSA_PSS_SALTLEN_MAX_SIGN -2
|
| 142 |
+
|
| 143 |
+
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 144 |
+
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
| 145 |
+
const char *mdprops);
|
| 146 |
+
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
| 147 |
+
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
|
| 148 |
+
size_t namelen);
|
| 149 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 150 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx,
|
| 151 |
+
const char *mdname);
|
| 152 |
+
|
| 153 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 154 |
+
int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx,
|
| 155 |
+
const char *mdname,
|
| 156 |
+
const char *mdprops);
|
| 157 |
+
|
| 158 |
+
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
| 159 |
+
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
| 160 |
+
const char *mdprops);
|
| 161 |
+
int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
| 162 |
+
int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
|
| 163 |
+
size_t namelen);
|
| 164 |
+
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen);
|
| 165 |
+
int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
| 166 |
+
|
| 167 |
+
# define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
|
| 168 |
+
# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
|
| 169 |
+
|
| 170 |
+
# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
|
| 171 |
+
# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
|
| 172 |
+
# define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
|
| 173 |
+
|
| 174 |
+
# define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
|
| 175 |
+
# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
|
| 176 |
+
# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
|
| 177 |
+
|
| 178 |
+
# define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
|
| 179 |
+
# define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
|
| 180 |
+
|
| 181 |
+
# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
|
| 182 |
+
# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
|
| 183 |
+
|
| 184 |
+
# define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
|
| 185 |
+
|
| 186 |
+
# define RSA_PKCS1_PADDING 1
|
| 187 |
+
# define RSA_NO_PADDING 3
|
| 188 |
+
# define RSA_PKCS1_OAEP_PADDING 4
|
| 189 |
+
# define RSA_X931_PADDING 5
|
| 190 |
+
|
| 191 |
+
/* EVP_PKEY_ only */
|
| 192 |
+
# define RSA_PKCS1_PSS_PADDING 6
|
| 193 |
+
# define RSA_PKCS1_WITH_TLS_PADDING 7
|
| 194 |
+
|
| 195 |
+
# define RSA_PKCS1_PADDING_SIZE 11
|
| 196 |
+
|
| 197 |
+
# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
|
| 198 |
+
# define RSA_get_app_data(s) RSA_get_ex_data(s,0)
|
| 199 |
+
|
| 200 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 201 |
+
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
|
| 202 |
+
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
|
| 203 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
|
| 204 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
|
| 205 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
|
| 206 |
+
|
| 207 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
|
| 208 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
|
| 209 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r,
|
| 210 |
+
BIGNUM *dmp1, BIGNUM *dmq1,
|
| 211 |
+
BIGNUM *iqmp);
|
| 212 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set0_multi_prime_params(RSA *r,
|
| 213 |
+
BIGNUM *primes[],
|
| 214 |
+
BIGNUM *exps[],
|
| 215 |
+
BIGNUM *coeffs[],
|
| 216 |
+
int pnum);
|
| 217 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
|
| 218 |
+
const BIGNUM **n, const BIGNUM **e,
|
| 219 |
+
const BIGNUM **d);
|
| 220 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_factors(const RSA *r,
|
| 221 |
+
const BIGNUM **p, const BIGNUM **q);
|
| 222 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get_multi_prime_extra_count(const RSA *r);
|
| 223 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get0_multi_prime_factors(const RSA *r,
|
| 224 |
+
const BIGNUM *primes[]);
|
| 225 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
|
| 226 |
+
const BIGNUM **dmp1,
|
| 227 |
+
const BIGNUM **dmq1,
|
| 228 |
+
const BIGNUM **iqmp);
|
| 229 |
+
OSSL_DEPRECATEDIN_3_0
|
| 230 |
+
int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[],
|
| 231 |
+
const BIGNUM *coeffs[]);
|
| 232 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_n(const RSA *d);
|
| 233 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_e(const RSA *d);
|
| 234 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_d(const RSA *d);
|
| 235 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_p(const RSA *d);
|
| 236 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_q(const RSA *d);
|
| 237 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmp1(const RSA *r);
|
| 238 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmq1(const RSA *r);
|
| 239 |
+
OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_iqmp(const RSA *r);
|
| 240 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r);
|
| 241 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
|
| 242 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags);
|
| 243 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
|
| 244 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
|
| 245 |
+
OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r);
|
| 246 |
+
# endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 247 |
+
|
| 248 |
+
# define EVP_RSA_gen(bits) \
|
| 249 |
+
EVP_PKEY_Q_keygen(NULL, NULL, "RSA", (size_t)(0 + (bits)))
|
| 250 |
+
|
| 251 |
+
/* Deprecated version */
|
| 252 |
+
# ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
| 253 |
+
OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void
|
| 254 |
+
(*callback) (int, int, void *),
|
| 255 |
+
void *cb_arg);
|
| 256 |
+
# endif
|
| 257 |
+
|
| 258 |
+
/* New version */
|
| 259 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 260 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
|
| 261 |
+
BN_GENCB *cb);
|
| 262 |
+
/* Multi-prime version */
|
| 263 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits,
|
| 264 |
+
int primes, BIGNUM *e,
|
| 265 |
+
BN_GENCB *cb);
|
| 266 |
+
|
| 267 |
+
OSSL_DEPRECATEDIN_3_0
|
| 268 |
+
int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2,
|
| 269 |
+
BIGNUM *q1, BIGNUM *q2,
|
| 270 |
+
const BIGNUM *Xp1, const BIGNUM *Xp2,
|
| 271 |
+
const BIGNUM *Xp, const BIGNUM *Xq1,
|
| 272 |
+
const BIGNUM *Xq2, const BIGNUM *Xq,
|
| 273 |
+
const BIGNUM *e, BN_GENCB *cb);
|
| 274 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_X931_generate_key_ex(RSA *rsa, int bits,
|
| 275 |
+
const BIGNUM *e,
|
| 276 |
+
BN_GENCB *cb);
|
| 277 |
+
|
| 278 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_check_key(const RSA *);
|
| 279 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_check_key_ex(const RSA *, BN_GENCB *cb);
|
| 280 |
+
/* next 4 return -1 on error */
|
| 281 |
+
OSSL_DEPRECATEDIN_3_0
|
| 282 |
+
int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 283 |
+
RSA *rsa, int padding);
|
| 284 |
+
OSSL_DEPRECATEDIN_3_0
|
| 285 |
+
int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 286 |
+
RSA *rsa, int padding);
|
| 287 |
+
OSSL_DEPRECATEDIN_3_0
|
| 288 |
+
int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 289 |
+
RSA *rsa, int padding);
|
| 290 |
+
OSSL_DEPRECATEDIN_3_0
|
| 291 |
+
int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
| 292 |
+
RSA *rsa, int padding);
|
| 293 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
|
| 294 |
+
/* "up" the RSA object's reference count */
|
| 295 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_up_ref(RSA *r);
|
| 296 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
|
| 297 |
+
|
| 298 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_set_default_method(const RSA_METHOD *meth);
|
| 299 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_default_method(void);
|
| 300 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_null_method(void);
|
| 301 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_method(const RSA *rsa);
|
| 302 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
|
| 303 |
+
|
| 304 |
+
/* these are the actual RSA functions */
|
| 305 |
+
OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
|
| 306 |
+
|
| 307 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
| 308 |
+
RSA, RSAPublicKey)
|
| 309 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
|
| 310 |
+
RSA, RSAPrivateKey)
|
| 311 |
+
# endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 312 |
+
|
| 313 |
+
int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
|
| 314 |
+
|
| 315 |
+
struct rsa_pss_params_st {
|
| 316 |
+
X509_ALGOR *hashAlgorithm;
|
| 317 |
+
X509_ALGOR *maskGenAlgorithm;
|
| 318 |
+
ASN1_INTEGER *saltLength;
|
| 319 |
+
ASN1_INTEGER *trailerField;
|
| 320 |
+
/* Decoded hash algorithm from maskGenAlgorithm */
|
| 321 |
+
X509_ALGOR *maskHash;
|
| 322 |
+
};
|
| 323 |
+
|
| 324 |
+
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
|
| 325 |
+
DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS)
|
| 326 |
+
|
| 327 |
+
typedef struct rsa_oaep_params_st {
|
| 328 |
+
X509_ALGOR *hashFunc;
|
| 329 |
+
X509_ALGOR *maskGenFunc;
|
| 330 |
+
X509_ALGOR *pSourceFunc;
|
| 331 |
+
/* Decoded hash algorithm from maskGenFunc */
|
| 332 |
+
X509_ALGOR *maskHash;
|
| 333 |
+
} RSA_OAEP_PARAMS;
|
| 334 |
+
|
| 335 |
+
DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
|
| 336 |
+
|
| 337 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 338 |
+
# ifndef OPENSSL_NO_STDIO
|
| 339 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_print_fp(FILE *fp, const RSA *r, int offset);
|
| 340 |
+
# endif
|
| 341 |
+
|
| 342 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_print(BIO *bp, const RSA *r, int offset);
|
| 343 |
+
|
| 344 |
+
/*
|
| 345 |
+
* The following 2 functions sign and verify a X509_SIG ASN1 object inside
|
| 346 |
+
* PKCS#1 padded RSA encryption
|
| 347 |
+
*/
|
| 348 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_sign(int type, const unsigned char *m,
|
| 349 |
+
unsigned int m_length, unsigned char *sigret,
|
| 350 |
+
unsigned int *siglen, RSA *rsa);
|
| 351 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_verify(int type, const unsigned char *m,
|
| 352 |
+
unsigned int m_length,
|
| 353 |
+
const unsigned char *sigbuf,
|
| 354 |
+
unsigned int siglen, RSA *rsa);
|
| 355 |
+
|
| 356 |
+
/*
|
| 357 |
+
* The following 2 function sign and verify a ASN1_OCTET_STRING object inside
|
| 358 |
+
* PKCS#1 padded RSA encryption
|
| 359 |
+
*/
|
| 360 |
+
OSSL_DEPRECATEDIN_3_0
|
| 361 |
+
int RSA_sign_ASN1_OCTET_STRING(int type,
|
| 362 |
+
const unsigned char *m, unsigned int m_length,
|
| 363 |
+
unsigned char *sigret, unsigned int *siglen,
|
| 364 |
+
RSA *rsa);
|
| 365 |
+
OSSL_DEPRECATEDIN_3_0
|
| 366 |
+
int RSA_verify_ASN1_OCTET_STRING(int type,
|
| 367 |
+
const unsigned char *m, unsigned int m_length,
|
| 368 |
+
unsigned char *sigbuf, unsigned int siglen,
|
| 369 |
+
RSA *rsa);
|
| 370 |
+
|
| 371 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
| 372 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_blinding_off(RSA *rsa);
|
| 373 |
+
OSSL_DEPRECATEDIN_3_0 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
|
| 374 |
+
|
| 375 |
+
OSSL_DEPRECATEDIN_3_0
|
| 376 |
+
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
| 377 |
+
const unsigned char *f, int fl);
|
| 378 |
+
OSSL_DEPRECATEDIN_3_0
|
| 379 |
+
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
|
| 380 |
+
const unsigned char *f, int fl,
|
| 381 |
+
int rsa_len);
|
| 382 |
+
OSSL_DEPRECATEDIN_3_0
|
| 383 |
+
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
|
| 384 |
+
const unsigned char *f, int fl);
|
| 385 |
+
OSSL_DEPRECATEDIN_3_0
|
| 386 |
+
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
| 387 |
+
const unsigned char *f, int fl,
|
| 388 |
+
int rsa_len);
|
| 389 |
+
OSSL_DEPRECATEDIN_3_0 int PKCS1_MGF1(unsigned char *mask, long len,
|
| 390 |
+
const unsigned char *seed, long seedlen,
|
| 391 |
+
const EVP_MD *dgst);
|
| 392 |
+
OSSL_DEPRECATEDIN_3_0
|
| 393 |
+
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
|
| 394 |
+
const unsigned char *f, int fl,
|
| 395 |
+
const unsigned char *p, int pl);
|
| 396 |
+
OSSL_DEPRECATEDIN_3_0
|
| 397 |
+
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
|
| 398 |
+
const unsigned char *f, int fl, int rsa_len,
|
| 399 |
+
const unsigned char *p, int pl);
|
| 400 |
+
OSSL_DEPRECATEDIN_3_0
|
| 401 |
+
int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
| 402 |
+
const unsigned char *from, int flen,
|
| 403 |
+
const unsigned char *param, int plen,
|
| 404 |
+
const EVP_MD *md, const EVP_MD *mgf1md);
|
| 405 |
+
OSSL_DEPRECATEDIN_3_0
|
| 406 |
+
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
| 407 |
+
const unsigned char *from, int flen,
|
| 408 |
+
int num,
|
| 409 |
+
const unsigned char *param, int plen,
|
| 410 |
+
const EVP_MD *md, const EVP_MD *mgf1md);
|
| 411 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_none(unsigned char *to, int tlen,
|
| 412 |
+
const unsigned char *f, int fl);
|
| 413 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_none(unsigned char *to, int tlen,
|
| 414 |
+
const unsigned char *f, int fl,
|
| 415 |
+
int rsa_len);
|
| 416 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_X931(unsigned char *to, int tlen,
|
| 417 |
+
const unsigned char *f, int fl);
|
| 418 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_X931(unsigned char *to, int tlen,
|
| 419 |
+
const unsigned char *f, int fl,
|
| 420 |
+
int rsa_len);
|
| 421 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_X931_hash_id(int nid);
|
| 422 |
+
|
| 423 |
+
OSSL_DEPRECATEDIN_3_0
|
| 424 |
+
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
|
| 425 |
+
const EVP_MD *Hash, const unsigned char *EM,
|
| 426 |
+
int sLen);
|
| 427 |
+
OSSL_DEPRECATEDIN_3_0
|
| 428 |
+
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
|
| 429 |
+
const unsigned char *mHash, const EVP_MD *Hash,
|
| 430 |
+
int sLen);
|
| 431 |
+
|
| 432 |
+
OSSL_DEPRECATEDIN_3_0
|
| 433 |
+
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
|
| 434 |
+
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
| 435 |
+
const unsigned char *EM, int sLen);
|
| 436 |
+
|
| 437 |
+
OSSL_DEPRECATEDIN_3_0
|
| 438 |
+
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
|
| 439 |
+
const unsigned char *mHash,
|
| 440 |
+
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
| 441 |
+
int sLen);
|
| 442 |
+
|
| 443 |
+
# define RSA_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 444 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef)
|
| 445 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg);
|
| 446 |
+
OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx);
|
| 447 |
+
|
| 448 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPublicKey)
|
| 449 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPrivateKey)
|
| 450 |
+
|
| 451 |
+
/*
|
| 452 |
+
* If this flag is set the RSA method is FIPS compliant and can be used in
|
| 453 |
+
* FIPS mode. This is set in the validated module method. If an application
|
| 454 |
+
* sets this flag in its own methods it is its responsibility to ensure the
|
| 455 |
+
* result is compliant.
|
| 456 |
+
*/
|
| 457 |
+
|
| 458 |
+
# define RSA_FLAG_FIPS_METHOD 0x0400
|
| 459 |
+
|
| 460 |
+
/*
|
| 461 |
+
* If this flag is set the operations normally disabled in FIPS mode are
|
| 462 |
+
* permitted it is then the applications responsibility to ensure that the
|
| 463 |
+
* usage is compliant.
|
| 464 |
+
*/
|
| 465 |
+
|
| 466 |
+
# define RSA_FLAG_NON_FIPS_ALLOW 0x0400
|
| 467 |
+
/*
|
| 468 |
+
* Application has decided PRNG is good enough to generate a key: don't
|
| 469 |
+
* check.
|
| 470 |
+
*/
|
| 471 |
+
# define RSA_FLAG_CHECKED 0x0800
|
| 472 |
+
|
| 473 |
+
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags);
|
| 474 |
+
OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth);
|
| 475 |
+
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
|
| 476 |
+
OSSL_DEPRECATEDIN_3_0 const char *RSA_meth_get0_name(const RSA_METHOD *meth);
|
| 477 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set1_name(RSA_METHOD *meth,
|
| 478 |
+
const char *name);
|
| 479 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_get_flags(const RSA_METHOD *meth);
|
| 480 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
|
| 481 |
+
OSSL_DEPRECATEDIN_3_0 void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
|
| 482 |
+
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set0_app_data(RSA_METHOD *meth,
|
| 483 |
+
void *app_data);
|
| 484 |
+
OSSL_DEPRECATEDIN_3_0
|
| 485 |
+
int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) (int flen,
|
| 486 |
+
const unsigned char *from,
|
| 487 |
+
unsigned char *to,
|
| 488 |
+
RSA *rsa, int padding);
|
| 489 |
+
OSSL_DEPRECATEDIN_3_0
|
| 490 |
+
int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
|
| 491 |
+
int (*pub_enc) (int flen, const unsigned char *from,
|
| 492 |
+
unsigned char *to, RSA *rsa,
|
| 493 |
+
int padding));
|
| 494 |
+
OSSL_DEPRECATEDIN_3_0
|
| 495 |
+
int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) (int flen,
|
| 496 |
+
const unsigned char *from,
|
| 497 |
+
unsigned char *to,
|
| 498 |
+
RSA *rsa, int padding);
|
| 499 |
+
OSSL_DEPRECATEDIN_3_0
|
| 500 |
+
int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
|
| 501 |
+
int (*pub_dec) (int flen, const unsigned char *from,
|
| 502 |
+
unsigned char *to, RSA *rsa,
|
| 503 |
+
int padding));
|
| 504 |
+
OSSL_DEPRECATEDIN_3_0
|
| 505 |
+
int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) (int flen,
|
| 506 |
+
const unsigned char *from,
|
| 507 |
+
unsigned char *to,
|
| 508 |
+
RSA *rsa, int padding);
|
| 509 |
+
OSSL_DEPRECATEDIN_3_0
|
| 510 |
+
int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
|
| 511 |
+
int (*priv_enc) (int flen, const unsigned char *from,
|
| 512 |
+
unsigned char *to, RSA *rsa,
|
| 513 |
+
int padding));
|
| 514 |
+
OSSL_DEPRECATEDIN_3_0
|
| 515 |
+
int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) (int flen,
|
| 516 |
+
const unsigned char *from,
|
| 517 |
+
unsigned char *to,
|
| 518 |
+
RSA *rsa, int padding);
|
| 519 |
+
OSSL_DEPRECATEDIN_3_0
|
| 520 |
+
int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
|
| 521 |
+
int (*priv_dec) (int flen, const unsigned char *from,
|
| 522 |
+
unsigned char *to, RSA *rsa,
|
| 523 |
+
int padding));
|
| 524 |
+
OSSL_DEPRECATEDIN_3_0
|
| 525 |
+
int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r0,
|
| 526 |
+
const BIGNUM *i,
|
| 527 |
+
RSA *rsa, BN_CTX *ctx);
|
| 528 |
+
OSSL_DEPRECATEDIN_3_0
|
| 529 |
+
int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
|
| 530 |
+
int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa,
|
| 531 |
+
BN_CTX *ctx));
|
| 532 |
+
OSSL_DEPRECATEDIN_3_0
|
| 533 |
+
int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r,
|
| 534 |
+
const BIGNUM *a,
|
| 535 |
+
const BIGNUM *p,
|
| 536 |
+
const BIGNUM *m,
|
| 537 |
+
BN_CTX *ctx,
|
| 538 |
+
BN_MONT_CTX *m_ctx);
|
| 539 |
+
OSSL_DEPRECATEDIN_3_0
|
| 540 |
+
int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa,
|
| 541 |
+
int (*bn_mod_exp) (BIGNUM *r,
|
| 542 |
+
const BIGNUM *a,
|
| 543 |
+
const BIGNUM *p,
|
| 544 |
+
const BIGNUM *m,
|
| 545 |
+
BN_CTX *ctx,
|
| 546 |
+
BN_MONT_CTX *m_ctx));
|
| 547 |
+
OSSL_DEPRECATEDIN_3_0
|
| 548 |
+
int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa);
|
| 549 |
+
OSSL_DEPRECATEDIN_3_0
|
| 550 |
+
int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa));
|
| 551 |
+
OSSL_DEPRECATEDIN_3_0
|
| 552 |
+
int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa);
|
| 553 |
+
OSSL_DEPRECATEDIN_3_0
|
| 554 |
+
int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa));
|
| 555 |
+
OSSL_DEPRECATEDIN_3_0
|
| 556 |
+
int (*RSA_meth_get_sign(const RSA_METHOD *meth)) (int type,
|
| 557 |
+
const unsigned char *m,
|
| 558 |
+
unsigned int m_length,
|
| 559 |
+
unsigned char *sigret,
|
| 560 |
+
unsigned int *siglen,
|
| 561 |
+
const RSA *rsa);
|
| 562 |
+
OSSL_DEPRECATEDIN_3_0
|
| 563 |
+
int RSA_meth_set_sign(RSA_METHOD *rsa,
|
| 564 |
+
int (*sign) (int type, const unsigned char *m,
|
| 565 |
+
unsigned int m_length,
|
| 566 |
+
unsigned char *sigret, unsigned int *siglen,
|
| 567 |
+
const RSA *rsa));
|
| 568 |
+
OSSL_DEPRECATEDIN_3_0
|
| 569 |
+
int (*RSA_meth_get_verify(const RSA_METHOD *meth)) (int dtype,
|
| 570 |
+
const unsigned char *m,
|
| 571 |
+
unsigned int m_length,
|
| 572 |
+
const unsigned char *sigbuf,
|
| 573 |
+
unsigned int siglen,
|
| 574 |
+
const RSA *rsa);
|
| 575 |
+
OSSL_DEPRECATEDIN_3_0
|
| 576 |
+
int RSA_meth_set_verify(RSA_METHOD *rsa,
|
| 577 |
+
int (*verify) (int dtype, const unsigned char *m,
|
| 578 |
+
unsigned int m_length,
|
| 579 |
+
const unsigned char *sigbuf,
|
| 580 |
+
unsigned int siglen, const RSA *rsa));
|
| 581 |
+
OSSL_DEPRECATEDIN_3_0
|
| 582 |
+
int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) (RSA *rsa, int bits,
|
| 583 |
+
BIGNUM *e, BN_GENCB *cb);
|
| 584 |
+
OSSL_DEPRECATEDIN_3_0
|
| 585 |
+
int RSA_meth_set_keygen(RSA_METHOD *rsa,
|
| 586 |
+
int (*keygen) (RSA *rsa, int bits, BIGNUM *e,
|
| 587 |
+
BN_GENCB *cb));
|
| 588 |
+
OSSL_DEPRECATEDIN_3_0
|
| 589 |
+
int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) (RSA *rsa,
|
| 590 |
+
int bits,
|
| 591 |
+
int primes,
|
| 592 |
+
BIGNUM *e,
|
| 593 |
+
BN_GENCB *cb);
|
| 594 |
+
OSSL_DEPRECATEDIN_3_0
|
| 595 |
+
int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth,
|
| 596 |
+
int (*keygen) (RSA *rsa, int bits,
|
| 597 |
+
int primes, BIGNUM *e,
|
| 598 |
+
BN_GENCB *cb));
|
| 599 |
+
#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
|
| 600 |
+
|
| 601 |
+
# ifdef __cplusplus
|
| 602 |
+
}
|
| 603 |
+
# endif
|
| 604 |
+
#endif
|
llava_next/include/openssl/ssl2.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef OPENSSL_SSL2_H
|
| 11 |
+
# define OPENSSL_SSL2_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_SSL2_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
# define SSL2_VERSION 0x0002
|
| 24 |
+
|
| 25 |
+
# define SSL2_MT_CLIENT_HELLO 1
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
}
|
| 29 |
+
#endif
|
| 30 |
+
#endif
|
llava_next/include/openssl/sslerr_legacy.h
ADDED
|
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/*
|
| 11 |
+
* This header file preserves symbols from pre-3.0 OpenSSL.
|
| 12 |
+
* It should never be included directly, as it's already included
|
| 13 |
+
* by the public sslerr.h headers, and since it will go away some
|
| 14 |
+
* time in the future.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_SSLERR_LEGACY_H
|
| 18 |
+
# define OPENSSL_SSLERR_LEGACY_H
|
| 19 |
+
# pragma once
|
| 20 |
+
|
| 21 |
+
# include <openssl/macros.h>
|
| 22 |
+
# include <openssl/symhacks.h>
|
| 23 |
+
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 29 |
+
OSSL_DEPRECATEDIN_3_0 int ERR_load_SSL_strings(void);
|
| 30 |
+
|
| 31 |
+
/* Collected _F_ macros from OpenSSL 1.1.1 */
|
| 32 |
+
|
| 33 |
+
/*
|
| 34 |
+
* SSL function codes.
|
| 35 |
+
*/
|
| 36 |
+
# define SSL_F_ADD_CLIENT_KEY_SHARE_EXT 0
|
| 37 |
+
# define SSL_F_ADD_KEY_SHARE 0
|
| 38 |
+
# define SSL_F_BYTES_TO_CIPHER_LIST 0
|
| 39 |
+
# define SSL_F_CHECK_SUITEB_CIPHER_LIST 0
|
| 40 |
+
# define SSL_F_CIPHERSUITE_CB 0
|
| 41 |
+
# define SSL_F_CONSTRUCT_CA_NAMES 0
|
| 42 |
+
# define SSL_F_CONSTRUCT_KEY_EXCHANGE_TBS 0
|
| 43 |
+
# define SSL_F_CONSTRUCT_STATEFUL_TICKET 0
|
| 44 |
+
# define SSL_F_CONSTRUCT_STATELESS_TICKET 0
|
| 45 |
+
# define SSL_F_CREATE_SYNTHETIC_MESSAGE_HASH 0
|
| 46 |
+
# define SSL_F_CREATE_TICKET_PREQUEL 0
|
| 47 |
+
# define SSL_F_CT_MOVE_SCTS 0
|
| 48 |
+
# define SSL_F_CT_STRICT 0
|
| 49 |
+
# define SSL_F_CUSTOM_EXT_ADD 0
|
| 50 |
+
# define SSL_F_CUSTOM_EXT_PARSE 0
|
| 51 |
+
# define SSL_F_D2I_SSL_SESSION 0
|
| 52 |
+
# define SSL_F_DANE_CTX_ENABLE 0
|
| 53 |
+
# define SSL_F_DANE_MTYPE_SET 0
|
| 54 |
+
# define SSL_F_DANE_TLSA_ADD 0
|
| 55 |
+
# define SSL_F_DERIVE_SECRET_KEY_AND_IV 0
|
| 56 |
+
# define SSL_F_DO_DTLS1_WRITE 0
|
| 57 |
+
# define SSL_F_DO_SSL3_WRITE 0
|
| 58 |
+
# define SSL_F_DTLS1_BUFFER_RECORD 0
|
| 59 |
+
# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 0
|
| 60 |
+
# define SSL_F_DTLS1_HEARTBEAT 0
|
| 61 |
+
# define SSL_F_DTLS1_HM_FRAGMENT_NEW 0
|
| 62 |
+
# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 0
|
| 63 |
+
# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 0
|
| 64 |
+
# define SSL_F_DTLS1_PROCESS_RECORD 0
|
| 65 |
+
# define SSL_F_DTLS1_READ_BYTES 0
|
| 66 |
+
# define SSL_F_DTLS1_READ_FAILED 0
|
| 67 |
+
# define SSL_F_DTLS1_RETRANSMIT_MESSAGE 0
|
| 68 |
+
# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 0
|
| 69 |
+
# define SSL_F_DTLS1_WRITE_BYTES 0
|
| 70 |
+
# define SSL_F_DTLSV1_LISTEN 0
|
| 71 |
+
# define SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0
|
| 72 |
+
# define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 0
|
| 73 |
+
# define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 0
|
| 74 |
+
# define SSL_F_DTLS_PROCESS_HELLO_VERIFY 0
|
| 75 |
+
# define SSL_F_DTLS_RECORD_LAYER_NEW 0
|
| 76 |
+
# define SSL_F_DTLS_WAIT_FOR_DRY 0
|
| 77 |
+
# define SSL_F_EARLY_DATA_COUNT_OK 0
|
| 78 |
+
# define SSL_F_FINAL_EARLY_DATA 0
|
| 79 |
+
# define SSL_F_FINAL_EC_PT_FORMATS 0
|
| 80 |
+
# define SSL_F_FINAL_EMS 0
|
| 81 |
+
# define SSL_F_FINAL_KEY_SHARE 0
|
| 82 |
+
# define SSL_F_FINAL_MAXFRAGMENTLEN 0
|
| 83 |
+
# define SSL_F_FINAL_RENEGOTIATE 0
|
| 84 |
+
# define SSL_F_FINAL_SERVER_NAME 0
|
| 85 |
+
# define SSL_F_FINAL_SIG_ALGS 0
|
| 86 |
+
# define SSL_F_GET_CERT_VERIFY_TBS_DATA 0
|
| 87 |
+
# define SSL_F_NSS_KEYLOG_INT 0
|
| 88 |
+
# define SSL_F_OPENSSL_INIT_SSL 0
|
| 89 |
+
# define SSL_F_OSSL_STATEM_CLIENT13_READ_TRANSITION 0
|
| 90 |
+
# define SSL_F_OSSL_STATEM_CLIENT13_WRITE_TRANSITION 0
|
| 91 |
+
# define SSL_F_OSSL_STATEM_CLIENT_CONSTRUCT_MESSAGE 0
|
| 92 |
+
# define SSL_F_OSSL_STATEM_CLIENT_POST_PROCESS_MESSAGE 0
|
| 93 |
+
# define SSL_F_OSSL_STATEM_CLIENT_PROCESS_MESSAGE 0
|
| 94 |
+
# define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 0
|
| 95 |
+
# define SSL_F_OSSL_STATEM_CLIENT_WRITE_TRANSITION 0
|
| 96 |
+
# define SSL_F_OSSL_STATEM_SERVER13_READ_TRANSITION 0
|
| 97 |
+
# define SSL_F_OSSL_STATEM_SERVER13_WRITE_TRANSITION 0
|
| 98 |
+
# define SSL_F_OSSL_STATEM_SERVER_CONSTRUCT_MESSAGE 0
|
| 99 |
+
# define SSL_F_OSSL_STATEM_SERVER_POST_PROCESS_MESSAGE 0
|
| 100 |
+
# define SSL_F_OSSL_STATEM_SERVER_POST_WORK 0
|
| 101 |
+
# define SSL_F_OSSL_STATEM_SERVER_PRE_WORK 0
|
| 102 |
+
# define SSL_F_OSSL_STATEM_SERVER_PROCESS_MESSAGE 0
|
| 103 |
+
# define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 0
|
| 104 |
+
# define SSL_F_OSSL_STATEM_SERVER_WRITE_TRANSITION 0
|
| 105 |
+
# define SSL_F_PARSE_CA_NAMES 0
|
| 106 |
+
# define SSL_F_PITEM_NEW 0
|
| 107 |
+
# define SSL_F_PQUEUE_NEW 0
|
| 108 |
+
# define SSL_F_PROCESS_KEY_SHARE_EXT 0
|
| 109 |
+
# define SSL_F_READ_STATE_MACHINE 0
|
| 110 |
+
# define SSL_F_SET_CLIENT_CIPHERSUITE 0
|
| 111 |
+
# define SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET 0
|
| 112 |
+
# define SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET 0
|
| 113 |
+
# define SSL_F_SRP_VERIFY_SERVER_PARAM 0
|
| 114 |
+
# define SSL_F_SSL3_CHANGE_CIPHER_STATE 0
|
| 115 |
+
# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 0
|
| 116 |
+
# define SSL_F_SSL3_CTRL 0
|
| 117 |
+
# define SSL_F_SSL3_CTX_CTRL 0
|
| 118 |
+
# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 0
|
| 119 |
+
# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 0
|
| 120 |
+
# define SSL_F_SSL3_ENC 0
|
| 121 |
+
# define SSL_F_SSL3_FINAL_FINISH_MAC 0
|
| 122 |
+
# define SSL_F_SSL3_FINISH_MAC 0
|
| 123 |
+
# define SSL_F_SSL3_GENERATE_KEY_BLOCK 0
|
| 124 |
+
# define SSL_F_SSL3_GENERATE_MASTER_SECRET 0
|
| 125 |
+
# define SSL_F_SSL3_GET_RECORD 0
|
| 126 |
+
# define SSL_F_SSL3_INIT_FINISHED_MAC 0
|
| 127 |
+
# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 0
|
| 128 |
+
# define SSL_F_SSL3_READ_BYTES 0
|
| 129 |
+
# define SSL_F_SSL3_READ_N 0
|
| 130 |
+
# define SSL_F_SSL3_SETUP_KEY_BLOCK 0
|
| 131 |
+
# define SSL_F_SSL3_SETUP_READ_BUFFER 0
|
| 132 |
+
# define SSL_F_SSL3_SETUP_WRITE_BUFFER 0
|
| 133 |
+
# define SSL_F_SSL3_WRITE_BYTES 0
|
| 134 |
+
# define SSL_F_SSL3_WRITE_PENDING 0
|
| 135 |
+
# define SSL_F_SSL_ADD_CERT_CHAIN 0
|
| 136 |
+
# define SSL_F_SSL_ADD_CERT_TO_BUF 0
|
| 137 |
+
# define SSL_F_SSL_ADD_CERT_TO_WPACKET 0
|
| 138 |
+
# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 0
|
| 139 |
+
# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 0
|
| 140 |
+
# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 0
|
| 141 |
+
# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 0
|
| 142 |
+
# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 0
|
| 143 |
+
# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 0
|
| 144 |
+
# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 0
|
| 145 |
+
# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 0
|
| 146 |
+
# define SSL_F_SSL_BAD_METHOD 0
|
| 147 |
+
# define SSL_F_SSL_BUILD_CERT_CHAIN 0
|
| 148 |
+
# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 0
|
| 149 |
+
# define SSL_F_SSL_CACHE_CIPHERLIST 0
|
| 150 |
+
# define SSL_F_SSL_CERT_ADD0_CHAIN_CERT 0
|
| 151 |
+
# define SSL_F_SSL_CERT_DUP 0
|
| 152 |
+
# define SSL_F_SSL_CERT_NEW 0
|
| 153 |
+
# define SSL_F_SSL_CERT_SET0_CHAIN 0
|
| 154 |
+
# define SSL_F_SSL_CHECK_PRIVATE_KEY 0
|
| 155 |
+
# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 0
|
| 156 |
+
# define SSL_F_SSL_CHECK_SRP_EXT_CLIENTHELLO 0
|
| 157 |
+
# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 0
|
| 158 |
+
# define SSL_F_SSL_CHOOSE_CLIENT_VERSION 0
|
| 159 |
+
# define SSL_F_SSL_CIPHER_DESCRIPTION 0
|
| 160 |
+
# define SSL_F_SSL_CIPHER_LIST_TO_BYTES 0
|
| 161 |
+
# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 0
|
| 162 |
+
# define SSL_F_SSL_CIPHER_STRENGTH_SORT 0
|
| 163 |
+
# define SSL_F_SSL_CLEAR 0
|
| 164 |
+
# define SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT 0
|
| 165 |
+
# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 0
|
| 166 |
+
# define SSL_F_SSL_CONF_CMD 0
|
| 167 |
+
# define SSL_F_SSL_CREATE_CIPHER_LIST 0
|
| 168 |
+
# define SSL_F_SSL_CTRL 0
|
| 169 |
+
# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 0
|
| 170 |
+
# define SSL_F_SSL_CTX_ENABLE_CT 0
|
| 171 |
+
# define SSL_F_SSL_CTX_MAKE_PROFILES 0
|
| 172 |
+
# define SSL_F_SSL_CTX_NEW 0
|
| 173 |
+
# define SSL_F_SSL_CTX_SET_ALPN_PROTOS 0
|
| 174 |
+
# define SSL_F_SSL_CTX_SET_CIPHER_LIST 0
|
| 175 |
+
# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 0
|
| 176 |
+
# define SSL_F_SSL_CTX_SET_CT_VALIDATION_CALLBACK 0
|
| 177 |
+
# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 0
|
| 178 |
+
# define SSL_F_SSL_CTX_SET_SSL_VERSION 0
|
| 179 |
+
# define SSL_F_SSL_CTX_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0
|
| 180 |
+
# define SSL_F_SSL_CTX_USE_CERTIFICATE 0
|
| 181 |
+
# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 0
|
| 182 |
+
# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 0
|
| 183 |
+
# define SSL_F_SSL_CTX_USE_PRIVATEKEY 0
|
| 184 |
+
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 0
|
| 185 |
+
# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 0
|
| 186 |
+
# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 0
|
| 187 |
+
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 0
|
| 188 |
+
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 0
|
| 189 |
+
# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 0
|
| 190 |
+
# define SSL_F_SSL_CTX_USE_SERVERINFO 0
|
| 191 |
+
# define SSL_F_SSL_CTX_USE_SERVERINFO_EX 0
|
| 192 |
+
# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 0
|
| 193 |
+
# define SSL_F_SSL_DANE_DUP 0
|
| 194 |
+
# define SSL_F_SSL_DANE_ENABLE 0
|
| 195 |
+
# define SSL_F_SSL_DERIVE 0
|
| 196 |
+
# define SSL_F_SSL_DO_CONFIG 0
|
| 197 |
+
# define SSL_F_SSL_DO_HANDSHAKE 0
|
| 198 |
+
# define SSL_F_SSL_DUP_CA_LIST 0
|
| 199 |
+
# define SSL_F_SSL_ENABLE_CT 0
|
| 200 |
+
# define SSL_F_SSL_GENERATE_PKEY_GROUP 0
|
| 201 |
+
# define SSL_F_SSL_GENERATE_SESSION_ID 0
|
| 202 |
+
# define SSL_F_SSL_GET_NEW_SESSION 0
|
| 203 |
+
# define SSL_F_SSL_GET_PREV_SESSION 0
|
| 204 |
+
# define SSL_F_SSL_GET_SERVER_CERT_INDEX 0
|
| 205 |
+
# define SSL_F_SSL_GET_SIGN_PKEY 0
|
| 206 |
+
# define SSL_F_SSL_HANDSHAKE_HASH 0
|
| 207 |
+
# define SSL_F_SSL_INIT_WBIO_BUFFER 0
|
| 208 |
+
# define SSL_F_SSL_KEY_UPDATE 0
|
| 209 |
+
# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 0
|
| 210 |
+
# define SSL_F_SSL_LOG_MASTER_SECRET 0
|
| 211 |
+
# define SSL_F_SSL_LOG_RSA_CLIENT_KEY_EXCHANGE 0
|
| 212 |
+
# define SSL_F_SSL_MODULE_INIT 0
|
| 213 |
+
# define SSL_F_SSL_NEW 0
|
| 214 |
+
# define SSL_F_SSL_NEXT_PROTO_VALIDATE 0
|
| 215 |
+
# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 0
|
| 216 |
+
# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 0
|
| 217 |
+
# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 0
|
| 218 |
+
# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 0
|
| 219 |
+
# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 0
|
| 220 |
+
# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 0
|
| 221 |
+
# define SSL_F_SSL_PEEK 0
|
| 222 |
+
# define SSL_F_SSL_PEEK_EX 0
|
| 223 |
+
# define SSL_F_SSL_PEEK_INTERNAL 0
|
| 224 |
+
# define SSL_F_SSL_READ 0
|
| 225 |
+
# define SSL_F_SSL_READ_EARLY_DATA 0
|
| 226 |
+
# define SSL_F_SSL_READ_EX 0
|
| 227 |
+
# define SSL_F_SSL_READ_INTERNAL 0
|
| 228 |
+
# define SSL_F_SSL_RENEGOTIATE 0
|
| 229 |
+
# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 0
|
| 230 |
+
# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 0
|
| 231 |
+
# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 0
|
| 232 |
+
# define SSL_F_SSL_SESSION_DUP 0
|
| 233 |
+
# define SSL_F_SSL_SESSION_NEW 0
|
| 234 |
+
# define SSL_F_SSL_SESSION_PRINT_FP 0
|
| 235 |
+
# define SSL_F_SSL_SESSION_SET1_ID 0
|
| 236 |
+
# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 0
|
| 237 |
+
# define SSL_F_SSL_SET_ALPN_PROTOS 0
|
| 238 |
+
# define SSL_F_SSL_SET_CERT 0
|
| 239 |
+
# define SSL_F_SSL_SET_CERT_AND_KEY 0
|
| 240 |
+
# define SSL_F_SSL_SET_CIPHER_LIST 0
|
| 241 |
+
# define SSL_F_SSL_SET_CT_VALIDATION_CALLBACK 0
|
| 242 |
+
# define SSL_F_SSL_SET_FD 0
|
| 243 |
+
# define SSL_F_SSL_SET_PKEY 0
|
| 244 |
+
# define SSL_F_SSL_SET_RFD 0
|
| 245 |
+
# define SSL_F_SSL_SET_SESSION 0
|
| 246 |
+
# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 0
|
| 247 |
+
# define SSL_F_SSL_SET_SESSION_TICKET_EXT 0
|
| 248 |
+
# define SSL_F_SSL_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0
|
| 249 |
+
# define SSL_F_SSL_SET_WFD 0
|
| 250 |
+
# define SSL_F_SSL_SHUTDOWN 0
|
| 251 |
+
# define SSL_F_SSL_SRP_CTX_INIT 0
|
| 252 |
+
# define SSL_F_SSL_START_ASYNC_JOB 0
|
| 253 |
+
# define SSL_F_SSL_UNDEFINED_FUNCTION 0
|
| 254 |
+
# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 0
|
| 255 |
+
# define SSL_F_SSL_USE_CERTIFICATE 0
|
| 256 |
+
# define SSL_F_SSL_USE_CERTIFICATE_ASN1 0
|
| 257 |
+
# define SSL_F_SSL_USE_CERTIFICATE_FILE 0
|
| 258 |
+
# define SSL_F_SSL_USE_PRIVATEKEY 0
|
| 259 |
+
# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 0
|
| 260 |
+
# define SSL_F_SSL_USE_PRIVATEKEY_FILE 0
|
| 261 |
+
# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 0
|
| 262 |
+
# define SSL_F_SSL_USE_RSAPRIVATEKEY 0
|
| 263 |
+
# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 0
|
| 264 |
+
# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 0
|
| 265 |
+
# define SSL_F_SSL_VALIDATE_CT 0
|
| 266 |
+
# define SSL_F_SSL_VERIFY_CERT_CHAIN 0
|
| 267 |
+
# define SSL_F_SSL_VERIFY_CLIENT_POST_HANDSHAKE 0
|
| 268 |
+
# define SSL_F_SSL_WRITE 0
|
| 269 |
+
# define SSL_F_SSL_WRITE_EARLY_DATA 0
|
| 270 |
+
# define SSL_F_SSL_WRITE_EARLY_FINISH 0
|
| 271 |
+
# define SSL_F_SSL_WRITE_EX 0
|
| 272 |
+
# define SSL_F_SSL_WRITE_INTERNAL 0
|
| 273 |
+
# define SSL_F_STATE_MACHINE 0
|
| 274 |
+
# define SSL_F_TLS12_CHECK_PEER_SIGALG 0
|
| 275 |
+
# define SSL_F_TLS12_COPY_SIGALGS 0
|
| 276 |
+
# define SSL_F_TLS13_CHANGE_CIPHER_STATE 0
|
| 277 |
+
# define SSL_F_TLS13_ENC 0
|
| 278 |
+
# define SSL_F_TLS13_FINAL_FINISH_MAC 0
|
| 279 |
+
# define SSL_F_TLS13_GENERATE_SECRET 0
|
| 280 |
+
# define SSL_F_TLS13_HKDF_EXPAND 0
|
| 281 |
+
# define SSL_F_TLS13_RESTORE_HANDSHAKE_DIGEST_FOR_PHA 0
|
| 282 |
+
# define SSL_F_TLS13_SAVE_HANDSHAKE_DIGEST_FOR_PHA 0
|
| 283 |
+
# define SSL_F_TLS13_SETUP_KEY_BLOCK 0
|
| 284 |
+
# define SSL_F_TLS1_CHANGE_CIPHER_STATE 0
|
| 285 |
+
# define SSL_F_TLS1_CHECK_DUPLICATE_EXTENSIONS 0
|
| 286 |
+
# define SSL_F_TLS1_ENC 0
|
| 287 |
+
# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 0
|
| 288 |
+
# define SSL_F_TLS1_GET_CURVELIST 0
|
| 289 |
+
# define SSL_F_TLS1_PRF 0
|
| 290 |
+
# define SSL_F_TLS1_SAVE_U16 0
|
| 291 |
+
# define SSL_F_TLS1_SETUP_KEY_BLOCK 0
|
| 292 |
+
# define SSL_F_TLS1_SET_GROUPS 0
|
| 293 |
+
# define SSL_F_TLS1_SET_RAW_SIGALGS 0
|
| 294 |
+
# define SSL_F_TLS1_SET_SERVER_SIGALGS 0
|
| 295 |
+
# define SSL_F_TLS1_SET_SHARED_SIGALGS 0
|
| 296 |
+
# define SSL_F_TLS1_SET_SIGALGS 0
|
| 297 |
+
# define SSL_F_TLS_CHOOSE_SIGALG 0
|
| 298 |
+
# define SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK 0
|
| 299 |
+
# define SSL_F_TLS_COLLECT_EXTENSIONS 0
|
| 300 |
+
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_AUTHORITIES 0
|
| 301 |
+
# define SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST 0
|
| 302 |
+
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS 0
|
| 303 |
+
# define SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY 0
|
| 304 |
+
# define SSL_F_TLS_CONSTRUCT_CERT_VERIFY 0
|
| 305 |
+
# define SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0
|
| 306 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_DHE 0
|
| 307 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_ECDHE 0
|
| 308 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_GOST 0
|
| 309 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_PSK_PREAMBLE 0
|
| 310 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_RSA 0
|
| 311 |
+
# define SSL_F_TLS_CONSTRUCT_CKE_SRP 0
|
| 312 |
+
# define SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE 0
|
| 313 |
+
# define SSL_F_TLS_CONSTRUCT_CLIENT_HELLO 0
|
| 314 |
+
# define SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE 0
|
| 315 |
+
# define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 0
|
| 316 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_ALPN 0
|
| 317 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_CERTIFICATE 0
|
| 318 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_COOKIE 0
|
| 319 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_EARLY_DATA 0
|
| 320 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_EC_PT_FORMATS 0
|
| 321 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_EMS 0
|
| 322 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_ETM 0
|
| 323 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_HELLO 0
|
| 324 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_EXCHANGE 0
|
| 325 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE 0
|
| 326 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_MAXFRAGMENTLEN 0
|
| 327 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_NPN 0
|
| 328 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_PADDING 0
|
| 329 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH 0
|
| 330 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK 0
|
| 331 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES 0
|
| 332 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE 0
|
| 333 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SCT 0
|
| 334 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME 0
|
| 335 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SESSION_TICKET 0
|
| 336 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SIG_ALGS 0
|
| 337 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SRP 0
|
| 338 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_STATUS_REQUEST 0
|
| 339 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_GROUPS 0
|
| 340 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS 0
|
| 341 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_USE_SRTP 0
|
| 342 |
+
# define SSL_F_TLS_CONSTRUCT_CTOS_VERIFY 0
|
| 343 |
+
# define SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS 0
|
| 344 |
+
# define SSL_F_TLS_CONSTRUCT_END_OF_EARLY_DATA 0
|
| 345 |
+
# define SSL_F_TLS_CONSTRUCT_EXTENSIONS 0
|
| 346 |
+
# define SSL_F_TLS_CONSTRUCT_FINISHED 0
|
| 347 |
+
# define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 0
|
| 348 |
+
# define SSL_F_TLS_CONSTRUCT_HELLO_RETRY_REQUEST 0
|
| 349 |
+
# define SSL_F_TLS_CONSTRUCT_KEY_UPDATE 0
|
| 350 |
+
# define SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET 0
|
| 351 |
+
# define SSL_F_TLS_CONSTRUCT_NEXT_PROTO 0
|
| 352 |
+
# define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 0
|
| 353 |
+
# define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 0
|
| 354 |
+
# define SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE 0
|
| 355 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_ALPN 0
|
| 356 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_CERTIFICATE 0
|
| 357 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_COOKIE 0
|
| 358 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_CRYPTOPRO_BUG 0
|
| 359 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_DONE 0
|
| 360 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA 0
|
| 361 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO 0
|
| 362 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_EC_PT_FORMATS 0
|
| 363 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_EMS 0
|
| 364 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_ETM 0
|
| 365 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_HELLO 0
|
| 366 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_EXCHANGE 0
|
| 367 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE 0
|
| 368 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN 0
|
| 369 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG 0
|
| 370 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_PSK 0
|
| 371 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE 0
|
| 372 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME 0
|
| 373 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET 0
|
| 374 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_STATUS_REQUEST 0
|
| 375 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_GROUPS 0
|
| 376 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS 0
|
| 377 |
+
# define SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP 0
|
| 378 |
+
# define SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO 0
|
| 379 |
+
# define SSL_F_TLS_FINISH_HANDSHAKE 0
|
| 380 |
+
# define SSL_F_TLS_GET_MESSAGE_BODY 0
|
| 381 |
+
# define SSL_F_TLS_GET_MESSAGE_HEADER 0
|
| 382 |
+
# define SSL_F_TLS_HANDLE_ALPN 0
|
| 383 |
+
# define SSL_F_TLS_HANDLE_STATUS_REQUEST 0
|
| 384 |
+
# define SSL_F_TLS_PARSE_CERTIFICATE_AUTHORITIES 0
|
| 385 |
+
# define SSL_F_TLS_PARSE_CLIENTHELLO_TLSEXT 0
|
| 386 |
+
# define SSL_F_TLS_PARSE_CTOS_ALPN 0
|
| 387 |
+
# define SSL_F_TLS_PARSE_CTOS_COOKIE 0
|
| 388 |
+
# define SSL_F_TLS_PARSE_CTOS_EARLY_DATA 0
|
| 389 |
+
# define SSL_F_TLS_PARSE_CTOS_EC_PT_FORMATS 0
|
| 390 |
+
# define SSL_F_TLS_PARSE_CTOS_EMS 0
|
| 391 |
+
# define SSL_F_TLS_PARSE_CTOS_KEY_SHARE 0
|
| 392 |
+
# define SSL_F_TLS_PARSE_CTOS_MAXFRAGMENTLEN 0
|
| 393 |
+
# define SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH 0
|
| 394 |
+
# define SSL_F_TLS_PARSE_CTOS_PSK 0
|
| 395 |
+
# define SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES 0
|
| 396 |
+
# define SSL_F_TLS_PARSE_CTOS_RENEGOTIATE 0
|
| 397 |
+
# define SSL_F_TLS_PARSE_CTOS_SERVER_NAME 0
|
| 398 |
+
# define SSL_F_TLS_PARSE_CTOS_SESSION_TICKET 0
|
| 399 |
+
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS 0
|
| 400 |
+
# define SSL_F_TLS_PARSE_CTOS_SIG_ALGS_CERT 0
|
| 401 |
+
# define SSL_F_TLS_PARSE_CTOS_SRP 0
|
| 402 |
+
# define SSL_F_TLS_PARSE_CTOS_STATUS_REQUEST 0
|
| 403 |
+
# define SSL_F_TLS_PARSE_CTOS_SUPPORTED_GROUPS 0
|
| 404 |
+
# define SSL_F_TLS_PARSE_CTOS_USE_SRTP 0
|
| 405 |
+
# define SSL_F_TLS_PARSE_STOC_ALPN 0
|
| 406 |
+
# define SSL_F_TLS_PARSE_STOC_COOKIE 0
|
| 407 |
+
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA 0
|
| 408 |
+
# define SSL_F_TLS_PARSE_STOC_EARLY_DATA_INFO 0
|
| 409 |
+
# define SSL_F_TLS_PARSE_STOC_EC_PT_FORMATS 0
|
| 410 |
+
# define SSL_F_TLS_PARSE_STOC_KEY_SHARE 0
|
| 411 |
+
# define SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN 0
|
| 412 |
+
# define SSL_F_TLS_PARSE_STOC_NPN 0
|
| 413 |
+
# define SSL_F_TLS_PARSE_STOC_PSK 0
|
| 414 |
+
# define SSL_F_TLS_PARSE_STOC_RENEGOTIATE 0
|
| 415 |
+
# define SSL_F_TLS_PARSE_STOC_SCT 0
|
| 416 |
+
# define SSL_F_TLS_PARSE_STOC_SERVER_NAME 0
|
| 417 |
+
# define SSL_F_TLS_PARSE_STOC_SESSION_TICKET 0
|
| 418 |
+
# define SSL_F_TLS_PARSE_STOC_STATUS_REQUEST 0
|
| 419 |
+
# define SSL_F_TLS_PARSE_STOC_SUPPORTED_VERSIONS 0
|
| 420 |
+
# define SSL_F_TLS_PARSE_STOC_USE_SRTP 0
|
| 421 |
+
# define SSL_F_TLS_POST_PROCESS_CLIENT_HELLO 0
|
| 422 |
+
# define SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE 0
|
| 423 |
+
# define SSL_F_TLS_PREPARE_CLIENT_CERTIFICATE 0
|
| 424 |
+
# define SSL_F_TLS_PROCESS_AS_HELLO_RETRY_REQUEST 0
|
| 425 |
+
# define SSL_F_TLS_PROCESS_CERTIFICATE_REQUEST 0
|
| 426 |
+
# define SSL_F_TLS_PROCESS_CERT_STATUS 0
|
| 427 |
+
# define SSL_F_TLS_PROCESS_CERT_STATUS_BODY 0
|
| 428 |
+
# define SSL_F_TLS_PROCESS_CERT_VERIFY 0
|
| 429 |
+
# define SSL_F_TLS_PROCESS_CHANGE_CIPHER_SPEC 0
|
| 430 |
+
# define SSL_F_TLS_PROCESS_CKE_DHE 0
|
| 431 |
+
# define SSL_F_TLS_PROCESS_CKE_ECDHE 0
|
| 432 |
+
# define SSL_F_TLS_PROCESS_CKE_GOST 0
|
| 433 |
+
# define SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE 0
|
| 434 |
+
# define SSL_F_TLS_PROCESS_CKE_RSA 0
|
| 435 |
+
# define SSL_F_TLS_PROCESS_CKE_SRP 0
|
| 436 |
+
# define SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE 0
|
| 437 |
+
# define SSL_F_TLS_PROCESS_CLIENT_HELLO 0
|
| 438 |
+
# define SSL_F_TLS_PROCESS_CLIENT_KEY_EXCHANGE 0
|
| 439 |
+
# define SSL_F_TLS_PROCESS_ENCRYPTED_EXTENSIONS 0
|
| 440 |
+
# define SSL_F_TLS_PROCESS_END_OF_EARLY_DATA 0
|
| 441 |
+
# define SSL_F_TLS_PROCESS_FINISHED 0
|
| 442 |
+
# define SSL_F_TLS_PROCESS_HELLO_REQ 0
|
| 443 |
+
# define SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST 0
|
| 444 |
+
# define SSL_F_TLS_PROCESS_INITIAL_SERVER_FLIGHT 0
|
| 445 |
+
# define SSL_F_TLS_PROCESS_KEY_EXCHANGE 0
|
| 446 |
+
# define SSL_F_TLS_PROCESS_KEY_UPDATE 0
|
| 447 |
+
# define SSL_F_TLS_PROCESS_NEW_SESSION_TICKET 0
|
| 448 |
+
# define SSL_F_TLS_PROCESS_NEXT_PROTO 0
|
| 449 |
+
# define SSL_F_TLS_PROCESS_SERVER_CERTIFICATE 0
|
| 450 |
+
# define SSL_F_TLS_PROCESS_SERVER_DONE 0
|
| 451 |
+
# define SSL_F_TLS_PROCESS_SERVER_HELLO 0
|
| 452 |
+
# define SSL_F_TLS_PROCESS_SKE_DHE 0
|
| 453 |
+
# define SSL_F_TLS_PROCESS_SKE_ECDHE 0
|
| 454 |
+
# define SSL_F_TLS_PROCESS_SKE_PSK_PREAMBLE 0
|
| 455 |
+
# define SSL_F_TLS_PROCESS_SKE_SRP 0
|
| 456 |
+
# define SSL_F_TLS_PSK_DO_BINDER 0
|
| 457 |
+
# define SSL_F_TLS_SCAN_CLIENTHELLO_TLSEXT 0
|
| 458 |
+
# define SSL_F_TLS_SETUP_HANDSHAKE 0
|
| 459 |
+
# define SSL_F_USE_CERTIFICATE_CHAIN_FILE 0
|
| 460 |
+
# define SSL_F_WPACKET_INTERN_INIT_LEN 0
|
| 461 |
+
# define SSL_F_WPACKET_START_SUB_PACKET_LEN__ 0
|
| 462 |
+
# define SSL_F_WRITE_STATE_MACHINE 0
|
| 463 |
+
# endif
|
| 464 |
+
|
| 465 |
+
# ifdef __cplusplus
|
| 466 |
+
}
|
| 467 |
+
# endif
|
| 468 |
+
#endif
|
llava_next/include/openssl/stack.h
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_STACK_H
|
| 11 |
+
# define OPENSSL_STACK_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_STACK_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */
|
| 24 |
+
|
| 25 |
+
typedef int (*OPENSSL_sk_compfunc)(const void *, const void *);
|
| 26 |
+
typedef void (*OPENSSL_sk_freefunc)(void *);
|
| 27 |
+
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
|
| 28 |
+
|
| 29 |
+
int OPENSSL_sk_num(const OPENSSL_STACK *);
|
| 30 |
+
void *OPENSSL_sk_value(const OPENSSL_STACK *, int);
|
| 31 |
+
|
| 32 |
+
void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data);
|
| 33 |
+
|
| 34 |
+
OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp);
|
| 35 |
+
OPENSSL_STACK *OPENSSL_sk_new_null(void);
|
| 36 |
+
OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n);
|
| 37 |
+
int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n);
|
| 38 |
+
void OPENSSL_sk_free(OPENSSL_STACK *);
|
| 39 |
+
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *));
|
| 40 |
+
OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *,
|
| 41 |
+
OPENSSL_sk_copyfunc c,
|
| 42 |
+
OPENSSL_sk_freefunc f);
|
| 43 |
+
int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where);
|
| 44 |
+
void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc);
|
| 45 |
+
void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p);
|
| 46 |
+
int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data);
|
| 47 |
+
int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data);
|
| 48 |
+
int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum);
|
| 49 |
+
int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data);
|
| 50 |
+
int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data);
|
| 51 |
+
void *OPENSSL_sk_shift(OPENSSL_STACK *st);
|
| 52 |
+
void *OPENSSL_sk_pop(OPENSSL_STACK *st);
|
| 53 |
+
void OPENSSL_sk_zero(OPENSSL_STACK *st);
|
| 54 |
+
OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk,
|
| 55 |
+
OPENSSL_sk_compfunc cmp);
|
| 56 |
+
OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st);
|
| 57 |
+
void OPENSSL_sk_sort(OPENSSL_STACK *st);
|
| 58 |
+
int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st);
|
| 59 |
+
|
| 60 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 61 |
+
# define _STACK OPENSSL_STACK
|
| 62 |
+
# define sk_num OPENSSL_sk_num
|
| 63 |
+
# define sk_value OPENSSL_sk_value
|
| 64 |
+
# define sk_set OPENSSL_sk_set
|
| 65 |
+
# define sk_new OPENSSL_sk_new
|
| 66 |
+
# define sk_new_null OPENSSL_sk_new_null
|
| 67 |
+
# define sk_free OPENSSL_sk_free
|
| 68 |
+
# define sk_pop_free OPENSSL_sk_pop_free
|
| 69 |
+
# define sk_deep_copy OPENSSL_sk_deep_copy
|
| 70 |
+
# define sk_insert OPENSSL_sk_insert
|
| 71 |
+
# define sk_delete OPENSSL_sk_delete
|
| 72 |
+
# define sk_delete_ptr OPENSSL_sk_delete_ptr
|
| 73 |
+
# define sk_find OPENSSL_sk_find
|
| 74 |
+
# define sk_find_ex OPENSSL_sk_find_ex
|
| 75 |
+
# define sk_push OPENSSL_sk_push
|
| 76 |
+
# define sk_unshift OPENSSL_sk_unshift
|
| 77 |
+
# define sk_shift OPENSSL_sk_shift
|
| 78 |
+
# define sk_pop OPENSSL_sk_pop
|
| 79 |
+
# define sk_zero OPENSSL_sk_zero
|
| 80 |
+
# define sk_set_cmp_func OPENSSL_sk_set_cmp_func
|
| 81 |
+
# define sk_dup OPENSSL_sk_dup
|
| 82 |
+
# define sk_sort OPENSSL_sk_sort
|
| 83 |
+
# define sk_is_sorted OPENSSL_sk_is_sorted
|
| 84 |
+
# endif
|
| 85 |
+
|
| 86 |
+
#ifdef __cplusplus
|
| 87 |
+
}
|
| 88 |
+
#endif
|
| 89 |
+
|
| 90 |
+
#endif
|
llava_next/include/openssl/whrlpool.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2005-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_WHRLPOOL_H
|
| 11 |
+
# define OPENSSL_WHRLPOOL_H
|
| 12 |
+
# pragma once
|
| 13 |
+
|
| 14 |
+
# include <openssl/macros.h>
|
| 15 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 16 |
+
# define HEADER_WHRLPOOL_H
|
| 17 |
+
# endif
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# ifndef OPENSSL_NO_WHIRLPOOL
|
| 22 |
+
# include <openssl/e_os2.h>
|
| 23 |
+
# include <stddef.h>
|
| 24 |
+
# ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# define WHIRLPOOL_DIGEST_LENGTH (512/8)
|
| 29 |
+
|
| 30 |
+
# if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 31 |
+
|
| 32 |
+
# define WHIRLPOOL_BBLOCK 512
|
| 33 |
+
# define WHIRLPOOL_COUNTER (256/8)
|
| 34 |
+
|
| 35 |
+
typedef struct {
|
| 36 |
+
union {
|
| 37 |
+
unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
|
| 38 |
+
/* double q is here to ensure 64-bit alignment */
|
| 39 |
+
double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
|
| 40 |
+
} H;
|
| 41 |
+
unsigned char data[WHIRLPOOL_BBLOCK / 8];
|
| 42 |
+
unsigned int bitoff;
|
| 43 |
+
size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
|
| 44 |
+
} WHIRLPOOL_CTX;
|
| 45 |
+
# endif
|
| 46 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 47 |
+
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
|
| 48 |
+
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c,
|
| 49 |
+
const void *inp, size_t bytes);
|
| 50 |
+
OSSL_DEPRECATEDIN_3_0 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,
|
| 51 |
+
const void *inp, size_t bits);
|
| 52 |
+
OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
|
| 53 |
+
OSSL_DEPRECATEDIN_3_0 unsigned char *WHIRLPOOL(const void *inp, size_t bytes,
|
| 54 |
+
unsigned char *md);
|
| 55 |
+
# endif
|
| 56 |
+
|
| 57 |
+
# ifdef __cplusplus
|
| 58 |
+
}
|
| 59 |
+
# endif
|
| 60 |
+
# endif
|
| 61 |
+
|
| 62 |
+
#endif
|
llava_next/include/openssl/x509_vfy.h
ADDED
|
@@ -0,0 +1,894 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/x509_vfy.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_X509_VFY_H
|
| 16 |
+
# define OPENSSL_X509_VFY_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_X509_VFY_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Protect against recursion, x509.h and x509_vfy.h each include the other.
|
| 26 |
+
*/
|
| 27 |
+
# ifndef OPENSSL_X509_H
|
| 28 |
+
# include <openssl/x509.h>
|
| 29 |
+
# endif
|
| 30 |
+
|
| 31 |
+
# include <openssl/opensslconf.h>
|
| 32 |
+
# include <openssl/lhash.h>
|
| 33 |
+
# include <openssl/bio.h>
|
| 34 |
+
# include <openssl/crypto.h>
|
| 35 |
+
# include <openssl/symhacks.h>
|
| 36 |
+
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
/*-
|
| 42 |
+
SSL_CTX -> X509_STORE
|
| 43 |
+
-> X509_LOOKUP
|
| 44 |
+
->X509_LOOKUP_METHOD
|
| 45 |
+
-> X509_LOOKUP
|
| 46 |
+
->X509_LOOKUP_METHOD
|
| 47 |
+
|
| 48 |
+
SSL -> X509_STORE_CTX
|
| 49 |
+
->X509_STORE
|
| 50 |
+
|
| 51 |
+
The X509_STORE holds the tables etc for verification stuff.
|
| 52 |
+
A X509_STORE_CTX is used while validating a single certificate.
|
| 53 |
+
The X509_STORE has X509_LOOKUPs for looking up certs.
|
| 54 |
+
The X509_STORE then calls a function to actually verify the
|
| 55 |
+
certificate chain.
|
| 56 |
+
*/
|
| 57 |
+
|
| 58 |
+
typedef enum {
|
| 59 |
+
X509_LU_NONE = 0,
|
| 60 |
+
X509_LU_X509, X509_LU_CRL
|
| 61 |
+
} X509_LOOKUP_TYPE;
|
| 62 |
+
|
| 63 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 64 |
+
#define X509_LU_RETRY -1
|
| 65 |
+
#define X509_LU_FAIL 0
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP)
|
| 69 |
+
#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
| 70 |
+
#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
|
| 71 |
+
#define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
| 72 |
+
#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
|
| 73 |
+
#define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n)))
|
| 74 |
+
#define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n))
|
| 75 |
+
#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 76 |
+
#define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 77 |
+
#define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i)))
|
| 78 |
+
#define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)))
|
| 79 |
+
#define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 80 |
+
#define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 81 |
+
#define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk)))
|
| 82 |
+
#define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk)))
|
| 83 |
+
#define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk),ossl_check_X509_LOOKUP_freefunc_type(freefunc))
|
| 84 |
+
#define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx))
|
| 85 |
+
#define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr)))
|
| 86 |
+
#define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 87 |
+
#define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 88 |
+
#define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum)
|
| 89 |
+
#define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 90 |
+
#define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
| 91 |
+
#define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk)))
|
| 92 |
+
#define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc)))
|
| 93 |
+
#define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
| 94 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT)
|
| 95 |
+
#define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
|
| 96 |
+
#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
|
| 97 |
+
#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
| 98 |
+
#define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null())
|
| 99 |
+
#define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n)))
|
| 100 |
+
#define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n))
|
| 101 |
+
#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
|
| 102 |
+
#define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk))
|
| 103 |
+
#define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i)))
|
| 104 |
+
#define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)))
|
| 105 |
+
#define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 106 |
+
#define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 107 |
+
#define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk)))
|
| 108 |
+
#define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk)))
|
| 109 |
+
#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk),ossl_check_X509_OBJECT_freefunc_type(freefunc))
|
| 110 |
+
#define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx))
|
| 111 |
+
#define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr)))
|
| 112 |
+
#define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 113 |
+
#define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 114 |
+
#define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum)
|
| 115 |
+
#define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk))
|
| 116 |
+
#define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk))
|
| 117 |
+
#define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk)))
|
| 118 |
+
#define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
|
| 119 |
+
#define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
| 120 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
|
| 121 |
+
#define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
| 122 |
+
#define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
|
| 123 |
+
#define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
| 124 |
+
#define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null())
|
| 125 |
+
#define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n)))
|
| 126 |
+
#define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n))
|
| 127 |
+
#define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 128 |
+
#define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 129 |
+
#define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i)))
|
| 130 |
+
#define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
| 131 |
+
#define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 132 |
+
#define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 133 |
+
#define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
| 134 |
+
#define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
| 135 |
+
#define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk),ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))
|
| 136 |
+
#define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx))
|
| 137 |
+
#define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
| 138 |
+
#define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 139 |
+
#define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 140 |
+
#define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum)
|
| 141 |
+
#define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 142 |
+
#define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
| 143 |
+
#define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)))
|
| 144 |
+
#define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)))
|
| 145 |
+
#define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
/* This is used for a table of trust checking functions */
|
| 149 |
+
typedef struct x509_trust_st {
|
| 150 |
+
int trust;
|
| 151 |
+
int flags;
|
| 152 |
+
int (*check_trust) (struct x509_trust_st *, X509 *, int);
|
| 153 |
+
char *name;
|
| 154 |
+
int arg1;
|
| 155 |
+
void *arg2;
|
| 156 |
+
} X509_TRUST;
|
| 157 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST)
|
| 158 |
+
#define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk))
|
| 159 |
+
#define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx)))
|
| 160 |
+
#define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp)))
|
| 161 |
+
#define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null())
|
| 162 |
+
#define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n)))
|
| 163 |
+
#define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n))
|
| 164 |
+
#define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk))
|
| 165 |
+
#define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk))
|
| 166 |
+
#define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i)))
|
| 167 |
+
#define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)))
|
| 168 |
+
#define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 169 |
+
#define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 170 |
+
#define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk)))
|
| 171 |
+
#define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk)))
|
| 172 |
+
#define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk),ossl_check_X509_TRUST_freefunc_type(freefunc))
|
| 173 |
+
#define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx))
|
| 174 |
+
#define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr)))
|
| 175 |
+
#define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 176 |
+
#define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 177 |
+
#define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum)
|
| 178 |
+
#define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk))
|
| 179 |
+
#define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk))
|
| 180 |
+
#define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk)))
|
| 181 |
+
#define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc)))
|
| 182 |
+
#define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp)))
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
/* standard trust ids */
|
| 186 |
+
# define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */
|
| 187 |
+
# define X509_TRUST_COMPAT 1
|
| 188 |
+
# define X509_TRUST_SSL_CLIENT 2
|
| 189 |
+
# define X509_TRUST_SSL_SERVER 3
|
| 190 |
+
# define X509_TRUST_EMAIL 4
|
| 191 |
+
# define X509_TRUST_OBJECT_SIGN 5
|
| 192 |
+
# define X509_TRUST_OCSP_SIGN 6
|
| 193 |
+
# define X509_TRUST_OCSP_REQUEST 7
|
| 194 |
+
# define X509_TRUST_TSA 8
|
| 195 |
+
/* Keep these up to date! */
|
| 196 |
+
# define X509_TRUST_MIN 1
|
| 197 |
+
# define X509_TRUST_MAX 8
|
| 198 |
+
|
| 199 |
+
/* trust_flags values */
|
| 200 |
+
# define X509_TRUST_DYNAMIC (1U << 0)
|
| 201 |
+
# define X509_TRUST_DYNAMIC_NAME (1U << 1)
|
| 202 |
+
/* No compat trust if self-signed, preempts "DO_SS" */
|
| 203 |
+
# define X509_TRUST_NO_SS_COMPAT (1U << 2)
|
| 204 |
+
/* Compat trust if no explicit accepted trust EKUs */
|
| 205 |
+
# define X509_TRUST_DO_SS_COMPAT (1U << 3)
|
| 206 |
+
/* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */
|
| 207 |
+
# define X509_TRUST_OK_ANY_EKU (1U << 4)
|
| 208 |
+
|
| 209 |
+
/* check_trust return codes */
|
| 210 |
+
# define X509_TRUST_TRUSTED 1
|
| 211 |
+
# define X509_TRUST_REJECTED 2
|
| 212 |
+
# define X509_TRUST_UNTRUSTED 3
|
| 213 |
+
|
| 214 |
+
int X509_TRUST_set(int *t, int trust);
|
| 215 |
+
int X509_TRUST_get_count(void);
|
| 216 |
+
X509_TRUST *X509_TRUST_get0(int idx);
|
| 217 |
+
int X509_TRUST_get_by_id(int id);
|
| 218 |
+
int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
|
| 219 |
+
const char *name, int arg1, void *arg2);
|
| 220 |
+
void X509_TRUST_cleanup(void);
|
| 221 |
+
int X509_TRUST_get_flags(const X509_TRUST *xp);
|
| 222 |
+
char *X509_TRUST_get0_name(const X509_TRUST *xp);
|
| 223 |
+
int X509_TRUST_get_trust(const X509_TRUST *xp);
|
| 224 |
+
|
| 225 |
+
int X509_trusted(const X509 *x);
|
| 226 |
+
int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
|
| 227 |
+
int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
|
| 228 |
+
void X509_trust_clear(X509 *x);
|
| 229 |
+
void X509_reject_clear(X509 *x);
|
| 230 |
+
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
|
| 231 |
+
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
|
| 232 |
+
|
| 233 |
+
int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
|
| 234 |
+
int);
|
| 235 |
+
int X509_check_trust(X509 *x, int id, int flags);
|
| 236 |
+
|
| 237 |
+
int X509_verify_cert(X509_STORE_CTX *ctx);
|
| 238 |
+
int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
|
| 239 |
+
STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
|
| 240 |
+
X509_STORE *store, int with_self_signed,
|
| 241 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 242 |
+
|
| 243 |
+
int X509_STORE_set_depth(X509_STORE *store, int depth);
|
| 244 |
+
|
| 245 |
+
typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
|
| 246 |
+
int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
|
| 247 |
+
typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
|
| 248 |
+
typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
|
| 249 |
+
X509_STORE_CTX *ctx, X509 *x);
|
| 250 |
+
typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
|
| 251 |
+
X509 *x, X509 *issuer);
|
| 252 |
+
typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
|
| 253 |
+
typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
|
| 254 |
+
X509_CRL **crl, X509 *x);
|
| 255 |
+
typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
|
| 256 |
+
typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
|
| 257 |
+
X509_CRL *crl, X509 *x);
|
| 258 |
+
typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
|
| 259 |
+
typedef STACK_OF(X509)
|
| 260 |
+
*(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
|
| 261 |
+
const X509_NAME *nm);
|
| 262 |
+
typedef STACK_OF(X509_CRL)
|
| 263 |
+
*(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
|
| 264 |
+
const X509_NAME *nm);
|
| 265 |
+
typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
|
| 266 |
+
|
| 267 |
+
void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
|
| 268 |
+
|
| 269 |
+
# define X509_STORE_CTX_set_app_data(ctx,data) \
|
| 270 |
+
X509_STORE_CTX_set_ex_data(ctx,0,data)
|
| 271 |
+
# define X509_STORE_CTX_get_app_data(ctx) \
|
| 272 |
+
X509_STORE_CTX_get_ex_data(ctx,0)
|
| 273 |
+
|
| 274 |
+
# define X509_L_FILE_LOAD 1
|
| 275 |
+
# define X509_L_ADD_DIR 2
|
| 276 |
+
# define X509_L_ADD_STORE 3
|
| 277 |
+
# define X509_L_LOAD_STORE 4
|
| 278 |
+
|
| 279 |
+
# define X509_LOOKUP_load_file(x,name,type) \
|
| 280 |
+
X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
|
| 281 |
+
|
| 282 |
+
# define X509_LOOKUP_add_dir(x,name,type) \
|
| 283 |
+
X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
|
| 284 |
+
|
| 285 |
+
# define X509_LOOKUP_add_store(x,name) \
|
| 286 |
+
X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL)
|
| 287 |
+
|
| 288 |
+
# define X509_LOOKUP_load_store(x,name) \
|
| 289 |
+
X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL)
|
| 290 |
+
|
| 291 |
+
# define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \
|
| 292 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\
|
| 293 |
+
(libctx), (propq))
|
| 294 |
+
|
| 295 |
+
# define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \
|
| 296 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \
|
| 297 |
+
(libctx), (propq))
|
| 298 |
+
|
| 299 |
+
# define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \
|
| 300 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \
|
| 301 |
+
(libctx), (propq))
|
| 302 |
+
|
| 303 |
+
# define X509_V_OK 0
|
| 304 |
+
# define X509_V_ERR_UNSPECIFIED 1
|
| 305 |
+
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
|
| 306 |
+
# define X509_V_ERR_UNABLE_TO_GET_CRL 3
|
| 307 |
+
# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
|
| 308 |
+
# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
|
| 309 |
+
# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
|
| 310 |
+
# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
|
| 311 |
+
# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
|
| 312 |
+
# define X509_V_ERR_CERT_NOT_YET_VALID 9
|
| 313 |
+
# define X509_V_ERR_CERT_HAS_EXPIRED 10
|
| 314 |
+
# define X509_V_ERR_CRL_NOT_YET_VALID 11
|
| 315 |
+
# define X509_V_ERR_CRL_HAS_EXPIRED 12
|
| 316 |
+
# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
|
| 317 |
+
# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
|
| 318 |
+
# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
|
| 319 |
+
# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
|
| 320 |
+
# define X509_V_ERR_OUT_OF_MEM 17
|
| 321 |
+
# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
|
| 322 |
+
# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
|
| 323 |
+
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
|
| 324 |
+
# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
|
| 325 |
+
# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
|
| 326 |
+
# define X509_V_ERR_CERT_REVOKED 23
|
| 327 |
+
# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
|
| 328 |
+
# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
|
| 329 |
+
# define X509_V_ERR_INVALID_PURPOSE 26
|
| 330 |
+
# define X509_V_ERR_CERT_UNTRUSTED 27
|
| 331 |
+
# define X509_V_ERR_CERT_REJECTED 28
|
| 332 |
+
|
| 333 |
+
/* These are 'informational' when looking for issuer cert */
|
| 334 |
+
# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
|
| 335 |
+
# define X509_V_ERR_AKID_SKID_MISMATCH 30
|
| 336 |
+
# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
|
| 337 |
+
# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
|
| 338 |
+
# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
|
| 339 |
+
# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
|
| 340 |
+
# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
|
| 341 |
+
# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
|
| 342 |
+
# define X509_V_ERR_INVALID_NON_CA 37
|
| 343 |
+
# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
|
| 344 |
+
# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
|
| 345 |
+
# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
|
| 346 |
+
# define X509_V_ERR_INVALID_EXTENSION 41
|
| 347 |
+
# define X509_V_ERR_INVALID_POLICY_EXTENSION 42
|
| 348 |
+
# define X509_V_ERR_NO_EXPLICIT_POLICY 43
|
| 349 |
+
# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
|
| 350 |
+
# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
|
| 351 |
+
# define X509_V_ERR_UNNESTED_RESOURCE 46
|
| 352 |
+
# define X509_V_ERR_PERMITTED_VIOLATION 47
|
| 353 |
+
# define X509_V_ERR_EXCLUDED_VIOLATION 48
|
| 354 |
+
# define X509_V_ERR_SUBTREE_MINMAX 49
|
| 355 |
+
/* The application is not happy */
|
| 356 |
+
# define X509_V_ERR_APPLICATION_VERIFICATION 50
|
| 357 |
+
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
|
| 358 |
+
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
|
| 359 |
+
# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
|
| 360 |
+
# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
|
| 361 |
+
/* Another issuer check debug option */
|
| 362 |
+
# define X509_V_ERR_PATH_LOOP 55
|
| 363 |
+
/* Suite B mode algorithm violation */
|
| 364 |
+
# define X509_V_ERR_SUITE_B_INVALID_VERSION 56
|
| 365 |
+
# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
|
| 366 |
+
# define X509_V_ERR_SUITE_B_INVALID_CURVE 58
|
| 367 |
+
# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
|
| 368 |
+
# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
|
| 369 |
+
# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
|
| 370 |
+
/* Host, email and IP check errors */
|
| 371 |
+
# define X509_V_ERR_HOSTNAME_MISMATCH 62
|
| 372 |
+
# define X509_V_ERR_EMAIL_MISMATCH 63
|
| 373 |
+
# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
|
| 374 |
+
/* DANE TLSA errors */
|
| 375 |
+
# define X509_V_ERR_DANE_NO_MATCH 65
|
| 376 |
+
/* security level errors */
|
| 377 |
+
# define X509_V_ERR_EE_KEY_TOO_SMALL 66
|
| 378 |
+
# define X509_V_ERR_CA_KEY_TOO_SMALL 67
|
| 379 |
+
# define X509_V_ERR_CA_MD_TOO_WEAK 68
|
| 380 |
+
/* Caller error */
|
| 381 |
+
# define X509_V_ERR_INVALID_CALL 69
|
| 382 |
+
/* Issuer lookup error */
|
| 383 |
+
# define X509_V_ERR_STORE_LOOKUP 70
|
| 384 |
+
/* Certificate transparency */
|
| 385 |
+
# define X509_V_ERR_NO_VALID_SCTS 71
|
| 386 |
+
|
| 387 |
+
# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72
|
| 388 |
+
/* OCSP status errors */
|
| 389 |
+
# define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */
|
| 390 |
+
# define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */
|
| 391 |
+
# define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */
|
| 392 |
+
|
| 393 |
+
# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
|
| 394 |
+
# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
|
| 395 |
+
|
| 396 |
+
/* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */
|
| 397 |
+
# define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78
|
| 398 |
+
# define X509_V_ERR_INVALID_CA 79
|
| 399 |
+
# define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80
|
| 400 |
+
# define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81
|
| 401 |
+
# define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82
|
| 402 |
+
# define X509_V_ERR_ISSUER_NAME_EMPTY 83
|
| 403 |
+
# define X509_V_ERR_SUBJECT_NAME_EMPTY 84
|
| 404 |
+
# define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85
|
| 405 |
+
# define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86
|
| 406 |
+
# define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87
|
| 407 |
+
# define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88
|
| 408 |
+
# define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89
|
| 409 |
+
# define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90
|
| 410 |
+
# define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91
|
| 411 |
+
# define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92
|
| 412 |
+
# define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93
|
| 413 |
+
# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
|
| 414 |
+
|
| 415 |
+
/* Certificate verify flags */
|
| 416 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 417 |
+
# define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */
|
| 418 |
+
# endif
|
| 419 |
+
/* Use check time instead of current time */
|
| 420 |
+
# define X509_V_FLAG_USE_CHECK_TIME 0x2
|
| 421 |
+
/* Lookup CRLs */
|
| 422 |
+
# define X509_V_FLAG_CRL_CHECK 0x4
|
| 423 |
+
/* Lookup CRLs for whole chain */
|
| 424 |
+
# define X509_V_FLAG_CRL_CHECK_ALL 0x8
|
| 425 |
+
/* Ignore unhandled critical extensions */
|
| 426 |
+
# define X509_V_FLAG_IGNORE_CRITICAL 0x10
|
| 427 |
+
/* Disable workarounds for broken certificates */
|
| 428 |
+
# define X509_V_FLAG_X509_STRICT 0x20
|
| 429 |
+
/* Enable proxy certificate validation */
|
| 430 |
+
# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
|
| 431 |
+
/* Enable policy checking */
|
| 432 |
+
# define X509_V_FLAG_POLICY_CHECK 0x80
|
| 433 |
+
/* Policy variable require-explicit-policy */
|
| 434 |
+
# define X509_V_FLAG_EXPLICIT_POLICY 0x100
|
| 435 |
+
/* Policy variable inhibit-any-policy */
|
| 436 |
+
# define X509_V_FLAG_INHIBIT_ANY 0x200
|
| 437 |
+
/* Policy variable inhibit-policy-mapping */
|
| 438 |
+
# define X509_V_FLAG_INHIBIT_MAP 0x400
|
| 439 |
+
/* Notify callback that policy is OK */
|
| 440 |
+
# define X509_V_FLAG_NOTIFY_POLICY 0x800
|
| 441 |
+
/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
|
| 442 |
+
# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
|
| 443 |
+
/* Delta CRL support */
|
| 444 |
+
# define X509_V_FLAG_USE_DELTAS 0x2000
|
| 445 |
+
/* Check self-signed CA signature */
|
| 446 |
+
# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
|
| 447 |
+
/* Use trusted store first */
|
| 448 |
+
# define X509_V_FLAG_TRUSTED_FIRST 0x8000
|
| 449 |
+
/* Suite B 128 bit only mode: not normally used */
|
| 450 |
+
# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
|
| 451 |
+
/* Suite B 192 bit only mode */
|
| 452 |
+
# define X509_V_FLAG_SUITEB_192_LOS 0x20000
|
| 453 |
+
/* Suite B 128 bit mode allowing 192 bit algorithms */
|
| 454 |
+
# define X509_V_FLAG_SUITEB_128_LOS 0x30000
|
| 455 |
+
/* Allow partial chains if at least one certificate is in trusted store */
|
| 456 |
+
# define X509_V_FLAG_PARTIAL_CHAIN 0x80000
|
| 457 |
+
/*
|
| 458 |
+
* If the initial chain is not trusted, do not attempt to build an alternative
|
| 459 |
+
* chain. Alternate chain checking was introduced in 1.1.0. Setting this flag
|
| 460 |
+
* will force the behaviour to match that of previous versions.
|
| 461 |
+
*/
|
| 462 |
+
# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
|
| 463 |
+
/* Do not check certificate/CRL validity against current time */
|
| 464 |
+
# define X509_V_FLAG_NO_CHECK_TIME 0x200000
|
| 465 |
+
|
| 466 |
+
# define X509_VP_FLAG_DEFAULT 0x1
|
| 467 |
+
# define X509_VP_FLAG_OVERWRITE 0x2
|
| 468 |
+
# define X509_VP_FLAG_RESET_FLAGS 0x4
|
| 469 |
+
# define X509_VP_FLAG_LOCKED 0x8
|
| 470 |
+
# define X509_VP_FLAG_ONCE 0x10
|
| 471 |
+
|
| 472 |
+
/* Internal use: mask of policy related options */
|
| 473 |
+
# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
|
| 474 |
+
| X509_V_FLAG_EXPLICIT_POLICY \
|
| 475 |
+
| X509_V_FLAG_INHIBIT_ANY \
|
| 476 |
+
| X509_V_FLAG_INHIBIT_MAP)
|
| 477 |
+
|
| 478 |
+
int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type,
|
| 479 |
+
const X509_NAME *name);
|
| 480 |
+
X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
|
| 481 |
+
X509_LOOKUP_TYPE type,
|
| 482 |
+
const X509_NAME *name);
|
| 483 |
+
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
|
| 484 |
+
X509_OBJECT *x);
|
| 485 |
+
int X509_OBJECT_up_ref_count(X509_OBJECT *a);
|
| 486 |
+
X509_OBJECT *X509_OBJECT_new(void);
|
| 487 |
+
void X509_OBJECT_free(X509_OBJECT *a);
|
| 488 |
+
X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a);
|
| 489 |
+
X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a);
|
| 490 |
+
int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
|
| 491 |
+
X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a);
|
| 492 |
+
int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
|
| 493 |
+
X509_STORE *X509_STORE_new(void);
|
| 494 |
+
void X509_STORE_free(X509_STORE *v);
|
| 495 |
+
int X509_STORE_lock(X509_STORE *ctx);
|
| 496 |
+
int X509_STORE_unlock(X509_STORE *ctx);
|
| 497 |
+
int X509_STORE_up_ref(X509_STORE *v);
|
| 498 |
+
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *v);
|
| 499 |
+
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *st);
|
| 500 |
+
STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st,
|
| 501 |
+
const X509_NAME *nm);
|
| 502 |
+
STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
|
| 503 |
+
const X509_NAME *nm);
|
| 504 |
+
int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
|
| 505 |
+
int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
|
| 506 |
+
int X509_STORE_set_trust(X509_STORE *ctx, int trust);
|
| 507 |
+
int X509_STORE_set1_param(X509_STORE *ctx, const X509_VERIFY_PARAM *pm);
|
| 508 |
+
X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *ctx);
|
| 509 |
+
|
| 510 |
+
void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify);
|
| 511 |
+
#define X509_STORE_set_verify_func(ctx, func) \
|
| 512 |
+
X509_STORE_set_verify((ctx),(func))
|
| 513 |
+
void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx,
|
| 514 |
+
X509_STORE_CTX_verify_fn verify);
|
| 515 |
+
X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *ctx);
|
| 516 |
+
void X509_STORE_set_verify_cb(X509_STORE *ctx,
|
| 517 |
+
X509_STORE_CTX_verify_cb verify_cb);
|
| 518 |
+
# define X509_STORE_set_verify_cb_func(ctx,func) \
|
| 519 |
+
X509_STORE_set_verify_cb((ctx),(func))
|
| 520 |
+
X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *ctx);
|
| 521 |
+
void X509_STORE_set_get_issuer(X509_STORE *ctx,
|
| 522 |
+
X509_STORE_CTX_get_issuer_fn get_issuer);
|
| 523 |
+
X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *ctx);
|
| 524 |
+
void X509_STORE_set_check_issued(X509_STORE *ctx,
|
| 525 |
+
X509_STORE_CTX_check_issued_fn check_issued);
|
| 526 |
+
X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *ctx);
|
| 527 |
+
void X509_STORE_set_check_revocation(X509_STORE *ctx,
|
| 528 |
+
X509_STORE_CTX_check_revocation_fn check_revocation);
|
| 529 |
+
X509_STORE_CTX_check_revocation_fn
|
| 530 |
+
X509_STORE_get_check_revocation(const X509_STORE *ctx);
|
| 531 |
+
void X509_STORE_set_get_crl(X509_STORE *ctx,
|
| 532 |
+
X509_STORE_CTX_get_crl_fn get_crl);
|
| 533 |
+
X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *ctx);
|
| 534 |
+
void X509_STORE_set_check_crl(X509_STORE *ctx,
|
| 535 |
+
X509_STORE_CTX_check_crl_fn check_crl);
|
| 536 |
+
X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *ctx);
|
| 537 |
+
void X509_STORE_set_cert_crl(X509_STORE *ctx,
|
| 538 |
+
X509_STORE_CTX_cert_crl_fn cert_crl);
|
| 539 |
+
X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *ctx);
|
| 540 |
+
void X509_STORE_set_check_policy(X509_STORE *ctx,
|
| 541 |
+
X509_STORE_CTX_check_policy_fn check_policy);
|
| 542 |
+
X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *ctx);
|
| 543 |
+
void X509_STORE_set_lookup_certs(X509_STORE *ctx,
|
| 544 |
+
X509_STORE_CTX_lookup_certs_fn lookup_certs);
|
| 545 |
+
X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *ctx);
|
| 546 |
+
void X509_STORE_set_lookup_crls(X509_STORE *ctx,
|
| 547 |
+
X509_STORE_CTX_lookup_crls_fn lookup_crls);
|
| 548 |
+
#define X509_STORE_set_lookup_crls_cb(ctx, func) \
|
| 549 |
+
X509_STORE_set_lookup_crls((ctx), (func))
|
| 550 |
+
X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *ctx);
|
| 551 |
+
void X509_STORE_set_cleanup(X509_STORE *ctx,
|
| 552 |
+
X509_STORE_CTX_cleanup_fn cleanup);
|
| 553 |
+
X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *ctx);
|
| 554 |
+
|
| 555 |
+
#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 556 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
|
| 557 |
+
int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data);
|
| 558 |
+
void *X509_STORE_get_ex_data(const X509_STORE *ctx, int idx);
|
| 559 |
+
|
| 560 |
+
X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 561 |
+
X509_STORE_CTX *X509_STORE_CTX_new(void);
|
| 562 |
+
|
| 563 |
+
int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
|
| 564 |
+
|
| 565 |
+
void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
|
| 566 |
+
int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
|
| 567 |
+
X509 *target, STACK_OF(X509) *untrusted);
|
| 568 |
+
void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
| 569 |
+
void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
|
| 570 |
+
|
| 571 |
+
X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx);
|
| 572 |
+
X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx);
|
| 573 |
+
STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx);
|
| 574 |
+
void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
| 575 |
+
void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
|
| 576 |
+
X509_STORE_CTX_verify_cb verify);
|
| 577 |
+
X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx);
|
| 578 |
+
X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
|
| 579 |
+
X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx);
|
| 580 |
+
X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx);
|
| 581 |
+
X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx);
|
| 582 |
+
X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx);
|
| 583 |
+
X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx);
|
| 584 |
+
X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx);
|
| 585 |
+
X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx);
|
| 586 |
+
X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx);
|
| 587 |
+
X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx);
|
| 588 |
+
X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx);
|
| 589 |
+
|
| 590 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 591 |
+
# define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
|
| 592 |
+
# define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
|
| 593 |
+
# define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
|
| 594 |
+
# define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject
|
| 595 |
+
# define X509_STORE_get1_certs X509_STORE_CTX_get1_certs
|
| 596 |
+
# define X509_STORE_get1_crls X509_STORE_CTX_get1_crls
|
| 597 |
+
/* the following macro is misspelled; use X509_STORE_get1_certs instead */
|
| 598 |
+
# define X509_STORE_get1_cert X509_STORE_CTX_get1_certs
|
| 599 |
+
/* the following macro is misspelled; use X509_STORE_get1_crls instead */
|
| 600 |
+
# define X509_STORE_get1_crl X509_STORE_CTX_get1_crls
|
| 601 |
+
#endif
|
| 602 |
+
|
| 603 |
+
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
|
| 604 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
|
| 605 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
|
| 606 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
|
| 607 |
+
|
| 608 |
+
typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc,
|
| 609 |
+
long argl, char **ret);
|
| 610 |
+
typedef int (*X509_LOOKUP_ctrl_ex_fn)(
|
| 611 |
+
X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
|
| 612 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 613 |
+
|
| 614 |
+
typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
|
| 615 |
+
X509_LOOKUP_TYPE type,
|
| 616 |
+
const X509_NAME *name,
|
| 617 |
+
X509_OBJECT *ret);
|
| 618 |
+
typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx,
|
| 619 |
+
X509_LOOKUP_TYPE type,
|
| 620 |
+
const X509_NAME *name,
|
| 621 |
+
X509_OBJECT *ret,
|
| 622 |
+
OSSL_LIB_CTX *libctx,
|
| 623 |
+
const char *propq);
|
| 624 |
+
typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
|
| 625 |
+
X509_LOOKUP_TYPE type,
|
| 626 |
+
const X509_NAME *name,
|
| 627 |
+
const ASN1_INTEGER *serial,
|
| 628 |
+
X509_OBJECT *ret);
|
| 629 |
+
typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx,
|
| 630 |
+
X509_LOOKUP_TYPE type,
|
| 631 |
+
const unsigned char* bytes,
|
| 632 |
+
int len,
|
| 633 |
+
X509_OBJECT *ret);
|
| 634 |
+
typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx,
|
| 635 |
+
X509_LOOKUP_TYPE type,
|
| 636 |
+
const char *str,
|
| 637 |
+
int len,
|
| 638 |
+
X509_OBJECT *ret);
|
| 639 |
+
|
| 640 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
|
| 641 |
+
void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
|
| 642 |
+
|
| 643 |
+
int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method,
|
| 644 |
+
int (*new_item) (X509_LOOKUP *ctx));
|
| 645 |
+
int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
|
| 646 |
+
(X509_LOOKUP *ctx);
|
| 647 |
+
|
| 648 |
+
int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method,
|
| 649 |
+
void (*free_fn) (X509_LOOKUP *ctx));
|
| 650 |
+
void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method))
|
| 651 |
+
(X509_LOOKUP *ctx);
|
| 652 |
+
|
| 653 |
+
int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method,
|
| 654 |
+
int (*init) (X509_LOOKUP *ctx));
|
| 655 |
+
int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method))
|
| 656 |
+
(X509_LOOKUP *ctx);
|
| 657 |
+
|
| 658 |
+
int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method,
|
| 659 |
+
int (*shutdown) (X509_LOOKUP *ctx));
|
| 660 |
+
int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method))
|
| 661 |
+
(X509_LOOKUP *ctx);
|
| 662 |
+
|
| 663 |
+
int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method,
|
| 664 |
+
X509_LOOKUP_ctrl_fn ctrl_fn);
|
| 665 |
+
X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method);
|
| 666 |
+
|
| 667 |
+
int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method,
|
| 668 |
+
X509_LOOKUP_get_by_subject_fn fn);
|
| 669 |
+
X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject(
|
| 670 |
+
const X509_LOOKUP_METHOD *method);
|
| 671 |
+
|
| 672 |
+
int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method,
|
| 673 |
+
X509_LOOKUP_get_by_issuer_serial_fn fn);
|
| 674 |
+
X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial(
|
| 675 |
+
const X509_LOOKUP_METHOD *method);
|
| 676 |
+
|
| 677 |
+
int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method,
|
| 678 |
+
X509_LOOKUP_get_by_fingerprint_fn fn);
|
| 679 |
+
X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint(
|
| 680 |
+
const X509_LOOKUP_METHOD *method);
|
| 681 |
+
|
| 682 |
+
int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
|
| 683 |
+
X509_LOOKUP_get_by_alias_fn fn);
|
| 684 |
+
X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
|
| 685 |
+
const X509_LOOKUP_METHOD *method);
|
| 686 |
+
|
| 687 |
+
|
| 688 |
+
int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
|
| 689 |
+
int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
|
| 690 |
+
|
| 691 |
+
int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
|
| 692 |
+
X509_LOOKUP_TYPE type,
|
| 693 |
+
const X509_NAME *name, X509_OBJECT *ret);
|
| 694 |
+
X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs,
|
| 695 |
+
X509_LOOKUP_TYPE type,
|
| 696 |
+
const X509_NAME *name);
|
| 697 |
+
|
| 698 |
+
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
|
| 699 |
+
long argl, char **ret);
|
| 700 |
+
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
|
| 701 |
+
char **ret, OSSL_LIB_CTX *libctx, const char *propq);
|
| 702 |
+
|
| 703 |
+
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 704 |
+
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
| 705 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 706 |
+
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 707 |
+
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 708 |
+
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
| 709 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 710 |
+
|
| 711 |
+
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
|
| 712 |
+
void X509_LOOKUP_free(X509_LOOKUP *ctx);
|
| 713 |
+
int X509_LOOKUP_init(X509_LOOKUP *ctx);
|
| 714 |
+
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 715 |
+
const X509_NAME *name, X509_OBJECT *ret);
|
| 716 |
+
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 717 |
+
const X509_NAME *name, X509_OBJECT *ret,
|
| 718 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 719 |
+
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 720 |
+
const X509_NAME *name,
|
| 721 |
+
const ASN1_INTEGER *serial,
|
| 722 |
+
X509_OBJECT *ret);
|
| 723 |
+
int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 724 |
+
const unsigned char *bytes, int len,
|
| 725 |
+
X509_OBJECT *ret);
|
| 726 |
+
int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 727 |
+
const char *str, int len, X509_OBJECT *ret);
|
| 728 |
+
int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
|
| 729 |
+
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
|
| 730 |
+
X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
|
| 731 |
+
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
|
| 732 |
+
|
| 733 |
+
int X509_STORE_load_file(X509_STORE *ctx, const char *file);
|
| 734 |
+
int X509_STORE_load_path(X509_STORE *ctx, const char *path);
|
| 735 |
+
int X509_STORE_load_store(X509_STORE *ctx, const char *store);
|
| 736 |
+
int X509_STORE_load_locations(X509_STORE *ctx,
|
| 737 |
+
const char *file,
|
| 738 |
+
const char *dir);
|
| 739 |
+
int X509_STORE_set_default_paths(X509_STORE *ctx);
|
| 740 |
+
|
| 741 |
+
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
|
| 742 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 743 |
+
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *store,
|
| 744 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 745 |
+
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
|
| 746 |
+
const char *dir, OSSL_LIB_CTX *libctx,
|
| 747 |
+
const char *propq);
|
| 748 |
+
int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
|
| 749 |
+
const char *propq);
|
| 750 |
+
|
| 751 |
+
#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 752 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
|
| 753 |
+
int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
|
| 754 |
+
void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx);
|
| 755 |
+
int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx);
|
| 756 |
+
void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
|
| 757 |
+
int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx);
|
| 758 |
+
void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth);
|
| 759 |
+
X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx);
|
| 760 |
+
void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x);
|
| 761 |
+
X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx);
|
| 762 |
+
X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx);
|
| 763 |
+
X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx);
|
| 764 |
+
STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx);
|
| 765 |
+
STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx);
|
| 766 |
+
void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
|
| 767 |
+
void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
|
| 768 |
+
void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
|
| 769 |
+
int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
|
| 770 |
+
int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
|
| 771 |
+
int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
|
| 772 |
+
int purpose, int trust);
|
| 773 |
+
void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
|
| 774 |
+
void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
|
| 775 |
+
time_t t);
|
| 776 |
+
|
| 777 |
+
X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx);
|
| 778 |
+
int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx);
|
| 779 |
+
int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx);
|
| 780 |
+
|
| 781 |
+
X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx);
|
| 782 |
+
void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
|
| 783 |
+
int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
|
| 784 |
+
|
| 785 |
+
/*
|
| 786 |
+
* Bridge opacity barrier between libcrypt and libssl, also needed to support
|
| 787 |
+
* offline testing in test/danetest.c
|
| 788 |
+
*/
|
| 789 |
+
void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane);
|
| 790 |
+
#define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0)
|
| 791 |
+
|
| 792 |
+
/* X509_VERIFY_PARAM functions */
|
| 793 |
+
|
| 794 |
+
X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
|
| 795 |
+
void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
|
| 796 |
+
int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
|
| 797 |
+
const X509_VERIFY_PARAM *from);
|
| 798 |
+
int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
|
| 799 |
+
const X509_VERIFY_PARAM *from);
|
| 800 |
+
int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
|
| 801 |
+
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
|
| 802 |
+
unsigned long flags);
|
| 803 |
+
int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
|
| 804 |
+
unsigned long flags);
|
| 805 |
+
unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
|
| 806 |
+
int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
|
| 807 |
+
int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
|
| 808 |
+
void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
|
| 809 |
+
void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
|
| 810 |
+
time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
|
| 811 |
+
void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
|
| 812 |
+
int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
|
| 813 |
+
ASN1_OBJECT *policy);
|
| 814 |
+
int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
|
| 815 |
+
STACK_OF(ASN1_OBJECT) *policies);
|
| 816 |
+
|
| 817 |
+
int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
|
| 818 |
+
uint32_t flags);
|
| 819 |
+
uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
|
| 820 |
+
|
| 821 |
+
char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
|
| 822 |
+
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
|
| 823 |
+
const char *name, size_t namelen);
|
| 824 |
+
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
|
| 825 |
+
const char *name, size_t namelen);
|
| 826 |
+
void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
|
| 827 |
+
unsigned int flags);
|
| 828 |
+
unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
|
| 829 |
+
char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
|
| 830 |
+
void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
|
| 831 |
+
char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
|
| 832 |
+
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
|
| 833 |
+
const char *email, size_t emaillen);
|
| 834 |
+
char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
|
| 835 |
+
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
|
| 836 |
+
const unsigned char *ip, size_t iplen);
|
| 837 |
+
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
|
| 838 |
+
const char *ipasc);
|
| 839 |
+
|
| 840 |
+
int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
|
| 841 |
+
int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
|
| 842 |
+
const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
|
| 843 |
+
|
| 844 |
+
int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
|
| 845 |
+
int X509_VERIFY_PARAM_get_count(void);
|
| 846 |
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
|
| 847 |
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
|
| 848 |
+
void X509_VERIFY_PARAM_table_cleanup(void);
|
| 849 |
+
|
| 850 |
+
/* Non positive return values are errors */
|
| 851 |
+
#define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */
|
| 852 |
+
#define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */
|
| 853 |
+
#define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */
|
| 854 |
+
|
| 855 |
+
/*
|
| 856 |
+
* Positive return values form a bit mask, all but the first are internal to
|
| 857 |
+
* the library and don't appear in results from X509_policy_check().
|
| 858 |
+
*/
|
| 859 |
+
#define X509_PCY_TREE_VALID 1 /* The policy tree is valid */
|
| 860 |
+
#define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */
|
| 861 |
+
#define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */
|
| 862 |
+
|
| 863 |
+
int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
|
| 864 |
+
STACK_OF(X509) *certs,
|
| 865 |
+
STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
|
| 866 |
+
|
| 867 |
+
void X509_policy_tree_free(X509_POLICY_TREE *tree);
|
| 868 |
+
|
| 869 |
+
int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
|
| 870 |
+
X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
|
| 871 |
+
int i);
|
| 872 |
+
|
| 873 |
+
STACK_OF(X509_POLICY_NODE)
|
| 874 |
+
*X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
|
| 875 |
+
|
| 876 |
+
STACK_OF(X509_POLICY_NODE)
|
| 877 |
+
*X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
|
| 878 |
+
|
| 879 |
+
int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
|
| 880 |
+
|
| 881 |
+
X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level,
|
| 882 |
+
int i);
|
| 883 |
+
|
| 884 |
+
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
|
| 885 |
+
|
| 886 |
+
STACK_OF(POLICYQUALINFO)
|
| 887 |
+
*X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
|
| 888 |
+
const X509_POLICY_NODE
|
| 889 |
+
*X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
|
| 890 |
+
|
| 891 |
+
#ifdef __cplusplus
|
| 892 |
+
}
|
| 893 |
+
#endif
|
| 894 |
+
#endif
|
llava_next/include/openssl/x509v3err.h
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_X509V3ERR_H
|
| 12 |
+
# define OPENSSL_X509V3ERR_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 |
+
* X509V3 reason codes.
|
| 23 |
+
*/
|
| 24 |
+
# define X509V3_R_BAD_IP_ADDRESS 118
|
| 25 |
+
# define X509V3_R_BAD_OBJECT 119
|
| 26 |
+
# define X509V3_R_BN_DEC2BN_ERROR 100
|
| 27 |
+
# define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
|
| 28 |
+
# define X509V3_R_DIRNAME_ERROR 149
|
| 29 |
+
# define X509V3_R_DISTPOINT_ALREADY_SET 160
|
| 30 |
+
# define X509V3_R_DUPLICATE_ZONE_ID 133
|
| 31 |
+
# define X509V3_R_EMPTY_KEY_USAGE 169
|
| 32 |
+
# define X509V3_R_ERROR_CONVERTING_ZONE 131
|
| 33 |
+
# define X509V3_R_ERROR_CREATING_EXTENSION 144
|
| 34 |
+
# define X509V3_R_ERROR_IN_EXTENSION 128
|
| 35 |
+
# define X509V3_R_EXPECTED_A_SECTION_NAME 137
|
| 36 |
+
# define X509V3_R_EXTENSION_EXISTS 145
|
| 37 |
+
# define X509V3_R_EXTENSION_NAME_ERROR 115
|
| 38 |
+
# define X509V3_R_EXTENSION_NOT_FOUND 102
|
| 39 |
+
# define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
|
| 40 |
+
# define X509V3_R_EXTENSION_VALUE_ERROR 116
|
| 41 |
+
# define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
|
| 42 |
+
# define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
|
| 43 |
+
# define X509V3_R_INVALID_ASNUMBER 162
|
| 44 |
+
# define X509V3_R_INVALID_ASRANGE 163
|
| 45 |
+
# define X509V3_R_INVALID_BOOLEAN_STRING 104
|
| 46 |
+
# define X509V3_R_INVALID_CERTIFICATE 158
|
| 47 |
+
# define X509V3_R_INVALID_EMPTY_NAME 108
|
| 48 |
+
# define X509V3_R_INVALID_EXTENSION_STRING 105
|
| 49 |
+
# define X509V3_R_INVALID_INHERITANCE 165
|
| 50 |
+
# define X509V3_R_INVALID_IPADDRESS 166
|
| 51 |
+
# define X509V3_R_INVALID_MULTIPLE_RDNS 161
|
| 52 |
+
# define X509V3_R_INVALID_NAME 106
|
| 53 |
+
# define X509V3_R_INVALID_NULL_ARGUMENT 107
|
| 54 |
+
# define X509V3_R_INVALID_NULL_VALUE 109
|
| 55 |
+
# define X509V3_R_INVALID_NUMBER 140
|
| 56 |
+
# define X509V3_R_INVALID_NUMBERS 141
|
| 57 |
+
# define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
|
| 58 |
+
# define X509V3_R_INVALID_OPTION 138
|
| 59 |
+
# define X509V3_R_INVALID_POLICY_IDENTIFIER 134
|
| 60 |
+
# define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
|
| 61 |
+
# define X509V3_R_INVALID_PURPOSE 146
|
| 62 |
+
# define X509V3_R_INVALID_SAFI 164
|
| 63 |
+
# define X509V3_R_INVALID_SECTION 135
|
| 64 |
+
# define X509V3_R_INVALID_SYNTAX 143
|
| 65 |
+
# define X509V3_R_ISSUER_DECODE_ERROR 126
|
| 66 |
+
# define X509V3_R_MISSING_VALUE 124
|
| 67 |
+
# define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
|
| 68 |
+
# define X509V3_R_NEGATIVE_PATHLEN 168
|
| 69 |
+
# define X509V3_R_NO_CONFIG_DATABASE 136
|
| 70 |
+
# define X509V3_R_NO_ISSUER_CERTIFICATE 121
|
| 71 |
+
# define X509V3_R_NO_ISSUER_DETAILS 127
|
| 72 |
+
# define X509V3_R_NO_POLICY_IDENTIFIER 139
|
| 73 |
+
# define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
|
| 74 |
+
# define X509V3_R_NO_PUBLIC_KEY 114
|
| 75 |
+
# define X509V3_R_NO_SUBJECT_DETAILS 125
|
| 76 |
+
# define X509V3_R_OPERATION_NOT_DEFINED 148
|
| 77 |
+
# define X509V3_R_OTHERNAME_ERROR 147
|
| 78 |
+
# define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155
|
| 79 |
+
# define X509V3_R_POLICY_PATH_LENGTH 156
|
| 80 |
+
# define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157
|
| 81 |
+
# define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
|
| 82 |
+
# define X509V3_R_SECTION_NOT_FOUND 150
|
| 83 |
+
# define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
|
| 84 |
+
# define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
|
| 85 |
+
# define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
|
| 86 |
+
# define X509V3_R_UNKNOWN_EXTENSION 129
|
| 87 |
+
# define X509V3_R_UNKNOWN_EXTENSION_NAME 130
|
| 88 |
+
# define X509V3_R_UNKNOWN_OPTION 120
|
| 89 |
+
# define X509V3_R_UNSUPPORTED_OPTION 117
|
| 90 |
+
# define X509V3_R_UNSUPPORTED_TYPE 167
|
| 91 |
+
# define X509V3_R_USER_TOO_LONG 132
|
| 92 |
+
|
| 93 |
+
#endif
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/ConstantSymNodeImpl.h
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/SymNodeImpl.h>
|
| 4 |
+
#include <c10/macros/Export.h>
|
| 5 |
+
#include <c10/util/Exception.h>
|
| 6 |
+
#include <c10/util/Optional.h>
|
| 7 |
+
#include <cstdint>
|
| 8 |
+
#include <string>
|
| 9 |
+
#include <variant>
|
| 10 |
+
|
| 11 |
+
namespace c10 {
|
| 12 |
+
|
| 13 |
+
// Unlike other SymNodeImpl, this cannot be "dispatched" conventionally,
|
| 14 |
+
// as it typically needs to defer to another SymNodeImpl
|
| 15 |
+
//
|
| 16 |
+
// Can either represent a bool, int (don't support float yet) this is useful
|
| 17 |
+
// for representing otherwise unrepresentable large negative integer constant.
|
| 18 |
+
template <typename T>
|
| 19 |
+
class C10_API ConstantSymNodeImpl : public SymNodeImpl {
|
| 20 |
+
static_assert(
|
| 21 |
+
::std::is_same_v<T, int64_t> || ::std::is_same_v<T, bool>,
|
| 22 |
+
"ConstantSymNodeImpl can only accept int64_t or bool types");
|
| 23 |
+
|
| 24 |
+
public:
|
| 25 |
+
ConstantSymNodeImpl(T val) : value_(val) {}
|
| 26 |
+
|
| 27 |
+
bool is_int() override {
|
| 28 |
+
return is_int_();
|
| 29 |
+
}
|
| 30 |
+
bool is_bool() override {
|
| 31 |
+
return is_bool_();
|
| 32 |
+
}
|
| 33 |
+
bool is_float() override {
|
| 34 |
+
return false;
|
| 35 |
+
}
|
| 36 |
+
int64_t guard_int(const char* file, int64_t line) override {
|
| 37 |
+
TORCH_CHECK(is_int(), "not an int");
|
| 38 |
+
return int_();
|
| 39 |
+
}
|
| 40 |
+
bool guard_bool(const char* file, int64_t line) override {
|
| 41 |
+
TORCH_CHECK(is_bool(), "not a bool");
|
| 42 |
+
return bool_();
|
| 43 |
+
}
|
| 44 |
+
double guard_float(const char* file, int64_t line) override {
|
| 45 |
+
TORCH_CHECK(false, "not a float");
|
| 46 |
+
}
|
| 47 |
+
int64_t int_() override {
|
| 48 |
+
TORCH_CHECK(is_int(), "not an int");
|
| 49 |
+
return ::std::get<int64_t>(value_);
|
| 50 |
+
}
|
| 51 |
+
bool bool_() override {
|
| 52 |
+
TORCH_CHECK(is_bool(), "not a bool");
|
| 53 |
+
return ::std::get<bool>(value_);
|
| 54 |
+
}
|
| 55 |
+
bool has_hint() override {
|
| 56 |
+
return true;
|
| 57 |
+
}
|
| 58 |
+
c10::SymNode eq(const c10::SymNode& other) override;
|
| 59 |
+
c10::SymNode ne(const c10::SymNode& other) override;
|
| 60 |
+
c10::SymNode ge(const c10::SymNode& other) override;
|
| 61 |
+
c10::SymNode le(const c10::SymNode& other) override;
|
| 62 |
+
c10::SymNode lt(const c10::SymNode& other) override;
|
| 63 |
+
c10::SymNode gt(const c10::SymNode& other) override;
|
| 64 |
+
c10::SymNode mul(const c10::SymNode& other) override;
|
| 65 |
+
::std::string str() override {
|
| 66 |
+
if constexpr (is_int_()) {
|
| 67 |
+
return ::std::to_string(::std::get<int64_t>(value_));
|
| 68 |
+
} else {
|
| 69 |
+
return ::std::get<bool>(value_) ? "true" : "false";
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
std::optional<int64_t> constant_int() override {
|
| 73 |
+
if constexpr (is_int_()) {
|
| 74 |
+
return ::std::get<int64_t>(value_);
|
| 75 |
+
} else {
|
| 76 |
+
return c10::nullopt;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
std::optional<bool> constant_bool() override {
|
| 80 |
+
if constexpr (is_bool_()) {
|
| 81 |
+
return ::std::get<bool>(value_);
|
| 82 |
+
} else {
|
| 83 |
+
return c10::nullopt;
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
bool is_constant() override {
|
| 87 |
+
return true;
|
| 88 |
+
}
|
| 89 |
+
bool is_symbolic() override {
|
| 90 |
+
return false;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
private:
|
| 94 |
+
::std::variant<int64_t, bool> value_;
|
| 95 |
+
|
| 96 |
+
static constexpr bool is_int_() {
|
| 97 |
+
return ::std::is_same_v<T, int64_t>;
|
| 98 |
+
}
|
| 99 |
+
static constexpr bool is_bool_() {
|
| 100 |
+
return ::std::is_same_v<T, bool>;
|
| 101 |
+
}
|
| 102 |
+
};
|
| 103 |
+
|
| 104 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/Event.h
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/Device.h>
|
| 4 |
+
#include <c10/core/DeviceType.h>
|
| 5 |
+
#include <c10/core/Stream.h>
|
| 6 |
+
#include <c10/core/impl/DeviceGuardImplInterface.h>
|
| 7 |
+
#include <c10/core/impl/InlineEvent.h>
|
| 8 |
+
#include <c10/core/impl/VirtualGuardImpl.h>
|
| 9 |
+
|
| 10 |
+
namespace c10 {
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* A backend-generic movable, not copyable, not thread-safe event.
|
| 14 |
+
*
|
| 15 |
+
* The design of this event follows that of CUDA and HIP events. These events
|
| 16 |
+
* are recorded and waited on by streams and can be rerecorded to,
|
| 17 |
+
* each rerecording essentially creating a new version of the event.
|
| 18 |
+
* For example, if (in CPU time), stream X is asked to record E,
|
| 19 |
+
* stream Y waits on E, and stream X is asked to record E again, then Y will
|
| 20 |
+
* wait for X to finish the first call to record and not the second, because
|
| 21 |
+
* it's waiting on the first version of event E, not the second.
|
| 22 |
+
* Querying an event only returns the status of its most recent version.
|
| 23 |
+
*
|
| 24 |
+
* Backend-generic events are implemented by this class and
|
| 25 |
+
* impl::InlineEvent. In addition to these events there are also
|
| 26 |
+
* some backend-specific events, like ATen's CUDAEvent. Each of these
|
| 27 |
+
* classes has its own use.
|
| 28 |
+
*
|
| 29 |
+
* impl::InlineEvent<...> or a backend-specific event should be
|
| 30 |
+
* preferred when the backend is known at compile time and known to
|
| 31 |
+
* be compiled. Backend-specific events may have additional functionality.
|
| 32 |
+
*
|
| 33 |
+
* This Event should be used if a particular backend may not be available,
|
| 34 |
+
* or the backend required is not known at compile time.
|
| 35 |
+
*
|
| 36 |
+
* These generic events are built on top of DeviceGuardImpls, analogous
|
| 37 |
+
* to DeviceGuard and InlineDeviceGuard. The name "DeviceGuardImpls,"
|
| 38 |
+
* is no longer entirely accurate, as these classes implement the
|
| 39 |
+
* backend-specific logic for a generic backend interface.
|
| 40 |
+
*
|
| 41 |
+
* See DeviceGuardImplInterface.h for a list of all supported flags.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
struct Event final {
|
| 45 |
+
// Constructors
|
| 46 |
+
Event() = delete;
|
| 47 |
+
Event(
|
| 48 |
+
const DeviceType _device_type,
|
| 49 |
+
const EventFlag _flag = EventFlag::PYTORCH_DEFAULT)
|
| 50 |
+
: impl_{_device_type, _flag} {}
|
| 51 |
+
|
| 52 |
+
// Copy constructor and copy assignment operator (deleted)
|
| 53 |
+
Event(const Event&) = delete;
|
| 54 |
+
Event& operator=(const Event&) = delete;
|
| 55 |
+
|
| 56 |
+
// Move constructor and move assignment operator
|
| 57 |
+
Event(Event&&) noexcept = default;
|
| 58 |
+
Event& operator=(Event&&) noexcept = default;
|
| 59 |
+
|
| 60 |
+
// Destructor
|
| 61 |
+
~Event() = default;
|
| 62 |
+
|
| 63 |
+
// Getters
|
| 64 |
+
Device device() const noexcept {
|
| 65 |
+
return Device(device_type(), device_index());
|
| 66 |
+
}
|
| 67 |
+
DeviceType device_type() const noexcept {
|
| 68 |
+
return impl_.device_type();
|
| 69 |
+
}
|
| 70 |
+
DeviceIndex device_index() const noexcept {
|
| 71 |
+
return impl_.device_index();
|
| 72 |
+
}
|
| 73 |
+
EventFlag flag() const noexcept {
|
| 74 |
+
return impl_.flag();
|
| 75 |
+
}
|
| 76 |
+
bool was_marked_for_recording() const noexcept {
|
| 77 |
+
return impl_.was_marked_for_recording();
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
/**
|
| 81 |
+
* Calls record() if and only if record() has never been called for this
|
| 82 |
+
* event. Note: because Event is not thread-safe recordOnce() may call
|
| 83 |
+
* record() multiple times if called from multiple threads.
|
| 84 |
+
*/
|
| 85 |
+
void recordOnce(const Stream& stream) {
|
| 86 |
+
impl_.recordOnce(stream);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* Increments the event's version and enqueues a job with this version
|
| 91 |
+
* in the stream's work queue. When the stream process that job
|
| 92 |
+
* it notifies all streams waiting on / blocked by that version of the
|
| 93 |
+
* event to continue and marks that version as recorded.
|
| 94 |
+
* */
|
| 95 |
+
void record(const Stream& stream) {
|
| 96 |
+
impl_.record(stream);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
/**
|
| 100 |
+
* Does nothing if the event has not been scheduled to be recorded.
|
| 101 |
+
* If the event was previously enqueued to be recorded, a command
|
| 102 |
+
* to wait for the version of the event that exists at the time of this call
|
| 103 |
+
* is inserted in the stream's work queue.
|
| 104 |
+
* When the stream reaches this command it will stop processing
|
| 105 |
+
* additional commands until that version of the event is marked as recorded.
|
| 106 |
+
*/
|
| 107 |
+
void block(const Stream& stream) const {
|
| 108 |
+
impl_.block(stream);
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/**
|
| 112 |
+
* Returns true if (and only if)
|
| 113 |
+
* (1) the event has never been scheduled to be recorded
|
| 114 |
+
* (2) the current version is marked as recorded.
|
| 115 |
+
* Returns false otherwise.
|
| 116 |
+
*/
|
| 117 |
+
bool query() const {
|
| 118 |
+
return impl_.query();
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
double elapsedTime(const Event& event) const {
|
| 122 |
+
return impl_.elapsedTime(event.impl_);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
void* eventId() const {
|
| 126 |
+
return impl_.eventId();
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
void synchronize() const {
|
| 130 |
+
return impl_.synchronize();
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
private:
|
| 134 |
+
impl::InlineEvent<impl::VirtualGuardImpl> impl_;
|
| 135 |
+
};
|
| 136 |
+
|
| 137 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/GeneratorImpl.h
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cstdint>
|
| 4 |
+
#include <mutex>
|
| 5 |
+
|
| 6 |
+
#include <c10/core/Device.h>
|
| 7 |
+
#include <c10/core/DispatchKeySet.h>
|
| 8 |
+
#include <c10/core/TensorImpl.h>
|
| 9 |
+
#include <c10/macros/Export.h>
|
| 10 |
+
#include <c10/util/intrusive_ptr.h>
|
| 11 |
+
#include <c10/util/python_stub.h>
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Note [Generator]
|
| 15 |
+
* ~~~~~~~~~~~~~~~~
|
| 16 |
+
* A Pseudo Random Number Generator (PRNG) is an engine that uses an algorithm
|
| 17 |
+
* to generate a seemingly random sequence of numbers, that may be later be used
|
| 18 |
+
* in creating a random distribution. Such an engine almost always maintains a
|
| 19 |
+
* state and requires a seed to start off the creation of random numbers. Often
|
| 20 |
+
* times, users have found it beneficial to be able to explicitly create,
|
| 21 |
+
* retain, and destroy PRNG states and also be able to have control over the
|
| 22 |
+
* seed value.
|
| 23 |
+
*
|
| 24 |
+
* A Generator in ATen gives users the ability to read, write and modify a PRNG
|
| 25 |
+
* engine. For instance, it does so by letting users seed a PRNG engine, fork
|
| 26 |
+
* the state of the engine, etc.
|
| 27 |
+
*
|
| 28 |
+
* By default, there is one generator per device, and a device's generator is
|
| 29 |
+
* lazily created. A user can use the torch.Generator() api to create their own
|
| 30 |
+
* generator. Currently torch.Generator() can only create a CPUGeneratorImpl.
|
| 31 |
+
*/
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Note [Acquire lock when using random generators]
|
| 35 |
+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 36 |
+
* Generator and its derived classes are NOT thread-safe. Please note that most
|
| 37 |
+
* of the places where we have inserted locking for generators are historically
|
| 38 |
+
* based, and we haven't actually checked that everything is truly thread safe
|
| 39 |
+
* (and it probably isn't). Please use the public mutex_ when using any methods
|
| 40 |
+
* from these classes, except for the read-only methods. You can learn about the
|
| 41 |
+
* usage by looking into the unittests (aten/src/ATen/cpu_generator_test.cpp)
|
| 42 |
+
* and other places where we have used lock_guard.
|
| 43 |
+
*
|
| 44 |
+
* TODO: Look into changing the threading semantics of Generators in ATen (e.g.,
|
| 45 |
+
* making them non-thread safe and instead making the generator state
|
| 46 |
+
* splittable, to accommodate forks into other threads).
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
namespace c10 {
|
| 50 |
+
|
| 51 |
+
// The default seed is selected to be a large number
|
| 52 |
+
// with good distribution of 0s and 1s in bit representation
|
| 53 |
+
constexpr uint64_t default_rng_seed_val = 67280421310721;
|
| 54 |
+
|
| 55 |
+
struct C10_API GeneratorImpl : public c10::intrusive_ptr_target {
|
| 56 |
+
// Constructors
|
| 57 |
+
GeneratorImpl(Device device_in, DispatchKeySet key_set);
|
| 58 |
+
|
| 59 |
+
// Delete all copy and move assignment in favor of clone()
|
| 60 |
+
// method
|
| 61 |
+
GeneratorImpl(const GeneratorImpl& other) = delete;
|
| 62 |
+
GeneratorImpl(GeneratorImpl&& other) = delete;
|
| 63 |
+
GeneratorImpl& operator=(const GeneratorImpl& other) = delete;
|
| 64 |
+
|
| 65 |
+
~GeneratorImpl() override = default;
|
| 66 |
+
c10::intrusive_ptr<GeneratorImpl> clone() const;
|
| 67 |
+
|
| 68 |
+
// Common methods for all generators
|
| 69 |
+
virtual void set_current_seed(uint64_t seed) = 0;
|
| 70 |
+
virtual void set_offset(uint64_t offset) = 0;
|
| 71 |
+
virtual uint64_t get_offset() const = 0;
|
| 72 |
+
virtual uint64_t current_seed() const = 0;
|
| 73 |
+
virtual uint64_t seed() = 0;
|
| 74 |
+
virtual void set_state(const c10::TensorImpl& new_state) = 0;
|
| 75 |
+
virtual c10::intrusive_ptr<c10::TensorImpl> get_state() const = 0;
|
| 76 |
+
virtual void graphsafe_set_state(
|
| 77 |
+
const c10::intrusive_ptr<c10::GeneratorImpl>& new_state);
|
| 78 |
+
virtual c10::intrusive_ptr<c10::GeneratorImpl> graphsafe_get_state() const;
|
| 79 |
+
Device device() const;
|
| 80 |
+
|
| 81 |
+
// See Note [Acquire lock when using random generators]
|
| 82 |
+
std::mutex mutex_;
|
| 83 |
+
|
| 84 |
+
DispatchKeySet key_set() const {
|
| 85 |
+
return key_set_;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
inline void set_pyobj(PyObject* pyobj) noexcept {
|
| 89 |
+
pyobj_ = pyobj;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
inline PyObject* pyobj() const noexcept {
|
| 93 |
+
return pyobj_;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
protected:
|
| 97 |
+
Device device_;
|
| 98 |
+
DispatchKeySet key_set_;
|
| 99 |
+
PyObject* pyobj_ = nullptr;
|
| 100 |
+
|
| 101 |
+
virtual GeneratorImpl* clone_impl() const = 0;
|
| 102 |
+
};
|
| 103 |
+
|
| 104 |
+
namespace detail {
|
| 105 |
+
|
| 106 |
+
C10_API uint64_t getNonDeterministicRandom(bool is_cuda = false);
|
| 107 |
+
|
| 108 |
+
} // namespace detail
|
| 109 |
+
|
| 110 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/Layout.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/Backend.h>
|
| 4 |
+
#include <c10/util/Exception.h>
|
| 5 |
+
|
| 6 |
+
#include <cstdint>
|
| 7 |
+
#include <ostream>
|
| 8 |
+
|
| 9 |
+
namespace c10 {
|
| 10 |
+
enum class Layout : int8_t {
|
| 11 |
+
Strided,
|
| 12 |
+
Sparse,
|
| 13 |
+
SparseCsr,
|
| 14 |
+
Mkldnn,
|
| 15 |
+
SparseCsc,
|
| 16 |
+
SparseBsr,
|
| 17 |
+
SparseBsc,
|
| 18 |
+
Jagged,
|
| 19 |
+
NumOptions
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
constexpr auto kStrided = Layout::Strided;
|
| 23 |
+
constexpr auto kSparse = Layout::Sparse;
|
| 24 |
+
constexpr auto kSparseCsr = Layout::SparseCsr;
|
| 25 |
+
constexpr auto kMkldnn = Layout::Mkldnn;
|
| 26 |
+
constexpr auto kSparseCsc = Layout::SparseCsc;
|
| 27 |
+
constexpr auto kSparseBsr = Layout::SparseBsr;
|
| 28 |
+
constexpr auto kSparseBsc = Layout::SparseBsc;
|
| 29 |
+
constexpr auto kJagged = Layout::Jagged;
|
| 30 |
+
|
| 31 |
+
inline Layout layout_from_backend(Backend backend) {
|
| 32 |
+
switch (backend) {
|
| 33 |
+
case Backend::SparseCPU:
|
| 34 |
+
case Backend::SparseCUDA:
|
| 35 |
+
case Backend::SparseHIP:
|
| 36 |
+
case Backend::SparseVE:
|
| 37 |
+
case Backend::SparseXPU:
|
| 38 |
+
case Backend::SparsePrivateUse1:
|
| 39 |
+
return Layout::Sparse;
|
| 40 |
+
case Backend::MkldnnCPU:
|
| 41 |
+
return Layout::Mkldnn;
|
| 42 |
+
case Backend::SparseCsrCPU:
|
| 43 |
+
case Backend::SparseCsrCUDA:
|
| 44 |
+
case Backend::SparseCsrHIP:
|
| 45 |
+
case Backend::SparseCsrVE:
|
| 46 |
+
case Backend::SparseCsrXPU:
|
| 47 |
+
TORCH_CHECK(
|
| 48 |
+
false,
|
| 49 |
+
"Cannot map Backend SparseCsr(CPU|CUDA|HIP|VE|XPU) to a unique layout.");
|
| 50 |
+
default:
|
| 51 |
+
return Layout::Strided;
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
inline std::ostream& operator<<(std::ostream& stream, at::Layout layout) {
|
| 56 |
+
switch (layout) {
|
| 57 |
+
case at::kStrided:
|
| 58 |
+
return stream << "Strided";
|
| 59 |
+
case at::kSparse:
|
| 60 |
+
return stream << "Sparse";
|
| 61 |
+
case at::kSparseCsr:
|
| 62 |
+
return stream << "SparseCsr";
|
| 63 |
+
case at::kSparseCsc:
|
| 64 |
+
return stream << "SparseCsc";
|
| 65 |
+
case at::kSparseBsr:
|
| 66 |
+
return stream << "SparseBsr";
|
| 67 |
+
case at::kSparseBsc:
|
| 68 |
+
return stream << "SparseBsc";
|
| 69 |
+
case at::kMkldnn:
|
| 70 |
+
return stream << "Mkldnn";
|
| 71 |
+
case at::kJagged:
|
| 72 |
+
return stream << "Jagged";
|
| 73 |
+
default:
|
| 74 |
+
TORCH_CHECK(false, "Unknown layout");
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/COW.h
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Macros.h>
|
| 4 |
+
#include <c10/util/intrusive_ptr.h>
|
| 5 |
+
|
| 6 |
+
namespace c10 {
|
| 7 |
+
struct StorageImpl;
|
| 8 |
+
class DataPtr;
|
| 9 |
+
}; // namespace c10
|
| 10 |
+
|
| 11 |
+
namespace c10::impl::cow {
|
| 12 |
+
|
| 13 |
+
// Creates a Copy-on-write (COW) clone of the given storage. This will also
|
| 14 |
+
// convert the given storage into a COW storage if it is not COW already.
|
| 15 |
+
//
|
| 16 |
+
// Converting the storage into a COW storage will not be successful if the
|
| 17 |
+
// storage's DataPtr has some context (`DataPtr::get_context()`) which is not
|
| 18 |
+
// equal to the data pointer (`DataPtr::get()`). In this case, a nullptr is
|
| 19 |
+
// returned.
|
| 20 |
+
C10_API c10::intrusive_ptr<StorageImpl> lazy_clone_storage(
|
| 21 |
+
StorageImpl& storage);
|
| 22 |
+
|
| 23 |
+
// Check if a storage has a simple DataPtr with no abnormal context
|
| 24 |
+
C10_API bool has_simple_data_ptr(const c10::StorageImpl& storage);
|
| 25 |
+
|
| 26 |
+
// Check if a DataPtr is COW
|
| 27 |
+
C10_API bool is_cow_data_ptr(const c10::DataPtr& data_ptr);
|
| 28 |
+
|
| 29 |
+
// Eagerly copies a COW storage's data, turning it into a non-COW storage.
|
| 30 |
+
C10_API void materialize_cow_storage(StorageImpl& storage);
|
| 31 |
+
|
| 32 |
+
} // namespace c10::impl::cow
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/COWDeleter.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/macros/Export.h>
|
| 4 |
+
#include <c10/util/UniqueVoidPtr.h>
|
| 5 |
+
|
| 6 |
+
#include <atomic>
|
| 7 |
+
#include <cstdint>
|
| 8 |
+
#include <memory>
|
| 9 |
+
#include <shared_mutex>
|
| 10 |
+
#include <variant>
|
| 11 |
+
|
| 12 |
+
namespace c10::impl::cow {
|
| 13 |
+
|
| 14 |
+
// A COWDeleterContext object is used as the `ctx` argument for DataPtr
|
| 15 |
+
// to implement a Copy-on-write (COW) DataPtr.
|
| 16 |
+
class C10_API COWDeleterContext {
|
| 17 |
+
public:
|
| 18 |
+
// Creates an instance, holding the pair of data and original
|
| 19 |
+
// deleter.
|
| 20 |
+
//
|
| 21 |
+
// Note that the deleter will only be called in our destructor if
|
| 22 |
+
// the last reference to this goes away without getting
|
| 23 |
+
// materialized.
|
| 24 |
+
explicit COWDeleterContext(std::unique_ptr<void, DeleterFnPtr> data);
|
| 25 |
+
|
| 26 |
+
// Increments the current refcount.
|
| 27 |
+
void increment_refcount();
|
| 28 |
+
|
| 29 |
+
// See README.md in this directory to understand the locking
|
| 30 |
+
// strategy.
|
| 31 |
+
|
| 32 |
+
// Represents a reference to the context.
|
| 33 |
+
//
|
| 34 |
+
// This is returned by decrement_refcount to allow the caller to
|
| 35 |
+
// copy the data under the shared lock.
|
| 36 |
+
using NotLastReference = std::shared_lock<std::shared_mutex>;
|
| 37 |
+
|
| 38 |
+
// Represents the last reference to the context.
|
| 39 |
+
//
|
| 40 |
+
// This will be returned by decrement_refcount when it is the last
|
| 41 |
+
// reference remaining and after any pending copies have completed.
|
| 42 |
+
using LastReference = std::unique_ptr<void, DeleterFnPtr>;
|
| 43 |
+
|
| 44 |
+
// Decrements the refcount, returning a handle indicating what to
|
| 45 |
+
// do with it.
|
| 46 |
+
std::variant<NotLastReference, LastReference> decrement_refcount();
|
| 47 |
+
|
| 48 |
+
private:
|
| 49 |
+
// The destructor is hidden, this should only ever be used within
|
| 50 |
+
// UniqueVoidPtr using cow::delete_context as the deleter.
|
| 51 |
+
~COWDeleterContext();
|
| 52 |
+
|
| 53 |
+
std::shared_mutex mutex_;
|
| 54 |
+
std::unique_ptr<void, DeleterFnPtr> data_;
|
| 55 |
+
std::atomic<std::int64_t> refcount_ = 1;
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
// `cow_deleter` is used as the `ctx_deleter` for DataPtr to implement a COW
|
| 59 |
+
// DataPtr.
|
| 60 |
+
//
|
| 61 |
+
// Warning: This should only be called on a pointer to a COWDeleterContext that
|
| 62 |
+
// was allocated on the heap with `new`, because when the refcount reaches 0,
|
| 63 |
+
// the context is deleted with `delete`.
|
| 64 |
+
C10_API void cow_deleter(void* ctx);
|
| 65 |
+
|
| 66 |
+
} // namespace c10::impl::cow
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/FakeGuardImpl.h
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/impl/DeviceGuardImplInterface.h>
|
| 4 |
+
|
| 5 |
+
#include <array>
|
| 6 |
+
|
| 7 |
+
namespace c10::impl {
|
| 8 |
+
|
| 9 |
+
// FakeGuardImpl is hardcoded to have eight devices. Not for
|
| 10 |
+
// any good reason, just to simplify code.
|
| 11 |
+
constexpr DeviceIndex kFakeGuardImplMaxDevices = 8;
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* A fake implementation of DeviceGuardImplInterface suitable for testing.
|
| 15 |
+
* The current device is modeled as a mutable field in the guard implementation
|
| 16 |
+
* class. See DeviceGuard_test.cpp for an example use.
|
| 17 |
+
*/
|
| 18 |
+
template <DeviceType T>
|
| 19 |
+
struct FakeGuardImpl final : public DeviceGuardImplInterface {
|
| 20 |
+
static constexpr DeviceType static_type = T;
|
| 21 |
+
// Runtime device type is not used
|
| 22 |
+
FakeGuardImpl(DeviceType) {}
|
| 23 |
+
FakeGuardImpl() = default;
|
| 24 |
+
DeviceType type() const override {
|
| 25 |
+
return T;
|
| 26 |
+
}
|
| 27 |
+
Device exchangeDevice(Device d) const override {
|
| 28 |
+
AT_ASSERT(d.type() == type());
|
| 29 |
+
AT_ASSERT(d.index() < kFakeGuardImplMaxDevices);
|
| 30 |
+
Device old_device = getDevice();
|
| 31 |
+
if (old_device.index() != d.index()) {
|
| 32 |
+
current_device_ = d.index();
|
| 33 |
+
}
|
| 34 |
+
return old_device;
|
| 35 |
+
}
|
| 36 |
+
Device getDevice() const override {
|
| 37 |
+
return Device(type(), current_device_);
|
| 38 |
+
}
|
| 39 |
+
void setDevice(Device d) const override {
|
| 40 |
+
AT_ASSERT(d.type() == type());
|
| 41 |
+
AT_ASSERT(d.index() >= 0);
|
| 42 |
+
AT_ASSERT(d.index() < kFakeGuardImplMaxDevices);
|
| 43 |
+
current_device_ = d.index();
|
| 44 |
+
}
|
| 45 |
+
void uncheckedSetDevice(Device d) const noexcept override {
|
| 46 |
+
current_device_ = d.index();
|
| 47 |
+
}
|
| 48 |
+
Stream getStream(Device d) const noexcept override {
|
| 49 |
+
return Stream(Stream::UNSAFE, d, current_streams_[d.index()]);
|
| 50 |
+
}
|
| 51 |
+
Stream exchangeStream(Stream s) const noexcept override {
|
| 52 |
+
auto old_id = current_streams_[s.device_index()];
|
| 53 |
+
current_streams_[s.device_index()] = s.id();
|
| 54 |
+
return Stream(Stream::UNSAFE, s.device(), old_id);
|
| 55 |
+
}
|
| 56 |
+
DeviceIndex deviceCount() const noexcept override {
|
| 57 |
+
return kFakeGuardImplMaxDevices;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
// Event-related functions
|
| 61 |
+
void record(
|
| 62 |
+
void** event,
|
| 63 |
+
const Stream& stream,
|
| 64 |
+
const DeviceIndex device_index,
|
| 65 |
+
const EventFlag flag) const override {}
|
| 66 |
+
void block(void* event, const Stream& stream) const override {}
|
| 67 |
+
bool queryEvent(void* event) const override {
|
| 68 |
+
return true;
|
| 69 |
+
}
|
| 70 |
+
void destroyEvent(void* event, const DeviceIndex device_index)
|
| 71 |
+
const noexcept override {}
|
| 72 |
+
|
| 73 |
+
// Convenience methods for testing
|
| 74 |
+
static DeviceIndex getDeviceIndex() {
|
| 75 |
+
return current_device_;
|
| 76 |
+
}
|
| 77 |
+
static void setDeviceIndex(DeviceIndex i) {
|
| 78 |
+
AT_ASSERT(i >= 0);
|
| 79 |
+
AT_ASSERT(i < kFakeGuardImplMaxDevices);
|
| 80 |
+
current_device_ = i;
|
| 81 |
+
}
|
| 82 |
+
static StreamId getCurrentStreamIdFor(DeviceIndex i) {
|
| 83 |
+
return current_streams_.at(i);
|
| 84 |
+
}
|
| 85 |
+
static void resetStreams() {
|
| 86 |
+
current_streams_.fill(0);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
private:
|
| 90 |
+
thread_local static DeviceIndex current_device_;
|
| 91 |
+
thread_local static std::array<StreamId, kFakeGuardImplMaxDevices>
|
| 92 |
+
current_streams_;
|
| 93 |
+
};
|
| 94 |
+
|
| 95 |
+
template <DeviceType T>
|
| 96 |
+
thread_local DeviceIndex FakeGuardImpl<T>::current_device_ = 0;
|
| 97 |
+
|
| 98 |
+
template <DeviceType T>
|
| 99 |
+
thread_local std::array<StreamId, kFakeGuardImplMaxDevices>
|
| 100 |
+
FakeGuardImpl<T>::current_streams_ = {0, 0, 0, 0, 0, 0, 0, 0};
|
| 101 |
+
|
| 102 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/GPUTrace.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/impl/PyInterpreter.h>
|
| 4 |
+
|
| 5 |
+
namespace c10::impl {
|
| 6 |
+
|
| 7 |
+
struct C10_API GPUTrace {
|
| 8 |
+
// On the x86 architecture the atomic operations are lock-less.
|
| 9 |
+
static std::atomic<const PyInterpreter*> gpuTraceState;
|
| 10 |
+
|
| 11 |
+
// When PyTorch migrates to C++20, this should be changed to an atomic flag.
|
| 12 |
+
// Currently, the access to this variable is not synchronized, on the basis
|
| 13 |
+
// that it will only be flipped once and by the first interpreter that
|
| 14 |
+
// accesses it.
|
| 15 |
+
static bool haveState;
|
| 16 |
+
|
| 17 |
+
// This function will only register the first interpreter that tries to invoke
|
| 18 |
+
// it. For all of the next ones it will be a no-op.
|
| 19 |
+
static void set_trace(const PyInterpreter*);
|
| 20 |
+
|
| 21 |
+
static const PyInterpreter* get_trace() {
|
| 22 |
+
if (!haveState)
|
| 23 |
+
return nullptr;
|
| 24 |
+
return gpuTraceState.load(std::memory_order_acquire);
|
| 25 |
+
}
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/InlineEvent.h
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/DeviceType.h>
|
| 4 |
+
#include <c10/core/Stream.h>
|
| 5 |
+
#include <c10/core/impl/DeviceGuardImplInterface.h>
|
| 6 |
+
#include <c10/util/Exception.h>
|
| 7 |
+
|
| 8 |
+
namespace c10::impl {
|
| 9 |
+
|
| 10 |
+
template <typename T>
|
| 11 |
+
struct InlineEvent final {
|
| 12 |
+
InlineEvent() = delete;
|
| 13 |
+
InlineEvent(
|
| 14 |
+
const DeviceType _device_type,
|
| 15 |
+
const EventFlag _flag = EventFlag::PYTORCH_DEFAULT)
|
| 16 |
+
: backend_{_device_type}, device_type_{_device_type}, flag_{_flag} {}
|
| 17 |
+
|
| 18 |
+
// Copy constructor and copy assignment operator (deleted)
|
| 19 |
+
InlineEvent(const InlineEvent&) = delete;
|
| 20 |
+
InlineEvent& operator=(const InlineEvent&) = delete;
|
| 21 |
+
|
| 22 |
+
// Move constructor and move assignment operator
|
| 23 |
+
InlineEvent(InlineEvent&& other) noexcept
|
| 24 |
+
: event_(other.event_),
|
| 25 |
+
backend_(std::move(other.backend_)),
|
| 26 |
+
device_type_(other.device_type_),
|
| 27 |
+
device_index_(other.device_index_),
|
| 28 |
+
flag_(other.flag_),
|
| 29 |
+
was_marked_for_recording_(other.was_marked_for_recording_) {
|
| 30 |
+
other.event_ = nullptr;
|
| 31 |
+
}
|
| 32 |
+
InlineEvent& operator=(InlineEvent&& other) noexcept {
|
| 33 |
+
swap(other);
|
| 34 |
+
return *this;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
void swap(InlineEvent& other) noexcept {
|
| 38 |
+
std::swap(event_, other.event_);
|
| 39 |
+
std::swap(backend_, other.backend_);
|
| 40 |
+
std::swap(device_type_, other.device_type_);
|
| 41 |
+
std::swap(device_index_, other.device_index_);
|
| 42 |
+
std::swap(flag_, other.flag_);
|
| 43 |
+
std::swap(was_marked_for_recording_, other.was_marked_for_recording_);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
~InlineEvent() noexcept {
|
| 47 |
+
if (event_)
|
| 48 |
+
backend_.destroyEvent(event_, device_index_);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
DeviceType device_type() const noexcept {
|
| 52 |
+
return device_type_;
|
| 53 |
+
}
|
| 54 |
+
DeviceIndex device_index() const noexcept {
|
| 55 |
+
return device_index_;
|
| 56 |
+
}
|
| 57 |
+
EventFlag flag() const noexcept {
|
| 58 |
+
return flag_;
|
| 59 |
+
}
|
| 60 |
+
bool was_marked_for_recording() const noexcept {
|
| 61 |
+
return was_marked_for_recording_;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
void recordOnce(const Stream& stream) {
|
| 65 |
+
if (!was_marked_for_recording_)
|
| 66 |
+
record(stream);
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
void record(const Stream& stream) {
|
| 70 |
+
TORCH_CHECK(
|
| 71 |
+
stream.device_type() == device_type_,
|
| 72 |
+
"Event device type ",
|
| 73 |
+
DeviceTypeName(device_type_),
|
| 74 |
+
" does not match recording stream's device type ",
|
| 75 |
+
DeviceTypeName(stream.device_type()),
|
| 76 |
+
".");
|
| 77 |
+
|
| 78 |
+
backend_.record(&event_, stream, device_index_, flag_);
|
| 79 |
+
was_marked_for_recording_ = true;
|
| 80 |
+
device_index_ = stream.device_index();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
void block(const Stream& stream) const {
|
| 84 |
+
if (!was_marked_for_recording_)
|
| 85 |
+
return;
|
| 86 |
+
|
| 87 |
+
TORCH_CHECK(
|
| 88 |
+
stream.device_type() == device_type_,
|
| 89 |
+
"Event device type ",
|
| 90 |
+
DeviceTypeName(device_type_),
|
| 91 |
+
" does not match blocking stream's device type ",
|
| 92 |
+
DeviceTypeName(stream.device_type()),
|
| 93 |
+
".");
|
| 94 |
+
|
| 95 |
+
backend_.block(event_, stream);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
bool query() const {
|
| 99 |
+
if (!was_marked_for_recording_)
|
| 100 |
+
return true;
|
| 101 |
+
return backend_.queryEvent(event_);
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
void* eventId() const {
|
| 105 |
+
return event_;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
double elapsedTime(const InlineEvent& other) const {
|
| 109 |
+
TORCH_CHECK(
|
| 110 |
+
other.was_marked_for_recording(),
|
| 111 |
+
"other was not marked for recording.");
|
| 112 |
+
TORCH_CHECK(
|
| 113 |
+
was_marked_for_recording(), "self was not marked for recording.");
|
| 114 |
+
TORCH_CHECK(
|
| 115 |
+
other.device_type() == device_type_,
|
| 116 |
+
"Event device type ",
|
| 117 |
+
DeviceTypeName(device_type_),
|
| 118 |
+
" does not match other's device type ",
|
| 119 |
+
DeviceTypeName(other.device_type()),
|
| 120 |
+
".");
|
| 121 |
+
return backend_.elapsedTime(event_, other.event_, device_index_);
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
void synchronize() const {
|
| 125 |
+
if (!was_marked_for_recording_)
|
| 126 |
+
return;
|
| 127 |
+
backend_.synchronizeEvent(event_);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
private:
|
| 131 |
+
void* event_ = nullptr;
|
| 132 |
+
T backend_;
|
| 133 |
+
DeviceType device_type_;
|
| 134 |
+
DeviceIndex device_index_ = -1;
|
| 135 |
+
EventFlag flag_ = EventFlag::PYTORCH_DEFAULT;
|
| 136 |
+
bool was_marked_for_recording_ = false;
|
| 137 |
+
};
|
| 138 |
+
|
| 139 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/PyInterpreter.h
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/Device.h>
|
| 4 |
+
#include <c10/core/DispatchKeySet.h>
|
| 5 |
+
#include <c10/core/Layout.h>
|
| 6 |
+
#include <c10/core/MemoryFormat.h>
|
| 7 |
+
#include <c10/core/SymIntArrayRef.h>
|
| 8 |
+
#include <c10/macros/Export.h>
|
| 9 |
+
#include <c10/util/ArrayRef.h>
|
| 10 |
+
#include <c10/util/intrusive_ptr.h>
|
| 11 |
+
#include <c10/util/python_stub.h>
|
| 12 |
+
#include <string>
|
| 13 |
+
#include <vector>
|
| 14 |
+
|
| 15 |
+
// Forward declarations
|
| 16 |
+
|
| 17 |
+
namespace c10 {
|
| 18 |
+
struct IValue;
|
| 19 |
+
class OperatorHandle;
|
| 20 |
+
struct TensorImpl;
|
| 21 |
+
} // namespace c10
|
| 22 |
+
|
| 23 |
+
namespace torch::jit {
|
| 24 |
+
using Stack = std::vector<c10::IValue>;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
// Actual implementation
|
| 28 |
+
|
| 29 |
+
namespace c10::impl {
|
| 30 |
+
|
| 31 |
+
struct C10_API PyInterpreter;
|
| 32 |
+
|
| 33 |
+
// Note [Python interpreter tag]
|
| 34 |
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 35 |
+
// Traditionally, PyTorch is layered such that our Python library
|
| 36 |
+
// (libtorch_python) references our pure C++ library (libtorch) as the
|
| 37 |
+
// natural order of things. However, sometimes this natural order is
|
| 38 |
+
// subverted: C++ objects refer to Python objects (for example, we
|
| 39 |
+
// store a PyObject* pointer on TensorImpl so that converting from a
|
| 40 |
+
// C++ Tensor to a Python Tensor is just a memory dereference).
|
| 41 |
+
//
|
| 42 |
+
// These unusual orderings must be treated with care. To start, you need to
|
| 43 |
+
// virtualize the destructor so that the PyObject can be decref'ed on
|
| 44 |
+
// destruction (because the C++ object itself doesn't know anything about
|
| 45 |
+
// Python--remember, layering!). This process itself is fraught, since
|
| 46 |
+
// acquiring the GIL could lead to deadlocks if someone is blocking on you
|
| 47 |
+
// while holding the GIL. Furthermore, if the C++ objects outlive the
|
| 48 |
+
// interpreter (which can happen if you stash them in a static global
|
| 49 |
+
// variable defined in libtorch), you may attempt to decref the object when
|
| 50 |
+
// the Python interpreter has already been shutdown.
|
| 51 |
+
//
|
| 52 |
+
// BUT WAIT, IT GETS WORSE. With torchdeploy, there may be multiple Python
|
| 53 |
+
// interpreters in a single process. If a C++ object is accessible from
|
| 54 |
+
// multiple interpreters, we must take care not to accidentally pass a
|
| 55 |
+
// PyObject from one interpreter with another interpreter.
|
| 56 |
+
//
|
| 57 |
+
// To prevent these mixups, we introduce a PyInterpreter "tag" (object with
|
| 58 |
+
// a vtable), which specifies a specific Python interpreter.
|
| 59 |
+
//
|
| 60 |
+
// - Any given object can be associated with AT MOST one Python interpreter.
|
| 61 |
+
// We represent the interpreter tag as a memory address to an instance of
|
| 62 |
+
// a virtual class that is allocated once per interpreter (this is so that
|
| 63 |
+
// we can request the interpreter to perform operations for us, if
|
| 64 |
+
// necessary).
|
| 65 |
+
//
|
| 66 |
+
// - It can be recorded with a PyObject (PyInterpreterObject) so that
|
| 67 |
+
// we know what interpreter the object is associated with, and we can
|
| 68 |
+
// raise an error if you try to use the PyObject from the wrong
|
| 69 |
+
// interpreter context.
|
| 70 |
+
//
|
| 71 |
+
// - It contains a vtable that can be used to perform various Python
|
| 72 |
+
// operations from ordinary C++ code that ordinarily wouldn't be accessible
|
| 73 |
+
// from libtorch.
|
| 74 |
+
//
|
| 75 |
+
// A simple use case is when a C++ object must be associated with a PyObject.
|
| 76 |
+
// However, for TensorImpl, we lazily allocate a PyObject the first time the
|
| 77 |
+
// object passes into Python. The invariants for this situation are more
|
| 78 |
+
// subtle:
|
| 79 |
+
//
|
| 80 |
+
// - A given TensorImpl's interpreter tag can only go from uninitialized to
|
| 81 |
+
// tagged; once tagged, this is a quiescent state (once tagged to an
|
| 82 |
+
// interpreter, ALWAYS tagged to that interpreter)
|
| 83 |
+
//
|
| 84 |
+
// - A thread may mutate the PyObject field of a TensorImpl if and only if it
|
| 85 |
+
// holds the GIL for the interpreter tagged on the TensorImpl. (If the
|
| 86 |
+
// TensorImpl is not tagged, it must first atomically claim its tag before it
|
| 87 |
+
// can validly write)
|
| 88 |
+
//
|
| 89 |
+
// WARNING: This class has to be written very carefully, because it may be
|
| 90 |
+
// possible for a Tensor to have a reference an interpreter corresponding to
|
| 91 |
+
// a shared library that has ALREADY BEEN UNLOADED. This makes blindly calling
|
| 92 |
+
// virtual methods very dangerous, because the vtable may be garbage at that
|
| 93 |
+
// point (on a good day, you might get "pure virtual method called").
|
| 94 |
+
//
|
| 95 |
+
// The idea to solve this problem is we always leak PyInterpreters (so they
|
| 96 |
+
// always stay live even after dlclose), and make sure we can disarm their
|
| 97 |
+
// virtual methods by indirecting through a separate PyInterpreterVTable
|
| 98 |
+
// object. This can be replaced with a no-op vtable from libc10.so, which
|
| 99 |
+
// is guaranteed to stick around until the bitter end.
|
| 100 |
+
//
|
| 101 |
+
// NB: The downside with representing PyInterpreter tags as full objects is that
|
| 102 |
+
// it takes an extra word on TensorImpl. If tags were instead just integer
|
| 103 |
+
// indices, on 64-bit architectures we could pack the tag and PyObject together
|
| 104 |
+
// into a single atomic word. On 32-bit architectures we could simply say that
|
| 105 |
+
// only one Python interpreter is supported (erroring if a nontrivial
|
| 106 |
+
// interpreter tag is attempted to be set).
|
| 107 |
+
//
|
| 108 |
+
// The difficulty with this scheme is we need to maintain an out-of-line table
|
| 109 |
+
// to get at the PyInterpreters so that we can do virtual method calls on them,
|
| 110 |
+
// and registration/deregistration to this table must be done in a thread safe
|
| 111 |
+
// manner. This can be easily done if the number of possible PyInterpreters is
|
| 112 |
+
// small enough (e.g., 8-bit integer) by simply preallocating an array of
|
| 113 |
+
// sufficient size to hold all possible interpreters. Surely 128 threads is
|
| 114 |
+
// more than enough for anyone!
|
| 115 |
+
//
|
| 116 |
+
// I didn't decide to do this technique at the moment, because the extra word
|
| 117 |
+
// added by the PyInterpreter tag takes us to 24 words, which means that we
|
| 118 |
+
// still fit inside three eight word cache lines. If you need to penny pinch
|
| 119 |
+
// another word consider doing this!
|
| 120 |
+
|
| 121 |
+
struct C10_API PyInterpreterVTable {
|
| 122 |
+
virtual ~PyInterpreterVTable() = default;
|
| 123 |
+
|
| 124 |
+
// Report the name of this interpreter
|
| 125 |
+
virtual std::string name() const = 0;
|
| 126 |
+
|
| 127 |
+
// Run Py_DECREF on a PyObject. We DO NOT assume the GIL is held on call
|
| 128 |
+
// See NOTE [PyInterpreter::decref takes a `has_pyobj_slot` arg]
|
| 129 |
+
virtual void decref(PyObject* pyobj, bool has_pyobj_slot) const = 0;
|
| 130 |
+
|
| 131 |
+
// Perform a detach by deferring to the __torch_dispatch__ implementation of
|
| 132 |
+
// detach, which will also arrange for the PyObject to get copied in this
|
| 133 |
+
// situation
|
| 134 |
+
virtual c10::intrusive_ptr<TensorImpl> detach(
|
| 135 |
+
const TensorImpl* self) const = 0;
|
| 136 |
+
|
| 137 |
+
// Invoke the Python boxed fallback dispatch to go back into Python
|
| 138 |
+
virtual void dispatch(const c10::OperatorHandle& op, torch::jit::Stack* stack)
|
| 139 |
+
const = 0;
|
| 140 |
+
|
| 141 |
+
virtual void reportErrorCallback(PyObject* callback, DispatchKey key)
|
| 142 |
+
const = 0;
|
| 143 |
+
|
| 144 |
+
// This is only invoked in the multipy/torchdeploy situation from
|
| 145 |
+
// pythonOpRegistrationTrampoline; this lets us get to the Python
|
| 146 |
+
// interpreter to actually find the appropriate Python op registration
|
| 147 |
+
// entry to call.
|
| 148 |
+
virtual void python_op_registration_trampoline(
|
| 149 |
+
const c10::OperatorHandle& op,
|
| 150 |
+
c10::DispatchKey,
|
| 151 |
+
c10::DispatchKeySet keyset,
|
| 152 |
+
torch::jit::Stack* stack,
|
| 153 |
+
bool with_keyset) const = 0;
|
| 154 |
+
|
| 155 |
+
virtual void throw_abstract_impl_not_imported_error(
|
| 156 |
+
std::string opname,
|
| 157 |
+
const char* pymodule,
|
| 158 |
+
const char* context) const = 0;
|
| 159 |
+
|
| 160 |
+
// Invoke the Python dispatcher to handle this call
|
| 161 |
+
virtual void python_dispatcher(
|
| 162 |
+
const c10::OperatorHandle& op,
|
| 163 |
+
c10::DispatchKeySet,
|
| 164 |
+
torch::jit::Stack* stack) const = 0;
|
| 165 |
+
|
| 166 |
+
virtual bool is_contiguous(const TensorImpl* self, at::MemoryFormat)
|
| 167 |
+
const = 0;
|
| 168 |
+
virtual bool is_strides_like(const TensorImpl* self, at::MemoryFormat)
|
| 169 |
+
const = 0;
|
| 170 |
+
virtual bool is_non_overlapping_and_dense(const TensorImpl* self) const = 0;
|
| 171 |
+
virtual c10::Device device(const TensorImpl* self) const = 0;
|
| 172 |
+
virtual int64_t dim(const TensorImpl* self) const = 0;
|
| 173 |
+
virtual c10::IntArrayRef strides(const TensorImpl* self) const = 0;
|
| 174 |
+
virtual c10::IntArrayRef sizes(const TensorImpl* self) const = 0;
|
| 175 |
+
virtual c10::SymIntArrayRef sym_sizes(const TensorImpl* self) const = 0;
|
| 176 |
+
virtual c10::Layout layout(const TensorImpl* self) const = 0;
|
| 177 |
+
virtual int64_t numel(const TensorImpl* self) const = 0;
|
| 178 |
+
virtual c10::SymInt sym_numel(const TensorImpl* self) const = 0;
|
| 179 |
+
virtual c10::SymIntArrayRef sym_strides(const TensorImpl* self) const = 0;
|
| 180 |
+
virtual c10::SymInt sym_storage_offset(const TensorImpl* self) const = 0;
|
| 181 |
+
|
| 182 |
+
virtual void trace_gpu_event_creation(
|
| 183 |
+
c10::DeviceType device_type,
|
| 184 |
+
uintptr_t event) const = 0;
|
| 185 |
+
virtual void trace_gpu_event_deletion(
|
| 186 |
+
c10::DeviceType device_type,
|
| 187 |
+
uintptr_t event) const = 0;
|
| 188 |
+
virtual void trace_gpu_event_record(
|
| 189 |
+
c10::DeviceType device_type,
|
| 190 |
+
uintptr_t event,
|
| 191 |
+
uintptr_t stream) const = 0;
|
| 192 |
+
virtual void trace_gpu_event_wait(
|
| 193 |
+
c10::DeviceType device_type,
|
| 194 |
+
uintptr_t event,
|
| 195 |
+
uintptr_t stream) const = 0;
|
| 196 |
+
virtual void trace_gpu_memory_allocation(
|
| 197 |
+
c10::DeviceType device_type,
|
| 198 |
+
uintptr_t ptr) const = 0;
|
| 199 |
+
virtual void trace_gpu_memory_deallocation(
|
| 200 |
+
c10::DeviceType device_type,
|
| 201 |
+
uintptr_t ptr) const = 0;
|
| 202 |
+
virtual void trace_gpu_stream_creation(
|
| 203 |
+
c10::DeviceType device_type,
|
| 204 |
+
uintptr_t stream) const = 0;
|
| 205 |
+
virtual void trace_gpu_device_synchronization(
|
| 206 |
+
c10::DeviceType device_type) const = 0;
|
| 207 |
+
virtual void trace_gpu_stream_synchronization(
|
| 208 |
+
c10::DeviceType device_type,
|
| 209 |
+
uintptr_t stream) const = 0;
|
| 210 |
+
virtual void trace_gpu_event_synchronization(
|
| 211 |
+
c10::DeviceType device_type,
|
| 212 |
+
uintptr_t event) const = 0;
|
| 213 |
+
|
| 214 |
+
virtual void reset_backward_hooks(const TensorImpl* self) const = 0;
|
| 215 |
+
};
|
| 216 |
+
|
| 217 |
+
struct C10_API PyInterpreter {
|
| 218 |
+
const PyInterpreterVTable* vtable_;
|
| 219 |
+
|
| 220 |
+
PyInterpreter(const PyInterpreterVTable* vtable) : vtable_(vtable){};
|
| 221 |
+
|
| 222 |
+
const PyInterpreterVTable& operator*() const noexcept {
|
| 223 |
+
return *vtable_;
|
| 224 |
+
}
|
| 225 |
+
const PyInterpreterVTable* operator->() const noexcept {
|
| 226 |
+
return vtable_;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
// Disarm this PyInterpreter, making all of its methods noops.
|
| 230 |
+
// The vtable pointer is not an atomic at the moment, which means
|
| 231 |
+
// a disarm() invocation that is concurrent with active destructors
|
| 232 |
+
// is not thread safe and will trigger TSAN. My hope is that this
|
| 233 |
+
// situations doesn't ever actually happen; tensor destruction should
|
| 234 |
+
// quiesce when a dlclose happens, and any long lived tensors whose
|
| 235 |
+
// destructors would be disarmed here only begin the destruction process
|
| 236 |
+
// on process shutdown (long after the dlclose has occurred).
|
| 237 |
+
void disarm() noexcept;
|
| 238 |
+
};
|
| 239 |
+
|
| 240 |
+
// PyInterpreterStatus describes what the state of its interpreter tag
|
| 241 |
+
// is, relative to the thread currently holding the GIL.
|
| 242 |
+
enum class PyInterpreterStatus {
|
| 243 |
+
// We just allocated the Tensor, it hasn't escaped to other threads,
|
| 244 |
+
// we know that it definitely hasn't been tagged to be associated
|
| 245 |
+
// with an interpreter.
|
| 246 |
+
DEFINITELY_UNINITIALIZED,
|
| 247 |
+
// We queried the interpreter field and it looked uninitialized. But
|
| 248 |
+
// another thread may have raced with us to tag it with some other
|
| 249 |
+
// interpreter id. So we will have to do a CEX to make sure we can
|
| 250 |
+
// actually nab it.
|
| 251 |
+
MAYBE_UNINITIALIZED,
|
| 252 |
+
// We queried the interpreter field and it was tagged to belong to us.
|
| 253 |
+
// This means we have sole write access (as we hold the GIL for this
|
| 254 |
+
// interpreter)
|
| 255 |
+
TAGGED_BY_US,
|
| 256 |
+
// Someone else tagged this. We can't use this TensorImpl from Python.
|
| 257 |
+
TAGGED_BY_OTHER,
|
| 258 |
+
};
|
| 259 |
+
|
| 260 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/SizesAndStrides.h
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <algorithm>
|
| 4 |
+
#include <cstdint>
|
| 5 |
+
|
| 6 |
+
#include <c10/macros/Macros.h>
|
| 7 |
+
#include <c10/util/ArrayRef.h>
|
| 8 |
+
#include <c10/util/SmallVector.h>
|
| 9 |
+
|
| 10 |
+
#define C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE 5
|
| 11 |
+
|
| 12 |
+
namespace c10::impl {
|
| 13 |
+
|
| 14 |
+
// Packed container for TensorImpl sizes and strides.
|
| 15 |
+
// This design improves on the previous approach of using a pair of
|
| 16 |
+
// c10::SmallVector<int64_t, 5> by specializing for the operations we
|
| 17 |
+
// actually use and enforcing that the number of sizes is the same as
|
| 18 |
+
// the number of strides. The memory layout is as follows:
|
| 19 |
+
//
|
| 20 |
+
// 1 size_t for the size
|
| 21 |
+
// 5 eightbytes of inline sizes and 5 eightbytes of inline strides, OR pointer
|
| 22 |
+
// to out-of-line array
|
| 23 |
+
class C10_API SizesAndStrides {
|
| 24 |
+
public:
|
| 25 |
+
// TODO: different iterator types for sizes & strides to prevent
|
| 26 |
+
// mixing the two accidentally.
|
| 27 |
+
using sizes_iterator = int64_t*;
|
| 28 |
+
using sizes_const_iterator = const int64_t*;
|
| 29 |
+
using strides_iterator = int64_t*;
|
| 30 |
+
using strides_const_iterator = const int64_t*;
|
| 31 |
+
|
| 32 |
+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
| 33 |
+
SizesAndStrides() {
|
| 34 |
+
size_at_unchecked(0) = 0;
|
| 35 |
+
stride_at_unchecked(0) = 1;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
~SizesAndStrides() {
|
| 39 |
+
if (C10_UNLIKELY(!isInline())) {
|
| 40 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 41 |
+
free(outOfLineStorage_);
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
| 46 |
+
SizesAndStrides(const SizesAndStrides& rhs) : size_(rhs.size_) {
|
| 47 |
+
if (C10_LIKELY(rhs.isInline())) {
|
| 48 |
+
copyDataInline(rhs);
|
| 49 |
+
} else {
|
| 50 |
+
allocateOutOfLineStorage(size_);
|
| 51 |
+
copyDataOutline(rhs);
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
SizesAndStrides& operator=(const SizesAndStrides& rhs) {
|
| 56 |
+
if (this == &rhs) {
|
| 57 |
+
return *this;
|
| 58 |
+
}
|
| 59 |
+
if (C10_LIKELY(rhs.isInline())) {
|
| 60 |
+
if (C10_UNLIKELY(!isInline())) {
|
| 61 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 62 |
+
free(outOfLineStorage_);
|
| 63 |
+
}
|
| 64 |
+
copyDataInline(rhs);
|
| 65 |
+
} else {
|
| 66 |
+
if (isInline()) {
|
| 67 |
+
allocateOutOfLineStorage(rhs.size_);
|
| 68 |
+
} else {
|
| 69 |
+
resizeOutOfLineStorage(rhs.size_);
|
| 70 |
+
}
|
| 71 |
+
copyDataOutline(rhs);
|
| 72 |
+
}
|
| 73 |
+
size_ = rhs.size_;
|
| 74 |
+
return *this;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
// Move from rhs. rhs.size() == 0 afterwards.
|
| 78 |
+
SizesAndStrides(SizesAndStrides&& rhs) noexcept : size_(rhs.size_) {
|
| 79 |
+
if (C10_LIKELY(isInline())) {
|
| 80 |
+
memcpy(inlineStorage_, rhs.inlineStorage_, sizeof(inlineStorage_));
|
| 81 |
+
} else {
|
| 82 |
+
outOfLineStorage_ = rhs.outOfLineStorage_;
|
| 83 |
+
rhs.outOfLineStorage_ = nullptr;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
rhs.size_ = 0;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
// Move from rhs. rhs.size() == 0 afterwards.
|
| 90 |
+
SizesAndStrides& operator=(SizesAndStrides&& rhs) noexcept {
|
| 91 |
+
if (this == &rhs) {
|
| 92 |
+
return *this;
|
| 93 |
+
}
|
| 94 |
+
if (C10_LIKELY(rhs.isInline())) {
|
| 95 |
+
if (C10_UNLIKELY(!isInline())) {
|
| 96 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 97 |
+
free(outOfLineStorage_);
|
| 98 |
+
}
|
| 99 |
+
copyDataInline(rhs);
|
| 100 |
+
} else {
|
| 101 |
+
// They're outline. We're going to steal their vector.
|
| 102 |
+
if (!isInline()) {
|
| 103 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 104 |
+
free(outOfLineStorage_);
|
| 105 |
+
}
|
| 106 |
+
outOfLineStorage_ = rhs.outOfLineStorage_;
|
| 107 |
+
rhs.outOfLineStorage_ = nullptr;
|
| 108 |
+
}
|
| 109 |
+
size_ = rhs.size_;
|
| 110 |
+
rhs.size_ = 0;
|
| 111 |
+
|
| 112 |
+
return *this;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
size_t size() const noexcept {
|
| 116 |
+
return size_;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
const int64_t* sizes_data() const noexcept {
|
| 120 |
+
if (C10_LIKELY(isInline())) {
|
| 121 |
+
return &inlineStorage_[0];
|
| 122 |
+
} else {
|
| 123 |
+
return &outOfLineStorage_[0];
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
int64_t* sizes_data() noexcept {
|
| 128 |
+
if (C10_LIKELY(isInline())) {
|
| 129 |
+
return &inlineStorage_[0];
|
| 130 |
+
} else {
|
| 131 |
+
return &outOfLineStorage_[0];
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
sizes_const_iterator sizes_begin() const noexcept {
|
| 136 |
+
return sizes_data();
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
sizes_iterator sizes_begin() noexcept {
|
| 140 |
+
return sizes_data();
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
sizes_const_iterator sizes_end() const noexcept {
|
| 144 |
+
return sizes_begin() + size();
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
sizes_iterator sizes_end() noexcept {
|
| 148 |
+
return sizes_begin() + size();
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
IntArrayRef sizes_arrayref() const noexcept {
|
| 152 |
+
return IntArrayRef{sizes_data(), size()};
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
void set_sizes(IntArrayRef newSizes) {
|
| 156 |
+
resize(newSizes.size());
|
| 157 |
+
std::copy(newSizes.begin(), newSizes.end(), sizes_begin());
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
void set_strides(IntArrayRef strides) {
|
| 161 |
+
TORCH_INTERNAL_ASSERT(strides.size() == size());
|
| 162 |
+
std::copy(strides.begin(), strides.end(), strides_begin());
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
const int64_t* strides_data() const noexcept {
|
| 166 |
+
if (C10_LIKELY(isInline())) {
|
| 167 |
+
return &inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE];
|
| 168 |
+
} else {
|
| 169 |
+
return &outOfLineStorage_[size()];
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
int64_t* strides_data() noexcept {
|
| 174 |
+
if (C10_LIKELY(isInline())) {
|
| 175 |
+
return &inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE];
|
| 176 |
+
} else {
|
| 177 |
+
return &outOfLineStorage_[size()];
|
| 178 |
+
}
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
strides_const_iterator strides_begin() const noexcept {
|
| 182 |
+
if (C10_LIKELY(isInline())) {
|
| 183 |
+
return &inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE];
|
| 184 |
+
} else {
|
| 185 |
+
return &outOfLineStorage_[size()];
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
strides_iterator strides_begin() noexcept {
|
| 190 |
+
if (C10_LIKELY(isInline())) {
|
| 191 |
+
return &inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE];
|
| 192 |
+
} else {
|
| 193 |
+
return &outOfLineStorage_[size()];
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
strides_const_iterator strides_end() const noexcept {
|
| 198 |
+
return strides_begin() + size();
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
strides_iterator strides_end() noexcept {
|
| 202 |
+
return strides_begin() + size();
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
IntArrayRef strides_arrayref() const noexcept {
|
| 206 |
+
return IntArrayRef{strides_data(), size()};
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
// Size accessors.
|
| 210 |
+
int64_t size_at(size_t idx) const noexcept {
|
| 211 |
+
assert(idx < size());
|
| 212 |
+
return sizes_data()[idx];
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
int64_t& size_at(size_t idx) noexcept {
|
| 216 |
+
assert(idx < size());
|
| 217 |
+
return sizes_data()[idx];
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
int64_t size_at_unchecked(size_t idx) const noexcept {
|
| 221 |
+
return sizes_data()[idx];
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
int64_t& size_at_unchecked(size_t idx) noexcept {
|
| 225 |
+
return sizes_data()[idx];
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
// Size accessors.
|
| 229 |
+
int64_t stride_at(size_t idx) const noexcept {
|
| 230 |
+
assert(idx < size());
|
| 231 |
+
return strides_data()[idx];
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
int64_t& stride_at(size_t idx) noexcept {
|
| 235 |
+
assert(idx < size());
|
| 236 |
+
return strides_data()[idx];
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
int64_t stride_at_unchecked(size_t idx) const noexcept {
|
| 240 |
+
return strides_data()[idx];
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
int64_t& stride_at_unchecked(size_t idx) noexcept {
|
| 244 |
+
return strides_data()[idx];
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
void resize(size_t newSize) {
|
| 248 |
+
const auto oldSize = size();
|
| 249 |
+
if (newSize == oldSize) {
|
| 250 |
+
return;
|
| 251 |
+
}
|
| 252 |
+
if (C10_LIKELY(
|
| 253 |
+
newSize <= C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE && isInline())) {
|
| 254 |
+
if (oldSize < newSize) {
|
| 255 |
+
const auto bytesToZero =
|
| 256 |
+
(newSize - oldSize) * sizeof(inlineStorage_[0]);
|
| 257 |
+
memset(&inlineStorage_[oldSize], 0, bytesToZero);
|
| 258 |
+
memset(
|
| 259 |
+
&inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE + oldSize],
|
| 260 |
+
0,
|
| 261 |
+
bytesToZero);
|
| 262 |
+
}
|
| 263 |
+
size_ = newSize;
|
| 264 |
+
} else {
|
| 265 |
+
resizeSlowPath(newSize, oldSize);
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
void resizeSlowPath(size_t newSize, size_t oldSize);
|
| 270 |
+
|
| 271 |
+
private:
|
| 272 |
+
bool isInline() const noexcept {
|
| 273 |
+
return size_ <= C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE;
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
void copyDataInline(const SizesAndStrides& rhs) {
|
| 277 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(rhs.isInline());
|
| 278 |
+
memcpy(inlineStorage_, rhs.inlineStorage_, sizeof(inlineStorage_));
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
static size_t storageBytes(size_t size) noexcept {
|
| 282 |
+
return size * 2 * sizeof(int64_t);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
void allocateOutOfLineStorage(size_t size) {
|
| 286 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 287 |
+
outOfLineStorage_ = static_cast<int64_t*>(malloc(storageBytes(size)));
|
| 288 |
+
TORCH_CHECK(
|
| 289 |
+
outOfLineStorage_,
|
| 290 |
+
"Could not allocate memory for Tensor SizesAndStrides!");
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
void resizeOutOfLineStorage(size_t newSize) {
|
| 294 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(!isInline());
|
| 295 |
+
outOfLineStorage_ = static_cast<int64_t*>(
|
| 296 |
+
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
| 297 |
+
realloc(outOfLineStorage_, storageBytes(newSize)));
|
| 298 |
+
TORCH_CHECK(
|
| 299 |
+
outOfLineStorage_,
|
| 300 |
+
"Could not allocate memory for Tensor SizesAndStrides!");
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
void copyDataOutline(const SizesAndStrides& rhs) noexcept {
|
| 304 |
+
memcpy(outOfLineStorage_, rhs.outOfLineStorage_, storageBytes(rhs.size_));
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
size_t size_{1};
|
| 308 |
+
union {
|
| 309 |
+
int64_t* outOfLineStorage_;
|
| 310 |
+
// NOLINTNEXTLINE(*c-array*)
|
| 311 |
+
int64_t inlineStorage_[C10_SIZES_AND_STRIDES_MAX_INLINE_SIZE * 2]{};
|
| 312 |
+
};
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/TorchDispatchModeTLS.h
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/SafePyObject.h>
|
| 4 |
+
#include <c10/macros/Export.h>
|
| 5 |
+
|
| 6 |
+
namespace c10::impl {
|
| 7 |
+
|
| 8 |
+
enum class TorchDispatchModeKey : int8_t {
|
| 9 |
+
FAKE,
|
| 10 |
+
PROXY,
|
| 11 |
+
FUNCTIONAL,
|
| 12 |
+
NUM_MODE_KEYS
|
| 13 |
+
};
|
| 14 |
+
|
| 15 |
+
using PyObject_TorchDispatchMode = SafePyObjectT<TorchDispatchModeKey>;
|
| 16 |
+
|
| 17 |
+
struct C10_API TorchDispatchModeTLS {
|
| 18 |
+
// This API is NOT invariant safe.
|
| 19 |
+
// It must not take in an infra mode that uses TorchDispatchModeKey
|
| 20 |
+
// If you're pushing an infra mode onto the stack, we expect
|
| 21 |
+
// you to use set_mode
|
| 22 |
+
static void push_non_infra_mode_onto_stack(
|
| 23 |
+
std::shared_ptr<PyObject_TorchDispatchMode> mode);
|
| 24 |
+
// Pops the top mode of the stack,
|
| 25 |
+
// giving precedence to user modes before attempting to pop
|
| 26 |
+
// any infra modes
|
| 27 |
+
static const std::shared_ptr<PyObject_TorchDispatchMode> pop_stack();
|
| 28 |
+
// Returns the highest-priority infra mode on the stack,
|
| 29 |
+
// along with its mode key.
|
| 30 |
+
static const std::
|
| 31 |
+
tuple<std::shared_ptr<PyObject_TorchDispatchMode>, TorchDispatchModeKey>
|
| 32 |
+
pop_highest_infra_mode();
|
| 33 |
+
|
| 34 |
+
static const std::shared_ptr<PyObject_TorchDispatchMode>& get_stack_at(
|
| 35 |
+
int64_t idx);
|
| 36 |
+
static int64_t stack_len();
|
| 37 |
+
|
| 38 |
+
static const std::optional<std::shared_ptr<PyObject_TorchDispatchMode>>
|
| 39 |
+
get_mode(TorchDispatchModeKey mode_key);
|
| 40 |
+
static const std::optional<std::shared_ptr<PyObject_TorchDispatchMode>>
|
| 41 |
+
unset_mode(TorchDispatchModeKey mode_key);
|
| 42 |
+
static void set_mode(
|
| 43 |
+
const std::shared_ptr<PyObject_TorchDispatchMode>& mode,
|
| 44 |
+
TorchDispatchModeKey mode_key);
|
| 45 |
+
|
| 46 |
+
static const TorchDispatchModeTLS& get_state();
|
| 47 |
+
static void set_state(TorchDispatchModeTLS state);
|
| 48 |
+
|
| 49 |
+
static bool any_modes_set(bool skip_infra_modes = false);
|
| 50 |
+
|
| 51 |
+
private:
|
| 52 |
+
std::vector<std::shared_ptr<PyObject_TorchDispatchMode>> stack_;
|
| 53 |
+
// Users are allowed to push multiple ProxyTorchDispatchMode objects onto the
|
| 54 |
+
// stack
|
| 55 |
+
// However, we only allow a single FakeTensorMode onto the stack at a time
|
| 56 |
+
// (Pushing additional FakeTensorModes onto the stack is a no-op)
|
| 57 |
+
std::array<
|
| 58 |
+
std::optional<std::shared_ptr<PyObject_TorchDispatchMode>>,
|
| 59 |
+
static_cast<size_t>(TorchDispatchModeKey::NUM_MODE_KEYS)>
|
| 60 |
+
infra_modes_;
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
C10_API bool dispatch_mode_enabled();
|
| 64 |
+
|
| 65 |
+
C10_API std::string to_string(TorchDispatchModeKey mode_key);
|
| 66 |
+
|
| 67 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/core/impl/VirtualGuardImpl.h
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/impl/DeviceGuardImplInterface.h>
|
| 4 |
+
|
| 5 |
+
namespace c10::impl {
|
| 6 |
+
|
| 7 |
+
/**
|
| 8 |
+
* An implementation of DeviceGuardImplInterface which delegates
|
| 9 |
+
* to virtual dispatch on the DeviceGuardImpl registry.
|
| 10 |
+
*/
|
| 11 |
+
class VirtualGuardImpl final : public DeviceGuardImplInterface {
|
| 12 |
+
public:
|
| 13 |
+
VirtualGuardImpl(DeviceType device_type)
|
| 14 |
+
: impl_(getDeviceGuardImpl(device_type)) {}
|
| 15 |
+
// This constructor exists purely for testing
|
| 16 |
+
VirtualGuardImpl(const DeviceGuardImplInterface* impl) : impl_(impl) {}
|
| 17 |
+
|
| 18 |
+
// Copying and moving is OK!
|
| 19 |
+
VirtualGuardImpl(const VirtualGuardImpl&) = default;
|
| 20 |
+
VirtualGuardImpl& operator=(const VirtualGuardImpl&) = default;
|
| 21 |
+
VirtualGuardImpl(VirtualGuardImpl&&) noexcept = default;
|
| 22 |
+
VirtualGuardImpl& operator=(VirtualGuardImpl&&) noexcept = default;
|
| 23 |
+
|
| 24 |
+
DeviceType type() const override {
|
| 25 |
+
return impl_->type();
|
| 26 |
+
}
|
| 27 |
+
Device exchangeDevice(Device d) const override {
|
| 28 |
+
return impl_->exchangeDevice(d);
|
| 29 |
+
}
|
| 30 |
+
Device getDevice() const override {
|
| 31 |
+
return impl_->getDevice();
|
| 32 |
+
}
|
| 33 |
+
void setDevice(Device d) const override {
|
| 34 |
+
impl_->setDevice(d);
|
| 35 |
+
}
|
| 36 |
+
void uncheckedSetDevice(Device d) const noexcept override {
|
| 37 |
+
impl_->uncheckedSetDevice(d);
|
| 38 |
+
}
|
| 39 |
+
Stream getStream(Device d) const noexcept override {
|
| 40 |
+
return impl_->getStream(d);
|
| 41 |
+
}
|
| 42 |
+
Stream getNewStream(Device d, int priority = 0) const override {
|
| 43 |
+
return impl_->getNewStream(d, priority);
|
| 44 |
+
}
|
| 45 |
+
Stream getDefaultStream(Device d) const override {
|
| 46 |
+
return impl_->getDefaultStream(d);
|
| 47 |
+
}
|
| 48 |
+
Stream getStreamFromGlobalPool(Device d, bool isHighPriority = false)
|
| 49 |
+
const override {
|
| 50 |
+
return impl_->getStreamFromGlobalPool(d, isHighPriority);
|
| 51 |
+
}
|
| 52 |
+
Stream exchangeStream(Stream s) const noexcept override {
|
| 53 |
+
return impl_->exchangeStream(s);
|
| 54 |
+
}
|
| 55 |
+
DeviceIndex deviceCount() const noexcept override {
|
| 56 |
+
return impl_->deviceCount();
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
// Event functions
|
| 60 |
+
void record(
|
| 61 |
+
void** event,
|
| 62 |
+
const Stream& stream,
|
| 63 |
+
const DeviceIndex device_index,
|
| 64 |
+
const EventFlag flag) const override {
|
| 65 |
+
impl_->record(event, stream, device_index, flag);
|
| 66 |
+
}
|
| 67 |
+
void block(void* event, const Stream& stream) const override {
|
| 68 |
+
impl_->block(event, stream);
|
| 69 |
+
}
|
| 70 |
+
bool queryEvent(void* event) const override {
|
| 71 |
+
return impl_->queryEvent(event);
|
| 72 |
+
}
|
| 73 |
+
void destroyEvent(void* event, const DeviceIndex device_index)
|
| 74 |
+
const noexcept override {
|
| 75 |
+
impl_->destroyEvent(event, device_index);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
bool queryStream(const Stream& stream) const override {
|
| 79 |
+
return impl_->queryStream(stream);
|
| 80 |
+
}
|
| 81 |
+
void synchronizeStream(const Stream& stream) const override {
|
| 82 |
+
impl_->synchronizeStream(stream);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
void recordDataPtrOnStream(const c10::DataPtr& data_ptr, const Stream& stream)
|
| 86 |
+
const override {
|
| 87 |
+
impl_->recordDataPtrOnStream(data_ptr, stream);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
double elapsedTime(void* event1, void* event2, const DeviceIndex device_index)
|
| 91 |
+
const override {
|
| 92 |
+
return impl_->elapsedTime(event1, event2, device_index);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
void synchronizeEvent(void* event) const override {
|
| 96 |
+
return impl_->synchronizeEvent(event);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
private:
|
| 100 |
+
const DeviceGuardImplInterface* impl_ = nullptr;
|
| 101 |
+
};
|
| 102 |
+
|
| 103 |
+
} // namespace c10::impl
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/AbortHandler.h
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include <c10/macros/Macros.h>
|
| 2 |
+
#include <c10/util/Backtrace.h>
|
| 3 |
+
#include <c10/util/env.h>
|
| 4 |
+
#include <cstdlib>
|
| 5 |
+
#include <exception>
|
| 6 |
+
#include <iostream>
|
| 7 |
+
#include <mutex>
|
| 8 |
+
#include <optional>
|
| 9 |
+
|
| 10 |
+
namespace c10 {
|
| 11 |
+
class AbortHandlerHelper {
|
| 12 |
+
public:
|
| 13 |
+
static AbortHandlerHelper& getInstance() {
|
| 14 |
+
#ifdef _WIN32
|
| 15 |
+
thread_local
|
| 16 |
+
#endif // _WIN32
|
| 17 |
+
static AbortHandlerHelper instance;
|
| 18 |
+
return instance;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
void set(std::terminate_handler handler) {
|
| 22 |
+
std::lock_guard<std::mutex> lk(mutex);
|
| 23 |
+
if (!inited) {
|
| 24 |
+
prev = std::set_terminate(handler);
|
| 25 |
+
curr = std::get_terminate();
|
| 26 |
+
inited = true;
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
std::terminate_handler getPrev() const {
|
| 31 |
+
return prev;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
private:
|
| 35 |
+
std::terminate_handler prev = nullptr;
|
| 36 |
+
std::terminate_handler curr = nullptr;
|
| 37 |
+
bool inited = false;
|
| 38 |
+
std::mutex mutex;
|
| 39 |
+
AbortHandlerHelper() = default;
|
| 40 |
+
~AbortHandlerHelper() {
|
| 41 |
+
// Only restore the handler if we are the current one
|
| 42 |
+
if (inited && curr == std::get_terminate()) {
|
| 43 |
+
std::set_terminate(prev);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
public:
|
| 48 |
+
AbortHandlerHelper(AbortHandlerHelper const&) = delete;
|
| 49 |
+
void operator=(AbortHandlerHelper const&) = delete;
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
namespace detail {
|
| 53 |
+
C10_ALWAYS_INLINE void terminate_handler() {
|
| 54 |
+
std::cout << "Unhandled exception caught in c10/util/AbortHandler.h" << '\n';
|
| 55 |
+
auto backtrace = get_backtrace();
|
| 56 |
+
std::cout << backtrace << '\n' << std::flush;
|
| 57 |
+
auto prev_handler = AbortHandlerHelper::getInstance().getPrev();
|
| 58 |
+
if (prev_handler) {
|
| 59 |
+
prev_handler();
|
| 60 |
+
} else {
|
| 61 |
+
std::abort();
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
} // namespace detail
|
| 65 |
+
|
| 66 |
+
C10_ALWAYS_INLINE void set_terminate_handler() {
|
| 67 |
+
bool use_custom_terminate = false;
|
| 68 |
+
// On Windows it is enabled by default based on
|
| 69 |
+
// https://github.com/pytorch/pytorch/pull/50320#issuecomment-763147062
|
| 70 |
+
#ifdef _WIN32
|
| 71 |
+
use_custom_terminate = true;
|
| 72 |
+
#endif // _WIN32
|
| 73 |
+
auto result = c10::utils::check_env("TORCH_CUSTOM_TERMINATE");
|
| 74 |
+
if (result != std::nullopt) {
|
| 75 |
+
use_custom_terminate = result.value();
|
| 76 |
+
}
|
| 77 |
+
if (use_custom_terminate) {
|
| 78 |
+
AbortHandlerHelper::getInstance().set(detail::terminate_handler);
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
} // namespace c10
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/BFloat16-math.h
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/util/BFloat16.h>
|
| 4 |
+
#include <c10/util/Half.h>
|
| 5 |
+
|
| 6 |
+
C10_CLANG_DIAGNOSTIC_PUSH()
|
| 7 |
+
#if C10_CLANG_HAS_WARNING("-Wimplicit-float-conversion")
|
| 8 |
+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wimplicit-float-conversion")
|
| 9 |
+
#endif
|
| 10 |
+
|
| 11 |
+
namespace std {
|
| 12 |
+
|
| 13 |
+
template <typename T>
|
| 14 |
+
struct is_reduced_floating_point
|
| 15 |
+
: std::integral_constant<
|
| 16 |
+
bool,
|
| 17 |
+
std::is_same_v<T, c10::Half> || std::is_same_v<T, c10::BFloat16>> {};
|
| 18 |
+
|
| 19 |
+
template <typename T>
|
| 20 |
+
constexpr bool is_reduced_floating_point_v =
|
| 21 |
+
is_reduced_floating_point<T>::value;
|
| 22 |
+
|
| 23 |
+
template <
|
| 24 |
+
typename T,
|
| 25 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 26 |
+
inline T acos(T a) {
|
| 27 |
+
return std::acos(float(a));
|
| 28 |
+
}
|
| 29 |
+
template <
|
| 30 |
+
typename T,
|
| 31 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 32 |
+
inline T asin(T a) {
|
| 33 |
+
return std::asin(float(a));
|
| 34 |
+
}
|
| 35 |
+
template <
|
| 36 |
+
typename T,
|
| 37 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 38 |
+
inline T atan(T a) {
|
| 39 |
+
return std::atan(float(a));
|
| 40 |
+
}
|
| 41 |
+
template <
|
| 42 |
+
typename T,
|
| 43 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 44 |
+
inline T atanh(T a) {
|
| 45 |
+
return std::atanh(float(a));
|
| 46 |
+
}
|
| 47 |
+
template <
|
| 48 |
+
typename T,
|
| 49 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 50 |
+
inline T erf(T a) {
|
| 51 |
+
return std::erf(float(a));
|
| 52 |
+
}
|
| 53 |
+
template <
|
| 54 |
+
typename T,
|
| 55 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 56 |
+
inline T erfc(T a) {
|
| 57 |
+
return std::erfc(float(a));
|
| 58 |
+
}
|
| 59 |
+
template <
|
| 60 |
+
typename T,
|
| 61 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 62 |
+
inline T exp(T a) {
|
| 63 |
+
return std::exp(float(a));
|
| 64 |
+
}
|
| 65 |
+
template <
|
| 66 |
+
typename T,
|
| 67 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 68 |
+
inline T expm1(T a) {
|
| 69 |
+
return std::expm1(float(a));
|
| 70 |
+
}
|
| 71 |
+
template <
|
| 72 |
+
typename T,
|
| 73 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 74 |
+
inline T log(T a) {
|
| 75 |
+
return std::log(float(a));
|
| 76 |
+
}
|
| 77 |
+
template <
|
| 78 |
+
typename T,
|
| 79 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 80 |
+
inline T log10(T a) {
|
| 81 |
+
return std::log10(float(a));
|
| 82 |
+
}
|
| 83 |
+
template <
|
| 84 |
+
typename T,
|
| 85 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 86 |
+
inline T log1p(T a) {
|
| 87 |
+
return std::log1p(float(a));
|
| 88 |
+
}
|
| 89 |
+
template <
|
| 90 |
+
typename T,
|
| 91 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 92 |
+
inline T log2(T a) {
|
| 93 |
+
return std::log2(float(a));
|
| 94 |
+
}
|
| 95 |
+
template <
|
| 96 |
+
typename T,
|
| 97 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 98 |
+
inline T ceil(T a) {
|
| 99 |
+
return std::ceil(float(a));
|
| 100 |
+
}
|
| 101 |
+
template <
|
| 102 |
+
typename T,
|
| 103 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 104 |
+
inline T cos(T a) {
|
| 105 |
+
return std::cos(float(a));
|
| 106 |
+
}
|
| 107 |
+
template <
|
| 108 |
+
typename T,
|
| 109 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 110 |
+
inline T floor(T a) {
|
| 111 |
+
return std::floor(float(a));
|
| 112 |
+
}
|
| 113 |
+
template <
|
| 114 |
+
typename T,
|
| 115 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 116 |
+
inline T nearbyint(T a) {
|
| 117 |
+
return std::nearbyint(float(a));
|
| 118 |
+
}
|
| 119 |
+
template <
|
| 120 |
+
typename T,
|
| 121 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 122 |
+
inline T sin(T a) {
|
| 123 |
+
return std::sin(float(a));
|
| 124 |
+
}
|
| 125 |
+
template <
|
| 126 |
+
typename T,
|
| 127 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 128 |
+
inline T tan(T a) {
|
| 129 |
+
return std::tan(float(a));
|
| 130 |
+
}
|
| 131 |
+
template <
|
| 132 |
+
typename T,
|
| 133 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 134 |
+
inline T sinh(T a) {
|
| 135 |
+
return std::sinh(float(a));
|
| 136 |
+
}
|
| 137 |
+
template <
|
| 138 |
+
typename T,
|
| 139 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 140 |
+
inline T cosh(T a) {
|
| 141 |
+
return std::cosh(float(a));
|
| 142 |
+
}
|
| 143 |
+
template <
|
| 144 |
+
typename T,
|
| 145 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 146 |
+
inline T tanh(T a) {
|
| 147 |
+
return std::tanh(float(a));
|
| 148 |
+
}
|
| 149 |
+
template <
|
| 150 |
+
typename T,
|
| 151 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 152 |
+
inline T trunc(T a) {
|
| 153 |
+
return std::trunc(float(a));
|
| 154 |
+
}
|
| 155 |
+
template <
|
| 156 |
+
typename T,
|
| 157 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 158 |
+
inline T lgamma(T a) {
|
| 159 |
+
return std::lgamma(float(a));
|
| 160 |
+
}
|
| 161 |
+
template <
|
| 162 |
+
typename T,
|
| 163 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 164 |
+
inline T sqrt(T a) {
|
| 165 |
+
return std::sqrt(float(a));
|
| 166 |
+
}
|
| 167 |
+
template <
|
| 168 |
+
typename T,
|
| 169 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 170 |
+
inline T rsqrt(T a) {
|
| 171 |
+
return 1.0 / std::sqrt(float(a));
|
| 172 |
+
}
|
| 173 |
+
template <
|
| 174 |
+
typename T,
|
| 175 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 176 |
+
inline T abs(T a) {
|
| 177 |
+
return std::abs(float(a));
|
| 178 |
+
}
|
| 179 |
+
#if defined(_MSC_VER) && defined(__CUDACC__)
|
| 180 |
+
template <
|
| 181 |
+
typename T,
|
| 182 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 183 |
+
inline T pow(T a, double b) {
|
| 184 |
+
return std::pow(float(a), float(b));
|
| 185 |
+
}
|
| 186 |
+
#else
|
| 187 |
+
template <
|
| 188 |
+
typename T,
|
| 189 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 190 |
+
inline T pow(T a, double b) {
|
| 191 |
+
return std::pow(float(a), b);
|
| 192 |
+
}
|
| 193 |
+
#endif
|
| 194 |
+
template <
|
| 195 |
+
typename T,
|
| 196 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 197 |
+
inline T pow(T a, T b) {
|
| 198 |
+
return std::pow(float(a), float(b));
|
| 199 |
+
}
|
| 200 |
+
template <
|
| 201 |
+
typename T,
|
| 202 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 203 |
+
inline T fmod(T a, T b) {
|
| 204 |
+
return std::fmod(float(a), float(b));
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
/*
|
| 208 |
+
The following function is inspired from the implementation in `musl`
|
| 209 |
+
Link to License: https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
|
| 210 |
+
----------------------------------------------------------------------
|
| 211 |
+
Copyright © 2005-2020 Rich Felker, et al.
|
| 212 |
+
|
| 213 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 214 |
+
a copy of this software and associated documentation files (the
|
| 215 |
+
"Software"), to deal in the Software without restriction, including
|
| 216 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 217 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 218 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 219 |
+
the following conditions:
|
| 220 |
+
|
| 221 |
+
The above copyright notice and this permission notice shall be
|
| 222 |
+
included in all copies or substantial portions of the Software.
|
| 223 |
+
|
| 224 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 225 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 226 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 227 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 228 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 229 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 230 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 231 |
+
----------------------------------------------------------------------
|
| 232 |
+
*/
|
| 233 |
+
template <
|
| 234 |
+
typename T,
|
| 235 |
+
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
| 236 |
+
C10_HOST_DEVICE inline T nextafter(T from, T to) {
|
| 237 |
+
// Reference:
|
| 238 |
+
// https://git.musl-libc.org/cgit/musl/tree/src/math/nextafter.c
|
| 239 |
+
using int_repr_t = uint16_t;
|
| 240 |
+
using float_t = T;
|
| 241 |
+
constexpr uint8_t bits = 16;
|
| 242 |
+
union {
|
| 243 |
+
float_t f;
|
| 244 |
+
int_repr_t i;
|
| 245 |
+
} ufrom = {from}, uto = {to};
|
| 246 |
+
|
| 247 |
+
// get a mask to get the sign bit i.e. MSB
|
| 248 |
+
int_repr_t sign_mask = int_repr_t{1} << (bits - 1);
|
| 249 |
+
|
| 250 |
+
// short-circuit: if either is NaN, return NaN
|
| 251 |
+
if (from != from || to != to) {
|
| 252 |
+
return from + to;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
// short-circuit: if they are exactly the same.
|
| 256 |
+
if (ufrom.i == uto.i) {
|
| 257 |
+
return from;
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
// mask the sign-bit to zero i.e. positive
|
| 261 |
+
// equivalent to abs(x)
|
| 262 |
+
int_repr_t abs_from = ufrom.i & ~sign_mask;
|
| 263 |
+
int_repr_t abs_to = uto.i & ~sign_mask;
|
| 264 |
+
if (abs_from == 0) {
|
| 265 |
+
// if both are zero but with different sign,
|
| 266 |
+
// preserve the sign of `to`.
|
| 267 |
+
if (abs_to == 0) {
|
| 268 |
+
return to;
|
| 269 |
+
}
|
| 270 |
+
// smallest subnormal with sign of `to`.
|
| 271 |
+
ufrom.i = (uto.i & sign_mask) | int_repr_t{1};
|
| 272 |
+
return ufrom.f;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
// if abs(from) > abs(to) or sign(from) != sign(to)
|
| 276 |
+
if (abs_from > abs_to || ((ufrom.i ^ uto.i) & sign_mask)) {
|
| 277 |
+
ufrom.i--;
|
| 278 |
+
} else {
|
| 279 |
+
ufrom.i++;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
return ufrom.f;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
} // namespace std
|
| 286 |
+
|
| 287 |
+
C10_CLANG_DIAGNOSTIC_POP()
|
parrot/lib/python3.10/site-packages/torch/include/c10/util/C++17.h
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#ifndef C10_UTIL_CPP17_H_
|
| 3 |
+
#define C10_UTIL_CPP17_H_
|
| 4 |
+
|
| 5 |
+
#include <c10/macros/Macros.h>
|
| 6 |
+
#include <functional>
|
| 7 |
+
#include <memory>
|
| 8 |
+
#include <type_traits>
|
| 9 |
+
#include <utility>
|
| 10 |
+
|
| 11 |
+
#if !defined(__clang__) && !defined(_MSC_VER) && defined(__GNUC__) && \
|
| 12 |
+
__GNUC__ < 9
|
| 13 |
+
#error \
|
| 14 |
+
"You're trying to build PyTorch with a too old version of GCC. We need GCC 9 or later."
|
| 15 |
+
#endif
|
| 16 |
+
|
| 17 |
+
#if defined(__clang__) && __clang_major__ < 9
|
| 18 |
+
#error \
|
| 19 |
+
"You're trying to build PyTorch with a too old version of Clang. We need Clang 9 or later."
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
#if (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)) || \
|
| 23 |
+
(!defined(_MSC_VER) && __cplusplus < 201703L)
|
| 24 |
+
#error You need C++17 to compile PyTorch
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#if defined(_WIN32) && (defined(min) || defined(max))
|
| 28 |
+
#error Macro clash with min and max -- define NOMINMAX when compiling your program on Windows
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
/*
|
| 32 |
+
* This header adds some polyfills with C++17 functionality
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
namespace c10 {
|
| 36 |
+
|
| 37 |
+
// std::is_pod is deprecated in C++20, std::is_standard_layout and
|
| 38 |
+
// std::is_trivial are introduced in C++11, std::conjunction has been introduced
|
| 39 |
+
// in C++17.
|
| 40 |
+
template <typename T>
|
| 41 |
+
using is_pod = std::conjunction<std::is_standard_layout<T>, std::is_trivial<T>>;
|
| 42 |
+
|
| 43 |
+
template <typename T>
|
| 44 |
+
constexpr bool is_pod_v = is_pod<T>::value;
|
| 45 |
+
|
| 46 |
+
namespace guts {
|
| 47 |
+
|
| 48 |
+
template <typename Base, typename Child, typename... Args>
|
| 49 |
+
std::enable_if_t<
|
| 50 |
+
!std::is_array_v<Base> && !std::is_array_v<Child> &&
|
| 51 |
+
std::is_base_of_v<Base, Child>,
|
| 52 |
+
std::unique_ptr<Base>>
|
| 53 |
+
make_unique_base(Args&&... args) {
|
| 54 |
+
return std::unique_ptr<Base>(new Child(std::forward<Args>(args)...));
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
#if defined(__cpp_lib_apply) && !defined(__CUDA_ARCH__) && !defined(__HIP__)
|
| 58 |
+
|
| 59 |
+
template <class F, class Tuple>
|
| 60 |
+
C10_HOST_DEVICE inline constexpr decltype(auto) apply(F&& f, Tuple&& t) {
|
| 61 |
+
return std::apply(std::forward<F>(f), std::forward<Tuple>(t));
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
#else
|
| 65 |
+
|
| 66 |
+
// Implementation from http://en.cppreference.com/w/cpp/utility/apply (but
|
| 67 |
+
// modified)
|
| 68 |
+
// TODO This is an incomplete implementation of std::apply, not working for
|
| 69 |
+
// member functions.
|
| 70 |
+
namespace detail {
|
| 71 |
+
template <class F, class Tuple, std::size_t... INDEX>
|
| 72 |
+
#if defined(_MSC_VER)
|
| 73 |
+
// MSVC has a problem with the decltype() return type, but it also doesn't need
|
| 74 |
+
// it
|
| 75 |
+
C10_HOST_DEVICE constexpr auto apply_impl(
|
| 76 |
+
F&& f,
|
| 77 |
+
Tuple&& t,
|
| 78 |
+
std::index_sequence<INDEX...>)
|
| 79 |
+
#else
|
| 80 |
+
// GCC/Clang need the decltype() return type
|
| 81 |
+
C10_HOST_DEVICE constexpr decltype(auto) apply_impl(
|
| 82 |
+
F&& f,
|
| 83 |
+
Tuple&& t,
|
| 84 |
+
std::index_sequence<INDEX...>)
|
| 85 |
+
#endif
|
| 86 |
+
{
|
| 87 |
+
return std::forward<F>(f)(std::get<INDEX>(std::forward<Tuple>(t))...);
|
| 88 |
+
}
|
| 89 |
+
} // namespace detail
|
| 90 |
+
|
| 91 |
+
template <class F, class Tuple>
|
| 92 |
+
C10_HOST_DEVICE constexpr decltype(auto) apply(F&& f, Tuple&& t) {
|
| 93 |
+
return detail::apply_impl(
|
| 94 |
+
std::forward<F>(f),
|
| 95 |
+
std::forward<Tuple>(t),
|
| 96 |
+
std::make_index_sequence<
|
| 97 |
+
std::tuple_size<std::remove_reference_t<Tuple>>::value>{});
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
#endif
|
| 101 |
+
|
| 102 |
+
template <typename Functor, typename... Args>
|
| 103 |
+
std::enable_if_t<
|
| 104 |
+
std::is_member_pointer_v<std::decay_t<Functor>>,
|
| 105 |
+
typename std::invoke_result_t<Functor, Args...>>
|
| 106 |
+
invoke(Functor&& f, Args&&... args) {
|
| 107 |
+
return std::mem_fn(std::forward<Functor>(f))(std::forward<Args>(args)...);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
template <typename Functor, typename... Args>
|
| 111 |
+
std::enable_if_t<
|
| 112 |
+
!std::is_member_pointer_v<std::decay_t<Functor>>,
|
| 113 |
+
typename std::invoke_result_t<Functor, Args...>>
|
| 114 |
+
invoke(Functor&& f, Args&&... args) {
|
| 115 |
+
return std::forward<Functor>(f)(std::forward<Args>(args)...);
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
namespace detail {
|
| 119 |
+
struct _identity final {
|
| 120 |
+
template <class T>
|
| 121 |
+
using type_identity = T;
|
| 122 |
+
|
| 123 |
+
template <class T>
|
| 124 |
+
decltype(auto) operator()(T&& arg) {
|
| 125 |
+
return std::forward<T>(arg);
|
| 126 |
+
}
|
| 127 |
+
};
|
| 128 |
+
|
| 129 |
+
template <class Func, class Enable = void>
|
| 130 |
+
struct function_takes_identity_argument : std::false_type {};
|
| 131 |
+
|
| 132 |
+
template <class Func>
|
| 133 |
+
struct function_takes_identity_argument<
|
| 134 |
+
Func,
|
| 135 |
+
std::void_t<decltype(std::declval<Func>()(_identity()))>> : std::true_type {
|
| 136 |
+
};
|
| 137 |
+
} // namespace detail
|
| 138 |
+
|
| 139 |
+
} // namespace guts
|
| 140 |
+
} // namespace c10
|
| 141 |
+
|
| 142 |
+
#endif // C10_UTIL_CPP17_H_
|