X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=tcl_tests%2Fca.try;h=7da25de2eae2691dcc10e72f944d38a65301d4d2;hb=HEAD;hp=c5693bbda54abfc1a08800f8e9dae58f69488c8c;hpb=c60fb20676ad9420e14e5d3377267c2bc620e6ea;p=openssl-gost%2Fengine.git diff --git a/tcl_tests/ca.try b/tcl_tests/ca.try index c5693bb..7da25de 100644 --- a/tcl_tests/ca.try +++ b/tcl_tests/ca.try @@ -61,9 +61,9 @@ test -skip {![file exists $userdir/broken.pem]} "Registering broken request at c test "Revoking certificate" { set revoking_cert $::test::ca/newcerts/[string trim [getFile $::test::ca/serial.old]].pem append serial_list [regsub "serial=" [openssl "x509 -in $revoking_cert -noout -serial"] " Serial Number: "] - grep "Data Base" [openssl "ca -crl_reason keyCompromize -crl_compromise [clock\ - format [clock seconds] -format %Y%m%d%H%M%SZ] -revoke $revoking_cert -config $::test::ca/ca.conf"] -} 0 "Data Base Updated + string map {"Data Base" Database Updated updated} [ grep "Data" [openssl "ca -crl_reason keyCompromize -crl_compromise [clock\ + format [clock seconds] -format %Y%m%d%H%M%SZ] -revoke $revoking_cert -config $::test::ca/ca.conf"] ] +} 0 "Database updated " test -createsfiles test.crl "Generating CRL" { openssl "ca -gencrl -config $::test::ca/ca.conf -out test.crl" @@ -73,10 +73,10 @@ test -createsfiles test.crl "Generating CRL" { test -skip {![file exists test.crl]} "Displaying CRL" { - grep "(Serial|Version|Signature Alg|Issuer)" [openssl "crl -text -noout -in test.crl"] + regsub -all " = " [grep "(Serial|Version|Signature Alg|Issuer)" [openssl "crl -text -noout -in test.crl"] ] "=" } 0 " Version 2 (0x1) Signature Algorithm: [hash_with_sign_long_name $ca_alg] - Issuer: C = RU, L = Moscow, CN = Test CA $ca_alg, O = Cryptocom, OU = OpenSSL CA, emailAddress = openssl@cryptocom.ru + Issuer: C=RU, L=Moscow, CN=Test CA $ca_alg, O=Cryptocom, OU=OpenSSL CA, emailAddress=openssl@cryptocom.ru $serial_list Signature Algorithm: [hash_with_sign_long_name $ca_alg] " @@ -88,17 +88,12 @@ test -skip {![file exists test.crl]} "Verifying CRL OK" { test -skip {![file exists test.crl]} "Verifying corrupted CRL" { makeFile "badcrl.pem" [hackPem "\01\x1E" [getFile test.crl] "\01\0"] grep verify [openssl "crl -in badcrl.pem -noout -CAfile $::test::ca/cacert.pem"] -} 0 "verify failure -" +} -1 "verify failure" test "Verifying CA certificate" { - grep "(cacert.pem|error|OK)" [openssl "verify $::test::ca/cacert.pem"] -} 1 "error $::test::ca/cacert.pem: verification failed -STDERR CONTENTS: -C = RU, L = Moscow, CN = Test CA $ca_alg, O = Cryptocom, OU = OpenSSL CA, emailAddress = openssl@cryptocom.ru -error 18 at 0 depth lookup: self signed certificate" - - + grep "(cacert.pem|error|OK)" [openssl "verify -CAfile $::test::ca/cacert.pem $::test::ca/cacert.pem"] +} 0 "$::test::ca/cacert.pem: OK +" test "Verifying certificate" { grep "cert.pem" [openssl "verify -CAfile $::test::ca/cacert.pem $userdir/cert.pem"]