CVS: beepcore-java/src/org/beepcore/beep/profile/sasl/otp SASLOTPProfile.java,1.8,1.9 OTPDictionary.java,1.2,1.3 OTPGenerator.java,1.4,1.5 OTPAuthenticator.java,1.11,1.12

Huston Franklin <[email protected]> Sat, 05 Oct 2002 08:32:08 -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 usw-pr-cvs1:/tmp/cvs-serv7819/src/org/beepcore/beep/profile/sasl/otp

Modified Files:
	SASLOTPProfile.java OTPDictionary.java OTPGenerator.java 
	OTPAuthenticator.java 
Log Message:
changed to use commons-logging

Index: SASLOTPProfile.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/SASLOTPProfile.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** SASLOTPProfile.java	22 Aug 2002 17:51:31 -0000	1.8
--- SASLOTPProfile.java	5 Oct 2002 15:32:06 -0000	1.9
***************
*** 25,28 ****
--- 25,31 ----
  import sun.misc.BASE64Encoder;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  import org.beepcore.beep.core.*;
  import org.beepcore.beep.profile.*;
***************
*** 33,37 ****
  import org.beepcore.beep.profile.sasl.otp.database.*;
  import org.beepcore.beep.transport.tcp.*;
- import org.beepcore.beep.util.*;
  
  
--- 36,39 ----
***************
*** 73,76 ****
--- 75,80 ----
  
      // Instance Data
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      private Hashtable authenticators;
      private MD5 md5;
***************
*** 138,142 ****
          String authorize, authenticate, challenge = null;
  
!         Log.logEntry(Log.SEV_DEBUG, SASL_OTP, "SASL-OTP Start Channel CCL");
  
          OTPAuthenticator temp = new OTPAuthenticator(this);
--- 142,146 ----
          String authorize, authenticate, challenge = null;
  
!         log.debug("SASL-OTP Start Channel CCL");
  
          OTPAuthenticator temp = new OTPAuthenticator(this);
***************
*** 154,159 ****
                  try {
                      blob = temp.receiveIDs(data);
!                     Log.logEntry(Log.SEV_DEBUG, SASL_OTP,
!                                  "Challenge is=>" + challenge);
                  } catch (SASLException szf) {
                      temp.abortNoThrow(szf.getMessage());
--- 158,164 ----
                  try {
                      blob = temp.receiveIDs(data);
!                     if (log.isDebugEnabled()) {
!                         log.debug("Challenge is=>" + challenge);
!                     }
                  } catch (SASLException szf) {
                      temp.abortNoThrow(szf.getMessage());
***************
*** 163,168 ****
                      return;
                  }
!                 Log.logEntry(Log.SEV_DEBUG, SASL_OTP,
!                              "Blobbed64 Challenge is=>" + data);
              }
              channel.setMessageListener(temp);
--- 168,174 ----
                      return;
                  }
!                 if (log.isDebugEnabled()) {
!                     log.debug("Blobbed64 Challenge is=>" + data);
!                 }
              }
              channel.setMessageListener(temp);
***************
*** 180,184 ****
              }
  
!             Log.logEntry(Log.SEV_DEBUG, "Started an SASL-OTP Channel");
          } catch (Exception x) {
              channel.getSession().terminate(x.getMessage());
--- 186,190 ----
              }
  
!             log.debug("Started an SASL-OTP Channel");
          } catch (Exception x) {
              channel.getSession().terminate(x.getMessage());
***************
*** 306,314 ****
          boolean success = false;
          
!         if (authenticateId == null || 
!             session == null ||
!             pwd == null ) {
!             Log.logEntry(Log.SEV_ERROR, SASL_OTP,
!                          ERR_INVALID_ID + authenticateId);
  
              throw new InvalidParameterException(ERR_INVALID_ID
--- 312,316 ----
          boolean success = false;
          
!         if (authenticateId == null || session == null || pwd == null ) {
  
              throw new InvalidParameterException(ERR_INVALID_ID
***************
*** 370,376 ****
                  } else {
                      success = true;
-                     Log.logEntry(Log.SEV_DEBUG, SASL_OTP,
-                                  "Wow, cool!!! " + session
-                                  + " is valid for\n" + cred.toString());
                  }
              }
--- 372,375 ----
***************
*** 408,414 ****
          
          if (authenticateId == null) {
-             Log.logEntry(Log.SEV_ERROR, SASL_OTP,
-                          ERR_INVALID_ID + authenticateId);
- 
              throw new InvalidParameterException(ERR_INVALID_ID
                                                  + authenticateId);
--- 407,410 ----
***************
*** 469,475 ****
                  } else {
                      success = true;
-                     Log.logEntry(Log.SEV_DEBUG, SASL_OTP,
-                                  "Wow, cool!!! " + session
-                                  + " is valid for\n" + cred.toString());
                  }
              }
--- 465,468 ----
***************
*** 584,590 ****
                  } else {
                      success = true;
-                     Log.logEntry(Log.SEV_DEBUG, SASL_OTP,
-                                  "Wow, cool!!! " + session
-                                  + " is valid for\n" + cred.toString());
                  }
              }
