* ext/openssl/openssl_missing.h, ext/openssl/ossl.h: Remove
unnecessary 'extern "C"' blocks. We don't use C++ and these headers
are local to ext/openssl, so there is no need to enclose with it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/extconf.rb: Remove check of OPENSSL_FIPS macro. This is
unneeded because we can check the macro directly in source code,
just as we already do for OPENSSL_NO_* macros.
* ext/openssl/ossl.c: Replace occurrences of HAVE_OPENSSL_FIPS with
OPENSSL_FIPS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/fake.rb: set "buildlibdir" to the build directory, instead
of "builddir" which is filterd by MakeMakefile#configuration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl_pkey_ec.c (ec_key_new_from_group): Create a new
EC_KEY on given EC group. Extracted from ossl_ec_key_initialize().
(ossl_ec_key_s_generate): Added. Create a new EC instance and
generate a random private and public key.
(ossl_ec_key_initialize): Use ec_key_new_from_group().
(Init_ossl_ec): Define the new method EC.generate. This change is
for consistency with other PKey types. [ruby-core:45541] [Bug #6567]
* test/openssl/test_pkey_ec.rb: Test that EC.generate works.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_generate_key): Fix up RDoc.
(Init_ossl_ec): Rename EC#generate_key to EC#generate_key!. Make the
old name an alias of #generate_key!. This change is for consistency
with other PKey types. [ruby-core:45541] [Bug #6567]
* test/openssl/test_pkey_ec.rb: Use EC#generate_key! instead of
EC#generate_key.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args_set): check the arity after
adjusting argc for an option hash, for optimization in simpler
cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (XCFLAGS): merge flags only for ruby itself from
ruby_cflags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl_cipher.c (ossl_cipher_set_key, ossl_cipher_set_iv):
Reject too long values as well as too short ones. Currently they
just truncate the input but this would hide bugs and lead to
unexpected encryption/decryption results.
* test/openssl/test_cipher.rb: Test that Cipher#key= and #iv= reject
Strings with invalid length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): Use
ASN1_OCTET_STRING_set() instead of M_ASN1_OCTET_STRING_set(). Macros
prefixed by "M_" are discouraged to be used from outside OpenSSL
library[1].
(ossl_x509ext_get_value): Likewise, use ASN1_STRING_print() instead
of M_ASN1_OCTET_STRING_print().
[1] https://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=CHANGES;h=bf61913d7b01212b4d8b2f3c13d71d645914f67c;hb=b6079a7835f61daa9fb2cbf9addfa86049523933#l878
* ext/openssl/ossl.h: Include openssl/asn1.h instead of
openssl/asn1_mac.h. It just includes openssl/asn1.h and defines some
additional "M_" macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args_verify): verify the format to
scan if no invalid chars and variable argument length matching,
at the compile time if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-fexcess-precision=standard and -fp-model precise are set to this now.
* configure.in (cflags): use ruby_cflags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl.c (Init_openssl): Avoid reference to unset global
variable. ossl_raise() may be called before dOSSL is set. Since
global variables default to 0 and the default value of dOSSL set in
Init_openssl() is also Qfalse, there is no real issue but confusing.
Patch by Bertram Scharpf <software@bertram-scharpf.de>
[ruby-core:58264] [Bug #9101]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args0): revert error attributes,
which may not be optimized away in readline extension library.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
exist. fixed build error on Windows itroduced at r55123.
I found that more complex definition of isfinite in numeric.c.
But it's unused because it inplicitly checks not defined _WIN32.
I don't know why the code do that.
IMO, the definition of isfinite should be put at missing.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c (lib_do_one_event_core): elimitate dead code.
after Check_Type, FIX2INT which implies conversion is not
useless. nil and fixnum cannot be tainted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dbm/dbm.c (fdbm_initialize): used for rb_sys_fail_str.
* ext/sdbm/init.c (fsdbm_initialize): ditto.
* ext/tk/tcltklib.c (lib_do_one_event_core): no effect.
* ext/tk/tkutil/tkutil.c (tk_eval_cmd, tk_get_eval_string): no
effect if tail call optimized.
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): set to const.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): add GC guards
instead of volatile after the uses.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args0): make compile error if the
format is wrong or does not match with the variable argument
length if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args0): raise fatal error if
variable argument length does not match, it is a bug in the code
which uses rb_scan_args, not a runtime error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e