mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:44:15 +00:00
Merge branch 'PurpleI2P:openssl' into openssl
This commit is contained in:
commit
6b81478bd2
11
.github/workflows/build-windows.yml
vendored
11
.github/workflows/build-windows.yml
vendored
@ -8,14 +8,14 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Building for ${{ matrix.arch }}
|
name: Building using ${{ matrix.arch }} toolchain
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include: [
|
include: [
|
||||||
{ msystem: MINGW64, arch: x86_64 },
|
{ msystem: MINGW64, arch: x86_64, arch_short: x64 },
|
||||||
{ msystem: MINGW32, arch: i686 }
|
{ msystem: MINGW32, arch: i686, arch_short: x86 }
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -25,11 +25,12 @@ jobs:
|
|||||||
msystem: ${{ matrix.msystem }}
|
msystem: ${{ matrix.msystem }}
|
||||||
install: base-devel mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-boost mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-miniupnpc
|
install: base-devel mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-boost mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-miniupnpc
|
||||||
update: true
|
update: true
|
||||||
- name: build application
|
- name: Build application
|
||||||
run: |
|
run: |
|
||||||
mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
|
mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
|
||||||
make USE_UPNP=yes DEBUG=no -j3
|
make USE_UPNP=yes DEBUG=no USE_GIT_VERSION=yes -j3
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
name: i2pd-${{ matrix.arch_short }}.exe
|
||||||
path: i2pd.exe
|
path: i2pd.exe
|
||||||
|
@ -78,7 +78,7 @@ ipv6 = false
|
|||||||
## Enable SSU transport (default = true)
|
## Enable SSU transport (default = true)
|
||||||
# ssu = true
|
# ssu = true
|
||||||
|
|
||||||
## Transit traffic bandwidth configuration
|
## Bandwidth configuration
|
||||||
## L limit bandwidth to 32KBs/sec, O - to 256KBs/sec, P - to 2048KBs/sec,
|
## L limit bandwidth to 32KBs/sec, O - to 256KBs/sec, P - to 2048KBs/sec,
|
||||||
## X - unlimited
|
## X - unlimited
|
||||||
## Default is X for floodfill, L for regular node
|
## Default is X for floodfill, L for regular node
|
||||||
@ -108,7 +108,8 @@ port = 7070
|
|||||||
# user = i2pd
|
# user = i2pd
|
||||||
# pass = changeme
|
# pass = changeme
|
||||||
## Select webconsole language
|
## Select webconsole language
|
||||||
## Currently supported english (default), afrikaans, russian, turkmen, ukrainian and uzbek languages
|
## Currently supported english (default), afrikaans, armenian, russian,
|
||||||
|
## turkmen, ukrainian and uzbek languages
|
||||||
# lang = english
|
# lang = english
|
||||||
|
|
||||||
[httpproxy]
|
[httpproxy]
|
||||||
|
215
i18n/Armenian.cpp
Normal file
215
i18n/Armenian.cpp
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021, The PurpleI2P Project
|
||||||
|
*
|
||||||
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
|
*
|
||||||
|
* See full license text in LICENSE file at top of project tree
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include "I18N.h"
|
||||||
|
|
||||||
|
// Armenian localization file
|
||||||
|
|
||||||
|
namespace i2p
|
||||||
|
{
|
||||||
|
namespace i18n
|
||||||
|
{
|
||||||
|
namespace armenian // language namespace
|
||||||
|
{
|
||||||
|
// language name in lowercase
|
||||||
|
static std::string language = "armenian";
|
||||||
|
|
||||||
|
// See for language plural forms here:
|
||||||
|
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
|
||||||
|
static int plural (int n) {
|
||||||
|
return n != 1 ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::map<std::string, std::string> strings
|
||||||
|
{
|
||||||
|
{"KiB", "ԿիԲ"},
|
||||||
|
{"MiB", "ՄիԲ"},
|
||||||
|
{"GiB", "ԳիԲ"},
|
||||||
|
{"building", "կառուցվում է"},
|
||||||
|
{"failed", "Անհաջող"},
|
||||||
|
{"expiring", "Լրանում է"},
|
||||||
|
{"established", "կարգավոյված է"},
|
||||||
|
{"unknown", "անհայտ"},
|
||||||
|
{"exploratory", "հետազոտոկան"},
|
||||||
|
{"<b>i2pd</b> webconsole", "Վեբ-կոնսոլ <b>i2pd</b>"},
|
||||||
|
{"Main page", "Գլխավոր էջ"},
|
||||||
|
{"Router commands", "Երթուղիչի հրահանգներ"},
|
||||||
|
{"Local Destinations", "Տեղական վերջնակետերը"},
|
||||||
|
{"LeaseSets", "ԼիզՍեթեր"},
|
||||||
|
{"Tunnels", "Թունելներ"},
|
||||||
|
{"Transit Tunnels", "Տարանցիկ թունելներ"},
|
||||||
|
{"Transports", "Տրանսպորտ"},
|
||||||
|
{"I2P tunnels", "I2P թունելներ"},
|
||||||
|
{"SAM sessions", "SAM նստաշրջաններ"},
|
||||||
|
{"ERROR", "ՍԽԱԼ"},
|
||||||
|
{"OK", "ԼԱՎ"},
|
||||||
|
{"Testing", "Փորձարկում"},
|
||||||
|
{"Firewalled", "Արգելափակված է դրսից"},
|
||||||
|
{"Unknown", "Անհայտ"},
|
||||||
|
{"Proxy", "Պրոկսի"},
|
||||||
|
{"Mesh", "MESH-ցանց"},
|
||||||
|
{"Error", "Սխալ"},
|
||||||
|
{"Clock skew", "Ոչ ճշգրիտ ժամանակ"},
|
||||||
|
{"Offline", "Օֆլայն"},
|
||||||
|
{"Symmetric NAT", "Սիմետրիկ NAT"},
|
||||||
|
{"Uptime", "Առկայություն"},
|
||||||
|
{"Network status", "Ցանցի կարգավիճակ"},
|
||||||
|
{"Network status v6", "Ցանցի կարգավիճակ v6"},
|
||||||
|
{"Stopping in", "Դադարում"},
|
||||||
|
{"Family", "Խմբատեսակ"},
|
||||||
|
{"Tunnel creation success rate", "Հաջողությամբ կառուցված թունելներ"},
|
||||||
|
{"Received", "Ստացվել է"},
|
||||||
|
{"KiB/s", "ԿիԲ/վ"},
|
||||||
|
{"Sent", "Ուղարկվել է"},
|
||||||
|
{"Transit", "Տարանցում"},
|
||||||
|
{"Data path", "Տվյալների ուղին"},
|
||||||
|
{"Hidden content. Press on text to see.", "Թաքցված բովանդակություն: Տեսնելու համար սեղմեկ տեքստին:"},
|
||||||
|
{"Router Ident", "Երթուղիչի նույնականացուցիչ"},
|
||||||
|
{"Router Family", "Երթուղիչի խումբը"},
|
||||||
|
{"Router Caps", "Երթուղիչի հատկություններ"},
|
||||||
|
{"Version", "Տարբերակ"},
|
||||||
|
{"Our external address", "Մեր արտաքին հասցեն"},
|
||||||
|
{"supported", "համատեղելի է"},
|
||||||
|
{"Routers", "Երթուղիչներ"},
|
||||||
|
{"Floodfills", "Floodfills-ներ"},
|
||||||
|
{"Client Tunnels", "Oգտատիրական թունելներ"},
|
||||||
|
{"Services", "Ծառայություններ"},
|
||||||
|
{"Enabled", "Միացված է"},
|
||||||
|
{"Disabled", "Անջատված է"},
|
||||||
|
{"Encrypted B33 address", "Գաղտնագրված B33 հասցեներ"},
|
||||||
|
{"Address registration line", "Հասցեի գրանցման տող"},
|
||||||
|
{"Domain", "Տիրույթ"},
|
||||||
|
{"Generate", "Գեներացնել"},
|
||||||
|
{"<b>Note:</b> result string can be used only for registering 2LD domains (example.i2p). For registering subdomains please use i2pd-tools.", "<b> Նշում. </b> արդյունքի տողը կարող է օգտագործվել միայն 2LD տիրույթներ գրանցելու համար (example.i2p): Ենթատիրույթներ գրանցելու համար խնդրում ենք օգտագործել i2pd-tools գործիքակազմը"},
|
||||||
|
{"Address", "Հասցե"},
|
||||||
|
{"Type", "Տեսակը"},
|
||||||
|
{"EncType", "Գաղտնագրի տեսակը"},
|
||||||
|
{"Inbound tunnels", "Մուտքային թունելներ"},
|
||||||
|
{"ms", "մլվ"},
|
||||||
|
{"Outbound tunnels", "Ելքային թունելներ"},
|
||||||
|
{"Tags", "Թեգեր"},
|
||||||
|
{"Incoming", "Մուտքային"},
|
||||||
|
{"Outgoing", "ելքային"},
|
||||||
|
{"Destination", "Նշանակման վայր"},
|
||||||
|
{"Amount", "Քանակ"},
|
||||||
|
{"Incoming Tags", "Մուտքային պիտակներ"},
|
||||||
|
{"Tags sessions", "Նստաշրջանի պիտակներ"},
|
||||||
|
{"Status", "Կարգավիճակ"},
|
||||||
|
{"Local Destination", "Տեղական նշանակման կետ"},
|
||||||
|
{"Streams", "Հոսքեր"},
|
||||||
|
{"Close stream", "Փակել հոսքը"},
|
||||||
|
{"I2CP session not found", "I2CP նստաշրջանը գոյություն չունի"},
|
||||||
|
{"I2CP is not enabled", "I2CP միացված է"},
|
||||||
|
{"Invalid", "Անվավեր"},
|
||||||
|
{"Store type", "Պահեստավորման տեսակը"},
|
||||||
|
{"Expires", "Սպառվում է"},
|
||||||
|
{"Non Expired Leases", "Չսպառված Lease-եր"},
|
||||||
|
{"Gateway", "Դարպաս"},
|
||||||
|
{"TunnelID", "Թունելի ID"},
|
||||||
|
{"EndDate", "Ավարտ"},
|
||||||
|
{"not floodfill", "ոչ floodfill-ներ"},
|
||||||
|
{"Queue size", "Հերթի չափսը"},
|
||||||
|
{"Run peer test", "Գործարկել փորձարկումը"},
|
||||||
|
{"Decline transit tunnels", "Մերժել տարանցիկ թունելներ"},
|
||||||
|
{"Accept transit tunnels", "Ընդունել տարանցիկ թունելներ"},
|
||||||
|
{"Cancel graceful shutdown", "Չեղարկել սահուն անջատումը"},
|
||||||
|
{"Start graceful shutdown", "Սկսել սահուն անջատումը"},
|
||||||
|
{"Force shutdown", "Հարկադիր անջատում"},
|
||||||
|
{"Reload external CSS styles", "Վերաբեռնեք CSS ոճաթերթը"},
|
||||||
|
{"<b>Note:</b> any action done here are not persistent and not changes your config files.", "<b> Նշում․ </b> այստեղ կատարված ցանկացած գործողություն մշտական չէ և չի փոխում ձեր կազմաձևման ֆայլերը։"},
|
||||||
|
{"Logging level", "Գրառման աստիճանը"},
|
||||||
|
{"Transit tunnels limit", "Տարանցիկ թունելների սահմանափակում"},
|
||||||
|
{"Change", "Փոփոխել"},
|
||||||
|
{"Change language", "Փոփոխել լեզուն"},
|
||||||
|
{"no transit tunnels currently built", "ընթացիկ կառուցված տարանցիկ թունելներ գոյություն չունեն"},
|
||||||
|
{"SAM disabled", "SAM-ն անջատված է"},
|
||||||
|
{"no sessions currently running", "ներկայումս գործող նստաշրջաններ գոյություն չունեն"},
|
||||||
|
{"SAM session not found", "SAM նստաշրջան գոյություն չունի"},
|
||||||
|
{"SAM Session", "SAM նստաշրջան"},
|
||||||
|
{"Server Tunnels", "Սերվերային թունելներ"},
|
||||||
|
{"Client Forwards", "Օգտատիրական փոխանցումներ"},
|
||||||
|
{"Server Forwards", "Սերվերային փոխանցումներ"},
|
||||||
|
{"Unknown page", "Անհայտ էջ"},
|
||||||
|
{"Invalid token", "Սխալ տոկեն"},
|
||||||
|
{"SUCCESS", "ՀԱՋՈՂՎԱԾ"},
|
||||||
|
{"Stream closed", "Հոսքն անջատված է"},
|
||||||
|
{"Stream not found or already was closed", "Հոսքը գոյություն չունի կամ արդեն ավարտված է"},
|
||||||
|
{"Destination not found", "Հասցեի վայրը չի գտնվել"},
|
||||||
|
{"StreamID can't be null", "StreamID-ն չի կարող լինել դատարկ"},
|
||||||
|
{"Return to destination page", "Վերադառնալ նախորդ էջի հասցե"},
|
||||||
|
{"You will be redirected in 5 seconds", "Դուք կտեղափոխվեք 5 վայրկյանից"},
|
||||||
|
{"Transit tunnels count must not exceed 65535", "Տարանցիկ թունելների քանակը չպետք է գերազանցի 65535-ը"},
|
||||||
|
{"Back to commands list", "Վերադառնալ հրահանգների ցուցակ"},
|
||||||
|
{"Register at reg.i2p", "Գրանցել reg.i2p-ում"},
|
||||||
|
{"Description", "Նկարագրություն"},
|
||||||
|
{"A bit information about service on domain", "Մի փոքր տեղեկատվություն տիրոիյթում գտնվող ծառայության մասին"},
|
||||||
|
{"Submit", "Ուղարկվել"},
|
||||||
|
{"Domain can't end with .b32.i2p", "Տիրույթը չպետք է վերջանա .b32.i2p-ով"},
|
||||||
|
{"Domain must end with .i2p", "Տիրույթը պետք է վերջանա .i2p-ով"},
|
||||||
|
{"Such destination is not found", "Այդիպսի հասցե գոյություն չունի"},
|
||||||
|
{"Unknown command", "Անհայտ հրահանգ"},
|
||||||
|
{"Command accepted", "Հրարահանգն ընդունված է"},
|
||||||
|
{"Proxy error", "Պրոկսի սխալ"},
|
||||||
|
{"Proxy info", "Պրոկսի տեղեկություն"},
|
||||||
|
{"Proxy error: Host not found", "Պրոկսի սխալ՝ նման հոսթ գոյություն չունի"},
|
||||||
|
{"Remote host not found in router's addressbook", "Դեպի հոսթ կատարված հարցումը գոյություն չունի երթուղիչի հասցեագրքում"},
|
||||||
|
{"You may try to find this host on jump services below", "Ստորև Դուք կարող եք գտնել այս հոսթը jump ծառայությունների միջոցով"},
|
||||||
|
{"Invalid request", "Սխալ հարցում"},
|
||||||
|
{"Proxy unable to parse your request", "Պրոկսին չի կարող հասկանալ Ձեր հարցումը"},
|
||||||
|
{"addresshelper is not supported", "addresshelper-ը համատեղելի չէ"},
|
||||||
|
{"Host", "Հոսթ"},
|
||||||
|
{"added to router's addressbook from helper", "Ավելացված է երթուղիչի հասցեագրքում helper-ի միջոցով"},
|
||||||
|
{"Click here to proceed:", "Շարունակելու համար սեղմեք այստեղ"},
|
||||||
|
{"Continue", "Շարունակել"},
|
||||||
|
{"Addresshelper found", "addresshelper-ը գնտված է"},
|
||||||
|
{"already in router's addressbook", "արդեն առկա է երթուղիչի հասցեագրքում"},
|
||||||
|
{"Click here to update record:", "Սեղմեկ այստեղ որպեսզի թարվացնեք գրառումը"},
|
||||||
|
{"invalid request uri", "Սխալ ձևավորված URI հարցում"},
|
||||||
|
{"Can't detect destination host from request", "Չհաջողվեց հայնտաբերեկ վայրի հասցեն նշված հարցմամբ"},
|
||||||
|
{"Outproxy failure", "Սխալ արտաքին պրոքսի"},
|
||||||
|
{"bad outproxy settings", "Սխալ արտաքին պրոկսի կարգավորումներ"},
|
||||||
|
{"not inside I2P network, but outproxy is not enabled", "Հարցումը I2P ցանցից դուրս է, բայց արտաքին պրոքսին միացված չէ"},
|
||||||
|
{"unknown outproxy url", "արտաքին պրոքսիի անհայտ URL"},
|
||||||
|
{"cannot resolve upstream proxy", "Չհաջողվեց որոշել վերադաս պրոկսին"},
|
||||||
|
{"hostname too long", "Հոսթի անունը չափազանց երկար է"},
|
||||||
|
{"cannot connect to upstream socks proxy", "չհաջողվեց միանալ վերադաս socks պրոկսիին"},
|
||||||
|
{"Cannot negotiate with socks proxy", "Չհաջողվեց պայմանավորվել վերադաս socks պրոկսիի հետ"},
|
||||||
|
{"CONNECT error", "Սխալ CONNECT հարցում"},
|
||||||
|
{"Failed to Connect", "Միանալ չhաջողվեց"},
|
||||||
|
{"socks proxy error", "Սխալ SOCKS պրոկսի"},
|
||||||
|
{"failed to send request to upstream", "Չհաջողվեց հարցումն ուղարկել վերադաս պրոկսիին"},
|
||||||
|
{"No Reply From socks proxy", "Բացակայում է պատասխանը SOCKS պրոկսի սերվերի կողմից"},
|
||||||
|
{"cannot connect", "Հնարավոր չե միանալ"},
|
||||||
|
{"http out proxy not implemented", "Արտաքին http պրոկսին դեռ իրականացված չէ"},
|
||||||
|
{"cannot connect to upstream http proxy", "Չհաջողվեց միանալ վերադաս http պրոկսի սերվերին"},
|
||||||
|
{"Host is down", "Հոսթն անհասանելի է"},
|
||||||
|
{"Can't create connection to requested host, it may be down. Please try again later.", "Հոսթի հետ կապը հաստատել չհաջողվեց, հնարավոր է այն անջատված է, փորձեք միանալ քիչ ուշ"},
|
||||||
|
{"", ""},
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::map<std::string, std::vector<std::string>> plurals
|
||||||
|
{
|
||||||
|
{"days", {"օր", "օր"}},
|
||||||
|
{"hours", {"ժամ", "ժամ"}},
|
||||||
|
{"minutes", {"րոպե", "րոպե"}},
|
||||||
|
{"seconds", {"վարկյան", "վարկյան"}},
|
||||||
|
{"", {"", ""}},
|
||||||
|
};
|
||||||
|
|
||||||
|
std::shared_ptr<const i2p::i18n::Locale> GetLocale()
|
||||||
|
{
|
||||||
|
return std::make_shared<i2p::i18n::Locale>(language, strings, plurals, [] (int n)->int { return plural(n); });
|
||||||
|
}
|
||||||
|
|
||||||
|
} // language
|
||||||
|
} // i18n
|
||||||
|
} // i2p
|
@ -72,6 +72,7 @@ namespace i18n
|
|||||||
|
|
||||||
// Add localization here with language name as namespace
|
// Add localization here with language name as namespace
|
||||||
namespace afrikaans { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
namespace afrikaans { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
||||||
|
namespace armenian { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
||||||
namespace english { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
namespace english { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
||||||
namespace russian { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
namespace russian { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
||||||
namespace turkmen { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
namespace turkmen { std::shared_ptr<const i2p::i18n::Locale> GetLocale (); }
|
||||||
@ -84,6 +85,7 @@ namespace i18n
|
|||||||
static std::map<std::string, langData> languages
|
static std::map<std::string, langData> languages
|
||||||
{
|
{
|
||||||
{ "afrikaans", {"Afrikaans", "af", i2p::i18n::afrikaans::GetLocale} },
|
{ "afrikaans", {"Afrikaans", "af", i2p::i18n::afrikaans::GetLocale} },
|
||||||
|
{ "armenian", {"հայերէն", "hy", i2p::i18n::armenian::GetLocale} },
|
||||||
{ "english", {"English", "en", i2p::i18n::english::GetLocale} },
|
{ "english", {"English", "en", i2p::i18n::english::GetLocale} },
|
||||||
{ "russian", {"русский язык", "ru", i2p::i18n::russian::GetLocale} },
|
{ "russian", {"русский язык", "ru", i2p::i18n::russian::GetLocale} },
|
||||||
{ "turkmen", {"türkmen dili", "tk", i2p::i18n::turkmen::GetLocale} },
|
{ "turkmen", {"türkmen dili", "tk", i2p::i18n::turkmen::GetLocale} },
|
||||||
|
@ -26,7 +26,7 @@ namespace russian // language namespace
|
|||||||
// See for language plural forms here:
|
// See for language plural forms here:
|
||||||
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
|
// https://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
|
||||||
static int plural (int n) {
|
static int plural (int n) {
|
||||||
return n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
|
return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::map<std::string, std::string> strings
|
static std::map<std::string, std::string> strings
|
||||||
|
@ -106,7 +106,7 @@ namespace crypto
|
|||||||
BN_CTX * m_Ctx;
|
BN_CTX * m_Ctx;
|
||||||
uint8_t m_PrivateKey[32];
|
uint8_t m_PrivateKey[32];
|
||||||
#endif
|
#endif
|
||||||
bool m_IsElligatorIneligible = false; // true if definitly ineligible
|
bool m_IsElligatorIneligible = false; // true if definitely ineligible
|
||||||
};
|
};
|
||||||
|
|
||||||
// ElGamal
|
// ElGamal
|
||||||
|
@ -271,7 +271,7 @@ namespace garlic
|
|||||||
(*numCloves)++;
|
(*numCloves)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg) // clove message ifself if presented
|
if (msg) // clove message itself if presented
|
||||||
{
|
{
|
||||||
size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false);
|
size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false);
|
||||||
(*numCloves)++;
|
(*numCloves)++;
|
||||||
@ -542,7 +542,7 @@ namespace garlic
|
|||||||
auto session = std::make_shared<ECIESX25519AEADRatchetSession> (this, false); // incoming
|
auto session = std::make_shared<ECIESX25519AEADRatchetSession> (this, false); // incoming
|
||||||
if (!session->HandleNextMessage (buf, length, nullptr, 0))
|
if (!session->HandleNextMessage (buf, length, nullptr, 0))
|
||||||
{
|
{
|
||||||
// try to gererate more tags for last tagset
|
// try to generate more tags for last tagset
|
||||||
if (m_LastTagset && (m_LastTagset->GetNextIndex () - m_LastTagset->GetTrimBehind () < 3*ECIESX25519_MAX_NUM_GENERATED_TAGS))
|
if (m_LastTagset && (m_LastTagset->GetNextIndex () - m_LastTagset->GetTrimBehind () < 3*ECIESX25519_MAX_NUM_GENERATED_TAGS))
|
||||||
{
|
{
|
||||||
uint64_t missingTag; memcpy (&missingTag, buf, 8);
|
uint64_t missingTag; memcpy (&missingTag, buf, 8);
|
||||||
|
@ -681,7 +681,7 @@ namespace transport
|
|||||||
auto addr = ri.GetNTCP2AddressWithStaticKey (m_Establisher->m_RemoteStaticKey);
|
auto addr = ri.GetNTCP2AddressWithStaticKey (m_Establisher->m_RemoteStaticKey);
|
||||||
if (!addr)
|
if (!addr)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "NTCP2: No NTCP2 address wth static key found in SessionConfirmed");
|
LogPrint (eLogError, "NTCP2: No NTCP2 address with static key found in SessionConfirmed");
|
||||||
Terminate ();
|
Terminate ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -973,7 +973,7 @@ namespace transport
|
|||||||
{
|
{
|
||||||
// allocate send buffer
|
// allocate send buffer
|
||||||
m_NextSendBuffer = new uint8_t[287]; // can be any size > 16, we just allocate 287 frequently
|
m_NextSendBuffer = new uint8_t[287]; // can be any size > 16, we just allocate 287 frequently
|
||||||
// crate padding block
|
// create padding block
|
||||||
auto paddingLen = CreatePaddingBlock (totalLen, m_NextSendBuffer, 287 - 16);
|
auto paddingLen = CreatePaddingBlock (totalLen, m_NextSendBuffer, 287 - 16);
|
||||||
// and padding block to encrypt and send
|
// and padding block to encrypt and send
|
||||||
if (paddingLen)
|
if (paddingLen)
|
||||||
|
@ -1261,7 +1261,7 @@ namespace data
|
|||||||
return it->second;
|
return it->second;
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
// still not found, try from the begining
|
// still not found, try from the beginning
|
||||||
it = m_RouterInfos.begin ();
|
it = m_RouterInfos.begin ();
|
||||||
while (it != it1 && it != m_RouterInfos.end ())
|
while (it != it1 && it != m_RouterInfos.end ())
|
||||||
{
|
{
|
||||||
@ -1269,7 +1269,7 @@ namespace data
|
|||||||
return it->second;
|
return it->second;
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
// still not found, try to the begining
|
// still not found, try to the beginning
|
||||||
it = it2;
|
it = it2;
|
||||||
while (it != m_RouterInfos.end ())
|
while (it != m_RouterInfos.end ())
|
||||||
{
|
{
|
||||||
|
@ -1020,7 +1020,7 @@ namespace transport
|
|||||||
void SSUSession::ProcessPeerTest (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& senderEndpoint)
|
void SSUSession::ProcessPeerTest (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& senderEndpoint)
|
||||||
{
|
{
|
||||||
uint32_t nonce = bufbe32toh (buf); // 4 bytes
|
uint32_t nonce = bufbe32toh (buf); // 4 bytes
|
||||||
boost::asio::ip::address addr; // Alice's addresss
|
boost::asio::ip::address addr; // Alice's address
|
||||||
uint16_t port = 0; // and port
|
uint16_t port = 0; // and port
|
||||||
auto size = ExtractIPAddressAndPort (buf + 4, len - 4, addr, port);
|
auto size = ExtractIPAddressAndPort (buf + 4, len - 4, addr, port);
|
||||||
if (port && (size != 7) && (size != 19))
|
if (port && (size != 7) && (size != 19))
|
||||||
|
@ -102,7 +102,7 @@ namespace stream
|
|||||||
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream::Terminate (bool deleteFromDestination) // shoudl be called from StreamingDestination::Stop only
|
void Stream::Terminate (bool deleteFromDestination) // should be called from StreamingDestination::Stop only
|
||||||
{
|
{
|
||||||
m_Status = eStreamStatusTerminated;
|
m_Status = eStreamStatusTerminated;
|
||||||
m_AckSendTimer.cancel ();
|
m_AckSendTimer.cancel ();
|
||||||
|
@ -111,7 +111,7 @@ namespace stream
|
|||||||
buf = new uint8_t[len];
|
buf = new uint8_t[len];
|
||||||
memcpy (buf, b, len);
|
memcpy (buf, b, len);
|
||||||
}
|
}
|
||||||
SendBuffer (size_t l): // creat empty buffer
|
SendBuffer (size_t l): // create empty buffer
|
||||||
len(l), offset (0)
|
len(l), offset (0)
|
||||||
{
|
{
|
||||||
buf = new uint8_t[len];
|
buf = new uint8_t[len];
|
||||||
@ -366,7 +366,7 @@ namespace stream
|
|||||||
handler (boost::asio::error::make_error_code (boost::asio::error::timed_out), received);
|
handler (boost::asio::error::make_error_code (boost::asio::error::timed_out), received);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// itermediate iterrupt
|
// itermediate interrupt
|
||||||
SendUpdatedLeaseSet (); // send our leaseset if applicable
|
SendUpdatedLeaseSet (); // send our leaseset if applicable
|
||||||
AsyncReceive (buffer, handler, remainingTimeout);
|
AsyncReceive (buffer, handler, remainingTimeout);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace tunnel
|
|||||||
m_NumReceivedBytes += TUNNEL_DATA_MSG_SIZE;
|
m_NumReceivedBytes += TUNNEL_DATA_MSG_SIZE;
|
||||||
|
|
||||||
uint8_t * decrypted = msg->GetPayload () + 20; // 4 + 16
|
uint8_t * decrypted = msg->GetPayload () + 20; // 4 + 16
|
||||||
uint8_t * zero = (uint8_t *)memchr (decrypted + 4, 0, TUNNEL_DATA_ENCRYPTED_SIZE - 4); // witout 4-byte checksum
|
uint8_t * zero = (uint8_t *)memchr (decrypted + 4, 0, TUNNEL_DATA_ENCRYPTED_SIZE - 4); // without 4-byte checksum
|
||||||
if (zero)
|
if (zero)
|
||||||
{
|
{
|
||||||
uint8_t * fragment = zero + 1;
|
uint8_t * fragment = zero + 1;
|
||||||
|
@ -49,7 +49,7 @@ namespace tunnel
|
|||||||
|
|
||||||
void HandleFollowOnFragment (uint32_t msgID, bool isLastFragment, uint8_t fragmentNum, const uint8_t * fragment, size_t size);
|
void HandleFollowOnFragment (uint32_t msgID, bool isLastFragment, uint8_t fragmentNum, const uint8_t * fragment, size_t size);
|
||||||
bool ConcatFollowOnFragment (TunnelMessageBlockEx& msg, const uint8_t * fragment, size_t size) const; // true if success
|
bool ConcatFollowOnFragment (TunnelMessageBlockEx& msg, const uint8_t * fragment, size_t size) const; // true if success
|
||||||
void HandleCurrenMessageFollowOnFragment (const uint8_t * frgament, size_t size, bool isLastFragment);
|
void HandleCurrenMessageFollowOnFragment (const uint8_t * fragment, size_t size, bool isLastFragment);
|
||||||
void HandleNextMessage (const TunnelMessageBlock& msg);
|
void HandleNextMessage (const TunnelMessageBlock& msg);
|
||||||
|
|
||||||
void AddOutOfSequenceFragment (uint32_t msgID, uint8_t fragmentNum, bool isLastFragment, const uint8_t * fragment, size_t size);
|
void AddOutOfSequenceFragment (uint32_t msgID, uint8_t fragmentNum, bool isLastFragment, const uint8_t * fragment, size_t size);
|
||||||
|
@ -63,7 +63,7 @@ namespace client
|
|||||||
const char BOB_HELP_OUTPORT[] = "outport <PORT_NUMBER> - Set the outbound port that nickname contacts.";
|
const char BOB_HELP_OUTPORT[] = "outport <PORT_NUMBER> - Set the outbound port that nickname contacts.";
|
||||||
const char BOB_HELP_INHOST[] = "inhost <HOSTNAME|IP> - Set the inbound hostname or IP.";
|
const char BOB_HELP_INHOST[] = "inhost <HOSTNAME|IP> - Set the inbound hostname or IP.";
|
||||||
const char BOB_HELP_INPORT[] = "inport <PORT_NUMBER> - Set the inbound port number nickname listens on.";
|
const char BOB_HELP_INPORT[] = "inport <PORT_NUMBER> - Set the inbound port number nickname listens on.";
|
||||||
const char BOB_HELP_QUIET[] = "quiet <True|False> - Wether to send the incoming destination.";
|
const char BOB_HELP_QUIET[] = "quiet <True|False> - Whether to send the incoming destination.";
|
||||||
const char BOB_HELP_LOOKUP[] = "lookup <I2P_HOSTNAME> - Look up an I2P hostname.";
|
const char BOB_HELP_LOOKUP[] = "lookup <I2P_HOSTNAME> - Look up an I2P hostname.";
|
||||||
const char BOB_HELP_CLEAR[] = "clear - Clear the current nickname out of the list.";
|
const char BOB_HELP_CLEAR[] = "clear - Clear the current nickname out of the list.";
|
||||||
const char BOB_HELP_LIST[] = "list - List all tunnels.";
|
const char BOB_HELP_LIST[] = "list - List all tunnels.";
|
||||||
|
@ -205,7 +205,7 @@ namespace client
|
|||||||
}
|
}
|
||||||
else // closed by peer
|
else // closed by peer
|
||||||
{
|
{
|
||||||
// get remaning data
|
// get remaining data
|
||||||
auto len = m_Stream->ReadSome (m_StreamBuffer, I2P_TUNNEL_CONNECTION_BUFFER_SIZE);
|
auto len = m_Stream->ReadSome (m_StreamBuffer, I2P_TUNNEL_CONNECTION_BUFFER_SIZE);
|
||||||
if (len > 0) // still some data
|
if (len > 0) // still some data
|
||||||
Write (m_StreamBuffer, len);
|
Write (m_StreamBuffer, len);
|
||||||
|
@ -936,7 +936,7 @@ namespace client
|
|||||||
else // closed by peer
|
else // closed by peer
|
||||||
{
|
{
|
||||||
uint8_t * buff = new uint8_t[SAM_SOCKET_BUFFER_SIZE];
|
uint8_t * buff = new uint8_t[SAM_SOCKET_BUFFER_SIZE];
|
||||||
// get remaning data
|
// get remaining data
|
||||||
auto len = m_Stream->ReadSome (buff, SAM_SOCKET_BUFFER_SIZE);
|
auto len = m_Stream->ReadSome (buff, SAM_SOCKET_BUFFER_SIZE);
|
||||||
if (len > 0) // still some data
|
if (len > 0) // still some data
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// See swig.org for more inteface options,
|
// See swig.org for more interface options,
|
||||||
// e.g. map std::string to Go string
|
// e.g. map std::string to Go string
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user