harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-749) [classlib][security] compatibility: different exceptions for java.security.Signature getInstance(null, Provider) and sign([],int,int) methods
Date Tue, 04 Jul 2006 13:06:29 GMT
[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
        Type: Bug

    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