From mboxrd@z Thu Jan 1 00:00:00 1970 From: ummeegge To: development@lists.ipfire.org Subject: [PATCH v2 2/7] OpenVPN: Substitute --cipher with --data-cipher-fallback Date: Thu, 10 Dec 2020 16:59:20 +0000 Message-ID: <20201210165925.25037-2-erik.kapfer@ipfire.org> In-Reply-To: <20201210165925.25037-1-erik.kapfer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8623801490929696996==" List-Id: --===============8623801490929696996== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - Since --cipher is with OpenVPN version 2.5.0 deprecated and will be handled= via --data-cipher-fallback, the VAR name and the index has been kept but renamed from --cipher to --data-cipher-fallback. Old default AES-256-CBC has also been kept. - All old ciphers except the GCM familiy are included. Code is needed to change in server.conf the directive from 'cipher' to 'data-cipher-fallback' for the update process in update.sh. Code start block: /usr/local/bin/openvpnctrl -k > /dev/null if grep -q 'cipher' /var/ipfire/ovpn/server.conf; then sed -i 's/cipher/data-ciphers-fallback/' /var/ipfire/ovpn/server.conf fi /usr/local/bin/openvpnctrl -s > /dev/null Code block end Signed-off-by: ummeegge --- html/cgi-bin/ovpnmain.cgi | 109 +++++++++++++++----------------------- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + langs/es/cgi-bin/es.pl | 1 + langs/fr/cgi-bin/fr.pl | 1 + langs/it/cgi-bin/it.pl | 1 + langs/nl/cgi-bin/nl.pl | 1 + langs/pl/cgi-bin/pl.pl | 1 + langs/ru/cgi-bin/ru.pl | 1 + langs/tr/cgi-bin/tr.pl | 1 + 10 files changed, 53 insertions(+), 65 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 40ae58673..dbf8a8d2e 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -327,7 +327,7 @@ sub writeserverconf { }=09 print CONF "status-version 1\n"; print CONF "status /var/run/ovpnserver.log 30\n"; - print CONF "cipher $sovpnsettings{DCIPHER}\n"; + print CONF "data-ciphers-fallback $sovpnsettings{DCIPHER}\n"; =20 # Data channel encryption # Set seperator for data ciphers @@ -928,6 +928,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}= ) { if ($cgiparams{'ACTION'} eq $Lang::tr{'save-enc-options'}) { &General::readhash("${General::swroot}/ovpn/settings", \%vpnsettings); =20 + $vpnsettings{'DCIPHER'} =3D $cgiparams{'DCIPHER'}; $vpnsettings{'DATACIPHERS'} =3D $cgiparams{'DATACIPHERS'}; =20 # --data-ciphers needs at least one cipher @@ -1245,7 +1246,6 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgipa= rams{'TYPE'} eq '' && $cg $vpnsettings{'DDEST_PORT'} =3D $cgiparams{'DDEST_PORT'}; $vpnsettings{'DMTU'} =3D $cgiparams{'DMTU'}; $vpnsettings{'DCOMPLZO'} =3D $cgiparams{'DCOMPLZO'}; - $vpnsettings{'DCIPHER'} =3D $cgiparams{'DCIPHER'}; $vpnsettings{'DAUTH'} =3D $cgiparams{'DAUTH'}; $vpnsettings{'TLSAUTH'} =3D $cgiparams{'TLSAUTH'}; #wrtie enable @@ -2915,10 +2915,30 @@ END $key =3D &General::findhasharraykey (\%confighash); foreach my $i (39.. 45) { $confighash{$key}[$i] =3D ""; } } + $confighash{$key}[40] =3D $cgiparams{'DCIPHER'}; $confighash{$key}[42] =3D $cgiparams{'DATACIPHERS'}; =20 ADV_ENC_ERROR: =20 + # Set default for data-cipher-fallback (the old --cipher directive) + if ($cgiparams{'DCIPHER'} eq '') { + $cgiparams{'DCIPHER'} =3D 'AES-256-CBC'; #[40] + } + $checked{'DCIPHER'}{'AES-256-CBC'} =3D ''; + $checked{'DCIPHER'}{'AES-192-CBC'} =3D ''; + $checked{'DCIPHER'}{'AES-128-CBC'} =3D ''; + $checked{'DCIPHER'}{'CAMELLIA-256-CBC'} =3D ''; + $checked{'DCIPHER'}{'CAMELLIA-192-CBC'} =3D ''; + $checked{'DCIPHER'}{'CAMELLIA-128-CBC'} =3D ''; + $checked{'DCIPHER'}{'SEED-CBC'} =3D ''; + $checked{'DCIPHER'}{'DES-EDE3-CBC'} =3D ''; + $checked{'DCIPHER'}{'DESX-CBC'} =3D ''; + $checked{'DCIPHER'}{'DES-EDE-CBC'} =3D ''; + $checked{'DCIPHER'}{'BF-CBC'} =3D ''; + $checked{'DCIPHER'}{'CAST5-CBC'} =3D ''; + @temp =3D split('\|', $cgiparams{'DCIPHER'}); + foreach my $key (@temp) {$checked{'DCIPHER'}{$key} =3D "selected=3D'selecte= d'"; } + # Set default data channel ciphers if ($cgiparams{'DATACIPHERS'} eq '') { $cgiparams{'DATACIPHERS'} =3D 'ChaCha20-Poly1305|AES-256-GCM'; #[42]; @@ -2932,8 +2952,10 @@ ADV_ENC_ERROR: =20 # Save settings and display default if not configured if ($cgiparams{'ACTION'} eq $Lang::tr{'save-enc-options'}) { + $confighash{$cgiparams{'KEY'}}[40] =3D $cgiparams{'DCIPHER'}; $confighash{$cgiparams{'KEY'}}[42] =3D $cgiparams{'DATACIPHERS'}; } else { + $cgiparams{'DCIPHER'} =3D $vpnsettings{'DCIPHER'}; $cgiparams{'DATACIPHERS'} =3D $vpnsettings{'DATACIPHERS'}; } =20 @@ -2968,6 +2990,7 @@ ADV_ENC_ERROR: $Lang::tr{'ovpn data channel'} + $Lang::tr{'ovpn data channel fallback'} @@ -2981,7 +3004,25 @@ ADV_ENC_ERROR: + + + + +
@@ -4677,28 +4718,6 @@ if ($cgiparams{'TYPE'} eq 'net') { $checked{'MSSFIX'}{'on'} =3D ''; $checked{'MSSFIX'}{$cgiparams{'MSSFIX'}} =3D 'CHECKED'; =20 - $selected{'DCIPHER'}{'AES-256-GCM'} =3D ''; - $selected{'DCIPHER'}{'AES-192-GCM'} =3D ''; - $selected{'DCIPHER'}{'AES-128-GCM'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-256-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-192-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-128-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-256-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-192-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-128-CBC'} =3D ''; - $selected{'DCIPHER'}{'DESX-CBC'} =3D ''; - $selected{'DCIPHER'}{'SEED-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-EDE3-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-EDE-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAST5-CBC'} =3D ''; - $selected{'DCIPHER'}{'BF-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-CBC'} =3D ''; - # If no cipher has been chossen yet, select - # the old default (AES-256-CBC) for compatiblity reasons. - if ($cgiparams{'DCIPHER'} eq '') { - $cgiparams{'DCIPHER'} =3D 'AES-256-CBC'; - } - $selected{'DCIPHER'}{$cgiparams{'DCIPHER'}} =3D 'SELECTED'; $selected{'DAUTH'}{'whirlpool'} =3D ''; $selected{'DAUTH'}{'SHA512'} =3D ''; $selected{'DAUTH'}{'SHA384'} =3D ''; @@ -5236,9 +5255,6 @@ END } =20 #default setzen - if ($cgiparams{'DCIPHER'} eq '') { - $cgiparams{'DCIPHER'} =3D 'AES-256-CBC'; - } if ($cgiparams{'DDEST_PORT'} eq '') { $cgiparams{'DDEST_PORT'} =3D '1194'; } @@ -5280,24 +5296,6 @@ END $selected{'DPROTOCOL'}{'tcp'} =3D ''; $selected{'DPROTOCOL'}{$cgiparams{'DPROTOCOL'}} =3D 'SELECTED'; =20 - $selected{'DCIPHER'}{'AES-256-GCM'} =3D ''; - $selected{'DCIPHER'}{'AES-192-GCM'} =3D ''; - $selected{'DCIPHER'}{'AES-128-GCM'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-256-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-192-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAMELLIA-128-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-256-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-192-CBC'} =3D ''; - $selected{'DCIPHER'}{'AES-128-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-EDE3-CBC'} =3D ''; - $selected{'DCIPHER'}{'DESX-CBC'} =3D ''; - $selected{'DCIPHER'}{'SEED-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-EDE-CBC'} =3D ''; - $selected{'DCIPHER'}{'CAST5-CBC'} =3D ''; - $selected{'DCIPHER'}{'BF-CBC'} =3D ''; - $selected{'DCIPHER'}{'DES-CBC'} =3D ''; - $selected{'DCIPHER'}{$cgiparams{'DCIPHER'}} =3D 'SELECTED'; - $selected{'DAUTH'}{'whirlpool'} =3D ''; $selected{'DAUTH'}{'SHA512'} =3D ''; $selected{'DAUTH'}{'SHA384'} =3D ''; @@ -5427,26 +5425,6 @@ END - - $Lang::tr{'cipher'} - - =20
@@ -6002,3 +5980,4 @@ END =20 &Header::closepage(); =20 + diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 0d0705845..08827b08a 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1910,6 +1910,7 @@ 'ovpn crypt options' =3D> 'Kryptografieoptionen', 'ovpn data encryption' =3D> 'Daten-Kanal Verschl=C3=BCsselung', 'ovpn data channel' =3D> 'Daten-Kanal', +'ovpn data channel fallback' =3D> 'Daten-Kanal Fallback', 'ovpn device' =3D> 'OpenVPN-Ger=C3=A4t', 'ovpn dh' =3D> 'Diffie-Hellman-Parameter-L=C3=A4nge', 'ovpn dh new key' =3D> 'Neuen Diffie-Hellman Parameter erstellen', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index affa43cd3..880cae5f7 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1942,6 +1942,7 @@ 'ovpn crypt options' =3D> 'Cryptographic options', 'ovpn data encryption' =3D> 'Data-Channel encryption', 'ovpn data channel' =3D> 'Data-Channel', +'ovpn data channel fallback' =3D> 'Data-Channel fallback', 'ovpn device' =3D> 'OpenVPN device:', 'ovpn dh' =3D> 'Diffie-Hellman parameters length', 'ovpn dh new key' =3D> 'Generate new Diffie-Hellman parameters', diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl index 3d6efc21a..c86580e81 100644 --- a/langs/es/cgi-bin/es.pl +++ b/langs/es/cgi-bin/es.pl @@ -1333,6 +1333,7 @@ 'ovpn config' =3D> 'Configruaci=C3=B3n de OVPN', 'ovpn data encryption' =3D> 'Encriptaci=C3=B3n Data-Channel', 'ovpn data channel' =3D> 'Canal-Datos', +'ovpn data channel fallback' =3D> 'Retroceso Canal-Datos', 'ovpn device' =3D> 'Dispositivo OpenVPN', 'ovpn errmsg invalid data cipher input' =3D> 'El cifrado de datos necesita a= l menos de un cifrado', 'ovpn dl' =3D> 'Configuraci=C3=B3n de descargas OVPN', diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl index df19ef316..1a1f37cbe 100644 --- a/langs/fr/cgi-bin/fr.pl +++ b/langs/fr/cgi-bin/fr.pl @@ -1943,6 +1943,7 @@ 'ovpn crypt options' =3D> 'Options cryptographiques', 'ovpn data encryption' =3D> 'Chiffrage du canal de donn=C3=A9es', 'ovpn data channel' =3D> 'Canal de donn=C3=A9es', +'ovpn data channel fallback' =3D> 'Canal de donn=C3=A9es de repli', 'ovpn device' =3D> 'P=C3=A9riph=C3=A9rique OpenVPN :', 'ovpn dh' =3D> 'Longueur de param=C3=A8tres Diffie-Hellman ', 'ovpn dh new key' =3D> 'G=C3=A9n=C3=A9rer de nouveaux param=C3=A8tres Diffie= -Hellman ', diff --git a/langs/it/cgi-bin/it.pl b/langs/it/cgi-bin/it.pl index 1c190eff2..2c1dc9559 100644 --- a/langs/it/cgi-bin/it.pl +++ b/langs/it/cgi-bin/it.pl @@ -45,6 +45,7 @@ 'OVPN' =3D> 'OpenVPN', 'ovpn data encryption' =3D> 'Crittografia del canale dati', 'ovpn data channel' =3D> 'Canale-Dati', +'ovpn data channel fallback' =3D> 'Canale-Dati di riserva', 'ovpn advanced encryption' =3D> 'Impostazioni avanzate di crittografia', 'ovpn client version 25 cipher negotiation' =3D> 'Negozazione cirttografia', 'ovpn client version 25 warning' =3D> 'Disponibile con client 2.5.0 o pi=C3= =B9 recente', diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl index 8207399e2..635cbd3b8 100644 --- a/langs/nl/cgi-bin/nl.pl +++ b/langs/nl/cgi-bin/nl.pl @@ -1660,6 +1660,7 @@ 'ovpn config' =3D> 'OVPN-Configuratie', 'ovpn data encryption' =3D> 'Datakanaalversleuteling', 'ovpn data channel' =3D> 'Data-kanaal', +'ovpn data channel fallback' =3D> 'Data-Kanaal terugval', 'ovpn device' =3D> 'OpenVPN apparaat:', 'ovpn dl' =3D> 'OVPN-Configuratie download', 'ovpn errmsg green already pushed' =3D> 'Route voor het groene netwerk is al= tijd aangezet', diff --git a/langs/pl/cgi-bin/pl.pl b/langs/pl/cgi-bin/pl.pl index f9fbe57df..4ceaeef8a 100644 --- a/langs/pl/cgi-bin/pl.pl +++ b/langs/pl/cgi-bin/pl.pl @@ -1345,6 +1345,7 @@ 'ovpn config' =3D> 'OVPN-Konfig', 'ovpn data encryption' =3D> 'Szyfrowanie Kana=C5=82u-Danych', 'ovpn data channel' =3D> 'Kana=C5=82-Danych', +'ovpn data channel fallback' =3D> 'Awaria Kana=C5=82u-Danych', 'ovpn device' =3D> 'Urz=C4=85dzenie OpenVPN:', 'ovpn dl' =3D> 'Pobierz konfig OVPN', 'ovpn errmsg invalid data cipher input' =3D> 'Szyfr danych wymaga co najmnie= j jednego szyfru', diff --git a/langs/ru/cgi-bin/ru.pl b/langs/ru/cgi-bin/ru.pl index 700a8d838..1d81eb62c 100644 --- a/langs/ru/cgi-bin/ru.pl +++ b/langs/ru/cgi-bin/ru.pl @@ -1336,6 +1336,7 @@ 'ovpn config' =3D> '=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8 O= VPN', 'ovpn data encryption' =3D> '=D1=88=D0=B8=D1=84=D1=80=D0=BE=D0=B2=D0=B0=D0= =BD=D0=B8=D0=B5-=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D0=BE=D0=B2 =D0=B4=D0=B0=D0=BD= =D0=BD=D1=8B=D1=85', 'ovpn data channel' =3D> '=D0=98=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86= =D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B9-=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB', +'ovpn data channel fallback' =3D> '=D0=98=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0= =B0=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B9-=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB = =D0=BE=D1=82=D1=81=D1=82=D1=83=D0=BF=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5', 'ovpn device' =3D> '=D0=A3=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1=82=D0=B2= =D0=BE OpenVPN:', 'ovpn dl' =3D> '=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B0 =D0=BD=D0= =B0=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA OVPN', 'ovpn errmsg green already pushed' =3D> '=D0=9C=D0=B0=D1=80=D1=88=D1=80=D1= =83=D1=82 =D0=B4=D0=BB=D1=8F =D0=B7=D0=B5=D0=BB=D1=91=D0=BD=D0=BE=D0=B9 =D1= =81=D0=B5=D1=82=D0=B8 =D0=B2=D1=81=D0=B5=D0=B3=D0=B4=D0=B0 =D0=B2=D0=BA=D0=BB= =D1=8E=D1=87=D1=91=D0=BD', diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl index 0c64063c7..5fbd9f3d3 100644 --- a/langs/tr/cgi-bin/tr.pl +++ b/langs/tr/cgi-bin/tr.pl @@ -1842,6 +1842,7 @@ 'ovpn config' =3D> 'OVPN-Yap=C4=B1land=C4=B1rmas=C4=B1', 'ovpn crypt options' =3D> '=C5=9Eifreleme se=C3=A7enekleri', 'ovpn data channel' =3D> 'Veri-Kanal=C4=B1', +'ovpn data channel fallback' =3D> 'Veri-Kanal=C4=B1 geri d=C3=B6n=C3=BC=C5= =9F=C3=BC', 'ovpn data encryption' =3D> 'Veri-Kanal=C4=B1 =C5=9Fifreleme', 'ovpn device' =3D> 'OpenVPN ayg=C4=B1t=C4=B1:', 'ovpn dh' =3D> 'Diffie-Hellman parametre uzunlu=C4=9Fu', --=20 2.20.1 --===============8623801490929696996==--