mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/securerandom.rb (SecureRandom.random_bytes): return string should
be ASCII-8BIT. [ruby-core:24640] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
00499c097f
commit
971f2bb769
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jul 31 18:01:34 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/securerandom.rb (SecureRandom.random_bytes): return string should
|
||||||
|
be ASCII-8BIT. [ruby-core:24640]
|
||||||
|
|
||||||
Fri Jul 31 16:28:33 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
Fri Jul 31 16:28:33 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_stdio_set_default_encoding): added.
|
* io.c (rb_stdio_set_default_encoding): added.
|
||||||
|
|
|
@ -104,7 +104,7 @@ module SecureRandom
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if @has_win32
|
if @has_win32
|
||||||
bytes = " " * n
|
bytes = " ".force_encoding("ASCII-8BIT") * n
|
||||||
if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
|
if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
|
||||||
raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
|
raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue