From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 1/2] ovpnmain.cgi: Fix detection of used DH key lenght.
Date: Mon, 21 Jun 2021 17:45:05 +0200 [thread overview]
Message-ID: <20210621154506.2482-1-stefan.schantl@ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]
Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
html/cgi-bin/ovpnmain.cgi | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 023000dd5..5af1b807e 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -221,14 +221,23 @@ sub pkiconfigcheck
# Warning if DH parameter is 1024 bit
if (-f "${General::swroot}/ovpn/ca/$cgiparams{'DH_NAME'}") {
my @dhparameter = &General::system_output("/usr/bin/openssl", "dhparam", "-text", "-in", "${General::swroot}/ovpn/ca/$cgiparams{'DH_NAME'}");
+ my $dhbit;
+ # Loop through the output and search for the DH bit lenght.
foreach my $line (@dhparameter) {
- my @dhbit = ($line =~ /(\d+)/);
- if ($1 < 2048) {
- $cryptoerror = "$Lang::tr{'ovpn error dh'}";
- goto CRYPTO_ERROR;
+ if ($line =~ (/(\d+)/)) {
+ # Assign match to dhbit value.
+ $dhbit = $1;
+
+ last;
}
}
+
+ # Check if the used key lenght is at least 2048 bit.
+ if ($dhbit < 2048) {
+ $cryptoerror = "$Lang::tr{'ovpn error dh'}";
+ goto CRYPTO_ERROR;
+ }
}
# Warning if md5 is in usage
--
2.20.1
next reply other threads:[~2021-06-21 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 15:45 Stefan Schantl [this message]
2021-06-21 15:45 ` [PATCH 2/2] ovpnmain.cgi: Call correct system_output() function Stefan Schantl
2021-06-21 19:45 ` Michael Tremer
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=20210621154506.2482-1-stefan.schantl@ipfire.org \
--to=stefan.schantl@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