diff --git a/.cirrus.yml b/.cirrus.yml index 68b66ab5..07218cc8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,7 @@ FreeBSD_task: SSL: matrix: freebsd_instance: - image_family: freebsd-13-2 + image_family: freebsd-14-0 prepare_script: - pkg install -y pkgconf cmake git libsodium $SSL - git submodule update --init --recursive diff --git a/developer_tools/vpnserver-jsonrpc-clients/vpnserver-jsonrpc-client-nodejs-package/package-lock.json b/developer_tools/vpnserver-jsonrpc-clients/vpnserver-jsonrpc-client-nodejs-package/package-lock.json index dbfcbe5d..b854915a 100644 --- a/developer_tools/vpnserver-jsonrpc-clients/vpnserver-jsonrpc-client-nodejs-package/package-lock.json +++ b/developer_tools/vpnserver-jsonrpc-clients/vpnserver-jsonrpc-client-nodejs-package/package-lock.json @@ -65,12 +65,23 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" + }, + "dependencies": { + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + } } }, "builtin-modules": { @@ -151,15 +162,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", diff --git a/src/Cedar/Virtual.c b/src/Cedar/Virtual.c index fa2367dc..f5d105cf 100644 --- a/src/Cedar/Virtual.c +++ b/src/Cedar/Virtual.c @@ -9349,62 +9349,35 @@ UINT ServeDhcpDiscoverEx(VH *v, UCHAR *mac, UINT request_ip, bool is_static_ip) // check whether it is a request from the same MAC address if (Cmp(mac, d->MacAddress, 6) == 0) { - // Examine whether the specified IP address is within the range of assignment + // Examine whether the specified IP address is within the range of static assignment if (Endian32(v->DhcpIpStart) > Endian32(request_ip) || Endian32(request_ip) > Endian32(v->DhcpIpEnd)) { - // Accept if within the range + // Accept if within the range of static assignment ret = request_ip; } } else { - // Duplicated IPV4 address found. The DHCP server replies to DHCPREQUEST with DHCP NAK. + // Duplicated IPV4 address found. The specified IP address is not available for use char ipstr[MAX_HOST_NAME_LEN + 1] = { 0 }; char macstr[128] = { 0 }; IPToStr32(ipstr, sizeof(ipstr), request_ip); - BinToStr(macstr, sizeof(macstr), d->MacAddress, 6); - Debug("Virtual DHC Server: Duplicated IP address detected. Static IP: %s, Used by MAC:%s\n", ipstr, macstr); - return ret; + MacToStr(macstr, sizeof(macstr), d->MacAddress); + Debug("Virtual DHC Server: Duplicated IP address detected. Static IP: %s, with the MAC: %s\n", ipstr, macstr); } } else { - // Examine whether the specified IP address is within the range of assignment + // Examine whether the specified IP address is within the range of static assignment if (Endian32(v->DhcpIpStart) > Endian32(request_ip) || Endian32(request_ip) > Endian32(v->DhcpIpEnd)) { - // Accept if within the range + // Accept if within the range of static assignment ret = request_ip; } else { - // Propose an IP in the range since it's a Discover although It is out of range - } - } - if (ret == 0) - { - // If there is any entry with the same MAC address - // that are already registered, use it with priority - DHCP_LEASE *d = SearchDhcpLeaseByMac(v, mac); - - if (d != NULL) - { - // Examine whether the found IP address is in the allocation region - if (Endian32(v->DhcpIpStart) > Endian32(d->IpAddress) || - Endian32(d->IpAddress) > Endian32(v->DhcpIpEnd)) - { - // Use the IP address if it's found within the range - ret = d->IpAddress; - } - } - } - if (ret == 0) - { - // For static IP, the requested IP address must NOT be within the range of the DHCP pool - if (Endian32(v->DhcpIpStart) > Endian32(request_ip) || - Endian32(request_ip) > Endian32(v->DhcpIpEnd)) - { - ret = request_ip; + // The specified IP address is not available for use } } @@ -9595,6 +9568,11 @@ void VirtualDhcpServer(VH *v, PKT *p) { ip = ServeDhcpRequestEx(v, p->MacAddressSrc, opt->RequestedIp, ip_static); } + // If the IP address in user's note is changed, then reply to DHCP_REQUEST with DHCP_NAK + if (p->L3.IPv4Header->SrcIP && ip != p->L3.IPv4Header->SrcIP) + { + ip = 0; + } } if (ip != 0 || opt->Opcode == DHCP_INFORM) @@ -9607,6 +9585,14 @@ void VirtualDhcpServer(VH *v, PKT *p) char client_mac[MAX_SIZE]; char client_ip[MAX_SIZE]; + // If there is any entry with the same MAC address, then remove it + d = SearchDhcpLeaseByMac(v, p->MacAddressSrc); + if (d != NULL) + { + FreeDhcpLease(d); + Delete(v->DhcpLeaseList, d); + } + // Remove old records with the same IP address d = SearchDhcpLeaseByIp(v, ip); if (d != NULL) @@ -9765,7 +9751,7 @@ void VirtualDhcpServer(VH *v, PKT *p) } else { - // Reply of DHCP_REQUEST must be either DHCP_ACK or DHCP_NAK. + // Reply of DHCP_REQUEST must be either DHCP_ACK or DHCP_NAK if (opt->Opcode == DHCP_REQUEST) { // There is no IP address that can be provided diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index ce5421b8..ee25308c 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -12287,9 +12287,15 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) Debug("%s %u SecureRecv() Disconnect\n", __FILE__, __LINE__); return 0; } + ERR_clear_error(); ret = SSL_peek(ssl, &c, sizeof(c)); } Unlock(sock->ssl_lock); +#if OPENSSL_VERSION_NUMBER < 0x30000000L + // 2021/09/10: After OpenSSL 3.x.x, both 0 and negative values might mean retryable. + // See: https://github.com/openssl/openssl/blob/435981cbadad2c58c35bacd30ca5d8b4c9bea72f/doc/man3/SSL_read.pod + // > Old documentation indicated a difference between 0 and -1, and that -1 was retryable. + // > You should instead call SSL_get_error() to find out if it's retryable. if (ret == 0) { // The communication have been disconnected @@ -12297,7 +12303,8 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) Debug("%s %u SecureRecv() Disconnect\n", __FILE__, __LINE__); return 0; } - if (ret < 0) +#endif + if (ret <= 0) { // An error has occurred e = SSL_get_error(ssl, ret); @@ -12305,14 +12312,18 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) { if (e == SSL_ERROR_SSL #if OPENSSL_VERSION_NUMBER < 0x10100000L - && - sock->ssl->s3->send_alert[0] == SSL3_AL_FATAL && - sock->ssl->s3->send_alert[0] != sock->Ssl_Init_Async_SendAlert[0] && - sock->ssl->s3->send_alert[1] != sock->Ssl_Init_Async_SendAlert[1] + && + sock->ssl->s3->send_alert[0] == SSL3_AL_FATAL && + sock->ssl->s3->send_alert[0] != sock->Ssl_Init_Async_SendAlert[0] && + sock->ssl->s3->send_alert[1] != sock->Ssl_Init_Async_SendAlert[1] #endif - ) + ) { - Debug("%s %u SSL Fatal Error on ASYNC socket !!!\n", __FILE__, __LINE__); + UINT ssl_err_no; + while (ssl_err_no = ERR_get_error()){ + Debug("%s %u SSL_ERROR_SSL on ASYNC socket !!! ssl_err_no = %u: '%s'\n", __FILE__, __LINE__, ssl_err_no, ERR_error_string(ssl_err_no, NULL)); + }; + Disconnect(sock); return 0; } @@ -12339,14 +12350,15 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) } #endif // OS_UNIX -// Run the time-out thread for SOLARIS + // Run the time-out thread for SOLARIS #ifdef UNIX_SOLARIS ttparam = NewSocketTimeout(sock); #endif // UNIX_SOLARIS + ERR_clear_error(); ret = SSL_read(ssl, data, size); -// Stop the timeout thread + // Stop the timeout thread #ifdef UNIX_SOLARIS FreeSocketTimeout(ttparam); #endif // UNIX_SOLARIS @@ -12359,7 +12371,11 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) } #endif // OS_UNIX - if (ret < 0) +#if OPENSSL_VERSION_NUMBER < 0x30000000L + if (ret < 0) // OpenSSL version < 3.0.0 +#else + if (ret <= 0) // OpenSSL version >= 3.0.0 +#endif { e = SSL_get_error(ssl, ret); } @@ -12382,6 +12398,12 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) return (UINT)ret; } + +#if OPENSSL_VERSION_NUMBER < 0x30000000L + // 2021/09/10: After OpenSSL 3.x.x, both 0 and negative values might mean retryable. + // See: https://github.com/openssl/openssl/blob/435981cbadad2c58c35bacd30ca5d8b4c9bea72f/doc/man3/SSL_read.pod + // > Old documentation indicated a difference between 0 and -1, and that -1 was retryable. + // > You should instead call SSL_get_error() to find out if it's retryable. if (ret == 0) { // Disconnect the communication @@ -12389,20 +12411,26 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) //Debug("%s %u SecureRecv() Disconnect\n", __FILE__, __LINE__); return 0; } +#endif + if (sock->AsyncMode) { if (e == SSL_ERROR_WANT_READ || e == SSL_ERROR_WANT_WRITE || e == SSL_ERROR_SSL) { if (e == SSL_ERROR_SSL #if OPENSSL_VERSION_NUMBER < 0x10100000L - && - sock->ssl->s3->send_alert[0] == SSL3_AL_FATAL && - sock->ssl->s3->send_alert[0] != sock->Ssl_Init_Async_SendAlert[0] && - sock->ssl->s3->send_alert[1] != sock->Ssl_Init_Async_SendAlert[1] + && + sock->ssl->s3->send_alert[0] == SSL3_AL_FATAL && + sock->ssl->s3->send_alert[0] != sock->Ssl_Init_Async_SendAlert[0] && + sock->ssl->s3->send_alert[1] != sock->Ssl_Init_Async_SendAlert[1] #endif - ) + ) { - Debug("%s %u SSL Fatal Error on ASYNC socket !!!\n", __FILE__, __LINE__); + UINT ssl_err_no; + while (ssl_err_no = ERR_get_error()) { + Debug("%s %u SSL_ERROR_SSL on ASYNC socket !!! ssl_err_no = %u: '%s'\n", __FILE__, __LINE__, ssl_err_no, ERR_error_string(ssl_err_no, NULL)); + }; + Disconnect(sock); return 0; } @@ -12411,8 +12439,8 @@ UINT SecureRecv(SOCK *sock, void *data, UINT size) return SOCK_LATER; } } + Debug("%s %u e=%u SecureRecv() Disconnect\n", __FILE__, __LINE__, e); Disconnect(sock); - Debug("%s %u SecureRecv() Disconnect\n", __FILE__, __LINE__); return 0; } @@ -12439,8 +12467,13 @@ UINT SecureSend(SOCK *sock, void *data, UINT size) return 0; } + ERR_clear_error(); ret = SSL_write(ssl, data, size); - if (ret < 0) +#if OPENSSL_VERSION_NUMBER < 0x30000000L + if (ret < 0) // OpenSSL version < 3.0.0 +#else + if (ret <= 0) // OpenSSL version >= 3.0.0 +#endif { e = SSL_get_error(ssl, ret); } @@ -12462,6 +12495,8 @@ UINT SecureSend(SOCK *sock, void *data, UINT size) sock->WriteBlocked = false; return (UINT)ret; } + +#if OPENSSL_VERSION_NUMBER < 0x30000000L if (ret == 0) { // Disconnect @@ -12469,18 +12504,29 @@ UINT SecureSend(SOCK *sock, void *data, UINT size) Disconnect(sock); return 0; } +#endif if (sock->AsyncMode) { // Confirmation of the error value if (e == SSL_ERROR_WANT_READ || e == SSL_ERROR_WANT_WRITE || e == SSL_ERROR_SSL) { + if (e == SSL_ERROR_SSL) + { + UINT ssl_err_no; + while (ssl_err_no = ERR_get_error()) { + Debug("%s %u SSL_ERROR_SSL on ASYNC socket !!! ssl_err_no = %u: '%s'\n", __FILE__, __LINE__, ssl_err_no, ERR_error_string(ssl_err_no, NULL)); + }; + + Disconnect(sock); + return 0; + } + sock->WriteBlocked = true; return SOCK_LATER; } - Debug("%s %u e=%u\n", __FILE__, __LINE__, e); } - //Debug("%s %u SecureSend() Disconnect\n", __FILE__, __LINE__); + Debug("%s %u e=%u SecureSend() Disconnect\n", __FILE__, __LINE__, e); Disconnect(sock); return 0; } diff --git a/src/bin/hamcore/strtable_ru.stb b/src/bin/hamcore/strtable_ru.stb index 5bc1653d..a384cb7f 100644 --- a/src/bin/hamcore/strtable_ru.stb +++ b/src/bin/hamcore/strtable_ru.stb @@ -115,7 +115,7 @@ ERR_48 Не удалось подключиться к контроллер ERR_49 Контроллеру кластера не удалось установить новую сессию в кластере. ERR_50 Не удается управлять Virtual Hub-ом сервера-члена кластера. ERR_51 Удаленное подключение запрещено, т.к. использован пустой пароль пользователя. Пустой пароль может быть разрешен только для соединений с локального хоста VPN-сервера (127.0.0.1). -ERR_52 Не достаточно прав. +ERR_52 Недостаточно прав. ERR_53 Указанный порт прослушивания не найден. ERR_54 Указанный порт прослушивания уже существует. ERR_55 Этот сервер не член кластера. @@ -2421,8 +2421,8 @@ STATIC17 Другие конфигурации: R_NO_ROUTING Не вносить изменения в таблицу маршрутизации STATIC18 Если у вас нет опыта работы с сетью и безопасностью, то оставьте настройки в этом окне по умолчанию. STATIC19 Функции VoIP/QoS обрабатывают пакеты (например VoIP) с высоким приоритетом для более быстрой передачи. -STATIC20 Source IP Address: -STATIC21 Source Port Number: +STATIC20 IP адрес источника: +STATIC21 Номер порта: R_DISABLE_QOS Отключить функции VoIP / QoS IDOK &OK IDCANCEL Отмена @@ -2524,7 +2524,7 @@ STATIC2 Имя Virtual &Hub: STATIC3 &Пользователь: STATIC4 &Старый пароль: STATIC5 &Новый пароль: -STATIC6 &Подтвердить новый пароль: +STATIC6 &Подтвердить пароль: IDOK &OK IDCANCEL Отмена S_STATIC Примечание: Вы не сможете изменить пароль пользователя, если выбран тип авторизации "RADIUS или авторизация в домене". @@ -2533,7 +2533,7 @@ S_STATIC Примечание: Вы не сможете изменить па PREFIX D_SM_MAIN CAPTION SoftEther VPN-сервер менеджер Developer Edition STATIC1 Настройки подключения для VPN-сервера: -STATIC2 Настройки подключения для VPN-сервера или VPN-моста. Чтобы подключиться к серверу дважды щелкните по его названию.\r\n Чтобы добавить новое подключение, нажмите "Новое подключение". +STATIC2 Настройки подключения для VPN-сервера или VPN-моста. Чтобы подключиться к серверу дважды щелкните по его названию.\r\nЧтобы добавить новое подключение, нажмите "Новое подключение". B_NEW_SETTING &Создать B_EDIT_SETTING &Изменить B_DELETE &Удалить @@ -2558,9 +2558,9 @@ STATIC8 Прокси-сервер: STATIC9 Вы можете подключиться к VPN-серверу через прокси-сервер. STATIC10 Тип прокси: R_DIRECT_TCP &Прямое TCP/IP соединение (без прокси) -R_HTTPS Подключиться через HTTP прокси-сервер -R_SOCKS Подключиться через SOCKS прокси-сервер -R_SOCKS5 Подключиться через SOCKS5 прокси-сервер +R_HTTPS Через HTTP прокси-сервер +R_SOCKS Через SOCKS прокси-сервер +R_SOCKS5 Через SOCKS5 прокси-сервер B_PROXY_CONFIG Настройки прокси-сервера STATIC11 Выберите режим администрирования и введите пароль STATIC12 Вы можете подключиться к VPN-серверу, используя либо режим администратора сервера, либо режим Virtual Hub администратора. \r\n\r\nРежим администратора сервера позволяет вам управлять VPN-сервером и всеми Virtual Hub. \r\n\r\nРежим Virtual Hub администратора позволяет вам управлять только одним Virtual Hub, на который у вас есть права. @@ -4111,7 +4111,7 @@ S_LATEST_STR Версия %S%s PREFIX D_UPDATE_CONFIG CAPTION Настройка уведомлений об обновлении -S_INFO Периодически проверяет новые версии %s и показывает уведомление, когда будет выпущена новая версия.\r\n\r\nДля проверки обновлений будут использоваться HTTPS пакеты между этим компьютером и сервером обновлений SoftEther, расположенным в городе Цукуба, префектура Ибараки, Япония. Никакая личная информация отправляться не будет. +S_INFO Периодически проверяет новые версии %s и показывает уведомление, когда будет выпущена новая версия.\r\n\r\nДля проверки обновлений будут использоваться HTTPS пакеты между этим компьютером и сервером обновлений SoftEther, расположенным в городе Цукуба, префектура Ибараки, Япония. Никакая личная информация отправляться не будет. S_TITLE %s настройки уведомлений об обновлении S_ENABLE &Включить проверку обновлений S_DISABLE &Отключить проверку обновлений diff --git a/src/bin/hamcore/wwwroot/admin/default/package-lock.json b/src/bin/hamcore/wwwroot/admin/default/package-lock.json index 65ae50a8..b15268b9 100644 --- a/src/bin/hamcore/wwwroot/admin/default/package-lock.json +++ b/src/bin/hamcore/wwwroot/admin/default/package-lock.json @@ -373,12 +373,23 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" + }, + "dependencies": { + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + } } }, "browserslist": { @@ -603,15 +614,6 @@ "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",