diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-04-14 11:59:32 +0000 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-04-14 11:59:32 +0000 |
commit | d68841d9f75636575cd778838a8ceea5fd5aada3 (patch) | |
tree | 778c84203ed9bfa4dc1c8234e4e2cf60da6ebd8c /server/resty/openssl/include/pkcs12.lua | |
parent | 42af09588f1f839b9ab36356f02f34c89559bcfa (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/pkcs12.lua')
-rw-r--r-- | server/resty/openssl/include/pkcs12.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/server/resty/openssl/include/pkcs12.lua b/server/resty/openssl/include/pkcs12.lua new file mode 100644 index 0000000..fb74025 --- /dev/null +++ b/server/resty/openssl/include/pkcs12.lua @@ -0,0 +1,31 @@ +local ffi = require "ffi" + +require "resty.openssl.include.ossl_typ" +require "resty.openssl.include.stack" + +local OPENSSL_3X = require("resty.openssl.version").OPENSSL_3X + +ffi.cdef [[ + // hack by changing char* to const char* here + PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, + OPENSSL_STACK *ca, // STACK_OF(X509) + int nid_key, int nid_cert, int iter, int mac_iter, int keytype); + + int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, + OPENSSL_STACK **ca); // STACK_OF(X509) **ca); + + void PKCS12_free(PKCS12 *p12); + int i2d_PKCS12_bio(BIO *bp, PKCS12 *a); + PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **a); +]] + +if OPENSSL_3X then + ffi.cdef [[ + PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, + OPENSSL_STACK *ca, // STACK_OF(X509) + int nid_key, int nid_cert, + int iter, int mac_iter, int keytype, + OSSL_LIB_CTX *ctx, const char *propq); + ]] +end |