--- 577,580 ----
***************
*** 594,602 ****
  
          return session;
-     }
- 
-     static void printHex(byte buff[])
-     {
-         Log.logEntry(Log.SEV_DEBUG, SASL_OTP, convertBytesToHex(buff));
      }
  
--- 584,587 ----

Index: OTPDictionary.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/OTPDictionary.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** OTPDictionary.java	8 Nov 2001 05:51:34 -0000	1.2
--- OTPDictionary.java	5 Oct 2002 15:32:06 -0000	1.3
***************
*** 22,29 ****
  import java.util.StringTokenizer;
  
  import org.beepcore.beep.profile.sasl.SASLException;
  import org.beepcore.beep.profile.sasl.InvalidParameterException;
- import org.beepcore.beep.util.ConsoleLog;
- import org.beepcore.beep.util.Log;
  
  
--- 22,30 ----
  import java.util.StringTokenizer;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  import org.beepcore.beep.profile.sasl.SASLException;
  import org.beepcore.beep.profile.sasl.InvalidParameterException;
  
  
***************
*** 449,452 ****
--- 450,455 ----
                                        "YELL", "YOGA", "YOKE" };
  
+     private static Log slog = LogFactory.getLog(OTPDictionary.class);
+ 
      static public String find(int index) throws InvalidParameterException
      {
***************
*** 491,495 ****
  
          if (i == null) {
!             Log.logEntry(Log.SEV_ERROR, "OTPDictionary", ERR_INVALID_HASH);
  
              throw new InvalidParameterException("Invalid OTP word=>" + s);
--- 494,498 ----
  
          if (i == null) {
!             slog.error(ERR_INVALID_HASH);
  
              throw new InvalidParameterException("Invalid OTP word=>" + s);
***************
*** 521,526 ****
  
          if (st.countTokens() != 6) {
!             Log.logEntry(Log.SEV_ERROR, "OTPDictionary",
!                          "Failed to hash=>" + words);
  
              throw new InvalidParameterException(ERR_INVALID_HASH);
--- 524,528 ----
  
          if (st.countTokens() != 6) {
!             slog.error("Failed to hash=>" + words);
  
              throw new InvalidParameterException(ERR_INVALID_HASH);
***************
*** 587,591 ****
          }
  
!         Log.logEntry(Log.SEV_CRITICAL, "OTPDictionary", ERR_INVALID_HASH);
  
          throw new RuntimeException(ERR_INVALID_HASH);
--- 589,593 ----
          }
  
!         slog.error(ERR_INVALID_HASH);
  
          throw new RuntimeException(ERR_INVALID_HASH);

Index: OTPGenerator.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/OTPGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** OTPGenerator.java	8 Nov 2001 05:51:34 -0000	1.4
--- OTPGenerator.java	5 Oct 2002 15:32:06 -0000	1.5
***************
*** 254,257 ****
--- 254,262 ----
      }
          
+     static void printHex(byte buff[])
+     {
+         System.out.println(SASLOTPProfile.convertBytesToHex(buff));
+     }
+ 
      /**
       * Method main is the method used to run the OTP generator.
***************
*** 296,300 ****
          }
  
!         SASLOTPProfile.printHex(hash);
  
          passphrase = SASLOTPProfile.convertBytesToHex(hash);
--- 301,305 ----
          }
  
!         printHex(hash);
  
          passphrase = SASLOTPProfile.convertBytesToHex(hash);

Index: OTPAuthenticator.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/OTPAuthenticator.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** OTPAuthenticator.java	10 Nov 2001 21:33:29 -0000	1.11
--- OTPAuthenticator.java	5 Oct 2002 15:32:06 -0000	1.12
***************
*** 25,30 ****
  import java.util.StringTokenizer;
  
  import org.beepcore.beep.core.*;
- import org.beepcore.beep.util.*;
  import org.beepcore.beep.profile.sasl.*;
  import org.beepcore.beep.profile.sasl.otp.algorithm.*;
--- 25,32 ----
  import java.util.StringTokenizer;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  import org.beepcore.beep.core.*;
  import org.beepcore.beep.profile.sasl.*;
  import org.beepcore.beep.profile.sasl.otp.algorithm.*;
***************
*** 97,100 ****
--- 99,104 ----
  
      // Data
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      private int state;
      private Algorithm algorithm;
***************
*** 113,118 ****
      OTPAuthenticator(SASLOTPProfile otpProfile)
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "Creating Listener OTP Authenticator");
  
          authenticated = null;
--- 117,121 ----
      OTPAuthenticator(SASLOTPProfile otpProfile)
      {
!         log.debug("Creating Listener OTP Authenticator");
  
          authenticated = null;
***************
*** 134,139 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "Starting OTP Authenticator");
  
          if (state != STATE_UNKNOWN) {
--- 137,141 ----
          throws SASLException
      {
!         log.debug("Starting OTP Authenticator");
  
          if (state != STATE_UNKNOWN) {
***************
*** 153,158 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator Receiving IDs");
  
          // If we're listening, the last state we should
--- 155,159 ----
          throws SASLException
      {
!         log.debug("OTP Authenticator Receiving IDs");
  
          // If we're listening, the last state we should
***************
*** 162,166 ****
          }
  
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, "Data is" + data);
  
          int i = data.charAt(0);    // data.indexOf(SPACE_CHAR);
--- 163,169 ----
          }
  
!         if (log.isDebugEnabled()) {
!             log.debug("Data is" + data);
!         }
  
          int i = data.charAt(0);    // data.indexOf(SPACE_CHAR);
***************
*** 194,199 ****
          }
  
!         Log.logEntry(Log.SEV_DEBUG, 
!                      "Fetching DB for " + authenticated);
  
          try
--- 197,203 ----
          }
  
!         if (log.isDebugEnabled()) {
!             log.debug("Fetching DB for " + authenticated);
!         }
  
          try
***************
*** 243,248 ****
          challenge.append(SPACE);
          challenge.append(EXT);
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "Generated Challenge=>" + challenge.toString());
  
          try
--- 247,253 ----
          challenge.append(SPACE);
          challenge.append(EXT);
!         if (log.isDebugEnabled()) {
!             log.debug("Generated Challenge=>" + challenge.toString());
!         }
  
          try
***************
*** 271,277 ****
          boolean doInit = false;
          byte responseHash[] = null;
!         
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator validating response");
  
          // If we're listening, the last state we should
--- 276,281 ----
          boolean doInit = false;
          byte responseHash[] = null;
! 
!         log.debug("OTP Authenticator validating response");
  
          // If we're listening, the last state we should
***************
*** 298,309 ****
              response = response.substring(WORD.length());
              long l = OTPDictionary.convertWordsToHash(response);
!             responseHash = profile.convertLongToBytes(l);            
!             Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                          "Hacked response=>" + response);
          } else if (response.indexOf(HEX) != -1) {
              response = response.substring(HEX.length());
              responseHash = profile.convertHexToBytes(response);
!             Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                          "Hacked response=>" + response);
          } else {
              abort(ERR_UNEXPECTED_MESSAGE);
--- 302,315 ----
              response = response.substring(WORD.length());
              long l = OTPDictionary.convertWordsToHash(response);
!             responseHash = profile.convertLongToBytes(l);
!             if (log.isDebugEnabled()) {
!                 log.debug("Hacked response=>" + response);
!             }
          } else if (response.indexOf(HEX) != -1) {
              response = response.substring(HEX.length());
              responseHash = profile.convertHexToBytes(response);
!             if (log.isDebugEnabled()) {
!                 log.debug("Hacked response=>" + response);
!             }
          } else {
              abort(ERR_UNEXPECTED_MESSAGE);
***************
*** 330,335 ****
          byte nextHash[] = database.getLastHash();
          byte responseHash[] = algorithm.generateHash(hash);
!         Log.logEntry(Log.SEV_DEBUG_VERBOSE,"Test====>"+profile.convertBytesToHex(responseHash));
!         Log.logEntry(Log.SEV_DEBUG_VERBOSE,"Control=>"+profile.convertBytesToHex(nextHash));
          boolean match = true;
          for(int i = 0; i < 8; i++)
--- 336,343 ----
          byte nextHash[] = database.getLastHash();
          byte responseHash[] = algorithm.generateHash(hash);
!         if (log.isTraceEnabled()) {
!             log.trace("Test====>"+profile.convertBytesToHex(responseHash));
!             log.trace("Control=>"+profile.convertBytesToHex(nextHash));
!         }
          boolean match = true;
          for(int i = 0; i < 8; i++)
***************
*** 351,355 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, "Validating init-* response");
          // Extract the various elements of the request
          String oldHashData;
--- 359,363 ----
          throws SASLException
      {
!         log.debug("Validating init-* response");
          // Extract the various elements of the request
          String oldHashData;
***************
*** 368,395 ****
              newParms = st.nextToken();
              newHashData = st.nextToken();
!             Log.logEntry(Log.SEV_DEBUG,"Command=>"+command);
!             Log.logEntry(Log.SEV_DEBUG,"OldHashData=>"+oldHashData);
!             Log.logEntry(Log.SEV_DEBUG,"newParms=>"+newParms);
!             Log.logEntry(Log.SEV_DEBUG,"newHashData=>"+newHashData);
                          
              // Validate login
              Algorithm a = profile.getAlgorithm(database.getAlgorithmName());
!             if(profile.HEX_INIT.startsWith(command))//command.indexOf(profile.HEX_INIT) != -1)
!             {
!                 Log.logEntry(Log.SEV_DEBUG,"CMD is "+profile.HEX_INIT);
                  oldHash = profile.convertHexToBytes(oldHashData);
!             }
!             else if(profile.WORD_INIT.startsWith(command))//command.indexOf(profile.WORD_INIT) != -1)
!             {
!                 Log.logEntry(Log.SEV_DEBUG,"CMD is "+profile.WORD_INIT);
                  // @todo obviate the 2nd step when you get a chance
                  long l = OTPDictionary.convertWordsToHash(oldHashData);
                  oldHash = profile.convertLongToBytes(l);
!             }
!             else
!             {
                  abort(ERR_UNKNOWN_COMMAND+command);
              }
!             Log.logEntry(Log.SEV_DEBUG,"Retrieved from init-* oldHash=>"+profile.convertBytesToHex(oldHash));
              
              // Compare the hash and fail if it doesn't match
--- 376,404 ----
              newParms = st.nextToken();
              newHashData = st.nextToken();
!             if (log.isDebugEnabled()) {
!                 log.debug("Command=>"+command);
!                 log.debug("OldHashData=>"+oldHashData);
!                 log.debug("newParms=>"+newParms);
!                 log.debug("newHashData=>"+newHashData);
!             }
                          
              // Validate login
              Algorithm a = profile.getAlgorithm(database.getAlgorithmName());
!             if(profile.HEX_INIT.startsWith(command)) {
!                 log.debug("CMD is "+profile.HEX_INIT);
                  oldHash = profile.convertHexToBytes(oldHashData);
!             } else if(profile.WORD_INIT.startsWith(command)) {
!                 log.debug("CMD is "+profile.WORD_INIT);
                  // @todo obviate the 2nd step when you get a chance
                  long l = OTPDictionary.convertWordsToHash(oldHashData);
                  oldHash = profile.convertLongToBytes(l);
!             } else {
                  abort(ERR_UNKNOWN_COMMAND+command);
              }
! 
!             if (log.isDebugEnabled()) {
!                 log.debug("Retrieved from init-* oldHash=>" +
!                           profile.convertBytesToHex(oldHash));
!             }
              
              // Compare the hash and fail if it doesn't match
***************
*** 405,413 ****
              st = new StringTokenizer(newParms);
              // Now do even weirder update of the db.
!             Log.logEntry(Log.SEV_DEBUG,"Auth=>"+authenticated);
!             Log.logEntry(Log.SEV_DEBUG,"Hash=>"+newHashData);
              profile.getUserDatabase().addUser(authenticated, algorithm,
                                                newHashData, seed, sequence);
!             Log.logEntry(Log.SEV_DEBUG, "Successful Authentication!");
              return cred;            
          }
--- 414,424 ----
              st = new StringTokenizer(newParms);
              // Now do even weirder update of the db.
!             if (log.isDebugEnabled()) {
!                 log.debug("Auth=>"+authenticated);
!                 log.debug("Hash=>"+newHashData);
!             }
              profile.getUserDatabase().addUser(authenticated, algorithm,
                                                newHashData, seed, sequence);
!             log.debug("Successful Authentication!");
              return cred;            
          }
***************
*** 434,439 ****
                        String authorizedId, String authenticateId)
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator Initiator Construtor");
  
          authenticated = authenticateId;
--- 445,449 ----
                        String authorizedId, String authenticateId)
      {
!         log.debug("OTP Authenticator Initiator Construtor");
  
          authenticated = authenticateId;
***************
*** 442,450 ****
          database = db;
  
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "Dict.getA()" + database.getAlgorithmName());
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "Dict.getA()"
!                      + profile.getAlgorithm(database.getAlgorithmName()));
  
          algorithm = profile.getAlgorithm(database.getAlgorithmName());
--- 452,460 ----
          database = db;
  
!         if (log.isDebugEnabled()) {
!             log.debug("Dict.getA()" + database.getAlgorithmName());
!             log.debug("Dict.getA()"
!                       + profile.getAlgorithm(database.getAlgorithmName()));
!         }
  
          algorithm = profile.getAlgorithm(database.getAlgorithmName());
***************
*** 493,498 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator sending Identities");
  
          // Grok and validate the parameters
--- 503,507 ----
          throws SASLException
      {
!         log.debug("OTP Authenticator sending Identities");
  
          // Grok and validate the parameters
***************
*** 512,520 ****
  
          temp.append(authenticateId);
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "AuthOTP Using=>" + temp.toString() + "<=");
          Blob blob = new Blob(Blob.STATUS_NONE, temp.toString());
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "AuthOTP Using=>" + blob.toString() + "<=");
          try {
              channel.sendMSG(new StringOutputDataStream(blob.toString()),
--- 521,531 ----
  
          temp.append(authenticateId);
!         if (log.isDebugEnabled()) {
!             log.debug("AuthOTP Using=>" + temp.toString() + "<=");
!         }
          Blob blob = new Blob(Blob.STATUS_NONE, temp.toString());
!         if (log.isDebugEnabled()) {
!             log.debug("AuthOTP Using=>" + blob.toString() + "<=");
!         }
          try {
              channel.sendMSG(new StringOutputDataStream(blob.toString()),
***************
*** 532,537 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator received Challenge");
  
          // If we're initiating, the last state we should
--- 543,547 ----
          throws SASLException
      {
!         log.debug("OTP Authenticator received Challenge");
  
          // If we're initiating, the last state we should
***************
*** 553,558 ****
          String seed = null, algo = null;
  
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "Tokenizing=>" + challenge);
  
          StringTokenizer st = new StringTokenizer(challenge);
--- 563,569 ----
          String seed = null, algo = null;
  
!         if (log.isDebugEnabled()) {
!             log.debug("Tokenizing=>" + challenge);
!         }
  
          StringTokenizer st = new StringTokenizer(challenge);
***************
*** 575,581 ****
              abort("Invalid Seed");
  
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "Algo is=>" + algo + " seed is=>" + seed + " seq=>"
!                      + sequence);
  
          String phrase = new String(seed + password);
--- 586,593 ----
              abort("Invalid Seed");
  
!         if (log.isDebugEnabled()) {
!             log.debug("Algo is=>" + algo + " seed is=>" + seed + " seq=>"
!                       + sequence);
!         }
  
          String phrase = new String(seed + password);
***************
*** 590,599 ****
          }
  
!         profile.printHex(temp);
          long l = profile.convertBytesToLong(temp);
          phrase = new String(WORD + OTPDictionary.convertHashToWords(l));
!         
!         Log.logEntry(Log.SEV_DEBUG, 
!                      "Prelim response is =>" + phrase + "<=");
  
          // IF this is an init request   
--- 602,614 ----
          }
  
!         if (log.isDebugEnabled()) {
!             log.debug(SASLOTPProfile.convertBytesToHex(temp));
!         }
          long l = profile.convertBytesToLong(temp);
          phrase = new String(WORD + OTPDictionary.convertHashToWords(l));
! 
!         if (log.isDebugEnabled()) {
!             log.debug("Prelim response is =>" + phrase + "<=");
!         }
  
          // IF this is an init request   
***************
*** 605,609 ****
              sb.append(initData);
              phrase = sb.toString();
!             Log.logEntry(Log.SEV_DEBUG,"Produced INIT response of "+phrase);
          }
          try
--- 620,626 ----
              sb.append(initData);
              phrase = sb.toString();
!             if (log.isDebugEnabled()) {
!                 log.debug("Produced INIT response of "+phrase);
!             }
          }
          try
***************
*** 626,631 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                      "OTP Authenticator Completing!");
  
          // If we're initiating, the last state we should
--- 643,647 ----
          throws SASLException
      {
!         log.debug("OTP Authenticator Completing!");
  
          // If we're initiating, the last state we should
***************
*** 643,648 ****
          throws SASLException
      {
!         Log.logEntry(Log.SEV_ERROR, OTP_AUTH, 
!                      "Aborting OTP Authenticator because " + message);
          state = STATE_ABORT;
          throw new SASLException(message);
--- 659,663 ----
          throws SASLException
      {
!         log.error("Aborting OTP Authenticator because " + message);
          state = STATE_ABORT;
          throw new SASLException(message);
***************
*** 657,662 ****
      void abortNoThrow(String message)
      {
!         Log.logEntry(Log.SEV_ERROR, OTP_AUTH, 
!                      "Aborting OTP Authenticator because " + message);
          state = STATE_ABORT;
      }
--- 672,676 ----
      void abortNoThrow(String message)
      {
!         log.error("Aborting OTP Authenticator because " + message);
          state = STATE_ABORT;
      }
***************
*** 680,685 ****
          try
          {
!             Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                          "OTP Authenticator.receiveMSG");
  
              String data = null;
--- 694,698 ----
          try
          {
!             log.debug("OTP Authenticator.receiveMSG");
  
              String data = null;
***************
*** 705,710 ****
              }
  
!             Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                          "MSG DATA=>" + data);
              String status = blob.getStatus();
  
--- 718,724 ----
              }
  
!             if (log.isDebugEnabled()) {
!                 log.debug("MSG DATA=>" + data);
!             }
              String status = blob.getStatus();
  
***************
*** 733,739 ****
                  state = STATE_COMPLETE;
  
!                 Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                              "Wow, cool!!! " + channel.getSession()
!                              + " is valid for\n" + cred.toString());
                  try
                  {
--- 747,754 ----
                  state = STATE_COMPLETE;
  
!                 if (log.isDebugEnabled()) {
!                     log.debug("" + channel.getSession()
!                               + " is valid for\n" + cred.toString());
!                 }
                  try
                  {
***************
*** 784,789 ****
      public void receiveRPY(Message message)
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "OTP Authenticator.receiveRPY");
  
          Blob blob = null;
--- 799,803 ----
      public void receiveRPY(Message message)
      {
!         log.debug("OTP Authenticator.receiveRPY");
  
          Blob blob = null;
***************
*** 814,821 ****
  
              if ((status != null)
!                 && status.equals(SASLProfile.SASL_STATUS_ABORT)) {
!                 Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                              "OTPAuthenticator receiveRPY got an RPY=>"
!                              + blob.getData());
                  sendAbort = false;
                  abort(ERR_PEER_ABORTED + blob.getData());
--- 828,835 ----
  
              if ((status != null)
!                 && status.equals(SASLProfile.SASL_STATUS_ABORT))
!             {
!                 log.debug("OTPAuthenticator receiveRPY got an RPY=>"
!                           + blob.getData());
                  sendAbort = false;
                  abort(ERR_PEER_ABORTED + blob.getData());
***************
*** 850,854 ****
          catch(Exception x)
          {
!             Log.logEntry(Log.SEV_ERROR, x);
              synchronized (this) {
                  this.notify();
--- 864,868 ----
          catch(Exception x)
          {
!             log.error(x);
              synchronized (this) {
                  this.notify();
***************
*** 888,893 ****
      public void receiveERR(Message message)
      {
!         Log.logEntry(Log.SEV_DEBUG, OTP_AUTH, 
!                      "OTP Authenticator.receiveERR");
  
          try {
--- 902,906 ----
      public void receiveERR(Message message)
      {
!         log.debug("OTP Authenticator.receiveERR");
  
          try {
***************
*** 898,903 ****
              is.read(buff);
              Blob b = new Blob(new String(buff));
!             Log.logEntry(Log.SEV_DEBUG, OTP_AUTH,
!                          "ERR received=>\n" + b.getData());
              abort(new String(buff));
              
--- 911,917 ----
              is.read(buff);
              Blob b = new Blob(new String(buff));
!             if (log.isDebugEnabled()) {
!                 log.debug("ERR received=>\n" + b.getData());
!             }
              abort(new String(buff));
              



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