add missing check for Curve25519 in vpnmain.cgi

Message ID 20171008204110.2569252c.peter.mueller@link38.eu
State Accepted
Headers
Series add missing check for Curve25519 in vpnmain.cgi |

Commit Message

Peter Müller Oct. 9, 2017, 5:41 a.m. UTC
  This fixes bug #11501 which causes IPsec connections to crash if
Curve25519 has been enabled.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
  

Comments

Michael Tremer Oct. 10, 2017, 12:55 a.m. UTC | #1
Hi,

I am quite surprised that I didn't notice this earlier, but thanks for sending
in the patch.

I fixed the whitespace because you indented with spaces and sometimes tabs where
we only use tabs.

Best,
-Michael

On Sun, 2017-10-08 at 20:41 +0200, Peter Müller wrote:
> This fixes bug #11501 which causes IPsec connections to crash if
> Curve25519 has been enabled.
> 
> Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> ---
> diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
> index f9508b53d..25551008f 100644
> --- a/html/cgi-bin/vpnmain.cgi
> +++ b/html/cgi-bin/vpnmain.cgi
> @@ -3125,6 +3125,8 @@ sub make_algos($$$$$) {
>  
>  					if ($grp =~ m/^e(.*)$/) {
>  						push(@algo, "ecp$1");
> +					} elsif ($grp =~ m/curve25519/) {
> +                                                push(@algo, "$grp");
>  					} else {
>  						push(@algo, "modp$grp");
>  					}
> @@ -3140,6 +3142,8 @@ sub make_algos($$$$$) {
>  						# noop
>  					} elsif ($grp =~ m/^e(.*)$/) {
>  						push(@algo, "ecp$1");
> +                                        } elsif ($grp =~ m/curve25519/) {
> +                                                push(@algo, "$grp");
>  					} else {
>  						push(@algo, "modp$grp");
>  					}
  

Patch

diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
index f9508b53d..25551008f 100644
--- a/html/cgi-bin/vpnmain.cgi
+++ b/html/cgi-bin/vpnmain.cgi
@@ -3125,6 +3125,8 @@  sub make_algos($$$$$) {
 
 					if ($grp =~ m/^e(.*)$/) {
 						push(@algo, "ecp$1");
+					} elsif ($grp =~ m/curve25519/) {
+                                                push(@algo, "$grp");
 					} else {
 						push(@algo, "modp$grp");
 					}
@@ -3140,6 +3142,8 @@  sub make_algos($$$$$) {
 						# noop
 					} elsif ($grp =~ m/^e(.*)$/) {
 						push(@algo, "ecp$1");
+                                        } elsif ($grp =~ m/curve25519/) {
+                                                push(@algo, "$grp");
 					} else {
 						push(@algo, "modp$grp");
 					}