Commit Graph

70 Commits

Author SHA1 Message Date
Connor McAdams 85cb1ff91e secur32: Fix trace in schannel pull_adapter function.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 22:04:05 +01:00
Connor McAdams 387a30a8ce secur32: Switch back to non-blocking mode for DTLS sessions.
In order for DTLS retransmission to occur properly, we need to be in
non-blocking mode.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 17:56:06 +01:00
Connor McAdams 117f79aa19 secur32: Add support for setting DTLS timeouts.
Add support for setting the DTLS timeout values, and set the
retransmission timeout value to 0 to allow for retransmission on each
call to schan_InitializeSecurityContext.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 17:56:06 +01:00
Alexandre Julliard 392bdb85e7 secur32: Convert the Unix library to the __wine_unix_call interface.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:24:36 +01:00
Alexandre Julliard 1cf48b4684 secur32: Pre-allocate the token buffer for handshake() on the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:23:59 +01:00
Alexandre Julliard abdae53938 secur32: Move the memory allocation for get_unique_channel_binding() to the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:23:49 +01:00
Alexandre Julliard bcc30639ad secur32: Move the memory allocation for get_session_peer_certificate() to the PE side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:23:38 +01:00
Alexandre Julliard a4d69c874b secur32: Move the buffers initialization and callbacks to the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:23:24 +01:00
Alexandre Julliard 9894e109ac secur32: Move the decrypt message receive loop to the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-04 13:23:19 +01:00
Alexandre Julliard 97ea9ee41c secur32: Move the get_buffer callback to the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 23:20:10 +01:00
Alexandre Julliard 4e579d49a7 secur32: Store the GnuTLS session inside the transport.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 23:20:10 +01:00
Alexandre Julliard 37eab1f496 secur32: Move the pull/push callbacks to the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 23:20:10 +01:00
Alexandre Julliard 143bd63b27 include: Remove some no longer used Unicode functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Alexandre Julliard ef6e33f89f include: Don't include wine/port.h in Unix libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Alexandre Julliard ef9a0f3bc3 include: Don't include stdlib.h in wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Alistair Leslie-Hughes 8ed81720e8 secur32: Set error flag on pull callback.
Fixes a regression introduced in b8aaf86b2d

