You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/02/26 05:31:10 UTC

[jira] Commented: (HARMONY-78) SecurityKeySpec.getEncoded returns incorrect value

    [ http://issues.apache.org/jira/browse/HARMONY-78?page=comments#action_12367811 ] 

Mikhail Loenko commented on HARMONY-78:
---------------------------------------

verified

> SecurityKeySpec.getEncoded returns incorrect value
> --------------------------------------------------
>
>          Key: HARMONY-78
>          URL: http://issues.apache.org/jira/browse/HARMONY-78
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Mikhail Loenko
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: test.java
>
> Constructor
>    SecretKeySpec(byte[] key, int offset, int len, String alg)
> should create an instance of the class with key material of size 'len'.
> In fact it creates key material of size 'key.length'
> the patch:
> Index: modules/security2/src/common/javasrc/javax/crypto/spec/SecretKeySpec.java
> ===================================================================
> --- modules/security2/src/common/javasrc/javax/crypto/spec/SecretKeySpec.java	(revision 374613)
> +++ modules/security2/src/common/javasrc/javax/crypto/spec/SecretKeySpec.java	(working copy)
> @@ -60,7 +60,7 @@
>              throw BADPARAMS_EXC;
>          }
>          this.algorithm = algorithm;
> -        this.key = new byte[key.length];
> +        this.key = new byte[len];
>          System.arraycopy(key, offset, this.key, 0, len);
>      }
>  

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