Gentoo Archives: gentoo-commits

From: "Peter Volkov (pva)" <pva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ssl-cert.eclass
Date: Tue, 16 Feb 2010 14:23:45
Message-Id: E1NhOKy-0003ij-A3@stork.gentoo.org
1 pva 10/02/16 14:23:40
2
3 Modified: ssl-cert.eclass
4 Log:
5 Use different CN for CA and certificate itself, fixes #164601, thank David Sperling for description and James Le Cuirot for fix.
6
7 Revision Changes Path
8 1.18 eclass/ssl-cert.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ssl-cert.eclass?rev=1.18&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ssl-cert.eclass?rev=1.18&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ssl-cert.eclass?r1=1.17&r2=1.18
13
14 Index: ssl-cert.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v
17 retrieving revision 1.17
18 retrieving revision 1.18
19 diff -u -r1.17 -r1.18
20 --- ssl-cert.eclass 16 Sep 2009 20:11:17 -0000 1.17
21 +++ ssl-cert.eclass 16 Feb 2010 14:23:39 -0000 1.18
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2004 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.17 2009/09/16 20:11:17 mrness Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.18 2010/02/16 14:23:39 pva Exp $
27 #
28 # @ECLASS: ssl-cert.eclass
29 # @MAINTAINER:
30 @@ -48,7 +48,7 @@
31 echo "01" > "${SSL_SERIAL}"
32
33 # Create the config file
34 - ebegin "Generating OpenSSL configuration"
35 + ebegin "Generating OpenSSL configuration${1:+ for CA}"
36 cat <<-EOF > "${SSL_CONF}"
37 [ req ]
38 prompt = no
39 @@ -60,7 +60,7 @@
40 L = ${SSL_LOCALITY}
41 O = ${SSL_ORGANIZATION}
42 OU = ${SSL_UNIT}
43 - CN = ${SSL_COMMONNAME}
44 + CN = ${SSL_COMMONNAME}${1:+ CA}
45 emailAddress = ${SSL_EMAIL}
46 EOF
47 eend $?
48 @@ -191,16 +191,16 @@
49 return 1 ;;
50 esac
51
52 - # Initialize configuration
53 - gen_cnf || return 1
54 - echo
55 -
56 - # Generate a CA environment
57 + # Generate a CA environment #164601
58 + gen_cnf 1 || return 1
59 gen_key 1 || return 1
60 gen_csr 1 || return 1
61 gen_crt 1 || return 1
62 echo
63
64 + gen_cnf || return 1
65 + echo
66 +
67 local count=0
68 for cert in "$@" ; do
69 # Check the requested certificate