From bff51b5578d30698f272a61a76a07fe4a1bb9465 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 30 Jul 2007 05:21:02 +0000 Subject: [PATCH] Typo fix git-svn-id: file:///home/svn/framework3/trunk@5067 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/proto/smb/utils.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rex/proto/smb/utils.rb b/lib/rex/proto/smb/utils.rb index 891a6eb0b2..ec0ea246a4 100644 --- a/lib/rex/proto/smb/utils.rb +++ b/lib/rex/proto/smb/utils.rb @@ -97,25 +97,25 @@ CONST = Rex::Proto::SMB::Constants # # Prepends an ASN1 formatted length field to a piece of data # - def self.asn1encode(data = '') + def self.asn1encode(str = '') res = '' # If the high bit of the first byte is 1, it contains the number of # length bytes that follow - case data.length + case str.length when 0 .. 0x7F - res = [data.length].pack('C') + data + res = [str.length].pack('C') + str when 0x80 .. 0xFF - res = [0x81, data.length].pack('CC') + data + res = [0x81, str.length].pack('CC') + str when 0x100 .. 0xFFFF - res = [0x82, data.length].pack('Cn') + data + res = [0x82, str.length].pack('Cn') + str when 0x10000 .. 0xffffff - res = [0x83, data.length >> 16, data.length & 0xFFFF].pack('CCn') + data + res = [0x83, str.length >> 16, str.length & 0xFFFF].pack('CCn') + str when 0x1000000 .. 0xffffffff - res = [0x84, data.length].pack('CN') + data + res = [0x84, str.length].pack('CN') + str else - raise "ASN1 data too long" + raise "ASN1 str too long" end return res end