harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-78) SecurityKeySpec.getEncoded returns incorrect value
Date Mon, 06 Feb 2006 13:14:04 GMT
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
    Priority: Minor

   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:
For more information on JIRA, see:

View raw message