Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp
In directory sc8-pr-cvs1:/tmp/cvs-serv5905/src/org/beepcore/beep/profile/sasl/otp
Modified Files:
Tag: PIGGYBACKED
OTPAuthenticator.java
Log Message:
Fix to build blob correctly when both authenticatedID and authorizedID are specified.
Fix to set authorizedID to authenticatedID if no authorizedID is specified.
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.14.2.1
diff -C2 -r1.14 -r1.14.2.1
*** OTPAuthenticator.java 10 Jun 2003 18:59:22 -0000 1.14
--- OTPAuthenticator.java 1 Sep 2003 18:39:15 -0000 1.14.2.1
***************
*** 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);
|