You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrey Pavlenko (JIRA)" <ji...@apache.org> on 2008/05/13 13:22:55 UTC

[jira] Created: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator

[classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator
--------------------------------------------------------------------------------

                 Key: HARMONY-5823
                 URL: https://issues.apache.org/jira/browse/HARMONY-5823
             Project: Harmony
          Issue Type: Bug
    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.


[jira] Commented: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877338#action_12877338 ] 

Mark Hindess commented on HARMONY-5823:
---------------------------------------

Before close we should probably add a regression test and check the "failures of the security functional tests" - they might get further now and show up more bugs.


> [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
>            Assignee: Mark Hindess
>             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.


[jira] Commented: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870558#action_12870558 ] 

Kevin Zhou commented on HARMONY-5823:
-------------------------------------

I can not reproduce it on svn revision r947582,

Thanks

> [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.


[jira] Commented: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator

Posted by "Alexey Varlamov (JIRA)" <ji...@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.<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.


[jira] Resolved: (HARMONY-5823) [classlib][security] ExceptionInInitializerError when accessing KeyPairGenerator

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Hindess resolved HARMONY-5823.
-----------------------------------

      Assignee: Mark Hindess
    Resolution: Fixed

I agree this seems to have been fixed.

> [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
>            Assignee: Mark Hindess
>             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.