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-4857) [classlib][security] KeyPairGenerator.getInstance() fails because of AccessControlException
Date Thu, 27 Sep 2007 07:25:50 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530648
] 

Alexey Varlamov commented on HARMONY-4857:
------------------------------------------

On Windows, it fails differently for me:
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 Test4857.main(Test4857.java:31)
Caused by: java.security.AccessControlException: Permission check failed (java.s
ecurity.SecurityPermission putProviderProperty.BC)
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
        at java.lang.SecurityManager.checkSecurityAccess(SecurityManager.java:42
2)
        at java.security.Provider.put(Provider.java:236)
        at org.bouncycastle.jce.provider.BouncyCastleProvider.addMappings(Unknow
n Source)
        at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Sou
rce)
        at java.lang.reflect.VMReflection.newClassInstance(Native Method)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at org.apache.harmony.security.fortress.Services.loadProviders(Services.
java:84)
        at org.apache.harmony.security.fortress.Services.access$0(Services.java:
73)
        at org.apache.harmony.security.fortress.Services$1.run(Services.java:66)

        at java.security.AccessController.doPrivilegedImpl(Unknown Source)
        at java.security.AccessController.doPrivileged(Unknown Source)
        at org.apache.harmony.security.fortress.Services.<clinit>(Services.java:
64)
        at java.security.SecureRandom.findService(SecureRandom.java:136)
        ... 3 more

After modifying default policy file, I've managed to reproduce the initially reported one:
>>>>>>>>>>>>
grant codeBase "file:${java.ext.dirs}/*" {
	permission java.security.AllPermission;
};
============
grant codeBase "file:${java.home}/lib/ext/*" {
	permission java.security.AllPermission;
};
<<<<<<<<<<<<<

So there is at least one more issue, probably in URL comparisons on windows. Here the only
difference is the case of drive letter:
java.home=C:\users\avarlamo\trunk\working_vm\build\win_ia32_msvc_release\deploy\jdk\jre
java.ext.dirs=c:\users\avarlamo\trunk\working_vm\build\win_ia32_msvc_release\deploy\jdk\jre\lib\ext

> [classlib][security] KeyPairGenerator.getInstance() fails because of AccessControlException
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4857
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4857
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Andrey Pavlenko
>            Priority: Critical
>         Attachments: Test.java
>
>
> I'm not sure is it a bug or non-bug-diff, but the attached test fails on Hramony if some
permissions are not granted. This test pass on RI and also it pass on Harmony only if I grant
all permissions.
> The test fails with the following stack:
> java.security.NoSuchAlgorithmException: Signature MD4WithRSAEncryption implementation
not found:
>         at java.security.Provider$Service.newInstance(Provider.java:847)
>         at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:111)
>         at java.security.Signature.getInstance(Signature.java:98)
>         at Test.main(Test.java:53)
> Caused by: java.security.AccessControlException: Permission check failed (java.util.PropertyPermission
org.bouncycastle.pkcs1.strict read)
>         at java.security.AccessControlContext.checkPermission(Unknown Source)
>         at java.security.AccessController.checkPermission(Unknown Source)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
>         at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:373)
>         at java.lang.System.getProperty(Unknown Source)
>         at java.lang.System.getProperty(Unknown Source)
>         at org.bouncycastle.crypto.encodings.PKCS1Encoding.useStrict(Unknown Source)
>         at org.bouncycastle.crypto.encodings.PKCS1Encoding.<init>(Unknown Source)
>         at org.bouncycastle.jce.provider.JDKDigestSignature$MD4WithRSAEncryption.<init>(Unknown
Source)
>         at java.lang.reflect.VMReflection.newClassInstance(Native Method)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.lang.Class.newInstance(Unknown Source)
>         at java.security.Provider$Service.newInstance(Provider.java:844)
>         at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:111)
>         ... 2 more
> Signature MD4WithRSAEncryption implementation not found:

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