Partial revert the pull_timeout function, which now return -1 and sets the
transport error to try again.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51440
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 12:13:13 +02:00
Hans Leidekker b8aaf86b2d secur32: Use blocking mode for DTLS sessions.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 19:55:22 +02:00
Gijs Vermeulen 4940d2ada2 secur32: Default to building with GnuTLS support on macOS, if present.
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-18 16:48:48 +02:00
Hans Leidekker cae161389b secur32: Translate errors from push/pull callbacks.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51192
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Hans Leidekker 7d0889b747 secur32: Move Schannel support to a Unix library.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Hans Leidekker a114ce67db secur32: Add support for setting DTLS MTU.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 19:01:38 +01:00
Hans Leidekker f93284dfa4 secur32: Add DTLS support.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 19:01:38 +01:00
Damjan Jovanovic de9238962c secur32: Implement the SECPKG_ATTR_UNIQUE_BINDINGS context attribute.
.NET's System.Data.SqlClient needs this to connect to MSSQL Server.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 20:39:24 +01:00
Paul Gofman c654839178 secur32: Prevent gnutls from using system priority file.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-12 20:22:33 +01:00
Alistair Leslie-Hughes 353c16f0d6 secur32: Fix compile for older gnutls libraries.
GNUTLS_ALPN_SERVER_PRECEDENCE was introduced into 3.5.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-10 12:41:52 +02:00
Hans Leidekker 0527cf89fb secur32: Add TLS application protocol negotiation support.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-09 21:04:04 +02:00
Hans Leidekker af5f9e6d0f secur32: Map GNUTLS_E_REHANDSHAKE to SEC_I_RENEGOTIATE.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 20:55:49 +02:00
Alexandre Julliard 55434d4539 secur32: Use standard dlopen() instead of the libwine wrappers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 14:26:19 +02:00
Alistair Leslie-Hughes fb78d19881 secur32: Stop memory leak (Coverity).
CID 1442946

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 14:50:16 +01:00
Hans Leidekker ba14773187 secur32: Fix the username fallback in get_key_container_path.
Spotted by Sven Baars.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-22 18:21:57 +01:00
Alistair Leslie-Hughes 9bbe5c3613 secur32: Fix compile error on older gnutls.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-08 22:18:16 +01:00
Hans Leidekker 16d9f62bdf secur32: Add support for client certificate authentication.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-07 12:54:35 +01:00
Jacek Caban 179ee89e65 secur32: Use VERS-ALL priority string only on recent gnutls versions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:43:37 +01:00
Jacek Caban 9dd0f8f4b7 secur32: Check for supported protocols when loading gnutls.
We mostly need to know if TLS1.3 is supported before attempting to
handle it. It's just in gnutls backend now, so it will not be actually
enabled yet.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:43:35 +01:00
Jacek Caban 5cc5b102c1 secur32: Use -VERS-ALL gnutls priority string to disable not enabled protocols.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46161
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 19:23:55 +01:00
Michael Stefaniuc baf4cb3958 secur32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-19 08:07:10 +02:00
Jacek Caban 855d73e927 secur32: Fixed compilation with prediluvian gnutls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-28 17:07:43 +02:00
Akihiro Sagawa ffefa721ba secur32: Return PRF algorithm value when using GCM.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-27 22:22:34 +02:00
Akihiro Sagawa b6d32239d6 secur32: Add support for SECPKG_ATTR_KEY_INFO.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-25 20:53:04 +02:00
Akihiro Sagawa d5bc3c7bce secur32: 3DES has a different ALG_ID.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-19 20:02:53 +02:00
Akihiro Sagawa 8981dac859 secur32: Return correct key exchange algorithm value.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-19 20:02:53 +02:00
Sebastian Lackner e6c85e8436 secur32: Define missing gnutls_kx_algorithm_t constants for gnutls versions < 3.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-14 22:10:31 +09:00
Max Qian cf9cd32df3 secur32: Added support for a few more algids.
Signed-off-by: Max Qian <public@maxqia.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-06 23:10:08 +09:00
Michael Cronenworth bf5ac531a0 secur32: Provide a static declaration for gnutls_cipher_get_block_size.
Instead of providing an extern provide a static declaration. The
function return type changed from signed to unsigned in GnuTLS 3.5.

Signed-off-by: Michael Cronenworth <mike@cchtml.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 00:09:20 +09:00
Jacek Caban f198b5a45a secur32: Use %LATEST_RECORD_VERSION gnutls priority.
It's based on [1], where it's reported to fix issues with older gnutls.
I tested what client hello packages Windows reports for different sets
of used protocol versions, and it always uses newest possible version.
There may be a concern about not using SSL3 client hello, which still
may negotiate newer protocol and was recommended for compatibility
reasons, but it's known to be problematic the other way those days and
recent gnutls won't use it by default anyway [2].

[1] http://us.battle.net/wow/en/forum/topic/20742995286?page=11
[2] 25ed275043

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-29 10:39:41 +09:00
Alexandre Julliard 52e68a7823 secur32: Avoid ssize_t type that causes printf format warnings. 2015-08-17 15:34:35 +09:00
Jacek Caban cae3f98c69 secur32: Fixed compilation on very old gnutls versions. 2015-06-18 21:41:02 +09:00
Jacek Caban 72747526b1 secur32: Fixed compilation on with gnutls. 2015-06-17 20:01:30 +09:00
Jacek Caban dedbd18836 secur32: Use gnutls_cipher_get_block_size to get cupher block size. 2015-06-16 23:56:46 +09:00
Jacek Caban 3617e2b2a9 secur32: Added support for a few more algorithms in schannel_get_cipher_algid. 2015-06-16 23:56:45 +09:00