Skip to content

Commit

Permalink
Add casts from SSLOptionType to c_long, required with OpenSSL 3+ on W…
Browse files Browse the repository at this point in the history
…indows

Where SSLOptionType is ulong (on all platforms since v3), but c_long
is 32-bit (Windows-specific). This fixes compilation errors when using
SSL_CTX_set_mode() etc.
  • Loading branch information
kinke committed Sep 26, 2024
1 parent 574ef8d commit 52cf52c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/deimos/openssl/ssl.di
Original file line number Diff line number Diff line change
Expand Up @@ -714,25 +714,25 @@ else
}

auto SSL_CTX_set_mode()(SSL_CTX* ctx, SSLOptionType op) {
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_MODE,op,null);
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_MODE,cast(c_long)op,null);
}
auto SSL_CTX_clear_mode()(SSL_CTX* ctx, SSLOptionType op) {
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_MODE,op,null);
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_MODE,cast(c_long)op,null);
}
auto SSL_CTX_get_mode()(SSL_CTX* ctx) {
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_MODE,0,null);
}
auto SSL_clear_mode()(SSL* ssl, SSLOptionType op) {
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_CLEAR_MODE,op,null);
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_CLEAR_MODE,cast(c_long)op,null);
}
auto SSL_set_mode()(SSL* ssl, SSLOptionType op) {
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_MODE,op,null);
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_MODE,cast(c_long)op,null);
}
auto SSL_get_mode()(SSL* ssl) {
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_MODE,0,null);
}
auto SSL_set_mtu()(SSL* ssl, SSLOptionType mtu) {
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_MTU,mtu,null);
pragma(inline, true); return SSL_ctrl(ssl,SSL_CTRL_MTU,cast(c_long)mtu,null);
}

auto SSL_get_secure_renegotiation_support()(SSL* ssl) {
Expand Down Expand Up @@ -2307,7 +2307,7 @@ auto SSL_set_max_cert_list()(SSL* ssl,c_long m) {
auto SSL_CTX_set_max_send_fragment()(SSL_CTX* ctx, c_long m) {
pragma(inline, true); return SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,null);
}
auto SSL_set_max_send_fragment()(SSL* ssl,m) {
auto SSL_set_max_send_fragment()(SSL* ssl, c_long m) {
pragma(inline, true); SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,null);
}

Expand Down

0 comments on commit 52cf52c

Please sign in to comment.