diff options
author | inoguchi <> | 2020-05-17 04:43:16 +0000 |
---|---|---|
committer | inoguchi <> | 2020-05-17 04:43:16 +0000 |
commit | 9852350d8f1c3ae6afd90fc8a6c646a36af3fcab (patch) | |
tree | ed247da843ecc26b064991b74ccfd91768290d46 /src | |
parent | e1d7797cb558c7a52420750dd342b68634cc82b4 (diff) | |
download | openbsd-9852350d8f1c3ae6afd90fc8a6c646a36af3fcab.tar.gz openbsd-9852350d8f1c3ae6afd90fc8a6c646a36af3fcab.tar.bz2 openbsd-9852350d8f1c3ae6afd90fc8a6c646a36af3fcab.zip |
Suppress display output and reduce s_time to 1 sec in appstest.sh
Diffstat (limited to 'src')
-rwxr-xr-x | src/regress/usr.bin/openssl/appstest.sh | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh index 9fb143d429..44b13438f7 100755 --- a/src/regress/usr.bin/openssl/appstest.sh +++ b/src/regress/usr.bin/openssl/appstest.sh | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # $OpenBSD: appstest.sh,v 1.38 2020/05/17 01:43:27 inoguchi Exp $ | 3 | # $OpenBSD: appstest.sh,v 1.39 2020/05/17 04:43:16 inoguchi Exp $ |
4 | # | 4 | # |
5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> | 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> |
6 | # | 6 | # |
@@ -102,7 +102,7 @@ __EOF__ | |||
102 | section_message "listing operations" | 102 | section_message "listing operations" |
103 | 103 | ||
104 | start_message "ciphers" | 104 | start_message "ciphers" |
105 | $openssl_bin ciphers -V | 105 | $openssl_bin ciphers -V > $user1_dir/ciphers-V.out |
106 | check_exit_status $? | 106 | check_exit_status $? |
107 | 107 | ||
108 | start_message "errstr" | 108 | start_message "errstr" |
@@ -250,7 +250,7 @@ function test_key { | |||
250 | 250 | ||
251 | start_message "gendh - Obsoleted by dhparam." | 251 | start_message "gendh - Obsoleted by dhparam." |
252 | gendh2=$key_dir/gendh2.pem | 252 | gendh2=$key_dir/gendh2.pem |
253 | $openssl_bin gendh -2 -out $gendh2 | 253 | $openssl_bin gendh -2 -out $gendh2 > $gendh2.log 2>&1 |
254 | check_exit_status $? | 254 | check_exit_status $? |
255 | 255 | ||
256 | start_message "dh - Obsoleted by dhparam." | 256 | start_message "dh - Obsoleted by dhparam." |
@@ -260,7 +260,7 @@ function test_key { | |||
260 | if [ $no_long_tests = 0 ] ; then | 260 | if [ $no_long_tests = 0 ] ; then |
261 | start_message "dhparam - Superseded by genpkey and pkeyparam." | 261 | start_message "dhparam - Superseded by genpkey and pkeyparam." |
262 | dhparam2=$key_dir/dhparam2.pem | 262 | dhparam2=$key_dir/dhparam2.pem |
263 | $openssl_bin dhparam -2 -out $dhparam2 | 263 | $openssl_bin dhparam -2 -out $dhparam2 > $dhparam2.log 2>&1 |
264 | check_exit_status $? | 264 | check_exit_status $? |
265 | $openssl_bin dhparam -in $dhparam2 -check -text \ | 265 | $openssl_bin dhparam -in $dhparam2 -check -text \ |
266 | -out $dhparam2.out | 266 | -out $dhparam2.out |
@@ -273,7 +273,8 @@ function test_key { | |||
273 | 273 | ||
274 | start_message "dsaparam - Superseded by genpkey and pkeyparam." | 274 | start_message "dsaparam - Superseded by genpkey and pkeyparam." |
275 | dsaparam512=$key_dir/dsaparam512.pem | 275 | dsaparam512=$key_dir/dsaparam512.pem |
276 | $openssl_bin dsaparam -genkey -out $dsaparam512 512 | 276 | $openssl_bin dsaparam -genkey -out $dsaparam512 512 \ |
277 | > $dsaparam512.log 2>&1 | ||
277 | check_exit_status $? | 278 | check_exit_status $? |
278 | 279 | ||
279 | start_message "dsa" | 280 | start_message "dsa" |
@@ -291,7 +292,7 @@ function test_key { | |||
291 | start_message "genrsa - Superseded by genpkey." | 292 | start_message "genrsa - Superseded by genpkey." |
292 | genrsa_aes256=$key_dir/genrsa_aes256.pem | 293 | genrsa_aes256=$key_dir/genrsa_aes256.pem |
293 | $openssl_bin genrsa -f4 -aes256 -out $genrsa_aes256 \ | 294 | $openssl_bin genrsa -f4 -aes256 -out $genrsa_aes256 \ |
294 | -passout pass:$key_pass 2048 | 295 | -passout pass:$key_pass 2048 > $genrsa_aes256.log 2>&1 |
295 | check_exit_status $? | 296 | check_exit_status $? |
296 | 297 | ||
297 | start_message "rsa" | 298 | start_message "rsa" |
@@ -315,7 +316,7 @@ function test_key { | |||
315 | # EC | 316 | # EC |
316 | 317 | ||
317 | start_message "ecparam -list-curves" | 318 | start_message "ecparam -list-curves" |
318 | $openssl_bin ecparam -list_curves | 319 | $openssl_bin ecparam -list_curves -out $key_dir/ecparam-list_curves.out |
319 | check_exit_status $? | 320 | check_exit_status $? |
320 | 321 | ||
321 | # get all EC curves | 322 | # get all EC curves |
@@ -346,7 +347,7 @@ function test_key { | |||
346 | 347 | ||
347 | genpkey_dh_param=$key_dir/genpkey_dh_param.pem | 348 | genpkey_dh_param=$key_dir/genpkey_dh_param.pem |
348 | $openssl_bin genpkey -genparam -algorithm DH -out $genpkey_dh_param \ | 349 | $openssl_bin genpkey -genparam -algorithm DH -out $genpkey_dh_param \ |
349 | -pkeyopt dh_paramgen_prime_len:1024 | 350 | -pkeyopt dh_paramgen_prime_len:1024 > $genpkey_dh_param.log 2>&1 |
350 | check_exit_status $? | 351 | check_exit_status $? |
351 | 352 | ||
352 | genpkey_dh=$key_dir/genpkey_dh.pem | 353 | genpkey_dh=$key_dir/genpkey_dh.pem |
@@ -357,7 +358,7 @@ function test_key { | |||
357 | 358 | ||
358 | genpkey_dsa_param=$key_dir/genpkey_dsa_param.pem | 359 | genpkey_dsa_param=$key_dir/genpkey_dsa_param.pem |
359 | $openssl_bin genpkey -genparam -algorithm DSA -out $genpkey_dsa_param \ | 360 | $openssl_bin genpkey -genparam -algorithm DSA -out $genpkey_dsa_param \ |
360 | -pkeyopt dsa_paramgen_bits:1024 | 361 | -pkeyopt dsa_paramgen_bits:1024 > $genpkey_dsa_param.log 2>&1 |
361 | check_exit_status $? | 362 | check_exit_status $? |
362 | 363 | ||
363 | genpkey_dsa=$key_dir/genpkey_dsa.pem | 364 | genpkey_dsa=$key_dir/genpkey_dsa.pem |
@@ -368,7 +369,8 @@ function test_key { | |||
368 | 369 | ||
369 | genpkey_rsa=$key_dir/genpkey_rsa.pem | 370 | genpkey_rsa=$key_dir/genpkey_rsa.pem |
370 | $openssl_bin genpkey -algorithm RSA -out $genpkey_rsa \ | 371 | $openssl_bin genpkey -algorithm RSA -out $genpkey_rsa \ |
371 | -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:3 | 372 | -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:3 \ |
373 | > $genpkey_rsa.log 2>&1 | ||
372 | check_exit_status $? | 374 | check_exit_status $? |
373 | 375 | ||
374 | genpkey_rsa_pss=$key_dir/genpkey_rsa_pss.pem | 376 | genpkey_rsa_pss=$key_dir/genpkey_rsa_pss.pem |
@@ -376,7 +378,8 @@ function test_key { | |||
376 | -pkeyopt rsa_keygen_bits:2048 \ | 378 | -pkeyopt rsa_keygen_bits:2048 \ |
377 | -pkeyopt rsa_pss_keygen_mgf1_md:sha256 \ | 379 | -pkeyopt rsa_pss_keygen_mgf1_md:sha256 \ |
378 | -pkeyopt rsa_pss_keygen_md:sha256 \ | 380 | -pkeyopt rsa_pss_keygen_md:sha256 \ |
379 | -pkeyopt rsa_pss_keygen_saltlen:32 | 381 | -pkeyopt rsa_pss_keygen_saltlen:32 \ |
382 | > $genpkey_rsa_pss.log 2>&1 | ||
380 | check_exit_status $? | 383 | check_exit_status $? |
381 | 384 | ||
382 | # EC by GENPKEY | 385 | # EC by GENPKEY |
@@ -648,7 +651,8 @@ __EOF__ | |||
648 | -policy policy_match -days 1 -md sha256 -extensions tsa_ext \ | 651 | -policy policy_match -days 1 -md sha256 -extensions tsa_ext \ |
649 | -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:32 \ | 652 | -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:32 \ |
650 | -multivalue-rdn -preserveDN -noemailDN \ | 653 | -multivalue-rdn -preserveDN -noemailDN \ |
651 | -in $tsa_csr -outdir $tsa_dir -out $tsa_cert -verbose -notext | 654 | -in $tsa_csr -outdir $tsa_dir -out $tsa_cert -verbose -notext \ |
655 | > $tsa_cert.log 2>&1 | ||
652 | check_exit_status $? | 656 | check_exit_status $? |
653 | 657 | ||
654 | #---------#---------#---------#---------#---------#---------#--------- | 658 | #---------#---------#---------#---------#---------#---------#--------- |
@@ -679,7 +683,7 @@ __EOF__ | |||
679 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -keyform pem \ | 683 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -keyform pem \ |
680 | -key $ca_pass -out $ocsp_cert -extensions ocsp_ext \ | 684 | -key $ca_pass -out $ocsp_cert -extensions ocsp_ext \ |
681 | -startdate `date -u '+%y%m%d%H%M%SZ'` -enddate 491223235959Z \ | 685 | -startdate `date -u '+%y%m%d%H%M%SZ'` -enddate 491223235959Z \ |
682 | -subj $subj -infiles $ocsp_csr | 686 | -subj $subj -infiles $ocsp_csr > $ocsp_cert.log 2>&1 |
683 | check_exit_status $? | 687 | check_exit_status $? |
684 | 688 | ||
685 | #---------#---------#---------#---------#---------#---------#--------- | 689 | #---------#---------#---------#---------#---------#---------#--------- |
@@ -752,7 +756,7 @@ __EOF__ | |||
752 | 756 | ||
753 | $openssl_bin req -new -subj $subj -sha256 \ | 757 | $openssl_bin req -new -subj $subj -sha256 \ |
754 | -key $ecdsa_key -keyform pem -passin pass:$ecdsa_pass \ | 758 | -key $ecdsa_key -keyform pem -passin pass:$ecdsa_pass \ |
755 | -addext 'subjectAltName = DNS:localhost.test_dummy.com' \ | 759 | -addext 'subjectAltName = DNS:ecdsa.test_dummy.com' \ |
756 | -out $ecdsa_csr -outform pem | 760 | -out $ecdsa_csr -outform pem |
757 | check_exit_status $? | 761 | check_exit_status $? |
758 | 762 | ||
@@ -773,7 +777,7 @@ __EOF__ | |||
773 | 777 | ||
774 | server_cert=$server_dir/server_cert.pem | 778 | server_cert=$server_dir/server_cert.pem |
775 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | 779 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ |
776 | -in $server_csr -out $server_cert | 780 | -in $server_csr -out $server_cert > $server_cert.log 2>&1 |
777 | check_exit_status $? | 781 | check_exit_status $? |
778 | 782 | ||
779 | start_message "x509 ... issue cert for server csr#2" | 783 | start_message "x509 ... issue cert for server csr#2" |
@@ -782,14 +786,15 @@ __EOF__ | |||
782 | $openssl_bin x509 -req -in $revoke_csr -CA $ca_cert -CAform pem \ | 786 | $openssl_bin x509 -req -in $revoke_csr -CA $ca_cert -CAform pem \ |
783 | -CAkey $ca_key -CAkeyform pem \ | 787 | -CAkey $ca_key -CAkeyform pem \ |
784 | -CAserial $ca_dir/serial -set_serial 10 \ | 788 | -CAserial $ca_dir/serial -set_serial 10 \ |
785 | -passin pass:$ca_pass -CAcreateserial -out $revoke_cert | 789 | -passin pass:$ca_pass -CAcreateserial -out $revoke_cert \ |
790 | > $revoke_cert.log 2>&1 | ||
786 | check_exit_status $? | 791 | check_exit_status $? |
787 | 792 | ||
788 | start_message "ca ... issue cert for server csr#3" | 793 | start_message "ca ... issue cert for server csr#3" |
789 | 794 | ||
790 | ecdsa_cert=$server_dir/ecdsa_cert.pem | 795 | ecdsa_cert=$server_dir/ecdsa_cert.pem |
791 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | 796 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ |
792 | -in $ecdsa_csr -out $ecdsa_cert | 797 | -in $ecdsa_csr -out $ecdsa_cert > $ecdsa_cert 2>&1 |
793 | check_exit_status $? | 798 | check_exit_status $? |
794 | 799 | ||
795 | #---------#---------#---------#---------#---------#---------#--------- | 800 | #---------#---------#---------#---------#---------#---------#--------- |
@@ -805,14 +810,15 @@ __EOF__ | |||
805 | -crl_reason unspecified -crl_hold 1.2.840.10040.2.2 \ | 810 | -crl_reason unspecified -crl_hold 1.2.840.10040.2.2 \ |
806 | -crl_compromise `date -u '+%Y%m%d%H%M%SZ'` \ | 811 | -crl_compromise `date -u '+%Y%m%d%H%M%SZ'` \ |
807 | -crl_CA_compromise `date -u '+%Y%m%d%H%M%SZ'` \ | 812 | -crl_CA_compromise `date -u '+%Y%m%d%H%M%SZ'` \ |
808 | -keyfile $ca_key -passin pass:$ca_pass -cert $ca_cert | 813 | -keyfile $ca_key -passin pass:$ca_pass -cert $ca_cert \ |
814 | > $crl_file.log 2>&1 | ||
809 | check_exit_status $? | 815 | check_exit_status $? |
810 | 816 | ||
811 | start_message "ca ... show certificate status by serial number" | 817 | start_message "ca ... show certificate status by serial number" |
812 | $openssl_bin ca -config $ssldir/openssl.cnf -status 1 | 818 | $openssl_bin ca -config $ssldir/openssl.cnf -status 1 |
813 | 819 | ||
814 | start_message "crl ... CA generates CRL" | 820 | start_message "crl ... CA generates CRL" |
815 | $openssl_bin crl -in $crl_file -fingerprint | 821 | $openssl_bin crl -in $crl_file -fingerprint >> $crl_file.log 2>&1 |
816 | check_exit_status $? | 822 | check_exit_status $? |
817 | 823 | ||
818 | crl_p7=$ca_dir/crl.p7 | 824 | crl_p7=$ca_dir/crl.p7 |
@@ -846,7 +852,8 @@ __EOF__ | |||
846 | 852 | ||
847 | if [ $mingw = 0 ] ; then | 853 | if [ $mingw = 0 ] ; then |
848 | start_message "certhash" | 854 | start_message "certhash" |
849 | $openssl_bin certhash -v $server_dir | 855 | $openssl_bin certhash -v $server_dir \ |
856 | > $server_dir/certhash.log 2>&1 | ||
850 | check_exit_status $? | 857 | check_exit_status $? |
851 | fi | 858 | fi |
852 | 859 | ||
@@ -887,7 +894,7 @@ __EOF__ | |||
887 | start_message "ca ... CA signs SPKAC csr" | 894 | start_message "ca ... CA signs SPKAC csr" |
888 | spkaccert=$server_dir/spkac.cert | 895 | spkaccert=$server_dir/spkac.cert |
889 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | 896 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ |
890 | -spkac $spkacreq -out $spkaccert | 897 | -spkac $spkacreq -out $spkaccert > $spkaccert.log 2>&1 |
891 | check_exit_status $? | 898 | check_exit_status $? |
892 | 899 | ||
893 | start_message "x509 ... convert DER format SPKAC cert to PEM" | 900 | start_message "x509 ... convert DER format SPKAC cert to PEM" |
@@ -910,7 +917,8 @@ __EOF__ | |||
910 | start_message "x509 ... trust testCA cert" | 917 | start_message "x509 ... trust testCA cert" |
911 | user1_trust=$user1_dir/user1_trust_ca.pem | 918 | user1_trust=$user1_dir/user1_trust_ca.pem |
912 | $openssl_bin x509 -in $ca_cert -addtrust clientAuth \ | 919 | $openssl_bin x509 -in $ca_cert -addtrust clientAuth \ |
913 | -setalias "trusted testCA" -purpose -out $user1_trust | 920 | -setalias "trusted testCA" -purpose -out $user1_trust \ |
921 | > $user1_trust.log 2>&1 | ||
914 | check_exit_status $? | 922 | check_exit_status $? |
915 | 923 | ||
916 | start_message "req ... generate private key and csr for user1" | 924 | start_message "req ... generate private key and csr for user1" |
@@ -926,7 +934,7 @@ __EOF__ | |||
926 | fi | 934 | fi |
927 | 935 | ||
928 | $openssl_bin req -new -keyout $user1_key -out $user1_csr \ | 936 | $openssl_bin req -new -keyout $user1_key -out $user1_csr \ |
929 | -passout pass:$user1_pass -subj $subj | 937 | -passout pass:$user1_pass -subj $subj > $user1_csr.log 2>&1 |
930 | check_exit_status $? | 938 | check_exit_status $? |
931 | 939 | ||
932 | #---------#---------#---------#---------#---------#---------#--------- | 940 | #---------#---------#---------#---------#---------#---------#--------- |
@@ -938,7 +946,7 @@ __EOF__ | |||
938 | 946 | ||
939 | user1_cert=$user1_dir/user1_cert.pem | 947 | user1_cert=$user1_dir/user1_cert.pem |
940 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | 948 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ |
941 | -in $user1_csr -out $user1_cert | 949 | -in $user1_csr -out $user1_cert > $user1_cert.log 2>&1 |
942 | check_exit_status $? | 950 | check_exit_status $? |
943 | } | 951 | } |
944 | 952 | ||
@@ -963,7 +971,7 @@ __EOF__ | |||
963 | 971 | ||
964 | start_message "ts ... print time stamp request" | 972 | start_message "ts ... print time stamp request" |
965 | 973 | ||
966 | $openssl_bin ts -query -in $tsa_tsq -text | 974 | $openssl_bin ts -query -in $tsa_tsq -text -out $tsa_tsq.log |
967 | check_exit_status $? | 975 | check_exit_status $? |
968 | 976 | ||
969 | # Reply | 977 | # Reply |
@@ -1047,7 +1055,8 @@ __EOF__ | |||
1047 | $openssl_bin cms -verify -in $cms_dec \ | 1055 | $openssl_bin cms -verify -in $cms_dec \ |
1048 | -CAfile $ca_cert -certfile $user1_cert -nointern \ | 1056 | -CAfile $ca_cert -certfile $user1_cert -nointern \ |
1049 | -check_ss_sig -issuer_checks -policy_check -x509_strict \ | 1057 | -check_ss_sig -issuer_checks -policy_check -x509_strict \ |
1050 | -signer $cms_sgr -text -out $cms_ver -receipt_request_print | 1058 | -signer $cms_sgr -text -out $cms_ver -receipt_request_print \ |
1059 | > $cms_ver.log 2>&1 | ||
1051 | check_exit_status $? | 1060 | check_exit_status $? |
1052 | 1061 | ||
1053 | diff -b $cms_ver $cms_txt | 1062 | diff -b $cms_ver $cms_txt |
@@ -1303,7 +1312,7 @@ function test_pkcs { | |||
1303 | 1312 | ||
1304 | start_message "pkcs12 ... verify" | 1313 | start_message "pkcs12 ... verify" |
1305 | $openssl_bin pkcs12 -in $server_cert.p12 -passin pass:$pkcs_pass -info \ | 1314 | $openssl_bin pkcs12 -in $server_cert.p12 -passin pass:$pkcs_pass -info \ |
1306 | -noout | 1315 | -noout > $server_cert.p12.log 2>&1 |
1307 | check_exit_status $? | 1316 | check_exit_status $? |
1308 | 1317 | ||
1309 | start_message "pkcs12 ... private key to PEM without encryption" | 1318 | start_message "pkcs12 ... private key to PEM without encryption" |
@@ -1548,7 +1557,8 @@ function test_server_client { | |||
1548 | 1557 | ||
1549 | # s_time | 1558 | # s_time |
1550 | start_message "s_time ... connect to TLS/SSL test server" | 1559 | start_message "s_time ... connect to TLS/SSL test server" |
1551 | $c_bin s_time -connect $host:$port -CApath $ca_dir -time 2 | 1560 | $c_bin s_time -connect $host:$port -CApath $ca_dir -time 1 \ |
1561 | > $server_dir/s_time_${sc}.log | ||
1552 | check_exit_status $? | 1562 | check_exit_status $? |
1553 | 1563 | ||
1554 | stop_s_server | 1564 | stop_s_server |