Lightpanda: the headless browser designed for AI and automation
`libcrypto`: bind couple X509, X509_STORE and SSL_CTX helpers
Halil Durak6e75a0caa9da
diff --git a/src/sys/libcrypto.zig b/src/sys/libcrypto.zigindex 0e62df336..1e47f8a69 100644--- a/src/sys/libcrypto.zig+++ b/src/sys/libcrypto.zig@@ -343,6 +343,26 @@ pub extern fn EVP_MD_CTX_free(ctx: ?*EVP_MD_CTX) void;pub const struct_evp_md_ctx_st = opaque {};pub const EVP_MD_CTX = struct_evp_md_ctx_st;+pub extern fn X509_free(x509: ?*X509) void;+pub extern fn d2i_X509(out: [*c]?*X509, inp: *[*]const u8, len: c_long) ?*X509;++//pub const struct_x509_store_ctx_st = opaque {};+//pub const X509_STORE_CTX = struct_x509_store_ctx_st;+pub const struct_x509_store_st = opaque {};+pub const X509_STORE = struct_x509_store_st;++pub extern fn X509_STORE_new() ?*X509_STORE;+pub extern fn X509_STORE_free(store: *X509_STORE) void;+pub extern fn X509_STORE_add_cert(store: ?*X509_STORE, x: ?*X509) c_int;+pub extern fn X509_STORE_add_crl(store: ?*X509_STORE, x: ?*X509_CRL) c_int;++pub const struct_ssl_ctx_st = opaque {};+pub const SSL_CTX = struct_ssl_ctx_st;+/// SSL_CTX takes ownership.+pub extern fn SSL_CTX_set0_verify_cert_store(ctx: ?*SSL_CTX, store: ?*X509_STORE) c_int;+/// Ownership remains, ref count increments.+pub extern fn SSL_CTX_set1_verify_cert_store(ctx: ?*SSL_CTX, store: ?*X509_STORE) c_int;+/// Returns the desired digest by its name.pub fn findDigest(name: []const u8) error{Invalid}!*const EVP_MD {if (std.mem.eql(u8, "SHA-256", name)) {