forked from openssl/openssl
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set LD_LIBRARY_PATH so the correct libs can be found. Testing: cd demos/certs && sh mkcerts.sh cd demos/certs/apps && sh -x mkacerts.sh Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Yang <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#23142)
- Loading branch information
Showing
5 changed files
with
84 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
#!/bin/sh | ||
|
||
# Create certificates using various algorithms to test multi-certificate | ||
# functionality. | ||
|
||
OPENSSL=../../../apps/openssl | ||
CN="OpenSSL Test RSA SHA-1 cert" $OPENSSL req \ | ||
opensslcmd() { | ||
LD_LIBRARY_PATH=../../.. ../../../apps/openssl $@ | ||
} | ||
|
||
opensslcmd version | ||
|
||
CN="OpenSSL Test RSA SHA-1 cert" opensslcmd req \ | ||
-config apps.cnf -extensions usr_cert -x509 -nodes \ | ||
-keyout tsha1.pem -out tsha1.pem -new -days 3650 -sha1 | ||
CN="OpenSSL Test RSA SHA-256 cert" $OPENSSL req \ | ||
CN="OpenSSL Test RSA SHA-256 cert" opensslcmd req \ | ||
-config apps.cnf -extensions usr_cert -x509 -nodes \ | ||
-keyout tsha256.pem -out tsha256.pem -new -days 3650 -sha256 | ||
CN="OpenSSL Test RSA SHA-512 cert" $OPENSSL req \ | ||
CN="OpenSSL Test RSA SHA-512 cert" opensslcmd req \ | ||
-config apps.cnf -extensions usr_cert -x509 -nodes \ | ||
-keyout tsha512.pem -out tsha512.pem -new -days 3650 -sha512 | ||
|
||
# Create EC parameters | ||
|
||
$OPENSSL ecparam -name P-256 -out ecp256.pem | ||
$OPENSSL ecparam -name P-384 -out ecp384.pem | ||
opensslcmd ecparam -name P-256 -out ecp256.pem | ||
opensslcmd ecparam -name P-384 -out ecp384.pem | ||
|
||
CN="OpenSSL Test P-256 SHA-256 cert" $OPENSSL req \ | ||
CN="OpenSSL Test P-256 SHA-256 cert" opensslcmd req \ | ||
-config apps.cnf -extensions ec_cert -x509 -nodes \ | ||
-nodes -keyout tecp256.pem -out tecp256.pem -newkey ec:ecp256.pem \ | ||
-days 3650 -sha256 | ||
|
||
CN="OpenSSL Test P-384 SHA-384 cert" $OPENSSL req \ | ||
CN="OpenSSL Test P-384 SHA-384 cert" opensslcmd req \ | ||
-config apps.cnf -extensions ec_cert -x509 -nodes \ | ||
-nodes -keyout tecp384.pem -out tecp384.pem -newkey ec:ecp384.pem \ | ||
-days 3650 -sha384 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Example querying OpenSSL test responder. Assumes ocsprun.sh has been | ||
# called. | ||
|
||
OPENSSL=../../apps/openssl | ||
opensslcmd() { | ||
LD_LIBRARY_PATH=../.. ../../apps/openssl $@ | ||
} | ||
|
||
OPENSSL_CONF=../../apps/openssl.cnf | ||
export OPENSSL_CONF | ||
|
||
opensslcmd version | ||
|
||
# Send responder queries for each certificate. | ||
|
||
echo "Requesting OCSP status for each certificate" | ||
$OPENSSL ocsp -issuer intca.pem -cert client.pem -CAfile root.pem \ | ||
opensslcmd ocsp -issuer intca.pem -cert client.pem -CAfile root.pem \ | ||
-url http://127.0.0.1:8888/ | ||
$OPENSSL ocsp -issuer intca.pem -cert server.pem -CAfile root.pem \ | ||
opensslcmd ocsp -issuer intca.pem -cert server.pem -CAfile root.pem \ | ||
-url http://127.0.0.1:8888/ | ||
$OPENSSL ocsp -issuer intca.pem -cert rev.pem -CAfile root.pem \ | ||
opensslcmd ocsp -issuer intca.pem -cert rev.pem -CAfile root.pem \ | ||
-url http://127.0.0.1:8888/ | ||
# One query for all three certificates. | ||
echo "Requesting OCSP status for three certificates in one request" | ||
$OPENSSL ocsp -issuer intca.pem \ | ||
opensslcmd ocsp -issuer intca.pem \ | ||
-cert client.pem -cert server.pem -cert rev.pem \ | ||
-CAfile root.pem -url http://127.0.0.1:8888/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
#!/bin/sh | ||
|
||
opensslcmd() { | ||
LD_LIBRARY_PATH=../.. ../../apps/openssl $@ | ||
} | ||
|
||
# Example of running an querying OpenSSL test OCSP responder. | ||
# This assumes "mkcerts.sh" or similar has been run to set up the | ||
# necessary file structure. | ||
|
||
OPENSSL=../../apps/openssl | ||
OPENSSL_CONF=../../apps/openssl.cnf | ||
export OPENSSL_CONF | ||
|
||
opensslcmd version | ||
|
||
# Run OCSP responder. | ||
|
||
PORT=8888 | ||
|
||
$OPENSSL ocsp -port $PORT -index index.txt -CA intca.pem \ | ||
opensslcmd ocsp -port $PORT -index index.txt -CA intca.pem \ | ||
-rsigner resp.pem -rkey respkey.pem -rother intca.pem $* |