You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2007/04/03 11:06:32 UTC
[jira] Created: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit
-------------------------------------------------------------------------------------------------------
Key: HARMONY-3552
URL: https://issues.apache.org/jira/browse/HARMONY-3552
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Leo Li
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Leo Li (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leo Li updated HARMONY-3552:
----------------------------
Attachment: patch-3552.diff
Will somebody try the patch?
Thanks,
Leo.
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
> Attachments: patch-3552.diff
>
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paulex Yang closed HARMONY-3552.
--------------------------------
Verified by Leo.
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Paulex Yang
> Attachments: patch-3552.diff
>
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Leo Li (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leo Li updated HARMONY-3552:
----------------------------
Estimated Complexity: Moderate
Description:
Here is a testcase:
public void test_Next() throws Exception {
MySecureRandom mySecureRandom = new MySecureRandom(
new MySecureRandomSpi(), null);
int numBits = 29;
int random = mySecureRandom.getNext(numBits);
assertEquals(numBits, Integer.bitCount(random));
}
class MySecureRandom extends SecureRandom {
private static final long serialVersionUID = 1L;
public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
super(secureRandomSpi, provider);
}
public int getNext(int numBits) {
return super.next(numBits);
}
}
class MySecureRandomSpi extends SecureRandomSpi {
private static final long serialVersionUID = 1L;
@Override
protected byte[] engineGenerateSeed(int arg0) {
return null;
}
@Override
protected void engineNextBytes(byte[] bytes) {
for (int i = 0; i < bytes.length; i++) {
bytes[i] = (byte) 0xFF;
}
}
@Override
protected void engineSetSeed(byte[] arg0) {
return;
}
}
RI passes.
Harmony fails with an int with length 32.
Summary: [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required. (was: [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit )
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Leo Li (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488044 ]
Leo Li commented on HARMONY-3552:
---------------------------------
Verified, Thanks.
Leo
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Paulex Yang
> Attachments: patch-3552.diff
>
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paulex Yang resolved HARMONY-3552.
----------------------------------
Resolution: Fixed
Leo, patch applied at r526042, thanks a lot, please verify.
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Paulex Yang
> Attachments: patch-3552.diff
>
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-3552)
[classlib][security]java.security.SecureRandom.next(int bitCount) returns a
int which has a longer bit length than required.
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paulex Yang reassigned HARMONY-3552:
------------------------------------
Assignee: Paulex Yang
> [classlib][security]java.security.SecureRandom.next(int bitCount) returns a int which has a longer bit length than required.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3552
> URL: https://issues.apache.org/jira/browse/HARMONY-3552
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Paulex Yang
> Attachments: patch-3552.diff
>
>
> Here is a testcase:
> public void test_Next() throws Exception {
> MySecureRandom mySecureRandom = new MySecureRandom(
> new MySecureRandomSpi(), null);
> int numBits = 29;
> int random = mySecureRandom.getNext(numBits);
> assertEquals(numBits, Integer.bitCount(random));
> }
>
> class MySecureRandom extends SecureRandom {
> private static final long serialVersionUID = 1L;
> public MySecureRandom(SecureRandomSpi secureRandomSpi, Provider provider) {
> super(secureRandomSpi, provider);
> }
> public int getNext(int numBits) {
> return super.next(numBits);
> }
> }
> class MySecureRandomSpi extends SecureRandomSpi {
> private static final long serialVersionUID = 1L;
> @Override
> protected byte[] engineGenerateSeed(int arg0) {
> return null;
> }
> @Override
> protected void engineNextBytes(byte[] bytes) {
> for (int i = 0; i < bytes.length; i++) {
> bytes[i] = (byte) 0xFF;
> }
> }
> @Override
> protected void engineSetSeed(byte[] arg0) {
> return;
> }
> }
> RI passes.
> Harmony fails with an int with length 32.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.