summaryrefslogtreecommitdiffstats
path: root/server/resty/openssl/include/x509/extension.lua
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-04-14 11:59:32 +0000
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-04-14 11:59:32 +0000
commitd68841d9f75636575cd778838a8ceea5fd5aada3 (patch)
tree778c84203ed9bfa4dc1c8234e4e2cf60da6ebd8c /server/resty/openssl/include/x509/extension.lua
parent42af09588f1f839b9ab36356f02f34c89559bcfa (diff)
Upload ui
Issue-ID: PORTAL-1084 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de> Change-Id: Id0c94859a775094e67b0bb9c91ca5e776a08c068
Diffstat (limited to 'server/resty/openssl/include/x509/extension.lua')
-rw-r--r--server/resty/openssl/include/x509/extension.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/server/resty/openssl/include/x509/extension.lua b/server/resty/openssl/include/x509/extension.lua
new file mode 100644
index 0000000..14b231e
--- /dev/null
+++ b/server/resty/openssl/include/x509/extension.lua
@@ -0,0 +1,44 @@
+local ffi = require "ffi"
+
+require "resty.openssl.include.ossl_typ"
+require "resty.openssl.include.x509v3"
+require "resty.openssl.include.x509"
+local asn1_macro = require "resty.openssl.include.asn1"
+local OPENSSL_3X = require("resty.openssl.version").OPENSSL_3X
+
+asn1_macro.declare_asn1_functions("X509_EXTENSION")
+
+if OPENSSL_3X then
+ ffi.cdef [[
+ struct v3_ext_ctx {
+ int flags;
+ X509 *issuer_cert;
+ X509 *subject_cert;
+ X509_REQ *subject_req;
+ X509_CRL *crl;
+ /*X509V3_CONF_METHOD*/ void *db_meth;
+ void *db;
+ EVP_PKEY *issuer_pkey;
+ };
+
+ int X509V3_set_issuer_pkey(X509V3_CTX *ctx, EVP_PKEY *pkey);
+ ]]
+
+else
+ ffi.cdef [[
+ struct v3_ext_ctx {
+ int flags;
+ X509 *issuer_cert;
+ X509 *subject_cert;
+ X509_REQ *subject_req;
+ X509_CRL *crl;
+ /*X509V3_CONF_METHOD*/ void *db_meth;
+ void *db;
+ };
+ ]]
+end
+
+ffi.cdef [[
+ int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
+ int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
+]] \ No newline at end of file