summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_asn1.c
AgeCommit message (Collapse)Author
2016-08-29import Ruby/OpenSSL 2.0.0.beta.1rhe
* NEWS, {ext,test,sample}/openssl: Import Ruby/OpenSSL 2.0.0.beta.1. ext/openssl is now converted into a default gem. The full commit history since r55538 can be found at: https://github.com/ruby/openssl/compare/08e1881f5663...v2.0.0.beta.1 [Feature #9612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-09openssl: use ASN1_ENUMERATED_to_BN() if neededrhe
* ext/openssl/ossl_asn1.c (asn1integer_to_num): Use ASN1_ENUMERATED_to_BN() to convert an ASN1_ENUMERATED to a BN. Starting from OpenSSL 1.1.0, ASN1_INTEGER_to_BN() rejects non-ASN1_INTEGER objects. The format of INTEGER and ENUMERATED are almost identical so they behaved in the same way in OpenSSL <= 1.0.2. [ruby-core:75225] [Feature #12324] * test/openssl/test_asn1.rb (test_decode_enumerated): Test that it works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-05openssl: avoid d2i_ASN1_BOOLEAN()rhe
* ext/openssl/ossl_asn1.c (decode_bool): Do the same thing as d2i_ASN1_BOOLEAN() does by ourselves. This function is removed in OpenSSL 1.1.0. [ruby-core:75225] [Feature #12324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-01ossl_asn1.c: check overflownobu
* ext/openssl/ossl_asn1.c (ossl_time_split): check overflow and reorder for optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-01openssl: fix the Year 2038 problemrhe
r55219 didn't fix the entire issue. It only fixed the issue on environment with sizeof(time_t) == 8 && sizeof(long) == 4. * ext/openssl/extconf.rb: Check existence of ASN1_TIME_adj(). The old ASN1_TIME_set() is not Year 2038 ready on sizeof(time_t) == 4 environment. This function was added in OpenSSL 1.0.0. [ruby-core:45552] [Bug #6571] * ext/openssl/ossl_asn1.c (ossl_time_split): Added. Split the argument (Time) into the number of days elapsed since the epoch and the remainder seconds to conform to ASN1_TIME_adj(). (obj_to_asn1utime, obj_to_asn1gtime): Use ossl_time_split() and ASN1_*TIME_adj(). * ext/openssl/ossl_asn1.h: Add the function prototype for ossl_time_split(). * ext/openssl/ossl_x509.[ch]: Add ossl_x509_time_adjust(). Similarly to obj_to_asn1*time(), use X509_time_adj_ex() instead of X509_time_adj(). * ext/openssl/ossl_x509cert.c, ext/openssl/ossl_x509crl.c, ext/openssl/ossl_x509revoked.c: Use ossl_x509_time_adjust(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-30openssl: use NUM2TIMET() to convert Integer to time_trhe
* ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of NUM2LONG(). time_t may be larger than long. [ruby-core:45552] [Bug #6571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25openssl: drop OpenSSL 0.9.6/0.9.7 supportrhe
* ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23openssl: use StringValueCStr() where NUL-terminated string is expectedrhe
* ext/openssl/ossl_asn1.c, ext/openssl/ossl_bn.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_digest.c ext/openssl/ossl_engine.c, ext/openssl/ossl_ns_spki.c ext/openssl/ossl_pkcs12.c, ext/openssl/ossl_pkcs7.c ext/openssl/ossl_pkey.c, ext/openssl/ossl_pkey_ec.c ext/openssl/ossl_rand.c, ext/openssl/ossl_ssl.c ext/openssl/ossl_x509attr.c, ext/openssl/ossl_x509cert.c ext/openssl/ossl_x509ext.c, ext/openssl/ossl_x509store.c: Use StringValueCStr() where NUL-terminated string is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-22* ext/openssl/*: Remove svn commit id macros to make sync easierzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27openssl: use RB_GC_GUARD instead of volatilenormal
From doc/extension.rdoc: > > Using the RB_GC_GUARD macro is preferable to using the "volatile" > keyword in C. RB_GC_GUARD has the following advantages: > > 1) the intent of the macro use is clear > > 2) RB_GC_GUARD only affects its call site, "volatile" generates some > extra code every time the variable is used, hurting optimization. > > 3) "volatile" implementations may be buggy/inconsistent in some > compilers and architectures. RB_GC_GUARD is customizable for broken > systems/compilers without those without negatively affecting other > systems. * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode, ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile [ruby-core:69371] [Bug #11185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27ossl_asn1.c: [DOC] Fix typo [skip ci]nobu
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): [DOC] Fix typo "recieved" to "received". [Fix GH-913] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20* ext/openssl/*: use license instead of licence.hsbt
[fix GH-876][ci skip] Patch by @davydovanton * lib/net/https.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-21ossl_asn1.c: fix docnobu
* ext/openssl/ossl_asn1.c (ossl_asn1obj_get_oid): [DOC] fix notation, an instance method but not a class method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-21[DOC] Backport ruby/openssl@86eb721 [ci skip]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30protoize no-arguments functionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-03openssl: constifynobu
* ext/openssl/ossl_asn1.c (ossl_asn1_info): constify. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_sym2typeid): constify and remove sentinel as the count is used. * ext/openssl/ossl_ssl.c (ossl_ssl_method_tab): constify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-24ossl_asn1.c: fix undefined behaviornobu
* ext/openssl/ossl_asn1.c (ossl_asn1_initialize): SYMID on a value other than Symbol is an undefined behavior. fix up r31699. [ruby-core:62142] [Bug #9771] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13ext: use PRIsVALUE for rb_raise and rb_warnnobu
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): use PRIsVALUE for rb_raise() and rb_warn(). * ext/openssl/ossl_cipher.c (ossl_cipher_init): ditto. * ext/racc/cparse/cparse.c (extract_user_token): ditto. * ext/syslog/syslog.c (mSyslog_log): ditto. * ext/openssl/ossl.h (OSSL_Check_Kind, OSSL_Check_Instance): now ossl_raise() also accepts PRIsVALUE. * ext/openssl/ossl_asn1.c (ossl_asn1_default_tag): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11* ext/win32ole/sample/olegen.rb: Fix typoa_matsuda
* ext/openssl/ossl_asn1.c: [DOC] Fix typo * lib/webrick/accesslog.rb: ditto * template/yarvarch.ja: ditto s/recieve/receive/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLISTnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13Squashed commit of the following:nagachika
commit 6895f38bfc3c0ad6bd212b8f9acc3c71384dfcb7 Author: Chikanaga Tomoyuki <nagachika00@gmail.com> Date: Thu Nov 14 00:14:00 2013 +0900 * ChangeLog: fix a typo at r43666 * ext/openssl/ossl_asn1.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13* ext/openssl/ossl_asn1.c: [DOC] Document parts ofzzak
OpenSSL::ASN1::ObjectId included a fix for the class overview, which previously showed the documentation for Constructive due to missing ObjectId overview. This patch also includes a note for Primative. Based on a patch by @vbatts via GH-436 https://github.com/ruby/ruby/pull/436 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-22* ext/openssl/ossl_asn1.c (asn1time_to_time): Implement YYMMDDhhmmZdrbrain
format for ASN.1 UTCTime. [ruby-trunk - Bug #8664] * test/openssl/test_asn1.rb: Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-28* ext/openssl/ossl_asn1.c: raise TypeError when trying to encode nilemboss
values for Primitive instances. * test/openssl/test_asn1.rb: Assert consistent behavior when encoding nil values: Primitives raise TypeError, Constructives raise NoMethodError. Fixes [ruby-core:43009][Bug #6102] -This line, and those below, will be ignored-- M test/openssl/test_asn1.rb M ext/openssl/ossl_asn1.c M ChangeLog git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25avoid rdoc's warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08* ext/openssl/ossl_asn1.c: Call INT2NUM only once for GeneralString.emboss
Thanks to Mantas Mikulenas for noticing and providing a patch! [ruby-core:42358] [Bug #5972] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15* ext/openssl/ossl_asn1.c: get rid of potential overflow.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04* whitespace cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25* ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when beingemboss
fed arbitrary string values. Clearly distinguish between the cases "universal, infinite and not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly infinite". Raise error for universal tags that are not infinite. * test/openssl/test_asn1.rb: add a test for this. Thanks to Hiroshi Yoshida for reporting this bug. [Bug #5363] [ruby-dev:44542] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-23* ext/openssl/ossl_asn1.c: remove unused variable.emboss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07* ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables.kosaki
Patch by Eric Wong. [Feature #5157] [ruby-core:38798] * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30* sytle fixes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-26* ext/openssl/extconf.rbemboss
* ext/openssl/ossl_missing.h/.c: add ASN1_put_eoc if missing. * ext/openssl/ossl_asn1.c: introduce ossl_asn1_object_size and ossl_asn1_put_object to wrap functionality depending on OpenSSL version in use. Fixes [ Ruby 1.9 - Bug #4916 ] reported by Hiroshi Nakamura. [ruby-core:37286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-23* ext/openssl/ossl_asn1.c: Do not parse zero-tagged values as EOC. Doemboss
not let current length become negative for infinite length constructed values. Support constructed values of length zero. Added tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Forbid Constructives whose value is not anemboss
Array to prevent segfault. Added test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Forbid Constructive without infiniteemboss
length. This also prevents a segfault. Added test and improved documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Fix decoding of infinite length values.emboss
Simplified ossl_asn1_decode0 by splitting it into three separate functions. Add tests. [Ruby 1.9 - Bug #4374][ruby-core:35123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation ofemboss
Constructives with an explicit tag_class parameter without automatically setting tagging to :EXPLICIT. Fixes a bug when encoding infinite length primitive values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c (ossl_asn1_cons_to_der): Add an additionalemboss
EOC for infinite length Constructives that are supposed to be encoded with explicit tagging. Also tabify method correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c (ossl_asn1data_to_der): Remove redundantemboss
flag tmp_cons. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Instead of rb_intern use static symbols toemboss
improve performance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Use OpenSSL constants V_ASN1_xxx instead ofemboss
hardcoded numbers for initializing class_tag_map. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c(ossl_asn1_default_tag): avoid using RCLASS_SUPERnahi
to make it compilable. Plus, tabify and change variable definition style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext/openssl/ossl_asn1.c: Default tag lookup in constant time via hashemboss
instead of previous linear algorithm. [Ruby 1.9 - Feature #4309][ruby-core:34813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-16* ext/openssl/ossl_asn1.c: Fix more typos. Document attributesemboss
explicitly. Set indentation for verbose sections from 4 to 2 spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-16 * ext/openssl/ossl_asn1.c: fix typos and remove trailing spacesnagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15Mon May 16 05:13:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>emboss
* ext/openssl/ossl_asn1.c: Add documentation. Previous revision: 31583 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e