/[gentoo-x86]/eclass/ssl-cert.eclass
Gentoo

Diff of /eclass/ssl-cert.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.17 Revision 1.19
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.17 2009/09/16 20:11:17 mrness Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.19 2011/08/22 04:46:32 vapier Exp $
4# 4
5# @ECLASS: ssl-cert.eclass 5# @ECLASS: ssl-cert.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# @AUTHOR:
7# Author: Max Kalika <max@gentoo.org> 8# Max Kalika <max@gentoo.org>
8# @BLURB: Eclass for SSL certificates 9# @BLURB: Eclass for SSL certificates
9# @DESCRIPTION: 10# @DESCRIPTION:
10# This eclass implements a standard installation procedure for installing 11# This eclass implements a standard installation procedure for installing
11# self-signed SSL certificates. 12# self-signed SSL certificates.
12# @EXAMPLE: 13# @EXAMPLE:
46 47
47 # Create the CA serial file 48 # Create the CA serial file
48 echo "01" > "${SSL_SERIAL}" 49 echo "01" > "${SSL_SERIAL}"
49 50
50 # Create the config file 51 # Create the config file
51 ebegin "Generating OpenSSL configuration" 52 ebegin "Generating OpenSSL configuration${1:+ for CA}"
52 cat <<-EOF > "${SSL_CONF}" 53 cat <<-EOF > "${SSL_CONF}"
53 [ req ] 54 [ req ]
54 prompt = no 55 prompt = no
55 default_bits = ${SSL_BITS} 56 default_bits = ${SSL_BITS}
56 distinguished_name = req_dn 57 distinguished_name = req_dn
58 C = ${SSL_COUNTRY} 59 C = ${SSL_COUNTRY}
59 ST = ${SSL_STATE} 60 ST = ${SSL_STATE}
60 L = ${SSL_LOCALITY} 61 L = ${SSL_LOCALITY}
61 O = ${SSL_ORGANIZATION} 62 O = ${SSL_ORGANIZATION}
62 OU = ${SSL_UNIT} 63 OU = ${SSL_UNIT}
63 CN = ${SSL_COMMONNAME} 64 CN = ${SSL_COMMONNAME}${1:+ CA}
64 emailAddress = ${SSL_EMAIL} 65 emailAddress = ${SSL_EMAIL}
65 EOF 66 EOF
66 eend $? 67 eend $?
67 68
68 return $? 69 return $?
189 unpack|compile|test|install) 190 unpack|compile|test|install)
190 eerror "install_cert cannot be called in ${EBUILD_PHASE}" 191 eerror "install_cert cannot be called in ${EBUILD_PHASE}"
191 return 1 ;; 192 return 1 ;;
192 esac 193 esac
193 194
194 # Initialize configuration 195 # Generate a CA environment #164601
195 gen_cnf || return 1 196 gen_cnf 1 || return 1
196 echo
197
198 # Generate a CA environment
199 gen_key 1 || return 1 197 gen_key 1 || return 1
200 gen_csr 1 || return 1 198 gen_csr 1 || return 1
201 gen_crt 1 || return 1 199 gen_crt 1 || return 1
200 echo
201
202 gen_cnf || return 1
202 echo 203 echo
203 204
204 local count=0 205 local count=0
205 for cert in "$@" ; do 206 for cert in "$@" ; do
206 # Check the requested certificate 207 # Check the requested certificate

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20