OpenVPN: Fix upload check for root and host certificate

Message ID 1529334637-31019-1-git-send-email-erik.kapfer@ipfire.org
State Accepted
Commit 87ea30ff5669c0174af3a481f31aba9f868101c6
Headers
Series OpenVPN: Fix upload check for root and host certificate |

Commit Message

Erik Kapfer June 19, 2018, 1:10 a.m. UTC
  Fix for #11766 .
Since the new OpenSSL output differs in the 'Subject' section, the regex needed to be adapted.
Old and new output should now be possible.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
---
 html/cgi-bin/ovpnmain.cgi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer June 19, 2018, 1:46 a.m. UTC | #1
Merged.

We are on fire today!

On Mon, 2018-06-18 at 17:10 +0200, Erik Kapfer wrote:
> Fix for #11766 .
> Since the new OpenSSL output differs in the 'Subject' section, the regex
> needed to be adapted.
> Old and new output should now be possible.
> 
> Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
> ---
>  html/cgi-bin/ovpnmain.cgi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> index b3122a4..947cbe9 100644
> --- a/html/cgi-bin/ovpnmain.cgi
> +++ b/html/cgi-bin/ovpnmain.cgi
> @@ -4045,7 +4045,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
>  	    }
>  
>  	    my $temp = `/usr/bin/openssl x509 -text -in
> ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
> -	    $temp =~ /Subject:.*CN=(.*)[\n]/;
> +	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
>  	    $temp = $1;
>  	    $temp =~ s+/Email+, E+;
>  	    $temp =~ s/ ST=/ S=/;
> @@ -4099,7 +4099,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
>  	    }
>  
>  	    my $temp = `/usr/bin/openssl x509 -text -in
> ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
> -	    $temp =~ /Subject:.*CN=(.*)[\n]/;
> +	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
>  	    $temp = $1;
>  	    $temp =~ s+/Email+, E+;
>  	    $temp =~ s/ ST=/ S=/;
  
Michael Tremer June 19, 2018, 1:52 a.m. UTC | #2
Actually. It doesn't apply against next... Can you check why?

On Mon, 2018-06-18 at 16:46 +0100, Michael Tremer wrote:
> Merged.
> 
> We are on fire today!
> 
> On Mon, 2018-06-18 at 17:10 +0200, Erik Kapfer wrote:
> > Fix for #11766 .
> > Since the new OpenSSL output differs in the 'Subject' section, the regex
> > needed to be adapted.
> > Old and new output should now be possible.
> > 
> > Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
> > ---
> >  html/cgi-bin/ovpnmain.cgi | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> > index b3122a4..947cbe9 100644
> > --- a/html/cgi-bin/ovpnmain.cgi
> > +++ b/html/cgi-bin/ovpnmain.cgi
> > @@ -4045,7 +4045,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
> >  	    }
> >  
> >  	    my $temp = `/usr/bin/openssl x509 -text -in
> > ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
> > -	    $temp =~ /Subject:.*CN=(.*)[\n]/;
> > +	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
> >  	    $temp = $1;
> >  	    $temp =~ s+/Email+, E+;
> >  	    $temp =~ s/ ST=/ S=/;
> > @@ -4099,7 +4099,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
> >  	    }
> >  
> >  	    my $temp = `/usr/bin/openssl x509 -text -in
> > ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
> > -	    $temp =~ /Subject:.*CN=(.*)[\n]/;
> > +	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
> >  	    $temp = $1;
> >  	    $temp =~ s+/Email+, E+;
> >  	    $temp =~ s/ ST=/ S=/;
  
ummeegge June 19, 2018, 2:30 a.m. UTC | #3
upps got a lot of conflicts,
but got an mail from patchwork that the last two patches has been
updated ? Should i nevertheless go for another commit ?

And yes we are on (IP)Fire :D ,

Best,

Erik

Am Montag, den 18.06.2018, 16:52 +0100 schrieb Michael Tremer:
> Actually. It doesn't apply against next... Can you check why?
> 
> On Mon, 2018-06-18 at 16:46 +0100, Michael Tremer wrote:
> > 
> > Merged.
> > 
> > We are on fire today!
> >
  
Michael Tremer June 19, 2018, 8:40 p.m. UTC | #4
?

On Mon, 2018-06-18 at 18:30 +0200, ummeegge wrote:
> upps got a lot of conflicts,
> but got an mail from patchwork that the last two patches has been
> updated ? Should i nevertheless go for another commit ?
> 
> And yes we are on (IP)Fire :D ,
> 
> Best,
> 
> Erik
> 
> Am Montag, den 18.06.2018, 16:52 +0100 schrieb Michael Tremer:
> > Actually. It doesn't apply against next... Can you check why?
> > 
> > On Mon, 2018-06-18 at 16:46 +0100, Michael Tremer wrote:
> > > 
> > > Merged.
> > > 
> > > We are on fire today!
> > > 
> 
>
  
ummeegge June 19, 2018, 10:02 p.m. UTC | #5
You´ve wrote before that the patch didn´t applied against next, is this
still the case ? Should i deliver it again ?

Am Dienstag, den 19.06.2018, 11:40 +0100 schrieb Michael Tremer:
> ?
>
  
Michael Tremer June 19, 2018, 11:01 p.m. UTC | #6
Yes please. I did not check why that is, so please double-check that we
apply what is needed :)

-Michael

On Tue, 2018-06-19 at 14:02 +0200, ummeegge wrote:
> You´ve wrote before that the patch didn´t applied against next, is this
> still the case ? Should i deliver it again ?
> 
> Am Dienstag, den 19.06.2018, 11:40 +0100 schrieb Michael Tremer:
> > ?
> > 
> 
>
  
ummeegge June 20, 2018, 12:10 a.m. UTC | #7
Have changed yesterday the dev working dir and can not reproduce this
one. Pulled the new changes and wanted to deliver this patch again but
it is already included also all patches seems to be included too,
currently not sure what happens there...

It seems that here is everything applied...


Am Dienstag, den 19.06.2018, 14:01 +0100 schrieb Michael Tremer:
> Yes please. I did not check why that is, so please double-check that
> we
> apply what is needed :)
> 
> -Michael
> 
> On Tue, 2018-06-19 at 14:02 +0200, ummeegge wrote:
> > 
> > You´ve wrote before that the patch didn´t applied against next, is
> > this
> > still the case ? Should i deliver it again ?
> > 
> > Am Dienstag, den 19.06.2018, 11:40 +0100 schrieb Michael Tremer:
> > > 
> > > ?
> > > 
> >
  

Patch

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index b3122a4..947cbe9 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -4045,7 +4045,7 @@  if ($cgiparams{'TYPE'} eq 'net') {
 	    }
 
 	    my $temp = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
-	    $temp =~ /Subject:.*CN=(.*)[\n]/;
+	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
 	    $temp = $1;
 	    $temp =~ s+/Email+, E+;
 	    $temp =~ s/ ST=/ S=/;
@@ -4099,7 +4099,7 @@  if ($cgiparams{'TYPE'} eq 'net') {
 	    }
 
 	    my $temp = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`;
-	    $temp =~ /Subject:.*CN=(.*)[\n]/;
+	    $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/;
 	    $temp = $1;
 	    $temp =~ s+/Email+, E+;
 	    $temp =~ s/ ST=/ S=/;