[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/profile/sasl/otp OTPAuthenticator.j
Status: Beta
Brought to you by:
huston
From: Huston F. <hu...@us...> - 2003-09-13 21:17:33
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp In directory sc8-pr-cvs1:/tmp/cvs-serv19027/src/org/beepcore/beep/profile/sasl/otp Modified Files: OTPAuthenticator.java Log Message: Fix for empty authorized user Index: OTPAuthenticator.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/OTPAuthenticator.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** OTPAuthenticator.java 10 Jun 2003 18:59:22 -0000 1.14 --- OTPAuthenticator.java 13 Sep 2003 21:17:30 -0000 1.15 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2003 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks License (the *************** *** 227,231 **** credential.put(SessionCredential.AUTHENTICATOR, authenticated); ! if (authorized != null) { credential.put(SessionCredential.AUTHORIZED, authorized); } --- 228,234 ---- credential.put(SessionCredential.AUTHENTICATOR, authenticated); ! if (authorized == null || authorized.equals("")) { ! credential.put(SessionCredential.AUTHORIZED, authenticated); ! } else { credential.put(SessionCredential.AUTHORIZED, authorized); } *************** *** 337,344 **** } boolean match = true; ! for(int i = 0; i < 8; i++) { if(nextHash[i] != responseHash[i]) ! match = false; } if(!match) --- 340,347 ---- } boolean match = true; ! for(int i = 0; i < 8; i++) ///@TODO change to use array compare { if(nextHash[i] != responseHash[i]) ! match = false; ///@TODO break; } if(!match) *************** *** 465,469 **** credential.put(SessionCredential.AUTHENTICATOR, authenticateId); ! if (authorizedId != null) { credential.put(SessionCredential.AUTHORIZED, authorizedId); } --- 468,474 ---- credential.put(SessionCredential.AUTHENTICATOR, authenticateId); ! if (authorizedId == null || authorizedId.equals("")) { ! credential.put(SessionCredential.AUTHORIZED, authenticateId); ! } else { credential.put(SessionCredential.AUTHORIZED, authorizedId); } *************** *** 513,519 **** if (authorizeId != null) { temp.append(authorizeId); - } else { - temp.append((char) 0); } temp.append(authenticateId); --- 518,524 ---- if (authorizeId != null) { temp.append(authorizeId); } + + temp.append((char) 0); temp.append(authenticateId); |