Skip to content

Commit 25f28af

Browse files
committed
make_sni.sh test -- Accomodate for platforms which do not have RANDOM in their sh(1) implementation - rely on the pid and a not so random prefix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757851 13f79535-47bb-0310-9956-ffa450edef68
1 parent a7dee94 commit 25f28af

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

test/make_sni.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ mkdir -p ${DIR}/ssl ${DIR}/htdocs ${DIR}/logs || exit 1
121121
# keyUsage = cRLSign, keyCertSign values. This is fine
122122
# for most browsers.
123123
#
124-
serial=$RANDOM
124+
serial=$RANDOM$$
125+
125126
openssl req -new -nodes -batch \
126127
-x509 \
127128
-days 10 -subj '/CN=Da Root/O=SNI testing/' -set_serial $serial \
@@ -134,13 +135,13 @@ mkdir -p ${CDIR}
134135
#
135136
openssl req -new -nodes -batch \
136137
-x509 \
137-
-days 10 -subj '/CN=Da Second Root/O=SNI user access I/' -set_serial $RANDOM \
138+
-days 10 -subj '/CN=Da Second Root/O=SNI user access I/' -set_serial 2$serial$$\
138139
-keyout ${CDIR}/xs-root-1.key -out ${CDIR}/xs-root-1.pem \
139140
|| exit 2
140141

141142
openssl req -new -nodes -batch \
142143
-x509 \
143-
-days 10 -subj '/CN=Da Second Root/O=SNI user access II/' -set_serial $RANDOM \
144+
-days 10 -subj '/CN=Da Second Root/O=SNI user access II/' -set_serial 3$serial$$ \
144145
-keyout ${CDIR}/xs-root-2.key -out ${CDIR}/xs-root-2.pem \
145146
|| exit 2
146147

@@ -169,7 +170,7 @@ do
169170
#
170171
openssl x509 -text -req \
171172
-CA ${CDIR}/xs-root-$i.pem -CAkey ${CDIR}/xs-root-$i.key \
172-
-set_serial $RANDOM -in ${CDIR}/client-$i.req -out ${CDIR}/client-$i.pem \
173+
-set_serial 3$serial$$ -in ${CDIR}/client-$i.req -out ${CDIR}/client-$i.pem \
173174
|| exit 4
174175

175176
# And create a pkcs#12 version for easy browser import.

0 commit comments

Comments
 (0)