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/15 09:32:21 UTC

[jira] Created: (HARMONY-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

[java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
-------------------------------------------------------------------------------------------------------------------------------

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


Here is a testcase:
public void test_algorithmParameters_getParamterSpec() throws Exception {
		AlgorithmParameters algorithmParameters = AlgorithmParameters
				.getInstance("DSA");
		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
				BigInteger.ONE, BigInteger.ONE));
		try {
			algorithmParameters.getParameterSpec(null);
			fail("should throw NullPointerException");

		} catch (NullPointerException e) {
			// expected
		}
	}

RI passes.
Harmony fails.

-- 
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-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

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

Stepan Mishura updated HARMONY-2733:
------------------------------------

    Component/s: Classlib

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
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] Closed: (HARMONY-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

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

Leo Li closed HARMONY-2733.
---------------------------

    Resolution: Won't Fix

Hi, all:
      The bouncy castle guys said that they would deal with it in the future.


Good luck!
Leo.

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

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

Hi, Stepan:
    You are right. I will ask bouncy castle guys how to deal with it. 
    Thank you.

Leo.

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
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-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

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

Leo Li updated HARMONY-2733:
----------------------------

    Attachment: patch-2733.diff

Will somebody try this?

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
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] Assigned: (HARMONY-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

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

Stepan Mishura reassigned HARMONY-2733:
---------------------------------------

    Assignee: Stepan Mishura

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

-- 
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-2733) [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.

Posted by "Stepan Mishura (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2733?page=comments#action_12459544 ] 
            
Stepan Mishura commented on HARMONY-2733:
-----------------------------------------

Hi Leo,

This issues is similar to HARMONY-2680. In this case NullPointerException is thrown by Sun's provider and is not thrown by BC provider.
I've added test case to security module. It passes on RI and demonstrates that null value is passed to corresponding spi-provider's method (engineGetParameterSpec(Class<T> paramSpec) ).

See:
modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java 

        //
        // test: if paramSpec is null
        //
        paramSpi = new MyAlgorithmParameters() {

            protected AlgorithmParameterSpec engineGetParameterSpec(
                    Class paramSpec) {
                assertNull(paramSpec); // null is passed to spi-provider
                return null;
            }
        };

        params = new DummyAlgorithmParameters(paramSpi, p, "algorithm");
        params.init(new MyAlgorithmParameterSpec());
        assertNull(params.getParameterSpec(null));

Thanks,
Stepan.

> [java][security]AlgorithmParameters.getParamterSpec should throw NullPointerException if the input AlgorithmSpec class is null.
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2733
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2733
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Stepan Mishura
>         Attachments: patch-2733.diff
>
>
> Here is a testcase:
> public void test_algorithmParameters_getParamterSpec() throws Exception {
> 		AlgorithmParameters algorithmParameters = AlgorithmParameters
> 				.getInstance("DSA");
> 		algorithmParameters.init(new DSAParameterSpec(BigInteger.ONE,
> 				BigInteger.ONE, BigInteger.ONE));
> 		try {
> 			algorithmParameters.getParameterSpec(null);
> 			fail("should throw NullPointerException");
> 		} catch (NullPointerException e) {
> 			// expected
> 		}
> 	}
> RI passes.
> Harmony fails.

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