1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/openssl
rhe 102815b046 openssl: add OpenSSL::OCSP::SingleResponse
* ext/openssl/ossl_ocsp.c: Add OCSP::SingleResponse that represents an
  OCSP SingleResponse structure. Also add two new methods #responses
  and #find_response to OCSP::BasicResponse. A BasicResponse has one or
  more SingleResponse. We have OCSP::BasicResponse#status that returns
  them as an array of arrays, each containing the content of a
  SingleResponse, but this is not useful. When validating an OCSP
  response, we need to look into the each SingleResponse and check their
  validity but it is not simple. For example, when validating for a
  certificate 'cert', the code would be like:

    # certid_target is an OpenSSL::OCSP::CertificateId for cert
    basic = res.basic
    result = basic.status.any? do |ary|
      ary[0].cmp(certid_target) &&
        ary[4] <= Time.now && (!ary[5] || Time.now <= ary[5])
    end

  Adding OCSP::SingleResponse at the same time allows exposing
  OCSP_check_validity(). With this, the code above can be rewritten as:

    basic = res.basic
    single = basic.find_response(certid_target)
    result = single.check_validity

* test/openssl/test_ocsp.rb: Test this.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-19 12:26:27 +00:00
..
test_asn1.rb openssl: use ASN1_ENUMERATED_to_BN() if needed 2016-06-09 12:42:08 +00:00
test_bn.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_buffering.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_cipher.rb openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
test_config.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_digest.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_engine.rb openssl: avoid test failure in test_engine.rb 2016-06-12 04:48:10 +00:00
test_fips.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_hmac.rb openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
test_ns_spki.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_ocsp.rb openssl: add OpenSSL::OCSP::SingleResponse 2016-06-19 12:26:27 +00:00
test_pair.rb openssl: fix build with OPENSSL_NO_EC 2016-06-09 10:46:46 +00:00
test_partial_record_read.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_pkcs5.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkcs7.rb openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
test_pkcs12.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkey_dh.rb openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
test_pkey_dsa.rb openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
test_pkey_ec.rb openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
test_pkey_rsa.rb openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
test_random.rb openssl: check existence of RAND_pseudo_bytes() 2016-06-05 12:38:34 +00:00
test_ssl.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_ssl_session.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_x509attr.rb openssl: check argument type in OpenSSL::X509::Attribute#value= 2016-05-19 04:12:57 +00:00
test_x509cert.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_x509crl.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509ext.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509name.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_x509req.rb openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
test_x509store.rb openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
utils.rb openssl: fix build with OPENSSL_NO_EC 2016-06-09 10:46:46 +00:00