public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: Adolf Belka <adolf.belka@ipfire.org>
Cc: development@lists.ipfire.org
Subject: Re: [RFC PATCH] ovpnmain.cgi: Replace the ncp-disable with data-ciphers server entry
Date: Wed, 24 Sep 2025 11:17:56 +0100	[thread overview]
Message-ID: <DD38EBA4-01EF-4AA8-99B8-6CD7BA0A5E51@ipfire.org> (raw)
In-Reply-To: <20250828102908.2602-1-adolf.belka@ipfire.org>

Hello Adolf,

Sorry for digging this up so late…

You are right that we cannot use ncp-disable at all any more with newer clients. However, there is no chance for a user to disable NCP on the server side any more. So we can simply remove the case of not having any ciphers set because that should never ever exist. I added this here:

  https://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff;h=d6ec7e0bf08a00c734c9e7b5f7c517ef82029afe

I had this in the back of my mind that this needed fixing, but I completely forgot that you sent this.

You still sent me down the right way.

-Michael

> On 28 Aug 2025, at 11:29, Adolf Belka <adolf.belka@ipfire.org> wrote:
> 
> - If a backup from before openvpn-2.6 is restored then the server.conf file has
>   ncp-disable still in it. Also data-ciphers in server.conf and DATACIPHERS in settings
>   will not be present.
> - The existing code checks if DATACIPHERS is empty and if it is then it puts ncp-disable
>   into server.conf which we no longer need to have.
> - This patch changes this code section so that if DATACIPHERS is empty then it has the
>   default ciphers added into server.conf and then also updates the DATACIPHERS entry
>   in the settings file.
> - I have made this an RFC patch as the patch does work but it might not be the correct
>   or best way to go about this.
> - If it is accepted then the previous patches I did for backup.pl and update.sh can be
>   reverted.
> - The change was tested out with the reverted backup.pl and all old backup versions
>   were successfully restored correctly and worked as expected. Also tested out the
>   change with a backup from CU197 and that restore also worked correctly.
> 
> Tested-by: Adolf Belka <adolf.belka@ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
> html/cgi-bin/ovpnmain.cgi | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> index dfe7f8ad5..8c908d725 100644
> --- a/html/cgi-bin/ovpnmain.cgi
> +++ b/html/cgi-bin/ovpnmain.cgi
> @@ -291,8 +291,14 @@ sub writeserverconf {
>     print CONF "status $RW_STATUS 30\n";
> 
> # Cryptography
> +
> + # Previous ncp-disable server conf will have an empty DATACIPHERS entry
> + # This will occur with restores from prior to OpenVPN-2.6
> + # Replace the empty DATACIPHERS entry with the default value
> if ($vpnsettings{'DATACIPHERS'} eq '') {
> - print CONF "ncp-disable\n";
> + print CONF "data-ciphers " . "AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305" . "\n";
> + $vpnsettings{'DATACIPHERS'} = "AES-256-GCM|AES-128-GCM|CHACHA20-POLY1305";
> + &General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
> } else {
> print CONF "data-ciphers " . $vpnsettings{'DATACIPHERS'} =~ s/\|/:/gr . "\n";
> }
> -- 
> 2.51.0
> 
> 



      reply	other threads:[~2025-09-24 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 10:29 Adolf Belka
2025-09-24 10:17 ` Michael Tremer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DD38EBA4-01EF-4AA8-99B8-6CD7BA0A5E51@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox