head	1.2;
access;
symbols
	RELENG_8_4:1.2.0.2
	RELENG_9_1_0_RELEASE:1.1.1.4
	RELENG_9_1:1.1.1.4.0.28
	RELENG_9_1_BP:1.1.1.4
	RELENG_8_3_0_RELEASE:1.1.1.4
	RELENG_8_3:1.1.1.4.0.26
	RELENG_8_3_BP:1.1.1.4
	RELENG_9_0_0_RELEASE:1.1.1.4
	RELENG_9_0:1.1.1.4.0.24
	RELENG_9_0_BP:1.1.1.4
	RELENG_9:1.1.1.4.0.22
	RELENG_9_BP:1.1.1.4
	RELENG_7_4_0_RELEASE:1.1.1.4
	RELENG_8_2_0_RELEASE:1.1.1.4
	RELENG_7_4:1.1.1.4.0.20
	RELENG_7_4_BP:1.1.1.4
	RELENG_8_2:1.1.1.4.0.18
	RELENG_8_2_BP:1.1.1.4
	RELENG_8_1_0_RELEASE:1.1.1.4
	RELENG_8_1:1.1.1.4.0.16
	RELENG_8_1_BP:1.1.1.4
	RELENG_7_3_0_RELEASE:1.1.1.4
	RELENG_7_3:1.1.1.4.0.14
	RELENG_7_3_BP:1.1.1.4
	RELENG_8_0_0_RELEASE:1.1.1.4
	RELENG_8_0:1.1.1.4.0.12
	RELENG_8_0_BP:1.1.1.4
	RELENG_8:1.1.1.4.0.10
	RELENG_8_BP:1.1.1.4
	RELENG_7_2_0_RELEASE:1.1.1.4
	RELENG_7_2:1.1.1.4.0.8
	RELENG_7_2_BP:1.1.1.4
	RELENG_7_1_0_RELEASE:1.1.1.4
	RELENG_6_4_0_RELEASE:1.1.1.3
	RELENG_7_1:1.1.1.4.0.6
	RELENG_7_1_BP:1.1.1.4
	RELENG_6_4:1.1.1.3.0.26
	RELENG_6_4_BP:1.1.1.3
	RELENG_7_0_0_RELEASE:1.1.1.4
	RELENG_6_3_0_RELEASE:1.1.1.3
	RELENG_7_0:1.1.1.4.0.4
	RELENG_7_0_BP:1.1.1.4
	RELENG_6_3:1.1.1.3.0.24
	RELENG_6_3_BP:1.1.1.3
	RELENG_7:1.1.1.4.0.2
	RELENG_7_BP:1.1.1.4
	v0_9_8e:1.1.1.4
	RELENG_6_2_0_RELEASE:1.1.1.3
	RELENG_6_2:1.1.1.3.0.22
	RELENG_6_2_BP:1.1.1.3
	v0_9_8d:1.1.1.4
	v0_9_8b:1.1.1.4
	RELENG_5_5_0_RELEASE:1.1.1.3
	RELENG_5_5:1.1.1.3.0.20
	RELENG_5_5_BP:1.1.1.3
	RELENG_6_1_0_RELEASE:1.1.1.3
	RELENG_6_1:1.1.1.3.0.18
	RELENG_6_1_BP:1.1.1.3
	RELENG_6_0_0_RELEASE:1.1.1.3
	RELENG_6_0:1.1.1.3.0.16
	RELENG_6_0_BP:1.1.1.3
	RELENG_6:1.1.1.3.0.14
	RELENG_6_BP:1.1.1.3
	RELENG_5_4_0_RELEASE:1.1.1.3
	RELENG_5_4:1.1.1.3.0.12
	RELENG_5_4_BP:1.1.1.3
	v0_9_7e:1.1.1.3
	RELENG_4_11_0_RELEASE:1.1.1.1.2.2
	RELENG_4_11:1.1.1.1.2.2.0.10
	RELENG_4_11_BP:1.1.1.1.2.2
	RELENG_5_3_0_RELEASE:1.1.1.3
	RELENG_5_3:1.1.1.3.0.10
	RELENG_5_3_BP:1.1.1.3
	RELENG_5:1.1.1.3.0.8
	RELENG_5_BP:1.1.1.3
	RELENG_4_10_0_RELEASE:1.1.1.1.2.2
	RELENG_4_10:1.1.1.1.2.2.0.8
	RELENG_4_10_BP:1.1.1.1.2.2
	v0_9_7d:1.1.1.3
	RELENG_5_2_1_RELEASE:1.1.1.3
	RELENG_5_2_0_RELEASE:1.1.1.3
	RELENG_5_2:1.1.1.3.0.6
	RELENG_5_2_BP:1.1.1.3
	RELENG_4_9_0_RELEASE:1.1.1.1.2.2
	RELENG_4_9:1.1.1.1.2.2.0.6
	RELENG_4_9_BP:1.1.1.1.2.2
	v0_9_7c:1.1.1.3
	RELENG_5_1_0_RELEASE:1.1.1.3
	RELENG_5_1:1.1.1.3.0.4
	RELENG_5_1_BP:1.1.1.3
	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1;
locks; strict;
comment	@# @;


1.2
date	2012.07.12.19.30.53;	author jkim;	state dead;
branches
	1.2.2.1;
next	1.1;

1.1
date	2000.01.10.06.22.02;	author kris;	state Exp;
branches
	1.1.1.1;
next	;

1.2.2.1
date	2012.07.12.19.30.53;	author svnexp;	state dead;
branches;
next	1.2.2.2;

1.2.2.2
date	2013.03.28.13.02.40;	author svnexp;	state Exp;
branches;
next	;

1.1.1.1
date	2000.01.10.06.22.02;	author kris;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2000.04.13.06.32.53;	author kris;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2002.01.27.03.13.00;	author kris;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2006.07.29.19.10.21;	author simon;	state Exp;
branches;
next	;

1.1.1.1.2.1
date	2000.08.20.08.47.04;	author kris;	state Exp;
branches
	1.1.1.1.2.1.4.1
	1.1.1.1.2.1.6.1
	1.1.1.1.2.1.8.1;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2002.07.30.22.06.05;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.1.4.1
date	2002.07.31.16.41.24;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.1.6.1
date	2002.07.31.14.05.30;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.1.8.1
date	2002.07.31.02.55.09;	author nectar;	state Exp;
branches;
next	;


desc
@@


1.2
log
@SVN rev 238405 on 2012-07-12 19:30:53Z by jkim

Merge OpenSSL 1.0.1c.

Approved by:	benl (maintainer)
@
text
@#!/bin/sh

digest='-mdc2'
reqcmd="../apps/openssl req"
x509cmd="../apps/openssl x509 $digest"
verifycmd="../apps/openssl verify"
dummycnf="../apps/openssl.cnf"

CAkey="keyCA.ss"
CAcert="certCA.ss"
CAreq="reqCA.ss"
CAconf="CAss.cnf"
CAreq2="req2CA.ss"	# temp

Uconf="Uss.cnf"
Ukey="keyU.ss"
Ureq="reqU.ss"
Ucert="certU.ss"

echo
echo "make a certificate request using 'req'"
$reqcmd -config $CAconf -out $CAreq -keyout $CAkey -new #>err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a certificate request"
	exit 1
fi
echo
echo "convert the certificate request into a self signed certificate using 'x509'"
$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to self sign a certificate request"
	exit 1
fi

echo
echo "convert a certificate into a certificate request using 'x509'"
$x509cmd -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' convert a certificate to a certificate request"
	exit 1
fi

$reqcmd -config $dummycnf -verify -in $CAreq -noout
if [ $? != 0 ]; then
	echo first generated request is invalid
	exit 1
fi

$reqcmd -config $dummycnf -verify -in $CAreq2 -noout
if [ $? != 0 ]; then
	echo second generated request is invalid
	exit 1
fi

$verifycmd -CAfile $CAcert $CAcert
if [ $? != 0 ]; then
	echo first generated cert is invalid
	exit 1
fi

echo
echo "make another certificate request using 'req'"
$reqcmd -config $Uconf -out $Ureq -keyout $Ukey -new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a certificate request"
	exit 1
fi

echo
echo "sign certificate request with the just created CA via 'x509'"
$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a certificate request"
	exit 1
fi

$verifycmd -CAfile $CAcert $Ucert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert

echo
echo The generated CA certificate is $CAcert
echo The generated CA private key is $CAkey

echo The generated user certificate is $Ucert
echo The generated user private key is $Ukey

/bin/rm err.ss
exit 0
@


