Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 10239 invoked from network); 26 May 2008 08:52:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 May 2008 08:52:20 -0000 Received: (qmail 92294 invoked by uid 500); 26 May 2008 08:52:21 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 92276 invoked by uid 500); 26 May 2008 08:52:21 -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 92267 invoked by uid 99); 26 May 2008 08:52:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2008 01:52:21 -0700 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; Mon, 26 May 2008 08:51:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EFCB6234C128 for ; Mon, 26 May 2008 01:51:55 -0700 (PDT) Message-ID: <1912619819.1211791915981.JavaMail.jira@brutus> Date: Mon, 26 May 2008 01:51:55 -0700 (PDT) From: "Alexey Varlamov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator In-Reply-To: <243381504.1210677775662.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599788#action_12599788 ] Alexey Varlamov commented on HARMONY-5823: ------------------------------------------ Funny, this is indeed Linux-specific. Reproduced: java.lang.ExceptionInInitializerError at java.security.SecureRandom.findService(SecureRandom.java:136) at java.security.SecureRandom.(SecureRandom.java:101) at java.security.KeyPairGenerator.(KeyPairGenerator.java:45) at Test5823.main(Test5823.java:8) Caused by: java.security.AccessControlException: Permission check failed (java.security.SecurityPermission putProviderProperty.BC) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:133) at java.security.AccessController.checkPermission(AccessController.java:194) at java.lang.SecurityManager.checkPermission(SecurityManager.java:746) at java.lang.SecurityManager.checkSecurityAccess(SecurityManager.java:422) at java.security.Provider.put(Provider.java:237) at org.bouncycastle.jce.provider.BouncyCastleProvider.addMappings(Unknown Source) at org.bouncycastle.jce.provider.BouncyCastleProvider.(Unknown Source) at java.lang.reflect.VMReflection.newClassInstance(VMReflection.java) at java.lang.reflect.Constructor.newInstance(Constructor.java:283) at java.lang.Class.newInstance(Class.java:740) at org.apache.harmony.security.fortress.Services.loadProviders(Services.java:86) at org.apache.harmony.security.fortress.Services.access$0(Services.java:75) at org.apache.harmony.security.fortress.Services$1.run(Services.java:68) at java.security.AccessController.doPrivilegedImpl(AccessController.java:171) at java.security.AccessController.doPrivileged(AccessController.java:53) at org.apache.harmony.security.fortress.Services.(Services.java:66) at java.security.SecureRandom.findService(SecureRandom.java:136) ... 3 more Apparently BouncyCastleProvider is guilty, it should use privileged block to access security properties: at org.bouncycastle.jce.provider.BouncyCastleProvider.addMappings(Unknown Source) at org.bouncycastle.jce.provider.BouncyCastleProvider.(Unknown Source) Please file a bug to BC. > [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator > -------------------------------------------------------------------------------- > > Key: HARMONY-5823 > URL: https://issues.apache.org/jira/browse/HARMONY-5823 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M6 > Environment: SLES 10 x86 > Reporter: Andrey Pavlenko > Fix For: 5.0M6 > > > The following code causes ExceptionInInitializerError under Linux x86. > import java.security.KeyPairGenerator; > import java.security.NoSuchAlgorithmException; > public class Test { > public static void main(String[] args) throws NoSuchAlgorithmException { > System.setSecurityManager(new SecurityManager()); > KeyPairGenerator.getInstance("RSA"); > } > } > This issue is a regression, it causes failures of the security functional tests http://people.apache.org/~smishura/r653525/Linux_x86/func/junit/index.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.