From 036db6789ab67dd51fa0d8390e843a1afd9dbdb4 Mon Sep 17 00:00:00 2001 From: Ori Peleg Date: Thu, 30 Jul 2026 18:09:46 +0300 Subject: [PATCH] Add missing ASN1_TIME* functions --- source/deimos/openssl/asn1.di | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/deimos/openssl/asn1.di b/source/deimos/openssl/asn1.di index 9cba43c..523c251 100644 --- a/source/deimos/openssl/asn1.di +++ b/source/deimos/openssl/asn1.di @@ -59,6 +59,7 @@ module deimos.openssl.asn1; import deimos.openssl._d_util; +import deimos.openssl.opensslv; import deimos.openssl.asn1t; // Needed for ASN1_ITEM_st. @@ -888,6 +889,12 @@ ASN1_GENERALIZEDTIME* ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME* s, time_t t, int offset_day, c_long offset_sec); int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME* s, const(char)* str); +static if (OPENSSL_VERSION_AT_LEAST(1, 0, 2)) +{ + int ASN1_TIME_diff(int* pday, int* psec, + const(ASN1_TIME)* from, const(ASN1_TIME)* to); +} + mixin(DECLARE_ASN1_FUNCTIONS!"ASN1_OCTET_STRING"); ASN1_OCTET_STRING* ASN1_OCTET_STRING_dup(const(ASN1_OCTET_STRING)* a); int ASN1_OCTET_STRING_cmp(const(ASN1_OCTET_STRING)* a, const(ASN1_OCTET_STRING)* b); @@ -923,6 +930,15 @@ int ASN1_TIME_check(ASN1_TIME* t); ASN1_GENERALIZEDTIME* ASN1_TIME_to_generalizedtime(ASN1_TIME* t, ASN1_GENERALIZEDTIME** out_); int ASN1_TIME_set_string(ASN1_TIME* s, const(char)* str); +static if (OPENSSL_VERSION_AT_LEAST(1, 1, 1)) +{ + int ASN1_TIME_set_string_X509(ASN1_TIME* s, const(char)* str); + int ASN1_TIME_to_tm(const(ASN1_TIME)* s, tm* tm_); + int ASN1_TIME_normalize(ASN1_TIME* s); + int ASN1_TIME_cmp_time_t(const(ASN1_TIME)* s, time_t t); + int ASN1_TIME_compare(const(ASN1_TIME)* a, const(ASN1_TIME)* b); +} + int i2d_ASN1_SET(STACK_OF!(OPENSSL_BLOCK) *a, ubyte** pp, i2d_of_void* i2d, int ex_tag, int ex_class, int is_set);