1.2.2.1
log
@file testss was added on branch RELENG_8_4 on 2013-03-28 13:02:40 +0000
@
text
@d1 90
@


1.2.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 163
#!/bin/sh

digest='-sha1'
reqcmd="../util/shlib_wrap.sh ../apps/openssl req"
x509cmd="../util/shlib_wrap.sh ../apps/openssl x509 $digest"
verifycmd="../util/shlib_wrap.sh ../apps/openssl verify"
dummycnf="../apps/openssl.cnf"

CAkey="keyCA.ss"
CAcert="certCA.ss"
CAreq="reqCA.ss"
CAconf="CAss.cnf"
CAreq2="req2CA.ss"	# temp

Uconf="Uss.cnf"
Ukey="keyU.ss"
Ureq="reqU.ss"
Ucert="certU.ss"

P1conf="P1ss.cnf"
P1key="keyP1.ss"
P1req="reqP1.ss"
P1cert="certP1.ss"
P1intermediate="tmp_intP1.ss"

P2conf="P2ss.cnf"
P2key="keyP2.ss"
P2req="reqP2.ss"
P2cert="certP2.ss"
P2intermediate="tmp_intP2.ss"

echo
echo "make a certificate request using 'req'"

echo "string to make the random number generator think it has entropy" >> ./.rnd

if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
  req_new='-newkey dsa:../apps/dsa512.pem'
else
  req_new='-new'
fi

$reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new #>err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a certificate request"
	exit 1
fi
echo
echo "convert the certificate request into a self signed certificate using 'x509'"
$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to self sign a certificate request"
	exit 1
fi

echo
echo "convert a certificate into a certificate request using 'x509'"
$x509cmd -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' convert a certificate to a certificate request"
	exit 1
fi

$reqcmd -config $dummycnf -verify -in $CAreq -noout
if [ $? != 0 ]; then
	echo first generated request is invalid
	exit 1
fi

$reqcmd -config $dummycnf -verify -in $CAreq2 -noout
if [ $? != 0 ]; then
	echo second generated request is invalid
	exit 1
fi

$verifycmd -CAfile $CAcert $CAcert
if [ $? != 0 ]; then
	echo first generated cert is invalid
	exit 1
fi

echo
echo "make a user certificate request using 'req'"
$reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a user certificate request"
	exit 1
fi

echo
echo "sign user certificate request with the just created CA via 'x509'"
$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a user certificate request"
	exit 1
fi

$verifycmd -CAfile $CAcert $Ucert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert

echo
echo "make a proxy certificate request using 'req'"
$reqcmd -config $P1conf -out $P1req -keyout $P1key $req_new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a proxy certificate request"
	exit 1
fi

echo
echo "sign proxy certificate request with the just created user certificate via 'x509'"
$x509cmd -CAcreateserial -in $P1req -days 30 -req -out $P1cert -CA $Ucert -CAkey $Ukey -extfile $P1conf -extensions v3_proxy >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a proxy certificate request"
	exit 1
fi

cat $Ucert > $P1intermediate
$verifycmd -CAfile $CAcert -untrusted $P1intermediate $P1cert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $P1cert

echo
echo "make another proxy certificate request using 'req'"
$reqcmd -config $P2conf -out $P2req -keyout $P2key $req_new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate another proxy certificate request"
	exit 1
fi

echo
echo "sign second proxy certificate request with the first proxy certificate via 'x509'"
$x509cmd -CAcreateserial -in $P2req -days 30 -req -out $P2cert -CA $P1cert -CAkey $P1key -extfile $P2conf -extensions v3_proxy >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a second proxy certificate request"
	exit 1
fi

cat $Ucert $P1cert > $P2intermediate
$verifycmd -CAfile $CAcert -untrusted $P2intermediate $P2cert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $P2cert

echo
echo The generated CA certificate is $CAcert
echo The generated CA private key is $CAkey

echo The generated user certificate is $Ucert
echo The generated user private key is $Ukey

echo The first generated proxy certificate is $P1cert
echo The first generated proxy private key is $P1key

echo The second generated proxy certificate is $P2cert
echo The second generated proxy private key is $P2key

/bin/rm err.ss
#/bin/rm $P1intermediate
#/bin/rm $P2intermediate
exit 0
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Initial import of OpenSSL 0.9.4, sans IDEA and RSA code for patent
infringement reasons.
@
text
@@


