1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/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
..
lib openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
depend Update dependencies. 2016-04-11 11:50:00 +00:00
deprecation.rb openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
extconf.rb openssl: fix build with OpenSSL 1.1.0 and no pkg-config 2016-06-09 06:03:55 +00:00
openssl_missing.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
openssl_missing.h openssl: add 'const's required in OpenSSL master 2016-06-19 05:31:28 +00:00
ossl.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl.h openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
ossl_asn1.c openssl: use ASN1_ENUMERATED_to_BN() if needed 2016-06-09 12:42:08 +00:00
ossl_asn1.h openssl: fix the Year 2038 problem 2016-06-01 12:41:15 +00:00
ossl_bio.c prefer rb_syserr_fail 2015-12-23 08:57:48 +00:00
ossl_bio.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_bn.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_bn.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_cipher.c openssl: support non AES-GCM AEAD ciphers in OpenSSL::Cipher 2016-06-12 05:06:18 +00:00
ossl_cipher.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_config.c * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_config.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_digest.c openssl: use StringValueCStr() where NUL-terminated string is expected 2016-05-23 11:40:07 +00:00
ossl_digest.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_engine.c openssl: adjust tests for OpenSSL 1.1.0 2016-06-07 12:20:46 +00:00
ossl_engine.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_hmac.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_hmac.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_ns_spki.c openssl: use StringValueCStr() where NUL-terminated string is expected 2016-05-23 11:40:07 +00:00
ossl_ns_spki.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_ocsp.c openssl: add OpenSSL::OCSP::SingleResponse 2016-06-19 12:26:27 +00:00
ossl_ocsp.h openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
ossl_pkcs5.c openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
ossl_pkcs5.h
ossl_pkcs7.c openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
ossl_pkcs7.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_pkcs12.c openssl: use StringValueCStr() where NUL-terminated string is expected 2016-05-23 11:40:07 +00:00
ossl_pkcs12.h * ext/openssl/ossl_pkcs12*: Remove svn commit id macro 2015-09-23 13:23:02 +00:00
ossl_pkey.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_pkey.h openssl: add 'const's required in OpenSSL master 2016-06-19 05:31:28 +00:00
ossl_pkey_dh.c openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
ossl_pkey_dsa.c openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
ossl_pkey_ec.c openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
ossl_pkey_rsa.c openssl: implement initialize_copy method for PKey classes 2016-06-19 09:29:59 +00:00
ossl_rand.c openssl: check existence of RAND_pseudo_bytes() 2016-06-05 12:38:34 +00:00
ossl_rand.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_ssl.c openssl: fix build with OPENSSL_NO_EC 2016-06-09 10:46:46 +00:00
ossl_ssl.h openssl: move SSLSocket#initialize to C extension 2016-05-28 05:00:36 +00:00
ossl_ssl_session.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_version.h * ext/openssl/*: Remove svn commit id macros to make sync easier 2015-09-22 16:12:15 +00:00
ossl_x509.c openssl: fix the Year 2038 problem 2016-06-01 12:41:15 +00:00
ossl_x509.h openssl: fix the Year 2038 problem 2016-06-01 12:41:15 +00:00
ossl_x509attr.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509cert.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509crl.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509ext.c openssl: drop OpenSSL 0.9.6/0.9.7 support 2016-05-25 08:50:03 +00:00
ossl_x509name.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509req.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509revoked.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ossl_x509store.c openssl: adapt to OpenSSL 1.1.0 opaque structs 2016-06-05 15:35:12 +00:00
ruby_missing.h openssl: allow passing absolute times in OCSP::BasicResponse#add_status 2016-06-19 09:42:30 +00:00