CVS: beepcore-java/src/org/beepcore/beep/profile/sasl/otp SASLOTPProfile.java,1.11.2.2,1.11.2.3

Huston Franklin <[email protected]> Mon, 15 Sep 2003 07:01:34 -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-serv2580/src/org/beepcore/beep/profile/sasl/otp

Modified Files:
      Tag: PIGGYBACKED
	SASLOTPProfile.java 
Log Message:
Cleaned up piggybacked message handling, removed references to TuningResetException.

Index: SASLOTPProfile.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/SASLOTPProfile.java,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -C2 -r1.11.2.2 -r1.11.2.3
*** SASLOTPProfile.java	1 Sep 2003 18:39:45 -0000	1.11.2.2
--- SASLOTPProfile.java	15 Sep 2003 14:01:32 -0000	1.11.2.3
***************
*** 132,191 ****
              throws StartChannelException
      {
-         Blob blob = null;
-         clearCredential(channel.getSession(), this);
- 
-         String authorize, authenticate, challenge = null;
- 
          log.debug("SASL-OTP Start Channel CCL");
  
!         OTPAuthenticator temp = new OTPAuthenticator(this);
  
          try {
- 
-             // Digest the data
-             // and generate a response (challenge) if possible
-             // to embed in the profile back.
-             if (data != null) {
-                 temp.started(channel);
-                 blob = new Blob(data);
-                 data = blob.getData();
- 
-                 try {
-                     blob = temp.receiveIDs(data);
-                     if (log.isDebugEnabled()) {
-                         log.debug("Challenge is=>" + challenge);
-                     }
-                 } catch (SASLException szf) {
-                     temp.abortNoThrow(szf.getMessage());
-                     // Write an error out in the profile
-                     blob = new Blob(Blob.STATUS_ABORT,
-                                     szf.getMessage());
-                     return;
-                 }
-                 if (log.isDebugEnabled()) {
-                     log.debug("Blobbed64 Challenge is=>" + data);
-                 }
-             }
              channel.setRequestHandler(temp);
!             if(blob != null)
!                 sendProfile(channel.getSession(), URI, blob.toString(),
!                             channel);
!             else
!                 sendProfile(channel.getSession(), URI, null, channel);
! 
!             // If we processed piggybacked data then blob will be non-null
!             // otherwise, we need to 'start' the OTPAuthenticator so that
!             // the state transitions remain valid
!             if (blob == null) {
!                 temp.started(channel);
!             }
! 
!             log.debug("Started an SASL-OTP Channel");
!         } catch (Exception x) {
!             channel.getSession().terminate(x.getMessage());
!             return;
          }
!         enableIO(channel.getSession());
!         throw new TuningResetException("SASL ANON RESET");
      }
  
--- 132,148 ----
              throws StartChannelException
      {
          log.debug("SASL-OTP Start Channel CCL");
  
!         clearCredential(channel.getSession(), this);
  
+         OTPAuthenticator temp = new OTPAuthenticator(this);
          try {
              channel.setRequestHandler(temp);
!             temp.started(channel);
!         } catch (SASLException x) {
!             throw new StartChannelException(BEEPError.CODE_REQUESTED_ACTION_NOT_TAKEN,
!                                             x.getMessage());
          }
!         log.debug("Started an SASL-OTP Channel");
      }
  



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