From 44348ccb2754f25862aa45148256f6e662e13760 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:12:06 +0000 Subject: [PATCH 1/6] deimos.openssl: Delete Emacs C mode lines These lines configure Emacs to use the C mode, which doesn't apply to the D port (and confuse Emacs when it opens these files). --- source/deimos/openssl/aes.d | 1 - source/deimos/openssl/camellia.d | 1 - source/deimos/openssl/dso.d | 1 - source/deimos/openssl/ui.d | 1 - source/deimos/openssl/ui_compat.d | 1 - 5 files changed, 5 deletions(-) diff --git a/source/deimos/openssl/aes.d b/source/deimos/openssl/aes.d index 90c0c8b..9b725be 100644 --- a/source/deimos/openssl/aes.d +++ b/source/deimos/openssl/aes.d @@ -1,4 +1,3 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/source/deimos/openssl/camellia.d b/source/deimos/openssl/camellia.d index 6bf0e4e..7f3866e 100644 --- a/source/deimos/openssl/camellia.d +++ b/source/deimos/openssl/camellia.d @@ -1,4 +1,3 @@ -/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/source/deimos/openssl/dso.d b/source/deimos/openssl/dso.d index 9e0e296..cbe267a 100644 --- a/source/deimos/openssl/dso.d +++ b/source/deimos/openssl/dso.d @@ -1,4 +1,3 @@ -/* dso.h -*- mode:C; c-file-style: "eay" -*- */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ diff --git a/source/deimos/openssl/ui.d b/source/deimos/openssl/ui.d index be2c978..770366d 100644 --- a/source/deimos/openssl/ui.d +++ b/source/deimos/openssl/ui.d @@ -1,4 +1,3 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ diff --git a/source/deimos/openssl/ui_compat.d b/source/deimos/openssl/ui_compat.d index 36e300c..96dda92 100644 --- a/source/deimos/openssl/ui_compat.d +++ b/source/deimos/openssl/ui_compat.d @@ -1,4 +1,3 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ From f2f8f4ade546e1888dbc99a8aebfd12f1155ec6f Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:33:54 +0000 Subject: [PATCH 2/6] deimos.openssl: Fix non-zero struct initial values These would have required that the Deimos bindings were compiled and linked into the application if said struct was used without "= void". --- source/deimos/openssl/asn1t.d | 4 ++-- source/deimos/openssl/camellia.d | 2 +- source/deimos/openssl/kssl.d | 2 +- source/deimos/openssl/ssl3.d | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/deimos/openssl/asn1t.d b/source/deimos/openssl/asn1t.d index 45628a5..e144bc3 100644 --- a/source/deimos/openssl/asn1t.d +++ b/source/deimos/openssl/asn1t.d @@ -564,7 +564,7 @@ enum ASN1_TFLG_NDEF = (0x1<<11); /* This is the actual ASN1 item itself */ struct ASN1_ITEM_st { -char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ +ubyte itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ c_long utype; /* underlying type */ const(ASN1_TEMPLATE)* templates; /* If SEQUENCE or CHOICE this contains the contents */ c_long tcount; /* Number of templates if SEQUENCE or CHOICE */ @@ -639,7 +639,7 @@ enum ASN1_ITYPE_NDEF_SEQUENCE = 0x6; */ struct ASN1_TLC_st{ - char valid; /* Values below are valid */ + ubyte valid; /* Values below are valid */ int ret; /* return value */ c_long plen; /* length */ int ptag; /* class value */ diff --git a/source/deimos/openssl/camellia.d b/source/deimos/openssl/camellia.d index 7f3866e..06e1b86 100644 --- a/source/deimos/openssl/camellia.d +++ b/source/deimos/openssl/camellia.d @@ -80,7 +80,7 @@ alias uint[CAMELLIA_TABLE_WORD_LEN] KEY_TABLE_TYPE; /* to match with WORD */ struct camellia_key_st { union u_ { - double d; /* ensures 64-bit align */ + double d = void; /* ensures 64-bit align */ KEY_TABLE_TYPE rd_key; } u_ u; diff --git a/source/deimos/openssl/kssl.d b/source/deimos/openssl/kssl.d index 4b6c737..237f96c 100644 --- a/source/deimos/openssl/kssl.d +++ b/source/deimos/openssl/kssl.d @@ -126,7 +126,7 @@ enum KSSL_CLOCKSKEW = 300;; enum KSSL_ERR_MAX = 255; struct kssl_err_st { int reason; - char[KSSL_ERR_MAX+1] text; + char[KSSL_ERR_MAX+1] text = 0; } alias kssl_err_st KSSL_ERR; diff --git a/source/deimos/openssl/ssl3.d b/source/deimos/openssl/ssl3.d index e44fc79..077a5a2 100644 --- a/source/deimos/openssl/ssl3.d +++ b/source/deimos/openssl/ssl3.d @@ -509,7 +509,7 @@ version(OPENSSL_NO_ECDH) {} else { /* used for certificate requests */ int cert_req; int ctype_num; - char[SSL3_CT_NUMBER] ctype; + char[SSL3_CT_NUMBER] ctype = 0; STACK_OF!(X509_NAME) *ca_names; int use_rsa_tmp; @@ -547,7 +547,7 @@ version(OPENSSL_NO_EC) {} else { /* This is set to true if we believe that this is a version of Safari * running on OS X 10.6 or newer. We wish to know this because Safari * on 10.8 .. 10.8.3 has broken ECDHE-ECDSA support. */ - char is_probably_safari; + char is_probably_safari = 0; } /* !OPENSSL_NO_EC */ } /* !OPENSSL_NO_TLSEXT */ } From 7d67f7f7f980cc56a12c2f20bf6dd9e39eea2834 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:34:50 +0000 Subject: [PATCH 3/6] deimos.openssl: Use template functions for macros Fix remaining non-template D functions which should have been template functions. --- source/deimos/openssl/dsa.d | 2 +- source/deimos/openssl/opensslv.d | 6 +++--- source/deimos/openssl/ssl.d | 16 ++++++++-------- source/deimos/openssl/tls1.d | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/deimos/openssl/dsa.d b/source/deimos/openssl/dsa.d index 08d79d0..64c09dd 100644 --- a/source/deimos/openssl/dsa.d +++ b/source/deimos/openssl/dsa.d @@ -225,7 +225,7 @@ static if (OPENSSL_VERSION_BEFORE(1, 1, 0)) } else { - auto DSA_get_ex_new_index(c_long l, void* p, CRYPTO_EX_new* newf, + auto DSA_get_ex_new_index()(c_long l, void* p, CRYPTO_EX_new* newf, CRYPTO_EX_dup* dupf, CRYPTO_EX_free* freef) { return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef); diff --git a/source/deimos/openssl/opensslv.d b/source/deimos/openssl/opensslv.d index 2236934..0f31222 100644 --- a/source/deimos/openssl/opensslv.d +++ b/source/deimos/openssl/opensslv.d @@ -122,7 +122,7 @@ enum OPENSSL_VERSION_PATCH = OpenSSLVersion.patch; enum OPENSSL_VERSION_BUILD = OpenSSLVersion.build; -int OPENSSL_MAKE_VERSION(int major, int minor, int patch, int build) +int OPENSSL_MAKE_VERSION()(int major, int minor, int patch, int build) { return (major << 28) | (minor << 20) | (patch << 12) | (build << 4) | 0xf; } @@ -131,12 +131,12 @@ enum OPENSSL_VERSION_NUMBER = OPENSSL_MAKE_VERSION(OpenSSLVersion.major, OpenSSLVersion.minor, OpenSSLVersion.patch, OpenSSLVersion.build); -bool OPENSSL_VERSION_AT_LEAST(int major, int minor, int patch = 0, int build = 0) +bool OPENSSL_VERSION_AT_LEAST()(int major, int minor, int patch = 0, int build = 0) { return OPENSSL_VERSION_NUMBER >= OPENSSL_MAKE_VERSION(major, minor, patch, build); } -bool OPENSSL_VERSION_BEFORE(int major, int minor, int patch = 0, int build = 0) +bool OPENSSL_VERSION_BEFORE()(int major, int minor, int patch = 0, int build = 0) { return OPENSSL_VERSION_NUMBER < OPENSSL_MAKE_VERSION(major, minor, patch, build); } diff --git a/source/deimos/openssl/ssl.d b/source/deimos/openssl/ssl.d index 782d753..1922997 100644 --- a/source/deimos/openssl/ssl.d +++ b/source/deimos/openssl/ssl.d @@ -1830,16 +1830,16 @@ static if (OPENSSL_VERSION_AT_LEAST(1, 1, 0)) enum SSL_CTRL_SET_MIN_PROTO_VERSION = 123; enum SSL_CTRL_SET_MAX_PROTO_VERSION = 124; - auto SSL_CTX_set_min_proto_version(SSL_CTX* ctx, int version_) { + auto SSL_CTX_set_min_proto_version()(SSL_CTX* ctx, int version_) { return SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version_, null); } - auto SSL_CTX_set_max_proto_version(SSL_CTX* ctx, int version_) { + auto SSL_CTX_set_max_proto_version()(SSL_CTX* ctx, int version_) { return SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version_, null); } - auto SSL_set_min_proto_version(SSL* s, int version_) { + auto SSL_set_min_proto_version()(SSL* s, int version_) { return SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version_, null); } - auto SSL_set_max_proto_version(SSL* s, int version_) { + auto SSL_set_max_proto_version()(SSL* s, int version_) { return SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version_, null); } @@ -1848,16 +1848,16 @@ static if (OPENSSL_VERSION_AT_LEAST(1, 1, 0)) enum SSL_CTRL_GET_MIN_PROTO_VERSION = 130; enum SSL_CTRL_GET_MAX_PROTO_VERSION = 131; - auto SSL_CTX_get_min_proto_version(SSL_CTX* ctx) { + auto SSL_CTX_get_min_proto_version()(SSL_CTX* ctx) { return SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, null); } - auto SSL_CTX_get_max_proto_version(SSL_CTX* ctx) { + auto SSL_CTX_get_max_proto_version()(SSL_CTX* ctx) { return SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, null); } - auto SSL_get_min_proto_version(SSL* s) { + auto SSL_get_min_proto_version()(SSL* s) { return SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, null); } - auto SSL_get_max_proto_version(SSL* s) { + auto SSL_get_max_proto_version()(SSL* s) { return SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, null); } } diff --git a/source/deimos/openssl/tls1.d b/source/deimos/openssl/tls1.d index b6777d2..aa5f3f2 100644 --- a/source/deimos/openssl/tls1.d +++ b/source/deimos/openssl/tls1.d @@ -341,7 +341,7 @@ auto SSL_set_tlsext_status_ocsp_resp()(SSL* ssl, void* arg, void* arglen) { return SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, arg); } -auto SSL_CTX_set_tlsext_servername_callback(SSL_CTX* ctx, ExternC!(void function()) cb) { +auto SSL_CTX_set_tlsext_servername_callback()(SSL_CTX* ctx, ExternC!(void function()) cb) { return SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,cb); } @@ -350,33 +350,33 @@ enum SSL_TLSEXT_ERR_ALERT_WARNING = 1; enum SSL_TLSEXT_ERR_ALERT_FATAL = 2; enum SSL_TLSEXT_ERR_NOACK = 3; -auto SSL_CTX_set_tlsext_servername_arg(SSL_CTX* ctx, void* arg) { +auto SSL_CTX_set_tlsext_servername_arg()(SSL_CTX* ctx, void* arg) { return SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0,arg); } -auto SSL_CTX_get_tlsext_ticket_keys(SSL_CTX* ctx, c_long keylen, void* keys) { +auto SSL_CTX_get_tlsext_ticket_keys()(SSL_CTX* ctx, c_long keylen, void* keys) { return SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS,keylen,keys); } -auto SSL_CTX_set_tlsext_ticket_keys(SSL_CTX* ctx, c_long keylen, void* keys) { +auto SSL_CTX_set_tlsext_ticket_keys()(SSL_CTX* ctx, c_long keylen, void* keys) { return SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_TICKET_KEYS,keylen,keys); } -auto SSL_CTX_set_tlsext_status_cb(SSL_CTX* ctx, ExternC!(void function()) cb) { +auto SSL_CTX_set_tlsext_status_cb()(SSL_CTX* ctx, ExternC!(void function()) cb) { return SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,cb); } -auto SSL_CTX_set_tlsext_status_arg(SSL_CTX* ctx, void* arg) { +auto SSL_CTX_set_tlsext_status_arg()(SSL_CTX* ctx, void* arg) { return SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,arg); } -auto SSL_set_tlsext_opaque_prf_input(SSL* s, void* src, c_long len) { +auto SSL_set_tlsext_opaque_prf_input()(SSL* s, void* src, c_long len) { return SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src); } -auto SSL_CTX_set_tlsext_opaque_prf_input_callback(SSL_CTX* ctx, ExternC!(void function()) cb) { +auto SSL_CTX_set_tlsext_opaque_prf_input_callback()(SSL_CTX* ctx, ExternC!(void function()) cb) { return SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, cb); } -auto SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(SSL_CTX* ctx, void* arg) { +auto SSL_CTX_set_tlsext_opaque_prf_input_callback_arg()(SSL_CTX* ctx, void* arg) { return SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg); } From 200c832ed5b813a579cdcd06a58d0f65effa17d7 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:35:36 +0000 Subject: [PATCH 4/6] deimos.openssl.ec: Fix an enum's initial value The non-zero value required an init to be linked in. --- source/deimos/openssl/ec.d | 1 + 1 file changed, 1 insertion(+) diff --git a/source/deimos/openssl/ec.d b/source/deimos/openssl/ec.d index 90f1249..265b72f 100644 --- a/source/deimos/openssl/ec.d +++ b/source/deimos/openssl/ec.d @@ -100,6 +100,7 @@ static if (!is(typeof(OPENSSL_ECC_MAX_FIELD_BITS))) { /** Enum for the point conversion form as defined in X9.62 (ECDSA) * for the encoding of a elliptic curve point (x,y) */ enum point_conversion_form_t { + init = 0, // Ensure initial values in D is zero /** the point is encoded as z||x, where the octet z specifies * which solution of the quadratic equation y is */ POINT_CONVERSION_COMPRESSED = 2, From 55d9fe6f98eac7a3d6292360abf7fab5ad036f2c Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:37:17 +0000 Subject: [PATCH 5/6] Rename all .d files to .di This ensures that they're not compiled/linked, as they have no reason to. --- .gitignore | 2 +- scripts/generate_version.d | 8 ++++---- source/deimos/openssl/{_d_util.d => _d_util.di} | 0 source/deimos/openssl/{aes.d => aes.di} | 0 source/deimos/openssl/{applink.d => applink.di} | 0 source/deimos/openssl/{asn1.d => asn1.di} | 0 source/deimos/openssl/{asn1_mac.d => asn1_mac.di} | 0 source/deimos/openssl/{asn1t.d => asn1t.di} | 0 source/deimos/openssl/{bio.d => bio.di} | 0 source/deimos/openssl/{blowfish.d => blowfish.di} | 0 source/deimos/openssl/{bn.d => bn.di} | 0 source/deimos/openssl/{buffer.d => buffer.di} | 0 source/deimos/openssl/{camellia.d => camellia.di} | 0 source/deimos/openssl/{cast_.d => cast_.di} | 0 source/deimos/openssl/{cmac.d => cmac.di} | 0 source/deimos/openssl/{cms.d => cms.di} | 0 source/deimos/openssl/{comp.d => comp.di} | 0 source/deimos/openssl/{conf.d => conf.di} | 0 source/deimos/openssl/{conf_api.d => conf_api.di} | 0 source/deimos/openssl/{crypto.d => crypto.di} | 0 source/deimos/openssl/{des.d => des.di} | 0 source/deimos/openssl/{dh.d => dh.di} | 0 source/deimos/openssl/{dsa.d => dsa.di} | 0 source/deimos/openssl/{dso.d => dso.di} | 0 source/deimos/openssl/{dtls1.d => dtls1.di} | 0 source/deimos/openssl/{e_os2.d => e_os2.di} | 0 source/deimos/openssl/{ebcdic.d => ebcdic.di} | 0 source/deimos/openssl/{ec.d => ec.di} | 0 source/deimos/openssl/{ecdh.d => ecdh.di} | 0 source/deimos/openssl/{ecdsa.d => ecdsa.di} | 0 source/deimos/openssl/{engine.d => engine.di} | 0 source/deimos/openssl/{err.d => err.di} | 0 source/deimos/openssl/{evp.d => evp.di} | 0 source/deimos/openssl/{hmac.d => hmac.di} | 0 source/deimos/openssl/{idea.d => idea.di} | 0 source/deimos/openssl/{kdf.d => kdf.di} | 0 source/deimos/openssl/{krb5_asn.d => krb5_asn.di} | 0 source/deimos/openssl/{kssl.d => kssl.di} | 0 source/deimos/openssl/{lhash.d => lhash.di} | 0 source/deimos/openssl/{md4.d => md4.di} | 0 source/deimos/openssl/{md5.d => md5.di} | 0 source/deimos/openssl/{mdc2.d => mdc2.di} | 0 source/deimos/openssl/{modes.d => modes.di} | 0 source/deimos/openssl/{obj_mac.d => obj_mac.di} | 0 source/deimos/openssl/{objects.d => objects.di} | 0 source/deimos/openssl/{ocsp.d => ocsp.di} | 0 source/deimos/openssl/{opensslconf.d => opensslconf.di} | 0 source/deimos/openssl/{opensslv.d => opensslv.di} | 0 source/deimos/openssl/{ossl_typ.d => ossl_typ.di} | 0 source/deimos/openssl/{pem.d => pem.di} | 0 source/deimos/openssl/{pem2.d => pem2.di} | 0 source/deimos/openssl/{pkcs12.d => pkcs12.di} | 0 source/deimos/openssl/{pkcs7.d => pkcs7.di} | 0 source/deimos/openssl/{pqueue.d => pqueue.di} | 0 source/deimos/openssl/{rand.d => rand.di} | 0 source/deimos/openssl/{rc2.d => rc2.di} | 0 source/deimos/openssl/{rc4.d => rc4.di} | 0 source/deimos/openssl/{ripemd.d => ripemd.di} | 0 source/deimos/openssl/{rsa.d => rsa.di} | 0 source/deimos/openssl/{safestack.d => safestack.di} | 0 source/deimos/openssl/{seed.d => seed.di} | 0 source/deimos/openssl/{sha.d => sha.di} | 0 source/deimos/openssl/{srp.d => srp.di} | 0 source/deimos/openssl/{srtp.d => srtp.di} | 0 source/deimos/openssl/{ssl.d => ssl.di} | 0 source/deimos/openssl/{ssl2.d => ssl2.di} | 0 source/deimos/openssl/{ssl23.d => ssl23.di} | 0 source/deimos/openssl/{ssl3.d => ssl3.di} | 0 source/deimos/openssl/{stack.d => stack.di} | 0 source/deimos/openssl/{symhacks.d => symhacks.di} | 0 source/deimos/openssl/{tls1.d => tls1.di} | 0 source/deimos/openssl/{ts.d => ts.di} | 0 source/deimos/openssl/{txt_db.d => txt_db.di} | 0 source/deimos/openssl/{types.d => types.di} | 0 source/deimos/openssl/{ui.d => ui.di} | 0 source/deimos/openssl/{ui_compat.d => ui_compat.di} | 0 source/deimos/openssl/{whrlpool.d => whrlpool.di} | 0 source/deimos/openssl/{x509.d => x509.di} | 0 source/deimos/openssl/{x509_vfy.d => x509_vfy.di} | 0 source/deimos/openssl/{x509v3.d => x509v3.di} | 0 80 files changed, 5 insertions(+), 5 deletions(-) rename source/deimos/openssl/{_d_util.d => _d_util.di} (100%) rename source/deimos/openssl/{aes.d => aes.di} (100%) rename source/deimos/openssl/{applink.d => applink.di} (100%) rename source/deimos/openssl/{asn1.d => asn1.di} (100%) rename source/deimos/openssl/{asn1_mac.d => asn1_mac.di} (100%) rename source/deimos/openssl/{asn1t.d => asn1t.di} (100%) rename source/deimos/openssl/{bio.d => bio.di} (100%) rename source/deimos/openssl/{blowfish.d => blowfish.di} (100%) rename source/deimos/openssl/{bn.d => bn.di} (100%) rename source/deimos/openssl/{buffer.d => buffer.di} (100%) rename source/deimos/openssl/{camellia.d => camellia.di} (100%) rename source/deimos/openssl/{cast_.d => cast_.di} (100%) rename source/deimos/openssl/{cmac.d => cmac.di} (100%) rename source/deimos/openssl/{cms.d => cms.di} (100%) rename source/deimos/openssl/{comp.d => comp.di} (100%) rename source/deimos/openssl/{conf.d => conf.di} (100%) rename source/deimos/openssl/{conf_api.d => conf_api.di} (100%) rename source/deimos/openssl/{crypto.d => crypto.di} (100%) rename source/deimos/openssl/{des.d => des.di} (100%) rename source/deimos/openssl/{dh.d => dh.di} (100%) rename source/deimos/openssl/{dsa.d => dsa.di} (100%) rename source/deimos/openssl/{dso.d => dso.di} (100%) rename source/deimos/openssl/{dtls1.d => dtls1.di} (100%) rename source/deimos/openssl/{e_os2.d => e_os2.di} (100%) rename source/deimos/openssl/{ebcdic.d => ebcdic.di} (100%) rename source/deimos/openssl/{ec.d => ec.di} (100%) rename source/deimos/openssl/{ecdh.d => ecdh.di} (100%) rename source/deimos/openssl/{ecdsa.d => ecdsa.di} (100%) rename source/deimos/openssl/{engine.d => engine.di} (100%) rename source/deimos/openssl/{err.d => err.di} (100%) rename source/deimos/openssl/{evp.d => evp.di} (100%) rename source/deimos/openssl/{hmac.d => hmac.di} (100%) rename source/deimos/openssl/{idea.d => idea.di} (100%) rename source/deimos/openssl/{kdf.d => kdf.di} (100%) rename source/deimos/openssl/{krb5_asn.d => krb5_asn.di} (100%) rename source/deimos/openssl/{kssl.d => kssl.di} (100%) rename source/deimos/openssl/{lhash.d => lhash.di} (100%) rename source/deimos/openssl/{md4.d => md4.di} (100%) rename source/deimos/openssl/{md5.d => md5.di} (100%) rename source/deimos/openssl/{mdc2.d => mdc2.di} (100%) rename source/deimos/openssl/{modes.d => modes.di} (100%) rename source/deimos/openssl/{obj_mac.d => obj_mac.di} (100%) rename source/deimos/openssl/{objects.d => objects.di} (100%) rename source/deimos/openssl/{ocsp.d => ocsp.di} (100%) rename source/deimos/openssl/{opensslconf.d => opensslconf.di} (100%) rename source/deimos/openssl/{opensslv.d => opensslv.di} (100%) rename source/deimos/openssl/{ossl_typ.d => ossl_typ.di} (100%) rename source/deimos/openssl/{pem.d => pem.di} (100%) rename source/deimos/openssl/{pem2.d => pem2.di} (100%) rename source/deimos/openssl/{pkcs12.d => pkcs12.di} (100%) rename source/deimos/openssl/{pkcs7.d => pkcs7.di} (100%) rename source/deimos/openssl/{pqueue.d => pqueue.di} (100%) rename source/deimos/openssl/{rand.d => rand.di} (100%) rename source/deimos/openssl/{rc2.d => rc2.di} (100%) rename source/deimos/openssl/{rc4.d => rc4.di} (100%) rename source/deimos/openssl/{ripemd.d => ripemd.di} (100%) rename source/deimos/openssl/{rsa.d => rsa.di} (100%) rename source/deimos/openssl/{safestack.d => safestack.di} (100%) rename source/deimos/openssl/{seed.d => seed.di} (100%) rename source/deimos/openssl/{sha.d => sha.di} (100%) rename source/deimos/openssl/{srp.d => srp.di} (100%) rename source/deimos/openssl/{srtp.d => srtp.di} (100%) rename source/deimos/openssl/{ssl.d => ssl.di} (100%) rename source/deimos/openssl/{ssl2.d => ssl2.di} (100%) rename source/deimos/openssl/{ssl23.d => ssl23.di} (100%) rename source/deimos/openssl/{ssl3.d => ssl3.di} (100%) rename source/deimos/openssl/{stack.d => stack.di} (100%) rename source/deimos/openssl/{symhacks.d => symhacks.di} (100%) rename source/deimos/openssl/{tls1.d => tls1.di} (100%) rename source/deimos/openssl/{ts.d => ts.di} (100%) rename source/deimos/openssl/{txt_db.d => txt_db.di} (100%) rename source/deimos/openssl/{types.d => types.di} (100%) rename source/deimos/openssl/{ui.d => ui.di} (100%) rename source/deimos/openssl/{ui_compat.d => ui_compat.di} (100%) rename source/deimos/openssl/{whrlpool.d => whrlpool.di} (100%) rename source/deimos/openssl/{x509.d => x509.di} (100%) rename source/deimos/openssl/{x509_vfy.d => x509_vfy.di} (100%) rename source/deimos/openssl/{x509v3.d => x509v3.di} (100%) diff --git a/.gitignore b/.gitignore index b8eb41e..6e1f706 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Generated version file -/source/deimos/openssl/version_.d +/source/deimos/openssl/version_.di # DUB artifacts /.dub/ diff --git a/scripts/generate_version.d b/scripts/generate_version.d index 6471eca..ae19cea 100644 --- a/scripts/generate_version.d +++ b/scripts/generate_version.d @@ -13,7 +13,7 @@ * * It is called directly as a `preGenerateCommand` (see dub.sdl). * To use it with another build system, pass the directory in which to write - * the `version_.d` file as first and only argument. The directory + * the `version_.di` file as first and only argument. The directory * must exist, this script will not create it. */ module generate_version; @@ -42,14 +42,14 @@ void main(string[] args) { assert(args[1].isDir(), "OpenSSL version detection: Argument '" ~ args[1] ~ "' is not a directory"); - target = args[1].buildPath("version_.d"); + target = args[1].buildPath("version_.di"); } else { assert(args.length == 1, "OpenSSL version detection expects only one argument, " ~ - "a directory path where to write `version_.d`"); - target = TARGET_DIR_PATH.buildPath("version_.d"); + "a directory path where to write `version_.di`"); + target = TARGET_DIR_PATH.buildPath("version_.di"); } string opensslVersion; diff --git a/source/deimos/openssl/_d_util.d b/source/deimos/openssl/_d_util.di similarity index 100% rename from source/deimos/openssl/_d_util.d rename to source/deimos/openssl/_d_util.di diff --git a/source/deimos/openssl/aes.d b/source/deimos/openssl/aes.di similarity index 100% rename from source/deimos/openssl/aes.d rename to source/deimos/openssl/aes.di diff --git a/source/deimos/openssl/applink.d b/source/deimos/openssl/applink.di similarity index 100% rename from source/deimos/openssl/applink.d rename to source/deimos/openssl/applink.di diff --git a/source/deimos/openssl/asn1.d b/source/deimos/openssl/asn1.di similarity index 100% rename from source/deimos/openssl/asn1.d rename to source/deimos/openssl/asn1.di diff --git a/source/deimos/openssl/asn1_mac.d b/source/deimos/openssl/asn1_mac.di similarity index 100% rename from source/deimos/openssl/asn1_mac.d rename to source/deimos/openssl/asn1_mac.di diff --git a/source/deimos/openssl/asn1t.d b/source/deimos/openssl/asn1t.di similarity index 100% rename from source/deimos/openssl/asn1t.d rename to source/deimos/openssl/asn1t.di diff --git a/source/deimos/openssl/bio.d b/source/deimos/openssl/bio.di similarity index 100% rename from source/deimos/openssl/bio.d rename to source/deimos/openssl/bio.di diff --git a/source/deimos/openssl/blowfish.d b/source/deimos/openssl/blowfish.di similarity index 100% rename from source/deimos/openssl/blowfish.d rename to source/deimos/openssl/blowfish.di diff --git a/source/deimos/openssl/bn.d b/source/deimos/openssl/bn.di similarity index 100% rename from source/deimos/openssl/bn.d rename to source/deimos/openssl/bn.di diff --git a/source/deimos/openssl/buffer.d b/source/deimos/openssl/buffer.di similarity index 100% rename from source/deimos/openssl/buffer.d rename to source/deimos/openssl/buffer.di diff --git a/source/deimos/openssl/camellia.d b/source/deimos/openssl/camellia.di similarity index 100% rename from source/deimos/openssl/camellia.d rename to source/deimos/openssl/camellia.di diff --git a/source/deimos/openssl/cast_.d b/source/deimos/openssl/cast_.di similarity index 100% rename from source/deimos/openssl/cast_.d rename to source/deimos/openssl/cast_.di diff --git a/source/deimos/openssl/cmac.d b/source/deimos/openssl/cmac.di similarity index 100% rename from source/deimos/openssl/cmac.d rename to source/deimos/openssl/cmac.di diff --git a/source/deimos/openssl/cms.d b/source/deimos/openssl/cms.di similarity index 100% rename from source/deimos/openssl/cms.d rename to source/deimos/openssl/cms.di diff --git a/source/deimos/openssl/comp.d b/source/deimos/openssl/comp.di similarity index 100% rename from source/deimos/openssl/comp.d rename to source/deimos/openssl/comp.di diff --git a/source/deimos/openssl/conf.d b/source/deimos/openssl/conf.di similarity index 100% rename from source/deimos/openssl/conf.d rename to source/deimos/openssl/conf.di diff --git a/source/deimos/openssl/conf_api.d b/source/deimos/openssl/conf_api.di similarity index 100% rename from source/deimos/openssl/conf_api.d rename to source/deimos/openssl/conf_api.di diff --git a/source/deimos/openssl/crypto.d b/source/deimos/openssl/crypto.di similarity index 100% rename from source/deimos/openssl/crypto.d rename to source/deimos/openssl/crypto.di diff --git a/source/deimos/openssl/des.d b/source/deimos/openssl/des.di similarity index 100% rename from source/deimos/openssl/des.d rename to source/deimos/openssl/des.di diff --git a/source/deimos/openssl/dh.d b/source/deimos/openssl/dh.di similarity index 100% rename from source/deimos/openssl/dh.d rename to source/deimos/openssl/dh.di diff --git a/source/deimos/openssl/dsa.d b/source/deimos/openssl/dsa.di similarity index 100% rename from source/deimos/openssl/dsa.d rename to source/deimos/openssl/dsa.di diff --git a/source/deimos/openssl/dso.d b/source/deimos/openssl/dso.di similarity index 100% rename from source/deimos/openssl/dso.d rename to source/deimos/openssl/dso.di diff --git a/source/deimos/openssl/dtls1.d b/source/deimos/openssl/dtls1.di similarity index 100% rename from source/deimos/openssl/dtls1.d rename to source/deimos/openssl/dtls1.di diff --git a/source/deimos/openssl/e_os2.d b/source/deimos/openssl/e_os2.di similarity index 100% rename from source/deimos/openssl/e_os2.d rename to source/deimos/openssl/e_os2.di diff --git a/source/deimos/openssl/ebcdic.d b/source/deimos/openssl/ebcdic.di similarity index 100% rename from source/deimos/openssl/ebcdic.d rename to source/deimos/openssl/ebcdic.di diff --git a/source/deimos/openssl/ec.d b/source/deimos/openssl/ec.di similarity index 100% rename from source/deimos/openssl/ec.d rename to source/deimos/openssl/ec.di diff --git a/source/deimos/openssl/ecdh.d b/source/deimos/openssl/ecdh.di similarity index 100% rename from source/deimos/openssl/ecdh.d rename to source/deimos/openssl/ecdh.di diff --git a/source/deimos/openssl/ecdsa.d b/source/deimos/openssl/ecdsa.di similarity index 100% rename from source/deimos/openssl/ecdsa.d rename to source/deimos/openssl/ecdsa.di diff --git a/source/deimos/openssl/engine.d b/source/deimos/openssl/engine.di similarity index 100% rename from source/deimos/openssl/engine.d rename to source/deimos/openssl/engine.di diff --git a/source/deimos/openssl/err.d b/source/deimos/openssl/err.di similarity index 100% rename from source/deimos/openssl/err.d rename to source/deimos/openssl/err.di diff --git a/source/deimos/openssl/evp.d b/source/deimos/openssl/evp.di similarity index 100% rename from source/deimos/openssl/evp.d rename to source/deimos/openssl/evp.di diff --git a/source/deimos/openssl/hmac.d b/source/deimos/openssl/hmac.di similarity index 100% rename from source/deimos/openssl/hmac.d rename to source/deimos/openssl/hmac.di diff --git a/source/deimos/openssl/idea.d b/source/deimos/openssl/idea.di similarity index 100% rename from source/deimos/openssl/idea.d rename to source/deimos/openssl/idea.di diff --git a/source/deimos/openssl/kdf.d b/source/deimos/openssl/kdf.di similarity index 100% rename from source/deimos/openssl/kdf.d rename to source/deimos/openssl/kdf.di diff --git a/source/deimos/openssl/krb5_asn.d b/source/deimos/openssl/krb5_asn.di similarity index 100% rename from source/deimos/openssl/krb5_asn.d rename to source/deimos/openssl/krb5_asn.di diff --git a/source/deimos/openssl/kssl.d b/source/deimos/openssl/kssl.di similarity index 100% rename from source/deimos/openssl/kssl.d rename to source/deimos/openssl/kssl.di diff --git a/source/deimos/openssl/lhash.d b/source/deimos/openssl/lhash.di similarity index 100% rename from source/deimos/openssl/lhash.d rename to source/deimos/openssl/lhash.di diff --git a/source/deimos/openssl/md4.d b/source/deimos/openssl/md4.di similarity index 100% rename from source/deimos/openssl/md4.d rename to source/deimos/openssl/md4.di diff --git a/source/deimos/openssl/md5.d b/source/deimos/openssl/md5.di similarity index 100% rename from source/deimos/openssl/md5.d rename to source/deimos/openssl/md5.di diff --git a/source/deimos/openssl/mdc2.d b/source/deimos/openssl/mdc2.di similarity index 100% rename from source/deimos/openssl/mdc2.d rename to source/deimos/openssl/mdc2.di diff --git a/source/deimos/openssl/modes.d b/source/deimos/openssl/modes.di similarity index 100% rename from source/deimos/openssl/modes.d rename to source/deimos/openssl/modes.di diff --git a/source/deimos/openssl/obj_mac.d b/source/deimos/openssl/obj_mac.di similarity index 100% rename from source/deimos/openssl/obj_mac.d rename to source/deimos/openssl/obj_mac.di diff --git a/source/deimos/openssl/objects.d b/source/deimos/openssl/objects.di similarity index 100% rename from source/deimos/openssl/objects.d rename to source/deimos/openssl/objects.di diff --git a/source/deimos/openssl/ocsp.d b/source/deimos/openssl/ocsp.di similarity index 100% rename from source/deimos/openssl/ocsp.d rename to source/deimos/openssl/ocsp.di diff --git a/source/deimos/openssl/opensslconf.d b/source/deimos/openssl/opensslconf.di similarity index 100% rename from source/deimos/openssl/opensslconf.d rename to source/deimos/openssl/opensslconf.di diff --git a/source/deimos/openssl/opensslv.d b/source/deimos/openssl/opensslv.di similarity index 100% rename from source/deimos/openssl/opensslv.d rename to source/deimos/openssl/opensslv.di diff --git a/source/deimos/openssl/ossl_typ.d b/source/deimos/openssl/ossl_typ.di similarity index 100% rename from source/deimos/openssl/ossl_typ.d rename to source/deimos/openssl/ossl_typ.di diff --git a/source/deimos/openssl/pem.d b/source/deimos/openssl/pem.di similarity index 100% rename from source/deimos/openssl/pem.d rename to source/deimos/openssl/pem.di diff --git a/source/deimos/openssl/pem2.d b/source/deimos/openssl/pem2.di similarity index 100% rename from source/deimos/openssl/pem2.d rename to source/deimos/openssl/pem2.di diff --git a/source/deimos/openssl/pkcs12.d b/source/deimos/openssl/pkcs12.di similarity index 100% rename from source/deimos/openssl/pkcs12.d rename to source/deimos/openssl/pkcs12.di diff --git a/source/deimos/openssl/pkcs7.d b/source/deimos/openssl/pkcs7.di similarity index 100% rename from source/deimos/openssl/pkcs7.d rename to source/deimos/openssl/pkcs7.di diff --git a/source/deimos/openssl/pqueue.d b/source/deimos/openssl/pqueue.di similarity index 100% rename from source/deimos/openssl/pqueue.d rename to source/deimos/openssl/pqueue.di diff --git a/source/deimos/openssl/rand.d b/source/deimos/openssl/rand.di similarity index 100% rename from source/deimos/openssl/rand.d rename to source/deimos/openssl/rand.di diff --git a/source/deimos/openssl/rc2.d b/source/deimos/openssl/rc2.di similarity index 100% rename from source/deimos/openssl/rc2.d rename to source/deimos/openssl/rc2.di diff --git a/source/deimos/openssl/rc4.d b/source/deimos/openssl/rc4.di similarity index 100% rename from source/deimos/openssl/rc4.d rename to source/deimos/openssl/rc4.di diff --git a/source/deimos/openssl/ripemd.d b/source/deimos/openssl/ripemd.di similarity index 100% rename from source/deimos/openssl/ripemd.d rename to source/deimos/openssl/ripemd.di diff --git a/source/deimos/openssl/rsa.d b/source/deimos/openssl/rsa.di similarity index 100% rename from source/deimos/openssl/rsa.d rename to source/deimos/openssl/rsa.di diff --git a/source/deimos/openssl/safestack.d b/source/deimos/openssl/safestack.di similarity index 100% rename from source/deimos/openssl/safestack.d rename to source/deimos/openssl/safestack.di diff --git a/source/deimos/openssl/seed.d b/source/deimos/openssl/seed.di similarity index 100% rename from source/deimos/openssl/seed.d rename to source/deimos/openssl/seed.di diff --git a/source/deimos/openssl/sha.d b/source/deimos/openssl/sha.di similarity index 100% rename from source/deimos/openssl/sha.d rename to source/deimos/openssl/sha.di diff --git a/source/deimos/openssl/srp.d b/source/deimos/openssl/srp.di similarity index 100% rename from source/deimos/openssl/srp.d rename to source/deimos/openssl/srp.di diff --git a/source/deimos/openssl/srtp.d b/source/deimos/openssl/srtp.di similarity index 100% rename from source/deimos/openssl/srtp.d rename to source/deimos/openssl/srtp.di diff --git a/source/deimos/openssl/ssl.d b/source/deimos/openssl/ssl.di similarity index 100% rename from source/deimos/openssl/ssl.d rename to source/deimos/openssl/ssl.di diff --git a/source/deimos/openssl/ssl2.d b/source/deimos/openssl/ssl2.di similarity index 100% rename from source/deimos/openssl/ssl2.d rename to source/deimos/openssl/ssl2.di diff --git a/source/deimos/openssl/ssl23.d b/source/deimos/openssl/ssl23.di similarity index 100% rename from source/deimos/openssl/ssl23.d rename to source/deimos/openssl/ssl23.di diff --git a/source/deimos/openssl/ssl3.d b/source/deimos/openssl/ssl3.di similarity index 100% rename from source/deimos/openssl/ssl3.d rename to source/deimos/openssl/ssl3.di diff --git a/source/deimos/openssl/stack.d b/source/deimos/openssl/stack.di similarity index 100% rename from source/deimos/openssl/stack.d rename to source/deimos/openssl/stack.di diff --git a/source/deimos/openssl/symhacks.d b/source/deimos/openssl/symhacks.di similarity index 100% rename from source/deimos/openssl/symhacks.d rename to source/deimos/openssl/symhacks.di diff --git a/source/deimos/openssl/tls1.d b/source/deimos/openssl/tls1.di similarity index 100% rename from source/deimos/openssl/tls1.d rename to source/deimos/openssl/tls1.di diff --git a/source/deimos/openssl/ts.d b/source/deimos/openssl/ts.di similarity index 100% rename from source/deimos/openssl/ts.d rename to source/deimos/openssl/ts.di diff --git a/source/deimos/openssl/txt_db.d b/source/deimos/openssl/txt_db.di similarity index 100% rename from source/deimos/openssl/txt_db.d rename to source/deimos/openssl/txt_db.di diff --git a/source/deimos/openssl/types.d b/source/deimos/openssl/types.di similarity index 100% rename from source/deimos/openssl/types.d rename to source/deimos/openssl/types.di diff --git a/source/deimos/openssl/ui.d b/source/deimos/openssl/ui.di similarity index 100% rename from source/deimos/openssl/ui.d rename to source/deimos/openssl/ui.di diff --git a/source/deimos/openssl/ui_compat.d b/source/deimos/openssl/ui_compat.di similarity index 100% rename from source/deimos/openssl/ui_compat.d rename to source/deimos/openssl/ui_compat.di diff --git a/source/deimos/openssl/whrlpool.d b/source/deimos/openssl/whrlpool.di similarity index 100% rename from source/deimos/openssl/whrlpool.d rename to source/deimos/openssl/whrlpool.di diff --git a/source/deimos/openssl/x509.d b/source/deimos/openssl/x509.di similarity index 100% rename from source/deimos/openssl/x509.d rename to source/deimos/openssl/x509.di diff --git a/source/deimos/openssl/x509_vfy.d b/source/deimos/openssl/x509_vfy.di similarity index 100% rename from source/deimos/openssl/x509_vfy.d rename to source/deimos/openssl/x509_vfy.di diff --git a/source/deimos/openssl/x509v3.d b/source/deimos/openssl/x509v3.di similarity index 100% rename from source/deimos/openssl/x509v3.d rename to source/deimos/openssl/x509v3.di From 14681ceb969e7737be48aef7aa7fe0aae65122a8 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 8 Jun 2022 13:47:08 +0000 Subject: [PATCH 6/6] Delete unittest CI step - There are no unittests in the source files, so this was meaningless. - It would be meaningful to perform a syntax check here. `dub build --build=syntax` would be a good fit, but it does not seem to pass `.di` files to the compiler. --- .github/workflows/ci.yml | 1 - dub.sdl | 9 --------- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55a196c..1ed6f50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,6 @@ jobs: # We don't checkout in $GITHUB_WORKSPACE to avoid polluting the repository with artifacts, # e.g. the C openssl library or Vibe.d cd ${{ github.workspace }}/deimos-openssl/ - dub test cd examples/sslecho/ ${{ github.workspace }}/openssl/install/bin/openssl req -batch -newkey rsa:4096 -x509 -sha256 -days 3650 -subj "/C=GB/CN=localhost" -nodes -out cert.pem -keyout key.pem dub build diff --git a/dub.sdl b/dub.sdl index da9bc2c..0bb20dc 100644 --- a/dub.sdl +++ b/dub.sdl @@ -21,12 +21,3 @@ configuration "library-manual-version" { configuration "library-applink" { targetType "sourceLibrary" } - -configuration "unittest" { - targetType "executable" - targetName "openssl-test-library" - dflags "-main" - excludedSourceFiles "source/deimos/openssl/applink.d" - preGenerateCommands `${DUB} scripts/generate_version.d` platform="posix" - versions `DeimosOpenSSLAutoDetect` -}