Граф коммитов

68 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 74c6662af5
Hoisted out rb_digest_namespace 2019-08-22 00:19:55 +09:00
Nobuyoshi Nakada 715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00
nobu d1e6304a89 Prefer relative directory from srcdir to top_srcdir
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14 05:42:14 +00:00
nobu 63f990674b Use $(hdrdir) for include/ruby.h, as well as r67033
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-11 13:43:14 +00:00
svn 10035cb4bc * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-20 07:57:31 +00:00
hsbt 814c1adec7 * ext/digest/digest.c: Add documentation for Digest.
[Feature #10452][ruby-core:66001][ci skip]
  * remove HMAC from list of digest algorithms,
  * add MD5 in list of digest algorithms,
  * add information about writing a C digest implementation using Digest::Base,
  * add documentation for Digest::Base public methods.
* ext/digest/md5/md5init.c: add examples for MD5.
* ext/digest/rmd160/rmd160init.c: add examples for Digest::RMD160.
* ext/digest/sha1/sha1init.c: add examples for Digest::SHA1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-20 07:57:30 +00:00
nobu 64fea27496 Update dependencies
* common.mk (compile.o, loadpath.o): update dependencies.

* common.mk (vm_call.o): remove stale object dependencies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:48:13 +00:00
nobu 1bdc1a5529 Local header dependencies
* lib/mkmf.rb (create_makefile): store $headers in LOCAL_HDRS for
  depend files.
* ext/digest/digest_conf.rb (digest_conf): add implementation
  specific headers to $header.
* ext/digest/{md5,rmd160,sha1,sha2}/depend: add LOCAL_HDRS to the
  dependencies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:44:58 +00:00
ngoto 8b251c6c2c * ext/digest/md5/md5ossl.h: Remove excess semicolons.
Suppress warning on Solaris with Oracle Solaris Studio 12.
  [ruby-dev:49692] [Bug #12524]
    
* ext/digest/md5/md5cc.h: ditto.
* ext/digest/sha1/sha1cc.h: ditto.
* ext/digest/sha1/sha1ossl.h: ditto.
* ext/digest/sha2/sha2cc.h: ditto.
* ext/digest/sha2/sha2ossl.h: ditto.
* ext/openssl/ossl_pkey_rsa.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 09:42:29 +00:00
akr 9d8ef4ea20 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-11 11:50:00 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
naruse 360b98355e fixup! r52695
OpenSSL's SHA1 struct name is SHA_CTX (which is also used for SHA-0),
but function name is SHA1_Transform.
http://openssl.org/docs/man0.9.8/crypto/SHA1.html

also note that LibreSSL 2.3 remove the SHA-0 support but still support SHA-1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 08:31:12 +00:00
naruse bbc63197bd * ext/digest/sha1/extconf.rb: OpenSSL's struct name for SHA1 is
SHA_CTX. http://openssl.org/docs/man0.9.8/crypto/SHA1.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-21 05:01:55 +00:00
naruse 9a7c25abab * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
includeing ext/digest/extconf.h. [Bug #3231]
  https://msdn.microsoft.com/library/36k2cdd4.aspx

* ext/digest/*/extconf.rb: remove ext/digest from include search path
  to avoid confusion of cl.exe.

* ext/digest/*/*.[ch]: explicitly specify def.h's path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-21 04:35:57 +00:00
nobu b97ceb66e9 digest: CommonDigest
* ext/digest/digest_conf.rb (digest_conf): check for CommonDigest.
* ext/digest/*/*cc.h: for Apple CommonCrypto/CommonDigest.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11 02:09:55 +00:00
nobu 935275bb59 digest: define Finish func from Final func
* ext/digest/digest.h (DEFINE_FINISH_FUNC_FROM_FINAL): macro for
  finish functions, by inverting arguments order.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11 02:09:23 +00:00
nobu b632ca436c digest: common configurations
* ext/digest/digest_conf.rb (digest_conf): extract common
  configurations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11 02:08:50 +00:00
nobu 4068d9089a digest: no ID cache
* ext/digest/*/*init.c: no need to cache interned IDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-10 23:37:08 +00:00
akr ecedd3b224 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19 13:34:54 +00:00
akr 6ca202fcee Update dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21 03:04:44 +00:00
akr dd547e1b22 Mark auogenerated part.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:14:08 +00:00
akr 57682b05e1 * common.mk: Remove comments in Dependency lines.
Notified by usa.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 10:28:25 +00:00
akr 8727eb77be * tool/update-deps: Extend to fix dependencies.
* common.mk: Dependencies updated by tool/update-deps.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 05:15:49 +00:00
nobu bb318692a6 digest/*/extconf.rb: do not link openssl when using bundled
* ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb: configure OpenSSL
  only if bundled libraries is not used, so that OpenSSL is not
  linked unnecessarily.  [ruby-core:65404] [Bug #10324]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-05 02:03:55 +00:00
nobu b208e060f2 ext/digest: hide metadata objects for internal use
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 08:29:02 +00:00
nobu 28b9f11d5a protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 05:25:32 +00:00
nobu 2f2f92b73e digest: no check for hidden objects
* ext/digest/digest.c (get_digest_base_metadata): metadata objects
  are hidden from ruby level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-29 12:17:47 +00:00
nobu aadebb29da ext/digest: return values of init and final
* ext/digest: make built-in digest function implementations
  indicate success or failure of init and final functions.
  [ruby-core:61614] [Bug #9659]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-15 14:59:20 +00:00
akr b47138580c * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.

* ext/-test-/old_thread_select/depend: Update dependencies.

* ext/-test-/wait_for_single_fd/depend: Ditto.

* ext/bigdecimal/depend: Ditto.

* ext/curses/depend: Ditto.

* ext/digest/bubblebabble/depend: Ditto.

* ext/digest/depend: Ditto.

* ext/digest/md5/depend: Ditto.

* ext/digest/rmd160/depend: Ditto.

* ext/digest/sha1/depend: Ditto.

* ext/digest/sha2/depend: Ditto.

* ext/dl/callback/depend: Ditto.

* ext/dl/depend: Ditto.

* ext/etc/depend: Ditto.

* ext/nkf/depend: Ditto.

* ext/objspace/depend: Ditto.

* ext/pty/depend: Ditto.

* ext/readline/depend: Ditto.

* ext/ripper/depend: Ditto.

* ext/sdbm/depend: Ditto.

* ext/socket/depend: Ditto.

* ext/stringio/depend: Ditto.

* ext/strscan/depend: Ditto.

* ext/syslog/depend: Ditto.

* ext/-test-/num2int/depend: Removed.

* ext/dbm/depend: Ditto.

* ext/fcntl/depend: Ditto.

* ext/gdbm/depend: Ditto.

* ext/racc/cparse/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 00:46:29 +00:00
nobu f0a229b69b extconf.rb: git rid of post-1.8 feature
* ext/digest/*/extconf.rb, ext/openssl/extconf.rb: get git rid of
  post-1.8 feature require_relative for cross compilation.
  [ruby-core:50160] [Bug #7439]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 00:58:52 +00:00
nobu 28b7df7820 * revert r35510 and r35511 which caused removing the headers everytime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-01 07:15:18 +00:00
nobu d7228e5bba depends on ext/openssl/deprecation.rb
* ext/digest/*/depend: depends on ext/openssl/deprecation.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-01 06:52:28 +00:00
nobu 26e258c807 * ext/digest/*/extconf.rb: use pkg_config to use same library with
openssl.  [ruby-core:44755][Bug #6379]
* ext/openssl/deprecation.rb: extract check for broken Apple OpenSSL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 21:03:38 +00:00
nobu 4c12eb747e * ext/openssl/extconf.rb: suppress useless deprecation warnings
from OpenSSL added by Apple.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27 01:48:52 +00:00
naruse 2646c69479 avoid rdoc's warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 20:37:12 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
knu 43b2e3be9a * ext/digest/*/extconf.rb: inttypes.h and unistd.h need not be
checked here. [ruby-dev:39032]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 16:36:54 +00:00
nobu cb50168eb0 * ext/digest/md5/md5init.c (md5), ext/digest/rmd160/rmd160init.c
(rmd160) ext/digest/sha1/sha1init.c (sha1),
  ext/digest/sha2/sha2init.c (sha256, sha384, sha512): constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-01 07:48:53 +00:00
knu 0e6521aa5d * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Silence warnings
regarding char * vs. unsigned char * mismatch; submitted by Lyle
  Johnson <lyle.johnson@gmail.com> in [ruby-core:10416].

* ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto.

* ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto.

* ext/digest/digest.c (rb_digest_base_finish,
  rb_digest_base_update): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-27 10:08:39 +00:00
knu b2c7fe1bbf * ext/digest: Prefix C constants with RUBY_ and C type names with
rb_ to avoid name clash in writing extensions.

* ext/digest: Introduce Digest::Class and Digest::Instance for
  ease of implementing subclasses and add-ons, inspried by
  gotoyuzo.

* ext/digest: The Digest::Instance module now requires and assumes
  that any instance be resettable and clonable, and add some
  convenient instance methods such as "new()", for creating a new
  copy, parameter taking "digest()" and "hexdigest()", for instant
  calculation.  These methods make digest instances work just like
  digest classes.

* ext/digest/sha2/lib/digest/sha2.rb:
  Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256,
  SHA384 and SHA512, hoping this module would make a decent
  example of a digest subclass written in Ruby.

* ext/digest/lib/digest.rb: Adjust autoload entries for SHA2
  classes.

* ext/digest/lib/digest/hmac.rb: Follow the framework updates.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-20 12:48:35 +00:00
knu d87fc2bdd4 * ext/digest/digest.c, ext/digest/digest.h,
ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c,
  ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c:
  Introduce API versioning.

* ext/digest/digest.c, ext/digest/digest.h,
  ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c,
  ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Remove
  the constants DIGEST_LENGTH and BLOCK_LENGTH and turn them into
  instance methods digest_length() and block_length().  Class
  methods with the same names are also provided, which take extra
  parameters for a digest method.

* ext/digest/lib/digest/hmac.rb: Completely redesign the API which
  is similar to Perl's, now that Digest classes can take hashing
  parameters.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13 23:23:18 +00:00
knu 5cafaa6744 * ext/digest/digest.c, ext/digest/md5/md5init.c,
ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c,
  ext/digest/sha2/sha2init.c: Add RDoc documentation.

* ext/digest/digest.txt, ext/digest/digest.txt.ja: Removed in
  favor of embedded RDoc documentation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13 11:52:18 +00:00
knu 9b81e26df2 * ext/digest/digest.c (get_digest_base_metadata): Use an instance
variable of a class object instead of a class variable for
  metadata.  This change is crucial for ruby 1.8 and applying it
  also to the trunk will assure compatibilities.

* ext/digest/md5/md5init.c (Init_md5): Ditto.

* ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.

* ext/digest/sha1/sha1init.c (Init_sha1): Ditto.

* ext/digest/sha2/sha2init.c (Init_sha2): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11 17:14:54 +00:00
knu 945a76d97b * ext/digest/digest.c (rb_digest_base_alloc,
rb_digest_base_equal): Simplify the equality check and just
  compare resulted digests since state-level equality should
  not be significant.

* ext/digest/digest.h: Ditto.

* ext/digest/*/*.[ch]: Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11 12:43:58 +00:00
matz fedfa6e5fa * ext/digest/sha1/sha1ossl.h: libssl 0.9.8c-3 defines no
SHA_BLOCK_LENGTH.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11 05:57:19 +00:00
knu cd58f3313e * ext/digest/digest.c (rb_digest_base_reset, Init_digest): Add
Digest::Base#reset.

* ext/digest/digest.h: Update the header comment.

* ext/digest/md5/md5ossl.h, ext/digest/md5/md5init.c (Init_md5):
  Define DIGEST_LENGTH and BLOCK_LENGTH.

* ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.

* ext/digest/sha1/sha1init.c (Init_sha1): Ditto.

* ext/digest/sha2/sha2init.c (Init_sha2): Ditto.

* ext/digest/depend, ext/digest/extconf.rb: Use $INSTALLFILES
  rather than adding make targets. [Pointed out by: nobu]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11 05:15:15 +00:00
knu f7579abcec * ext/digest/sha1/depend, ext/digest/sha2/depend: Remove obsolete
dependencies.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-10 04:22:30 +00:00
knu b9673f64f1 * ext/digest/digest.[ch]: Since the argument order of
hash_final_func_t was inconsistent with others, change it and
  rename to hash_finish_func_t to avoid confusion.

* ext/digest/digest.[ch]: Remove and eliminate the use of
  hash_end_func_t.  Implement hexdigest conversion in the base
  class.

* ext/digest/md5/md5.c, ext/digest/md5/md5.h,
  ext/digest/md5/md5init.c, ext/digest/md5/md5ossl.c,
  ext/digest/md5/md5ossl.h: Remove MD5_End() and change
  MD5_Final() to MD5_Finish().

* ext/digest/rmd160/depend, ext/digest/rmd160/extconf.rb,
  ext/digest/rmd160/rmd160.c, ext/digest/rmd160/rmd160.h,
  ext/digest/rmd160/rmd160hl.c, ext/digest/rmd160/rmd160init.c,
  ext/digest/rmd160/rmd160ossl.c, ext/digest/rmd160/rmd160ossl.h:
  Remove unused functions RMD160_End(), RMD160_File(),
  RMD160_Data() and change RMD160_Final() to RMD160_Finish().

* ext/digest/sha1/extconf.rb, ext/digest/sha1/sha1.c,
  ext/digest/sha1/sha1.h, ext/digest/sha1/sha1hl.c,
  ext/digest/sha1/sha1init.c, ext/digest/sha1/sha1ossl.c,
  ext/digest/sha1/sha1ossl.h: Likewise.

* ext/digest/sha2/extconf.rb, ext/digest/sha2/sha2.c,
  ext/digest/sha2/sha2.h, ext/digest/sha2/sha2hl.c,
  ext/digest/sha2/sha2init.c: Likewise.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05 11:09:42 +00:00
knu 3c29f3feef * ext/digest/md5/md5init.c (Init_md5): Now that we have digest.rb,
require "digest" rather than "digest.so".

* ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto.

* ext/digest/sha1/sha1init.c (Init_sha1): Ditto.

* ext/digest/sha2/sha2init.c (Init_sha2): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-27 14:34:49 +00:00