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 2006/07/03 11:31:30 UTC

[jira] Updated: (HARMONY-727) [classlib][security] unexpected exceptions for X509CertSelector. addSubjectAlternativeName(<2,4,6,7,8>, String name)

     [ http://issues.apache.org/jira/browse/HARMONY-727?page=all ]

Vladimir Ivanov updated HARMONY-727:
------------------------------------

    Attachment: X509CertSelectorTest.patch

unit test

> [classlib][security] unexpected exceptions for X509CertSelector. addSubjectAlternativeName(<2,4,6,7,8>, String name)
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-727
>          URL: http://issues.apache.org/jira/browse/HARMONY-727
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Vladimir Ivanov
>  Attachments: X509CertSelectorTest.patch
>
> According to 1.5 spec java.security.X509CertSelector. addSubjectAlternativeName(int type, String name) method must throw IOException - if a parsing error occurs. 
> Harmony throws
> 1)    nothing if type =2,6  and  name == null; RI throws IOException
> 2)    IAE if type =4,8 ; RI throws IOException
> 3)    NumberFormatException if type = 7 and  name == non-null incorrect string; RI throws IOException
> ===================== test.java =========================
> import java.security.cert.X509CertSelector;
> import java.io.IOException;
> public class test  {
>     public static void main (String[] args) { 
>         for (int type = 0; type <=8; type++) {
>             try {
>                 new X509CertSelector().addSubjectAlternativeName(type,"0xDFRF");                                                                         
>             } catch (IOException e) {
>                 System.out.println("[" + type + "] -> passed: " + e);
>             } catch (Exception e) {
>                 System.out.println("[" + type + "] -> failed: " + e);
>             }
>         }
>     } 
> }
> =====================================================
> 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))
> [0] -> passed: java.io.IOException: unable to parse String names of type 0
> [2] -> passed: java.io.IOException: DNSName components must begin with a letter
> [3] -> passed: java.io.IOException: unable to parse String names of type 3
> [4] -> passed: java.io.IOException: Incorrect AVA format
> [5] -> passed: java.io.IOException: unable to parse String names of type 5
> [6] -> passed: java.io.IOException: URI name must include scheme
> [7] -> passed: java.io.IOException: Invalid IPAddress: 0xDFRF
> [8] -> passed: java.io.IOException: Unable to create OIDName: java.lang.NumberFormatException: For input string: "0xDFRF"
> 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.
> [0] -> passed: java.io.IOException: Unknown string representation for type [0]
> [3] -> passed: java.io.IOException: Unknown string representation for type [3]
> [4] -> failed: java.lang.IllegalArgumentException: Invalid distinguished name string
> [5] -> passed: java.io.IOException: Unknown string representation for type [5]
> [7] -> failed: java.lang.NumberFormatException: 0xDFRF
> [8] -> failed: java.lang.IllegalArgumentException: Incorrect syntax

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