harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-749) [classlib][security] compatibility: different exceptions for java.security.Signature getInstance(null, Provider) and sign([],int,int) methods
Date Wed, 31 Jan 2007 03:04:33 GMT

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

Richard Liang resolved HARMONY-749.
-----------------------------------

    Resolution: Fixed

The patch has been applied at revision r501701. Thank you, Ruth for this enhancements.

Vladimir, would you please verify this issue is fixed as you expected. Thanks a lot.

Richard.

> [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
>         Assigned To: Richard Liang
>         Attachments: Harmony-749.diff
>
>
> 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.


Mime
View raw message