1.1.1.1.2.1
log
@MFC: OpenSSL 0.9.5a
@
text
@d3 1
a3 1
digest='-md5'
d22 1
a22 8

if ../apps/openssl no-rsa; then
  req_new='-newkey dsa:../apps/dsa512.pem'
else
  req_new='-new'
fi

$reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new #>err.ss
d63 1
a63 1
$reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss
@


1.1.1.1.2.1.4.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a22 2
echo "string to make the random number generator think it has entropy" >> ./.rnd

@


1.1.1.1.2.1.6.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a22 2
echo "string to make the random number generator think it has entropy" >> ./.rnd

@


1.1.1.1.2.1.8.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a22 2
echo "string to make the random number generator think it has entropy" >> ./.rnd

@


1.1.1.1.2.2
log
@MFC: OpenSSL 0.9.6e
@
text
@a22 2
echo "string to make the random number generator think it has entropy" >> ./.rnd

@


1.1.1.2
log
@Initial import of OpenSSL 0.9.5a
@
text
@d3 1
a3 1
digest='-md5'
d22 1
a22 8

if ../apps/openssl no-rsa; then
  req_new='-newkey dsa:../apps/dsa512.pem'
else
  req_new='-new'
fi

$reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new #>err.ss
d63 1
a63 1
$reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss
@


1.1.1.3
log
@Initial import of OpenSSL 0.9.6c
@
text
@a22 2
echo "string to make the random number generator think it has entropy" >> ./.rnd

@


1.1.1.4
log
@Vendor import of OpenSSL 0.9.8b
@
text
@d3 4
a6 4
digest='-sha1'
reqcmd="../util/shlib_wrap.sh ../apps/openssl req"
x509cmd="../util/shlib_wrap.sh ../apps/openssl x509 $digest"
verifycmd="../util/shlib_wrap.sh ../apps/openssl verify"
a19 12
P1conf="P1ss.cnf"
P1key="keyP1.ss"
P1req="reqP1.ss"
P1cert="certP1.ss"
P1intermediate="tmp_intP1.ss"

P2conf="P2ss.cnf"
P2key="keyP2.ss"
P2req="reqP2.ss"
P2cert="certP2.ss"
P2intermediate="tmp_intP2.ss"

d25 1
a25 1
if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
d38 1
a38 1
$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca >err.ss
d71 1
a71 1
echo "make a user certificate request using 'req'"
d74 1
a74 1
	echo "error using 'req' to generate a user certificate request"
d79 2
a80 2
echo "sign user certificate request with the just created CA via 'x509'"
$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee >err.ss
d82 1
a82 1
	echo "error using 'x509' to sign a user certificate request"
a91 44
echo "make a proxy certificate request using 'req'"
$reqcmd -config $P1conf -out $P1req -keyout $P1key $req_new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate a proxy certificate request"
	exit 1
fi

echo
echo "sign proxy certificate request with the just created user certificate via 'x509'"
$x509cmd -CAcreateserial -in $P1req -days 30 -req -out $P1cert -CA $Ucert -CAkey $Ukey -extfile $P1conf -extensions v3_proxy >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a proxy certificate request"
	exit 1
fi

cat $Ucert > $P1intermediate
$verifycmd -CAfile $CAcert -untrusted $P1intermediate $P1cert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $P1cert

echo
echo "make another proxy certificate request using 'req'"
$reqcmd -config $P2conf -out $P2req -keyout $P2key $req_new >err.ss
if [ $? != 0 ]; then
	echo "error using 'req' to generate another proxy certificate request"
	exit 1
fi

echo
echo "sign second proxy certificate request with the first proxy certificate via 'x509'"
$x509cmd -CAcreateserial -in $P2req -days 30 -req -out $P2cert -CA $P1cert -CAkey $P1key -extfile $P2conf -extensions v3_proxy >err.ss
if [ $? != 0 ]; then
	echo "error using 'x509' to sign a second proxy certificate request"
	exit 1
fi

cat $Ucert $P1cert > $P2intermediate
$verifycmd -CAfile $CAcert -untrusted $P2intermediate $P2cert
echo
echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $P2cert

echo
a97 6
echo The first generated proxy certificate is $P1cert
echo The first generated proxy private key is $P1key

echo The second generated proxy certificate is $P2cert
echo The second generated proxy private key is $P2key

a98 2
#/bin/rm $P1intermediate
#/bin/rm $P2intermediate
@


