You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/03/22 12:57:01 UTC

[jira] Created: (HARMONY-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
---------------------------------------------------------------------------------------------

         Key: HARMONY-233
         URL: http://issues.apache.org/jira/browse/HARMONY-233
     Project: Harmony
        Type: Bug
  Components: Classlib  
    Reporter: Svetlana Samoilenko


According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.

The same problem is for javax.cripto.spec.SecretKeySpec class.

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


Re: [jira] Created: (HARMONY-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

Posted by Geir Magnusson Jr <ge...@pobox.com>.
This sounds like a bug in the *spec*, because it means that 
theoretically, there is 1.4 code that won't compile under 1.5 due to 
reasons other than collision w/ language changes and 1.4 binary wouldn't 
run.

Right?

geir


Svetlana Samoilenko (JIRA) wrote:
> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
> 
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib  
>     Reporter: Svetlana Samoilenko
> 
> 
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> 
> The same problem is for javax.cripto.spec.SecretKeySpec class.
> 

[jira] Closed: (HARMONY-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-233?page=all ]
     
Tim Ellison closed HARMONY-233:
-------------------------------


Verified by Stepan

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

-- 
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-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

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

Stepan Mishura updated HARMONY-233:
-----------------------------------

    Attachment: fixHarmony233.txt

Yes, KerberosKey  should be fixed but the bug description says that there is the same problem for javax.crypto.spec.SecretKeySpec class. According to the 5.0 spec. serialized form for SecretKeySpec class doesn't specify serialVersionID. It is inherited from interface javax.crypto.SecretKey.

I've attached patch for KerberosKey class only.

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fixHarmony233.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

-- 
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] Resolved: (HARMONY-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-233?page=all ]
     
Tim Ellison resolved HARMONY-233:
---------------------------------

    Resolution: Fixed

Thanks Stepan,

Applied patch to SECURITY module
   javax.crypto.spec.SecretKeySpec
   javax.security.auth.kerberos.KerberosKey
at repo revision 389196.

Please check that the patch was applied as you expected, and Svetlana that this fully resolves your problem.


> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

-- 
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-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

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

Tim Ellison reassigned HARMONY-233:
-----------------------------------

    Assign To: Tim Ellison

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

-- 
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-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

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

Stepan Mishura updated HARMONY-233:
-----------------------------------

    Attachment: fixKerberosKey_SecretKeySpec.txt

I've serialized object of SecretKeySpec class on Harmony and tried to deserialized it on RI. Got the following exception:
java.io.InvalidClassException: javax.crypto.spec.SecretKeySpec; local class incompatible: stream classdesc serialVersionUID = -6458860205326416073, local class serialVersionUID = 6577238317307289933

I looked at serial spec. and found that serialVersionUID must be explicitly declared otherwise it is calculated by the serialization runtime. A serialVersionUID field is not inherited! So inheriting it from interface javax.crypto.SecretKey doesn't make Harmony implementation compatible. And we have to declare it explicitly. This was discussed on harmony-dev mailing list [1] so I assume it is OK to add it to SecretKeySpec class.

The patch includes fix for KerberosKey and SecretKeySpec. Feel free to change comments to SecretKeySpec.serialVersionUID field.

[1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200601.mbox/%3c906dd82e0601190059x3162c6c6u533928579c226572@mail.gmail.com%3e

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

-- 
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-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class

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

Stepan Mishura commented on HARMONY-233:
----------------------------------------

The patch was applied as expected - thanks Tim.

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
> ---------------------------------------------------------------------------------------------
>
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
>
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class has
> public serialVersionUID field (it implements SecretKey interface that inherited this field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

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