harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4463) [classlib][security] X500Principal equals method work improperly
Date Fri, 04 Jan 2008 13:15:35 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555919#action_12555919

Tim Ellison commented on HARMONY-4463:

I believe that the #equals method is working correctly.  However, Harmony is producing a different
encoding for the X500Principal.

In Harmony ASN.1 we encode "dummy@acme.org" as a UTF-8 string (tag 0x0c), so it becomes "#0c0e64756d6d794061636d652e636f6d"
 whereas the RI chooses to encode it as an ASCII IA5String (tag 0x16) as in the test case.

Take a look at org.apache.harmony.security.x501.AttributeValue#getHexString() which tests
to see if the value is a printable string.

Question is how to decide the type of string to encode in 'canoncial' format.

> [classlib][security] X500Principal equals method work improperly
> ----------------------------------------------------------------
>                 Key: HARMONY-4463
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4463
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexander Kleymenov
> The following code works fine on RI while reports failure on DRLVM:
> public class test {
>     public static void main(String[] args) {
>         if(new X500Principal("EMAILADDRESS=dummy@acme.com, CN=John Doe, OU=Engineering
Department, O=ACME Software, L=Novosibirsk, ST=Russia, C=RU")
>                 .equals(new X500Principal("1.2.840.113549.1.9.1=#160e64756d6d794061636d652e636f6d,CN=John
Doe,OU=Engineering Department,O=ACME Software,L=Novosibirsk,ST=Russia,C=RU"))) {
>             System.out.println("PASSED");
>         } else {
>             System.out.println("FAILED");
>         };
>     }
> }
> This is a reason of  failure of the following functional test:
> functional/org/apache/harmony/test/func/api/java/security/cert/F_CertStoreTest_02/F_CertStoreTest_02.xml

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

View raw message