harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-749) [classlib][security] compatibility: different exceptions for java.security.Signature getInstance(null, Provider) and sign([],int,int) methods
Date Thu, 26 Oct 2006 19:26:53 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-749?page=all ]

Geir Magnusson Jr updated HARMONY-749:
--------------------------------------

    Component/s: Classlib

> [classlib][security] compatibility: different exceptions for java.security.Signature
getInstance(null, Provider) and sign([],int,int) methods
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-749
>                 URL: http://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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message