From: GOTOU Yuuzou Date: 2004-06-14T04:04:32+09:00 Subject: Re: OpenSSL: patch Hi, In message <40CB365B.3000409@email.byu.edu>, `Jamis Buck ' wrote: > Attached is a patch for the Ruby/OpenSSL module, done against the code > in the snapshot.tar.gz file as currently available from > http://www.ruby-lang.org. Thanks a lot. Your patch seems a good solution. It will be applied when the CVS service's back. But a question. In ossl_pkey_dh.c, you made dh_bignum_accessors without using OSSL_PKEY_BN and DEF_OSSL_PKEY_BN. Does these macro have any problem? > This patch adds functionality necessary to support SSH operations. I > have also added a new method to Cipher::Cipher: called "crypt". I did > this because I couldn't get the update/final stuff to work. This may > have been because I do not have a complete understanding of how they are > *supposed* to work. Cipher#update and Cipher#final return a String; it is a set of streamable interface. I feel that Cipher#crypt may be added if you need a block specific interface. require "openssl" bf = OpenSSL::Cipher::Cipher.new("bf") bf.encrypt bf.key = "0123456789abcdef" bf.iv = "01234567" ciphertext = "" ciphertext << bf.update("line 1\n") ciphertext << bf.update("line 2\n") ciphertext << bf.final p ciphertext > Still, I have a very hacked-together SSH client in > Ruby now, using the routines provided by this patch. I look forward to reading it:) regards, -- gotoyuzo