User: ejort Date: 02/01/05 00:01:43 Modified: src/main/org/jboss/security/srp/jaas SRPLoginModule.java Log: Guarded debug logging Revision Changes Path 1.3 +18 -9 jbosssx/src/main/org/jboss/security/srp/jaas/SRPLoginModule.java Index: SRPLoginModule.java =================================================================== RCS file: /cvsroot/jboss/jbosssx/src/main/org/jboss/security/srp/jaas/SRPLoginModule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SRPLoginModule.java 2001/04/04 21:46:03 1.2 +++ SRPLoginModule.java 2002/01/05 08:01:43 1.3 @@ -34,7 +34,7 @@ authentication system developed by Tom Wu ([EMAIL PROTECTED]). @author [EMAIL PROTECTED] -@version $Revision: 1.2 $ +@version $Revision: 1.3 $ */ public class SRPLoginModule implements LoginModule { @@ -107,21 +107,28 @@ if( server == null ) throw new LoginException("Failed to access a SRPServerInterface instance"); + boolean debug = PkgCategory.isDebugEnabled(); byte[] M1, M2; SRPClientSession client = null; try { // Perform the SRP login protocol - PkgCategory.debug("Getting SRP parameters for username: "+username); + if (debug) + PkgCategory.debug("Getting SRP parameters for username: "+username); SRPParameters params = server.getSRPParameters(username); - PkgCategory.debug("Creating SRPClientSession"); + if (debug) + PkgCategory.debug("Creating SRPClientSession"); client = new SRPClientSession(username, password, params.s, params.N, params.g); - PkgCategory.debug("Generating client public key"); + if (debug) + PkgCategory.debug("Generating client public key"); byte[] A = client.exponential(); - PkgCategory.debug("Exchanging public keys"); + if (debug) + PkgCategory.debug("Exchanging public keys"); byte[] B = server.init(username, A); - PkgCategory.debug("Generating server challenge"); + if (debug) + PkgCategory.debug("Generating server challenge"); M1 = client.response(B); - PkgCategory.debug("Exchanging challenges"); + if (debug) + PkgCategory.debug("Exchanging challenges"); M2 = server.verify(username, M1); sessionKey = client.getSessionKey(); } @@ -135,10 +142,12 @@ server = null; } - PkgCategory.debug("Verifying server response"); + if (debug) + PkgCategory.debug("Verifying server response"); if( client.verify(M2) == false ) throw new LoginException("Failed to validate server reply"); - PkgCategory.debug("Login succeeded"); + if (debug) + PkgCategory.debug("Login succeeded"); // Put the username and the client challenge into the sharedState map sharedState.put("javax.security.auth.login.name", username);
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development