From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH v3 1/3] vpnmain.cgi: set SubjectAlternativeName default during root certificate generation
Date: Wed, 08 Jan 2020 10:58:12 +0000 [thread overview]
Message-ID: <B273EBE4-ADAD-48F5-9107-1648FC9076DD@ipfire.org> (raw)
In-Reply-To: <09672616-f2e0-2f1e-6d38-a30d5d70dae5@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 3863 bytes --]
Hi,
I am not sure about the change of behaviour here.
I thought the consensus in the telephone conference was to always set it to the FQDN of the IPFire box and accept any additional values from the user. So it will always be set.
The code looks like it does not do that.
Did I get it wrong what we agreed on in the end?
-Michael
> On 7 Jan 2020, at 21:47, Peter Müller <peter.mueller(a)ipfire.org> wrote:
>
> Some IPsec implementations such as OpenIKED require SubjectAlternativeName
> data on certificates and refuse to establish connections otherwise.
>
> The StrongSwan project also recommends it (see:
> https://wiki.strongswan.org/projects/strongswan/wiki/SimpleCA) although
> it is currently not enforced by their IPsec software.
>
> For convenience purposes and to raise awareness, this patch adds a default
> SubjectAlternativeName based on the machines hostname or IP address. Existing
> certificates remain unchanged for obvious reasons.
>
> The third version of this patch fixes a duplicate DNS query reported by Michael.
>
> Fixes #11594
>
> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
> Cc: Michael Tremer <michael.tremer(a)ipfire.org>
> ---
> html/cgi-bin/vpnmain.cgi | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
> index 33b504bc9..43cdc5aa0 100644
> --- a/html/cgi-bin/vpnmain.cgi
> +++ b/html/cgi-bin/vpnmain.cgi
> @@ -2,7 +2,7 @@
> ###############################################################################
> # #
> # IPFire.org - A linux based firewall #
> -# Copyright (C) 2007-2019 IPFire Team info(a)ipfire.org #
> +# Copyright (C) 2007-2020 IPFire Team <info(a)ipfire.org> #
> # #
> # This program is free software: you can redistribute it and/or modify #
> # it under the terms of the GNU General Public License as published by #
> @@ -822,8 +822,10 @@ END
> close IPADDR;
> chomp ($ipaddr);
> $cgiparams{'ROOTCERT_HOSTNAME'} = (gethostbyaddr(pack("C4", split(/\./, $ipaddr)), 2))[0];
> + $cgiparams{'SUBJECTALTNAME'} = "DNS:" . $cgiparams{'ROOTCERT_HOSTNAME'};
> if ($cgiparams{'ROOTCERT_HOSTNAME'} eq '') {
> $cgiparams{'ROOTCERT_HOSTNAME'} = $ipaddr;
> + $cgiparams{'SUBJECTALTNAME'} = "IP:" . $cgiparams{'ROOTCERT_HOSTNAME'};
> }
> }
> $cgiparams{'ROOTCERT_COUNTRY'} = $vpnsettings{'ROOTCERT_COUNTRY'} if (!$cgiparams{'ROOTCERT_COUNTRY'});
> @@ -975,6 +977,11 @@ END
> # IP: an IP address
> # example: email:franck(a)foo.com,IP:10.0.0.10,DNS:franck.foo.com
>
> + if ($cgiparams{'SUBJECTALTNAME'} eq '') {
> + $errormessage = $Lang::tr{'vpn subjectaltname missing'};
> + goto ROOTCERT_ERROR;
> + }
> +
> if ($cgiparams{'SUBJECTALTNAME'} ne '' && $cgiparams{'SUBJECTALTNAME'} !~ /^(email|URI|DNS|RID|IP):[a-zA-Z0-9 :\/,\.\-_@]*$/) {
> $errormessage = $Lang::tr{'vpn altname syntax'};
> goto VPNCONF_ERROR;
> @@ -1129,7 +1136,7 @@ END
> }
> print <<END
> </select></td></tr>
> - <tr><td class='base'>$Lang::tr{'vpn subjectaltname'} (subjectAltName=email:*,URI:*,DNS:*,RID:*)</td>
> + <tr><td class='base'>$Lang::tr{'vpn subjectaltname'} (subjectAltName=email:*,URI:*,DNS:*,RID:*) <img src='/blob.gif' alt='*' /></td>
> <td class='base' nowrap='nowrap'><input type='text' name='SUBJECTALTNAME' value='$cgiparams{'SUBJECTALTNAME'}' size='32' /></td></tr>
> <tr><td> </td>
> <td><br /><input type='submit' name='ACTION' value='$Lang::tr{'generate root/host certificates'}' /><br /><br /></td></tr>
> --
> 2.16.4
>
next prev parent reply other threads:[~2020-01-08 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-05 17:54 [PATCH] vpnmain.cgi: set SubjectAlternativeName default during root, " Peter Müller
2020-01-05 18:11 ` [PATCH v2] vpnmain.cgi: set SubjectAlternativeName default during root " Peter Müller
2020-01-06 11:15 ` Michael Tremer
2020-01-06 19:26 ` Peter Müller
2020-01-07 21:47 ` [PATCH v3 1/3] " Peter Müller
2020-01-07 21:47 ` [PATCH v3 2/3] update translation files for vpnmain.cgi changes Peter Müller
2020-01-07 21:48 ` [PATCH v3 3/3] Core Update 140: ship changed vpnmain.cgi Peter Müller
2020-01-08 10:58 ` Michael Tremer [this message]
2020-01-09 15:20 ` [PATCH v3 1/3] vpnmain.cgi: set SubjectAlternativeName default during root certificate generation Peter Müller
2020-01-13 12:37 ` 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=B273EBE4-ADAD-48F5-9107-1648FC9076DD@ipfire.org \
--to=michael.tremer@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