Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 67563 invoked from network); 12 May 2009 14:24:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 May 2009 14:24:16 -0000 Received: (qmail 63945 invoked by uid 500); 12 May 2009 14:04:18 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 63900 invoked by uid 500); 12 May 2009 14:04:14 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 63848 invoked by uid 99); 12 May 2009 14:04:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 14:04:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 14:04:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 934EC234C004 for ; Tue, 12 May 2009 07:03:45 -0700 (PDT) Message-ID: <1941487713.1242137025588.JavaMail.jira@brutus> Date: Tue, 12 May 2009 07:03:45 -0700 (PDT) From: "Chris Gray (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6202) JarEntry.getCertificates() not working with JarEntryStream In-Reply-To: <1333060938.1241894085573.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708446#action_12708446 ] Chris Gray commented on HARMONY-6202: ------------------------------------- Following Works For Me(TM), i.e. it causes the appropriate information to be passed to the JarVerifier: In JarInputStream.getNextEntry, at the start of the first else clause (i.e. if mEntry is null), if isMeta is true then call read([BII) until the entry is exhausted (i.e. it returns null). Then call super.getNextEntry as before. I would post code but I guess I should do paperwork first ... > JarEntry.getCertificates() not working with JarEntryStream > ---------------------------------------------------------- > > Key: HARMONY-6202 > URL: https://issues.apache.org/jira/browse/HARMONY-6202 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: x86/Linux, Eclipse Harmony plugin > Reporter: Chris Gray > > Following code fails on Harmony, i.e. prints "No certificates" even though the jar has been signed with Sun's jarsigner tool. Code works on RI 1.4, fails on RI 1.5 (subject of Sun bug report no. 6284489), works on RI 1.6. > import java.io.BufferedInputStream; > import java.io.FileInputStream; > import java.util.Enumeration; > import java.util.jar.*; > class SignatureTest2 { > static public void main(String[] args) { > if (args.length == 0) { > System.out.println("Usage: SignatueTest2 path/to/jarfile.jar"); > } > try { > String filename = args[0]; > System.out.println("Opening file: " + filename); > System.out.println(); > FileInputStream fis = new FileInputStream(filename); > BufferedInputStream bis = new BufferedInputStream(fis, 8192); > JarInputStream jis = new JarInputStream(bis); > Manifest m = jis.getManifest(); > JarEntry je = jis.getNextJarEntry(); > while (je != null) { > System.out.println("JarEntry: " + je); > if (!je.isDirectory()) { > String name = je.getName(); > if (!name.startsWith("META-INF/")) { > jis.closeEntry(); > java.security.cert.Certificate[] certs = je.getCertificates(); > if (certs == null) { > System.out.println("No certificates"); > } > else { > System.out.println("Certificates:"); > for (int i = 0; i < certs.length; ++i) > System.out.println(certs[i].toString()); > } > System.out.println(); > } > } > je = jis.getNextJarEntry(); > } > } > catch (Throwable t) { > t.printStackTrace(); > } > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.