aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ruby_missing.h
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 09:42:30 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 09:42:30 +0000
commit54a731bd2b58898920988cdebcfbd19fe0396a33 (patch)
tree24d90c5a7b69a8f921f906d0a6719012218e6f83 /ext/openssl/ruby_missing.h
parentd3957ebfe5a96b7607f0dffa3f8da1181734ec4e (diff)
downloadruby-54a731bd2b58898920988cdebcfbd19fe0396a33.tar.gz
openssl: allow passing absolute times in OCSP::BasicResponse#add_status
* ext/openssl/ossl_ocsp.c (ossl_ocspbres_add_status): Allow specifying the times (thisUpdate, nextUpdate and revocationTime) with Time objects. Currently they accepts only relative seconds from the current time. This is inconvenience, especially for revocationTime. When Integer is passed, they are still treated as relative times. Since the type check is currently done with rb_Integer(), this is a slightly incompatible change. Hope no one passes a relative time as String or Time object... Also, allow passing nil as nextUpdate. It is optional. * ext/openssl/ruby_missing.h: Define RB_INTEGER_TYPE_P() if not defined. openssl gem will be released before Ruby 2.4.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ruby_missing.h')
-rw-r--r--ext/openssl/ruby_missing.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/openssl/ruby_missing.h b/ext/openssl/ruby_missing.h
index d7384ec32c..f076b1757d 100644
--- a/ext/openssl/ruby_missing.h
+++ b/ext/openssl/ruby_missing.h
@@ -24,4 +24,9 @@
#define rb_io_t OpenFile
#endif
+#ifndef RB_INTEGER_TYPE_P
+/* for Ruby 2.3 compatibility */
+#define RB_INTEGER_TYPE_P(obj) (RB_FIXNUM_P(obj) || RB_TYPE_P(obj, T_BIGNUM))
+#endif
+
#endif /* _OSSL_RUBY_MISSING_H_ */