summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-04 07:26:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-04 07:26:14 +0000
commit768afa284479d7d586263d58273355c58aee224d (patch)
tree92b3eb442534cc10a8ca261ba03b6d9c435526ab
parent5ad3d60d896ff0a7239272b1f4f1e149b534ba79 (diff)
downloadruby-768afa284479d7d586263d58273355c58aee224d.tar.gz
ruby-768afa284479d7d586263d58273355c58aee224d.tar.xz
ruby-768afa284479d7d586263d58273355c58aee224d.zip
* ext/digest/lib/digest/hmac.rb (Digest::HMAC#initialize): use
String#bytesize to avoid test errors on EUC-JP environment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/digest/lib/digest/hmac.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index edc978072..41b9052c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 4 16:24:58 2008 Tanaka Akira <akr@fsij.org>
+
+ * ext/digest/lib/digest/hmac.rb (Digest::HMAC#initialize): use
+ String#bytesize to avoid test errors on EUC-JP environment.
+
Fri Jan 4 14:00:50 2008 Tanaka Akira <akr@fsij.org>
* re.c (rb_reg_prepare_re): check string encoding. Oniguruma doesn't
diff --git a/ext/digest/lib/digest/hmac.rb b/ext/digest/lib/digest/hmac.rb
index cdd537689..0e3068b0c 100644
--- a/ext/digest/lib/digest/hmac.rb
+++ b/ext/digest/lib/digest/hmac.rb
@@ -45,7 +45,7 @@ module Digest
block_len = @md.block_length
- if key.length > block_len
+ if key.bytesize > block_len
key = @md.digest(key)
end