grnq / joid

Java OpenID = JOID OpenID providers and relying parties for OpenID 1.1 and 2.0
Other
4 stars 0 forks source link

OP generate duplicate assoc_handle on multi-thread #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. OP generate duplicate assoc_handle on multi-thread
2.
3.

What is the expected output? What do you see instead?
generate unique assoc_handle.

What version of the product are you using? On what operating system?
joid-1.0.2 on Linux 2.6.9

Please provide any additional information below.

org.apache.tsik.uuid.UUID's generate() is not thread-safe,
Crypt's generateHandle() should be synchroinized.

Crypt.java:
    synchronized public static String generateHandle()
    {
    return UUID.generate().toString();
    }

tsik src: http://svn.apache.org/repos/asf/incubator/tsik/

Original issue reported on code.google.com by chimerar...@gmail.com on 28 May 2010 at 4:26