[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] Created: (SANDBOX-151) [ID]
From: "Martin Heitz (JIRA)" <jira () apache ! org>
Date: 2006-06-29 9:53:30
Message-ID: 13225994.1151574810082.JavaMail.jira () brutus
[Download RAW message or body]
[ID] VersionFourGenerator.nextIdentifier fails in secure mode
-------------------------------------------------------------
Key: SANDBOX-151
URL: http://issues.apache.org/jira/browse/SANDBOX-151
Project: Commons Sandbox
Type: Bug
Environment: This JIRA environment is horrible: If I am not logged in I cannot \
report a bug (may be OK), but I am then on a page which just does not tell me about \
authorization problems but offers me some other projects where I could report! \
Reporter: Martin Heitz Priority: Critical
Generating secure ID only works on initialization, aftyerwards always the same ID is \
returned.
Fix the wrong if-blocks, then also the third ID will be unique...:
private UUID nextUUID(boolean secure)
{
byte[] raw = new byte[UUID_BYTE_LENGTH];
if (secure) {
//Initialize the secure random if null.
if (secureRandom == null) {
try {
if (usePRNGPackage != null) {
secureRandom = SecureRandom.getInstance(usePRNG, \
usePRNGPackage); } else {
secureRandom = SecureRandom.getInstance(usePRNG);
}
} catch (NoSuchAlgorithmException nsae) {
nsae.printStackTrace();
secure = false; //Fail back to default PRNG/Random
} catch (NoSuchProviderException nspe) {
nspe.printStackTrace();
secure = false; //Fail back to default PRNG/Random
}
}
// fix by mattin
if (secureRandom != null) {
secureRandom.nextBytes(raw);
}
}
if (!secure) {
regularRandom.nextBytes(raw);
}
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic