Gert Doering has uploaded a new patch set (#2) to the change originally created by Răzvan Cojocaru. ( https://gerrit.openvpn.net/c/openvpn/+/2230?usp=email )
The following approvals got outdated and were removed: Code-Review+2 by Heiko Hund Change subject: Remove orphaned ring_buffer.h and ffdhe2048.pem ...................................................................... Remove orphaned ring_buffer.h and ffdhe2048.pem ring_buffer.h was deleted with Wintun support in ad7a6945 but came back with the clang-format reformat in 3cca3367. Nothing includes it. Also drop the unused TUN_IOCTL_REGISTER_RINGS define in interactive.c. ffdhe2048.pem was added for the t_server_null tests in b60ba20c, which switched to --dh none in 494fb718. Nothing references it. Change-Id: Ie074a6f52589f9bb3c0c98b95def5e8115a7c621 Signed-off-by: Razvan Cojocaru <[email protected]> Acked-by: Heiko Hund <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2230 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg41756.html Signed-off-by: Gert Doering <[email protected]> --- D sample/sample-keys/ffdhe2048.pem D src/openvpn/ring_buffer.h M src/openvpnserv/interactive.c 3 files changed, 0 insertions(+), 135 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/30/2230/2 diff --git a/sample/sample-keys/ffdhe2048.pem b/sample/sample-keys/ffdhe2048.pem deleted file mode 100644 index 9b182b7..0000000 --- a/sample/sample-keys/ffdhe2048.pem +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN DH PARAMETERS----- -MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz -+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a -87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 -YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi -7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD -ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== ------END DH PARAMETERS----- diff --git a/src/openvpn/ring_buffer.h b/src/openvpn/ring_buffer.h deleted file mode 100644 index aebcd9c..0000000 --- a/src/openvpn/ring_buffer.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * OpenVPN -- An application to securely tunnel IP networks - * over a single UDP port, with support for SSL/TLS-based - * session authentication and key exchange, - * packet encryption, packet authentication, and - * packet compression. - * - * Copyright (C) 2002-2026 OpenVPN Inc <[email protected]> - * 2019 Lev Stipakov <[email protected]> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifdef _WIN32 -#ifndef OPENVPN_RING_BUFFER_H -#define OPENVPN_RING_BUFFER_H - -#include <windows.h> -#include <winioctl.h> - -#include <stdint.h> -#include <stdbool.h> - -/* - * Values below are taken from Wireguard Windows client - * https://github.com/WireGuard/wireguard-go/blob/master/tun/wintun/ring_windows.go#L14 - */ -#define WINTUN_RING_CAPACITY 0x800000 -#define WINTUN_RING_TRAILING_BYTES 0x10000 -#define WINTUN_MAX_PACKET_SIZE 0xffff -#define WINTUN_PACKET_ALIGN 4 - -#define TUN_IOCTL_REGISTER_RINGS \ - CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) - -/** - * Wintun ring buffer - * See https://github.com/WireGuard/wintun#ring-layout - */ -struct tun_ring -{ - volatile ULONG head; - volatile ULONG tail; - volatile LONG alertable; - UCHAR data[WINTUN_RING_CAPACITY + WINTUN_RING_TRAILING_BYTES]; -}; - -/** - * Struct for ring buffers registration - * See https://github.com/WireGuard/wintun#registering-rings - */ -struct tun_register_rings -{ - struct - { - ULONG ring_size; - struct tun_ring *ring; - HANDLE tail_moved; - } send, receive; -}; - -struct TUN_PACKET_HEADER -{ - uint32_t size; -}; - -struct TUN_PACKET -{ - uint32_t size; - UCHAR data[WINTUN_MAX_PACKET_SIZE]; -}; - -/** - * Registers ring buffers used to exchange data between - * userspace openvpn process and wintun kernel driver, - * see https://github.com/WireGuard/wintun#registering-rings - * - * @param device handle to opened wintun device - * @param send_ring pointer to send ring - * @param receive_ring pointer to receive ring - * @param send_tail_moved event set by wintun to signal openvpn - * that data is available for reading in send ring - * @param receive_tail_moved event set by openvpn to signal wintun - * that data has been written to receive ring - * @return true if registration is successful, false otherwise - use - * GetLastError() - */ -static inline bool -register_ring_buffers(HANDLE device, struct tun_ring *send_ring, struct tun_ring *receive_ring, - HANDLE send_tail_moved, HANDLE receive_tail_moved) -{ - struct tun_register_rings rr; - BOOL res; - DWORD bytes_returned; - - ZeroMemory(&rr, sizeof(rr)); - - rr.send.ring = send_ring; - rr.send.ring_size = sizeof(struct tun_ring); - rr.send.tail_moved = send_tail_moved; - - rr.receive.ring = receive_ring; - rr.receive.ring_size = sizeof(struct tun_ring); - rr.receive.tail_moved = receive_tail_moved; - - res = DeviceIoControl(device, TUN_IOCTL_REGISTER_RINGS, &rr, sizeof(rr), NULL, 0, - &bytes_returned, NULL); - - return res != FALSE; -} - -#endif /* ifndef OPENVPN_RING_BUFFER_H */ -#endif /* ifdef _WIN32 */ diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 354fe09..6bd679f 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -55,9 +55,6 @@ static HANDLE rdns_semaphore = NULL; #define RDNS_TIMEOUT 600 /* seconds to wait for the semaphore */ -#define TUN_IOCTL_REGISTER_RINGS \ - CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) - openvpn_service_t interactive_service = { interactive, _L(PACKAGE_NAME) L"ServiceInteractive", _L(PACKAGE_NAME) L" Interactive Service", SERVICE_DEPENDENCIES, SERVICE_AUTO_START }; -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/2230?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie074a6f52589f9bb3c0c98b95def5e8115a7c621 Gerrit-Change-Number: 2230 Gerrit-PatchSet: 2 Gerrit-Owner: Răzvan Cojocaru <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Heiko Hund <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
