more than two decades ago. [fix GH-1350] Patch by @cremno
* include/ruby/ruby.h: ditto.
* io.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (rb_f_abort): [DOC] Process.abort is a singleton
method of Process, but not an instance method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transcode.c (str_transcode0): scrub in the given encoding when
the source encoding is given, not in the encoding of the
receiver. [ruby-core:75732] [Bug #12431]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args): remove nul padding which
caused syntax error if fmt is not a string literal.
* include/ruby/ruby.h (rb_scan_args_verify): suppress array-bounds
warnings by old clang.
* include/ruby/ruby.h (rb_scan_args0): make extractor macros
inline functions, which do not varidate the format and are
unnecessary to be expanded.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Though rb_enc_isalnum is encoding aware function, its argument here
is *m, which is a single byte. Therefore ISDIGIT is faster.
* symbol.c (is_special_global_name): ditto.
* symbol.c (rb_enc_symname_type): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args): add nul padding here to
apply to all references.
* include/ruby/ruby.h (rb_scan_args_verify): move length mismatch
check outside conditional operators.
Since old clang cannot optimize away string literal dereference by
an immediate index, e.g., ""[0], and both of true and false side
expressions are compiled and warned unintentionally. With such
old compilers, the check in rb_scan_args() does not work but may
result unpredictable value if the format is wrong.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/openssl/ossl_pkey_dh.c (ossl_dh_compute_key): Check that the DH
has 'p' (the prime) before calling DH_size(). We can create a DH with
no parameter but DH_size() does not check and dereferences NULL.
[ruby-core:75720] [Bug #12428]
* ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does
not check dsa->q.
* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
ossl_rsa_private_decrypt): Ditto. RSA_size() does not check rsa->n.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_scan_args0): use pointer dereference
forms instead of array forms, to get rid of warnings by clang.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(across most Unicode characters; later across most character encodings)
tests for case mapping.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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