You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Ivanov (JIRA)" <ji...@apache.org> on 2007/01/31 07:08:06 UTC
[jira] Closed: (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:all-tabpanel ]
Vladimir Ivanov closed HARMONY-749.
-----------------------------------
Verified. Thanks.
> [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.