harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator
Date Mon, 26 May 2008 08:51:55 GMT

    [ 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.<init>(SecureRandom.java:101)
        at java.security.KeyPairGenerator.<clinit>(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.<init>(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.<clinit>(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.<init>(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.


Mime
View raw message