You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ruth Cao (JIRA)" <ji...@apache.org> on 2007/01/24 04:40:49 UTC

[jira] Commented: (HARMONY-749) [classlib][security] compatibility: different exceptions for java.security.Signature getInstance(null, Provider) and sign([],int,int) methods

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

Ruth Cao commented on HARMONY-749:
----------------------------------

Hi,

I've run the test case again and found the first problem reported has been fixed in r490473. However, the second one still exists.

I'll attach a patch to fix this issue soon. Thanks.

Ruth

> [classlib][security] compatibility: different exceptions for java.security.Signature getInstance(null, Provider) and sign([],int,int) methods
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-749
>                 URL: https://issues.apache.org/jira/browse/HARMONY-749
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>
> The Harmony throws NoSuchProviderException and SignatureException while RI throws NullPointerException and IllegalArgumentException for  java.security.Signature getInstance(null, Provider) and sign([],int,int) methods
> ================= test.java =======================
> import java.security.*;
> public class test {
>      public static void main (String[] args) {  
>         try {                
>                    Signature.getInstance(null, "phj");                                                                                                        
>         } catch (Exception e) {
>                 e.printStackTrace();               
>         }
>         try {                
>                    Signature.getInstance("SHA1withRSA").sign(new byte[] {2}, 4, 5);
>         } catch (Exception e) {
>                 e.printStackTrace();               
>         }  
>     }
> }
> ===============================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
> java.lang.NullPointerException
>         at java.security.Signature.getInstance(Signature.java:320)
>         at test.main(test.java:6)
> java.lang.IllegalArgumentException: Output buffer too small for specified offset and length
>         at java.security.Signature.sign(Signature.java:567)
>         at test.main(test.java:11)
> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.security.NoSuchProviderException: Provider phj is not available
>         at java.security.Signature.getInstance(Signature.java:121)
>         at test.main(test.java:6)
> java.security.SignatureException: Signature object is not initialized properly.
>         at java.security.Signature.sign(Signature.java:256)
>         at test.main(test.java:11)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.