Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tagish password-based authentication has a race condition #2

Open
GoogleCodeExporter opened this issue Feb 1, 2016 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. call com.tagish.auth.Utils.cryptPassword simultaneously from two different 
threads
2. watch it return a corrupt byte array
3. or you could indirectly call it by having two tagish FileLogin or DbLogin 
instances authenticate two users at the same time on two different threads, and 
having one or both logins fail.

What is the expected output? What do you see instead?
I would expect cryptPassword to return correct results independent of how many 
threads were calling it at the same time.

What version of the product are you using? On what operating system?
// $Id: Utils.java,v 1.5 2003/02/17 20:13:23 andy Exp $

Please provide any additional information below.

To solve the problem, simply change line 89 in 
OWASPJaasLoginModule/src/com/tagish/auth/Utils.java from:
  public static char[] cryptPassword(char pwd[]) throws Exception
to:
  public static synchronized char[] cryptPassword(char pwd[]) throws Exception


Original issue reported on code.google.com by [email protected] on 30 Nov 2011 at 4:28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant