From: Jamis Buck Date: 2004-07-02T22:04:38+09:00 Subject: Re: Another Ruby/OpenSSL Patch GOTOU Yuuzou wrote: > In message <40E46DA4.2010105@email.byu.edu>, > `Jamis Buck ' wrote: > >>I've attached a patch. With the addition of the DSA#do_verify method >>that this patch exposes, Net::SSH can now successfully handle ssh-dss >>server keys. > > > I think these methods can be written with existing library. > Could you try the attached code? Thank-you! That works wonderfully. Now... could I bother you for an explanation of what the code does? Specifically, the verification code: sig_r = sig[0,20].unpack("H*")[0].to_i(16) sig_s = sig[20,20].unpack("H*")[0].to_i(16) a1sig = OpenSSL::ASN1::Sequence([ OpenSSL::ASN1::Integer(sig_r), OpenSSL::ASN1::Integer(sig_s) ]) return verify(OpenSSL::Digest::DSS1.new, a1sig.to_der, data) I understand the first two lines, but what is an ASN1::Sequence, and what does converting it to a "der" (on the last line) accomplish? Thanks again! -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis ruby -ropenssl -e'k="01234567";p((c,c.padding,c.iv,c.key=OpenSSL::Cipher::BF.new,0,k,k*2)[0].decrypt.update("1A81803C452C324619D319F980D5B84DBB45FC0FE2BAA045".scan(/../).map{|n|n.to_i(16).chr}.join))'