CVS: beepcore-java/src/org/beepcore/beep/profile/sasl/otp OTPAuthenticator.java,1.14,1.15

Huston Franklin <[email protected]> Sat, 13 Sep 2003 14:17:32 -0700
Newsgroups gmane.network.beep.beepcore.java.cvs
Message-ID <[email protected]>
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);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf