Cipher#reset should not reset the internal state for stream cipher
------------------------------------------------------------------

                 Key: JRUBY-5126
                 URL: http://jira.codehaus.org/browse/JRUBY-5126
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby-OSSL 0.7.1
         Environment: any
            Reporter: Hiroshi Nakamura
            Assignee: Hiroshi Nakamura


Funny but net-ssh depends on this behavior. Cipher#iv=, too.
{noformat}
0% cat reset.rb 
require 'openssl'

cipher = OpenSSL::Cipher::Cipher.new("RC4")
cipher.encrypt
cipher.key = "\0\1\2\3" * (128/8/4)
str = cipher.update('hello,world')
str += cipher.final
p str

cipher.reset
cipher.iv = "\0" * 16
str = cipher.update('hello,world')
str += cipher.final
p str
0% ruby -v reset.rb
ruby 1.9.3dev (2010-09-16 trunk 29265) [x86_64-linux]
"%E\x96\xDAZ\xEF\xB2$/\x9F\x02"
">aV\xB0\xE1l\xF3oyL\x9B"
0% 
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to