You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2006/12/18 04:50:21 UTC

[jira] Created: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

[classlib][security] Security.getProviders throws NumberFormatException unexpectedly
------------------------------------------------------------------------------------

                 Key: HARMONY-2761
                 URL: http://issues.apache.org/jira/browse/HARMONY-2761
             Project: Harmony
          Issue Type: Bug
            Reporter: Leo Li


Here is a testcase:

public void testgetProviders()
{
    Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
}

RI passes.
Harmony fails with throwing NumberFormatException.



-- 
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

        

[jira] Updated: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2761?page=all ]

Stepan Mishura updated HARMONY-2761:
------------------------------------

    Component/s: Classlib

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

-- 
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

        

[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472230 ] 

Stepan Mishura commented on HARMONY-2761:
-----------------------------------------

Yes, I'm going to resolve both issues. HARMONY-3154 resolution depends on discussion on dev-list.
Could you post your opinion there - why you think that we should follow RI in this case?

Thanks,
Stepan.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472226 ] 

Leo Li commented on HARMONY-2761:
---------------------------------

Hi, Stepan:
      If i do not miss somthing, you will fix the NumberFormatException in HARMONY-3154?
      Besides, I prefer to follow RI because we are not sure whether our customer application will rely on its behavior.

Good luck!
Leo. 

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Updated: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2761?page=all ]

Leo Li updated HARMONY-2761:
----------------------------

    Attachment: patch-2761.diff

Hi, Stepan:
      Will you pls validate the patch and apply it if appropriate?
      Besides, I made some modifications to the original testcases which have problem.

Thanks,
Leo.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

-- 
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

        

[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484074 ] 

Leo Li commented on HARMONY-2761:
---------------------------------

Hi, Stepan:
      Sorry for the delay. 
      Verified and thank you for your patch.

Good luck,
Leo.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472185 ] 

Stepan Mishura commented on HARMONY-2761:
-----------------------------------------

I've filled HARMONY-3154 for resolving issue with empty attribute value.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Closed: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stepan Mishura closed HARMONY-2761.
-----------------------------------


Verified by Leo.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Assigned: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2761?page=all ]

Stepan Mishura reassigned HARMONY-2761:
---------------------------------------

    Assignee: Stepan Mishura

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

-- 
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

        

[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2761?page=comments#action_12459250 ] 
            
Leo Li commented on HARMONY-2761:
---------------------------------

Hi, all:
      When fixing the bug, I encountered such a problem:
at Provider 314:
      
      getProperty("Signature.SHA1withDSA KeySize")) returns null thus incurs the NumberFormatException.

But if such property of the provider is null, shall we regard the provider supplies the service that the filter of  Security.getProviders requires?

If not, current Harmony has no matching provider.

If so, the provider that without the property "Signature.SHA1withDSA KeySize" will be legal for any keysize.

Besides, RI has a matching provider called "SUN version 1.5" with "Signature.SHA1withDSA KeySize" of 1024. So I suppose that current Harmony might have no matching provider.

Any suggestion?

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

-- 
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

        

[jira] Commented: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466638 ] 

Stepan Mishura commented on HARMONY-2761:
-----------------------------------------

Hi Leo,

Yes, this is a bug - Security.getProviders("Signature.SHA1withDSA KeySize:512") shouldn't throw NumberFormatException.

But from my point of view there are two separate issues here:
1) the bug for valid param string - "Signature.SHA1withDSA KeySize:512"
2) inconsistency with RI for invalid string - "Signature.SHA1withDSA KeySize"

The bug should be fixed and the question is how we should resolve inconsistency with RI. So the spec says for:
"public static Provider[] getProviders(String filter)
...
<crypto_service>.<algorithm_or_type> <attribute_name>:< attribute_value> 
The cryptographic service name must not contain any dots. There must be one or more space charaters between the the <algorithm_or_type> and the <attribute_name>. "

As I understand the spec. < attribute_value>  can not be an empty string. So the string "Signature.SHA1withDSA KeySize" is invalid and InvalidParameterException should be thrown. So Harmony implementation follows the spec. However RI accepts the string and returns a provider instance.

Also I've pick up one of tests that you modified:
@@ -140,11 +134,7 @@
         m.clear();
         m.put("AAA.BBB CCC", "");
         m.put("AAA.BBB", "");
-        try {
-            Security.getProviders(m);
-            fail("attribute value is empty string: No expected InvalidParameterException");
-        } catch (InvalidParameterException  e) {    
-        }
+        assertNull(Security.getProviders(m));        

The test follows the spec. It adds key with empty value to the map and verifies that InvalidParameterException is thrown.
The spec. says for :
"public static Provider[] getProviders(Map<String,String> filter)
...
The value associated with the key must be a non-empty string"

So if this test fails after applying the patch that means we'll have inconsistency with the spec here too.

I think Harmony follows the spec. and RI doesn't. Please correct me if I'm wrong. Thoughts?

Thanks,
Stepan.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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


[jira] Resolved: (HARMONY-2761) [classlib][security] Security.getProviders throws NumberFormatException unexpectedly

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stepan Mishura resolved HARMONY-2761.
-------------------------------------

    Resolution: Fixed

Thanks Leo, the issue was fixed in SECURITY module at r506411. The issue with empty attribute value will be resolved separately in HARMONY-3154.

Please check that the issue was resolved as you expected.

> [classlib][security] Security.getProviders throws NumberFormatException unexpectedly
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2761
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2761
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2761.diff
>
>
> Here is a testcase:
> public void testgetProviders()
> {
>     Provider[] providers = Security.getProviders("Signature.SHA1withDSA KeySize:512");
> }
> RI passes.
> Harmony fails with throwing NumberFormatException.

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