Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 24762 invoked from network); 15 Nov 2007 05:51:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 05:51:32 -0000 Received: (qmail 54361 invoked by uid 500); 15 Nov 2007 05:51:18 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 54331 invoked by uid 500); 15 Nov 2007 05:51:18 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 54322 invoked by uid 99); 15 Nov 2007 05:51:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Nov 2007 21:51:18 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stepan.mishura@gmail.com designates 209.85.146.180 as permitted sender) Received: from [209.85.146.180] (HELO wa-out-1112.google.com) (209.85.146.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 05:51:08 +0000 Received: by wa-out-1112.google.com with SMTP id k22so572033waf for ; Wed, 14 Nov 2007 21:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=UXNbEWcUXBH6+kgkanOWZAxQfgIWvFHqwKf+FIpqWH8=; b=f6rxAZ9RLWZGI8FyysT23GjlTBRrzV6XUlkT1ONcwz1XMUfHZq6jJvaHzZmCc/bxjanKMdhZQmAoednPH3bBkuEWjMlaVOy5x4o+r6TQtcqAY4KyCefNsTAFljU2M5hUsrYl6eoYNQq69X7H69yd3yFhE0f2LssqeBrIcceRDIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fbjAYMr4ga1sDZ5/r/7kXQRfDHRPrRiMZ4WKKEKZXD0TA9vpkFWsro9im1xUxTW+iv6H3+8XcV91y50gpgDXqXiFbS+mOo1dfdmHmD+Yv1uStizP3ryj5QoZO0lV5FsC0UU7aYyPbr5Y3jr3Jjjo/gDEHdKZNIY0P609xqL7zPE= Received: by 10.114.149.2 with SMTP id w2mr347211wad.1195105860055; Wed, 14 Nov 2007 21:51:00 -0800 (PST) Received: by 10.114.61.20 with HTTP; Wed, 14 Nov 2007 21:50:59 -0800 (PST) Message-ID: <6e47b64f0711142150w5f52d4ecvebd6c21accc9253f@mail.gmail.com> Date: Thu, 15 Nov 2007 11:50:59 +0600 From: "Stepan Mishura" To: dev@harmony.apache.org Subject: Re: [classlib][security] HARMONY-5054 status was ([jira] Created: (HARMONY-5054) [ASN.1] BerInputStream will incorrectly resize buffer when the enveloped InputStream has lots of bytes) In-Reply-To: <473c46620711141850u4f5586a5v7c8306e57368197d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <473c46620711111853h5209c9bdh408721bd9cb05848@mail.gmail.com> <6e47b64f0711120752h2a6ff72bl80ad4a109731fe5c@mail.gmail.com> <473c46620711131823y103704cct8e15712e2b97e284@mail.gmail.com> <6e47b64f0711140412k29ffdcd1v5a0ab48db1de141a@mail.gmail.com> <6e47b64f0711140913n12fa2271wc66e1a8379b9334d@mail.gmail.com> <473c46620711141850u4f5586a5v7c8306e57368197d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 11/15/07, Spark Shen wrote: > 2007/11/15, Stepan Mishura : > > > > On 11/14/07, Stepan Mishura wrote: > > > > > > When decoding input from an inputStream retrieved from socket, the if > > > > statement here is not adequate > > > > to guarantee all the response bytes from server been collected. > > > > > > > > I doubt the off-line reproducer can unveal this bug. Correct if I am > > wrong. > > > > > > > > > > I got the idea and going to try to create off-line reproducer by > > > implementing custom InputStream. > > > > Spark, > > > > Does the test below model correctly your case? > > > > byte[] encoding = { 0x04, 0x0F, 0x01, 0x02, > > 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, > > 0x0C, > > 0x0D, 0x0E, 0x0F }; > > > > // custom input stream that doesn't return all data at once > > ByteArrayInputStream in = new ByteArrayInputStream(encoding) { > > public int read(byte[] b, int off, int len) { > > if (len < 2) { > > return super.read(b, off, len); > > } else { > > return super.read(b, off, len - 1); > > } > > > > } > > }; > > > > BerInputStream berIn = new BerInputStream(in); > > berIn.readContent(); > > > Oh, Yes, I think so. > Fixed at r595216. Please verify. -Stepan.