From 7c7b9d023cd466c1771068badc020dab36beb553 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 5 Apr 2012 14:49:11 -0500 Subject: Removed whitespaces from Java code. Whitespaces in Java code have been removed with the following command: find . -not -path .git -name *.java -exec sed -i 's/[[:blank:]]\+$//' {} \; Ticket #134 --- .../netscape/cms/authentication/AVAPattern.java | 60 ++++++++-------- .../authentication/AgentCertAuthentication.java | 16 ++--- .../src/com/netscape/cms/authentication/Crypt.java | 14 ++-- .../com/netscape/cms/authentication/DNPattern.java | 48 ++++++------- .../cms/authentication/DirBasedAuthentication.java | 82 +++++++++++----------- .../netscape/cms/authentication/FlatFileAuth.java | 22 +++--- .../netscape/cms/authentication/HashAuthData.java | 2 +- .../cms/authentication/HashAuthentication.java | 10 +-- .../netscape/cms/authentication/PortalEnroll.java | 12 ++-- .../netscape/cms/authentication/RDNPattern.java | 50 ++++++------- .../SSLclientCertAuthentication.java | 16 ++--- .../cms/authentication/TokenAuthentication.java | 12 ++-- .../authentication/UdnPwdDirAuthentication.java | 10 +-- .../authentication/UidPwdDirAuthentication.java | 8 +-- .../authentication/UidPwdPinDirAuthentication.java | 10 +-- 15 files changed, 186 insertions(+), 186 deletions(-) (limited to 'base/common/src/com/netscape/cms/authentication') diff --git a/base/common/src/com/netscape/cms/authentication/AVAPattern.java b/base/common/src/com/netscape/cms/authentication/AVAPattern.java index 6a8bbcbf2..55c62eeb1 100644 --- a/base/common/src/com/netscape/cms/authentication/AVAPattern.java +++ b/base/common/src/com/netscape/cms/authentication/AVAPattern.java @@ -39,45 +39,45 @@ import com.netscape.certsrv.authentication.ECompSyntaxErr; * class for parsing a DN pattern used to construct a certificate * subject name from ldap attributes and dn. *

- * + * * dnpattern is a string representing a subject name pattern to formulate from the directory attributes and entry dn. If * empty or not set, the ldap entry DN will be used as the certificate subject name. *

- * + * * The syntax is - * + * *

  * 	dnPattern := rdnPattern *[ "," rdnPattern ]
  * 	rdnPattern := avaPattern *[ "+" avaPattern ]
- * 		avaPattern := name "=" value | 
- * 			      name "=" "$attr" "." attrName [ "." attrNumber ] | 
- * 			      name "=" "$dn" "." attrName [ "." attrNumber ] | 
+ * 		avaPattern := name "=" value |
+ * 			      name "=" "$attr" "." attrName [ "." attrNumber ] |
+ * 			      name "=" "$dn" "." attrName [ "." attrNumber ] |
  * 			 	  "$dn" "." "$rdn" "." number
  * 
- * + * *
  * Example1: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US 
  * Ldap entry: dn:  UID=jjames, OU=IS, OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example2: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN. note multiple AVAs @@ -86,40 +86,40 @@ import com.netscape.certsrv.authentication.ECompSyntaxErr; * C = the string "US" *

*

- * + * *
  * Example3: CN=$attr.cn, $rdn.2, O=$dn.o, C=US
  * Ldap entry: dn:  UID=jjames, OU=IS+OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* CN=Jesse James, OU=IS+OU=people, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
* followed by the second RDN in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example4: CN=$attr.cn, OU=$dn.ou.2+OU=$dn.ou.1, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* CN=Jesse James, OU=people+OU=IS, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
- * OU = the second 'ou' value in the user's entry DN followed by the + * OU = the second 'ou' value in the user's entry DN followed by the * first 'ou' value in the user's entry. note multiple AVAs * in a RDN in this example.
* O = the (first) 'o' value in the user's entry DN.
* C = the string "US" *

*

- * + * * If an attribute or subject DN component does not exist the attribute is skipped. - * + * * @version $Revision$, $Date$ */ class AVAPattern { @@ -184,7 +184,7 @@ class AVAPattern { if (c == -1) throw new ECompSyntaxErr(CMS.getUserMessage("CMS_AUTHENTICATION_COMPONENT_SYNTAX", "All blank")); - // $rdn "." number syntax. + // $rdn "." number syntax. if (c == '$') { //System.out.println("$rdn syntax"); @@ -228,9 +228,9 @@ class AVAPattern { return; } - // name "=" ... syntax. + // name "=" ... syntax. - // read name + // read name //System.out.println("reading name"); StringBuffer attrBuf = new StringBuffer(); @@ -250,10 +250,10 @@ class AVAPattern { throw new ECompSyntaxErr(CMS.getUserMessage("CMS_AUTHENTICATION_COMPONENT_SYNTAX", "Missing \"=\" in ava pattern")); - // read value + // read value //System.out.println("reading value"); - // skip spaces + // skip spaces //System.out.println("skip spaces for value"); try { while ((c = in.read()) == ' ' || c == '\t') {//System.out.println("spaces2 read "+(char)c); @@ -267,7 +267,7 @@ class AVAPattern { "no value after = in ava pattern")); if (c == '$') { - // check for $dn or $attr + // check for $dn or $attr try { c = in.read(); //System.out.println("check $dn or $attr read "+(char)c); @@ -306,7 +306,7 @@ class AVAPattern { "unknown keyword. expecting $dn or $attr.")); } - // get attr name of dn pattern from above. + // get attr name of dn pattern from above. String attrName = attrBuf.toString().trim(); //System.out.println("----- attrName "+attrName); @@ -333,7 +333,7 @@ class AVAPattern { valueBuf.append((char) c); } if (c == '+' || c == ',') // either ',' or '+' - in.unread(c); // pushback last , or + + in.unread(c); // pushback last , or + } catch (IOException e) { throw new EAuthException(CMS.getUserMessage("CMS_AUTHENTICATION_INTERNAL_ERROR", e.toString())); } @@ -375,7 +375,7 @@ class AVAPattern { // value is constant. treat as regular ava. mType = TYPE_CONSTANT; //System.out.println("----- mType constant"); - // parse ava value. + // parse ava value. StringBuffer valueBuf = new StringBuffer(); valueBuf.append((char) c); diff --git a/base/common/src/com/netscape/cms/authentication/AgentCertAuthentication.java b/base/common/src/com/netscape/cms/authentication/AgentCertAuthentication.java index 65ef434a9..03428102d 100644 --- a/base/common/src/com/netscape/cms/authentication/AgentCertAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/AgentCertAuthentication.java @@ -52,7 +52,7 @@ import com.netscape.certsrv.usrgrp.IUser; * Maps a SSL client authenticate certificate to a user (agent) entry in the * internal database. *

- * + * * @version $Revision$, $Date$ */ public class AgentCertAuthentication implements IAuthManager, @@ -90,7 +90,7 @@ public class AgentCertAuthentication implements IAuthManager, * initializes the CertUserDBAuthentication auth manager *

* called by AuthSubsystem init() method, when initializing all available authentication managers. - * + * * @param name The name of this authentication manager instance. * @param implName The name of the authentication manager plugin. * @param config The configuration store for this authentication manager. @@ -127,11 +127,11 @@ public class AgentCertAuthentication implements IAuthManager, * authenticates user(agent) by certificate *

* called by other subsystems or their servlets to authenticate users (agents) - * + * * @param authCred - authentication credential that contains * an usrgrp.Certificates of the user (agent) * @return the authentication token that contains the following - * + * * @exception EMissingCredential If a required credential for this * authentication manager is missing. * @exception EInvalidCredentials If credentials cannot be authenticated. @@ -207,7 +207,7 @@ public class AgentCertAuthentication implements IAuthManager, e.toString())); } - // any unexpected error occurs like internal db down, + // any unexpected error occurs like internal db down, // UGSubsystem only returns null for user. if (user == null) { throw new EInvalidCredentials(CMS.getUserMessage("CMS_AUTHENTICATION_INVALID_CREDENTIAL")); @@ -248,7 +248,7 @@ public class AgentCertAuthentication implements IAuthManager, * the servlets that handle agent operations to authenticate its * users. It calls this method to know which are the * required credentials from the user (e.g. Javascript form data) - * + * * @return attribute names in Vector */ public String[] getRequiredCreds() { @@ -261,7 +261,7 @@ public class AgentCertAuthentication implements IAuthManager, * the Certificate Server Console to display the table for * configuration purposes. CertUserDBAuthentication is currently not * exposed in this case, so this method is not to be used. - * + * * @return configuration parameter names in Hashtable of Vectors * where each hashtable entry's key is the substore name, value is a * Vector of parameter names. If no substore, the parameter name @@ -280,7 +280,7 @@ public class AgentCertAuthentication implements IAuthManager, /** * gets the configuretion substore used by this authentication * manager - * + * * @return configuration store */ public IConfigStore getConfigStore() { diff --git a/base/common/src/com/netscape/cms/authentication/Crypt.java b/base/common/src/com/netscape/cms/authentication/Crypt.java index e6dd7087d..867181138 100644 --- a/base/common/src/com/netscape/cms/authentication/Crypt.java +++ b/base/common/src/com/netscape/cms/authentication/Crypt.java @@ -178,7 +178,7 @@ public class Crypt { /** * Create a Crypt object with specified salt. Use setPasswd() before * getEncryptedPasswd(). - * + * * @param salt the salt string for encryption */ public Crypt(String salt) { @@ -191,7 +191,7 @@ public class Crypt { * Create a Crypt object with specified passwd and salt (often the * already encypted passwd). Get the encrypted result with * getEncryptedPasswd(). - * + * * @param passwd the passwd to encrypt * @param salt the salt string for encryption */ @@ -203,7 +203,7 @@ public class Crypt { /** * Retrieve the passwd string currently being encrypted. - * + * * @return the current passwd string */ public String getPasswd() { @@ -212,7 +212,7 @@ public class Crypt { /** * Retrieve the salt string currently being used for encryption. - * + * * @return the current salt string */ public String getSalt() { @@ -222,7 +222,7 @@ public class Crypt { /** * Retrieve the resulting encrypted string from the current passwd and * salt settings. - * + * * @return the encrypted passwd */ public String getEncryptedPasswd() { @@ -232,7 +232,7 @@ public class Crypt { /** * Set a new passwd string for encryption. Use getEncryptedPasswd() to * retrieve the new result. - * + * * @param passwd the new passwd string */ public void setPasswd(String passwd) { @@ -243,7 +243,7 @@ public class Crypt { /** * Set a new salt string for encryption. Use getEncryptedPasswd() to * retrieve the new result. - * + * * @param salt the new salt string */ public void setSalt(String salt) { diff --git a/base/common/src/com/netscape/cms/authentication/DNPattern.java b/base/common/src/com/netscape/cms/authentication/DNPattern.java index 480b5b909..e44f40e9d 100644 --- a/base/common/src/com/netscape/cms/authentication/DNPattern.java +++ b/base/common/src/com/netscape/cms/authentication/DNPattern.java @@ -31,45 +31,45 @@ import com.netscape.certsrv.base.EBaseException; * class for parsing a DN pattern used to construct a certificate * subject name from ldap attributes and dn. *

- * + * * dnpattern is a string representing a subject name pattern to formulate from the directory attributes and entry dn. If * empty or not set, the ldap entry DN will be used as the certificate subject name. *

- * + * * The syntax is - * + * *

  * 	dnPattern := rdnPattern *[ "," rdnPattern ]
  * 	rdnPattern := avaPattern *[ "+" avaPattern ]
- * 		avaPattern := name "=" value | 
- * 			      name "=" "$attr" "." attrName [ "." attrNumber ] | 
- * 			      name "=" "$dn" "." attrName [ "." attrNumber ] | 
+ * 		avaPattern := name "=" value |
+ * 			      name "=" "$attr" "." attrName [ "." attrNumber ] |
+ * 			      name "=" "$dn" "." attrName [ "." attrNumber ] |
  * 			 	  "$dn" "." "$rdn" "." number
  * 
- * + * *
  * Example1: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US 
  * Ldap entry: dn:  UID=jjames, OU=IS, OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example2: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN. note multiple AVAs @@ -78,40 +78,40 @@ import com.netscape.certsrv.base.EBaseException; * C = the string "US" *

*

- * + * *
  * Example3: CN=$attr.cn, $rdn.2, O=$dn.o, C=US
  * Ldap entry: dn:  UID=jjames, OU=IS+OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* CN=Jesse James, OU=IS+OU=people, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
* followed by the second RDN in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example4: CN=$attr.cn, OU=$dn.ou.2+OU=$dn.ou.1, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* CN=Jesse James, OU=people+OU=IS, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
- * OU = the second 'ou' value in the user's entry DN followed by the + * OU = the second 'ou' value in the user's entry DN followed by the * first 'ou' value in the user's entry. note multiple AVAs * in a RDN in this example.
* O = the (first) 'o' value in the user's entry DN.
* C = the string "US" *

*

- * + * * If an attribute or subject DN component does not exist the attribute is skipped. - * + * * @version $Revision$, $Date$ */ public class DNPattern { @@ -129,14 +129,14 @@ public class DNPattern { /** * Construct a DN pattern by parsing a pattern string. - * + * * @param pattern the DN pattern * @exception EBaseException If parsing error occurs. */ public DNPattern(String pattern) throws EAuthException { if (pattern == null || pattern.equals("")) { - // create an attribute list that is the dn. + // create an attribute list that is the dn. mLdapAttrs = new String[] { "dn" }; } else { mPatternString = pattern; @@ -185,7 +185,7 @@ public class DNPattern { /** * Form a Ldap v3 DN string from results of a ldap search. - * + * * @param entry LDAPentry from a ldap search * @return Ldap v3 DN string to use for a subject name. */ diff --git a/base/common/src/com/netscape/cms/authentication/DirBasedAuthentication.java b/base/common/src/com/netscape/cms/authentication/DirBasedAuthentication.java index da8d5bd51..f52904718 100644 --- a/base/common/src/com/netscape/cms/authentication/DirBasedAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/DirBasedAuthentication.java @@ -61,9 +61,9 @@ import com.netscape.cmsutil.util.Utils; * Uses a pattern for formulating subject names. * The pattern is read from configuration file. * Syntax of the pattern is described in the init() method. - * + * *

- * + * * @version $Revision$, $Date$ */ public abstract class DirBasedAuthentication @@ -78,7 +78,7 @@ public abstract class DirBasedAuthentication protected static final String PROP_LDAPSTRINGATTRS = "ldapStringAttributes"; protected static final String PROP_LDAPBYTEATTRS = "ldapByteAttributes"; - // members + // members /* name of this authentication manager instance */ protected String mName = null; @@ -104,11 +104,11 @@ public abstract class DirBasedAuthentication /* the subject DN pattern */ protected DNPattern mPattern = null; - /* the list of LDAP attributes with string values to retrieve to + /* the list of LDAP attributes with string values to retrieve to * save in the auth token including ones from the dn pattern. */ protected String[] mLdapStringAttrs = null; - /* the list of LDAP attributes with byte[] values to retrive to save + /* the list of LDAP attributes with byte[] values to retrive to save * in authtoken. */ protected String[] mLdapByteAttrs = null; @@ -160,14 +160,14 @@ public abstract class DirBasedAuthentication /** * Initializes the UidPwdDirBasedAuthentication auth manager. - * + * * Takes the following configuration parameters:
- * + * *

      * 	ldap.basedn             - the ldap base dn.
      * 	ldap.ldapconn.host      - the ldap host.
-     * 	ldap.ldapconn.port      - the ldap port 
-     * 	ldap.ldapconn.secureConn - whether port should be secure 
+     * 	ldap.ldapconn.port      - the ldap port
+     * 	ldap.ldapconn.secureConn - whether port should be secure
      * 	ldap.minConns           - minimum connections
      * 	ldap.maxConns           - max connections
      * 	dnpattern               - dn pattern.
@@ -177,33 +177,33 @@ public abstract class DirBasedAuthentication
      * attributes and entry dn. If empty or not set, the ldap entry DN will be used as the certificate subject name.
      * 

* The syntax is - * + * *

      *     dnpattern = SubjectNameComp *[ "," SubjectNameComp ]
-     * 
-     *     SubjectNameComponent = DnComp | EntryComp | ConstantComp  
+     *
+     *     SubjectNameComponent = DnComp | EntryComp | ConstantComp
      *     DnComp = CertAttr "=" "$dn" "." DnAttr "." Num
      *     EntryComp = CertAttr "=" "$attr" "." EntryAttr "." Num
      *     ConstantComp = CertAttr "=" Constant
      *     DnAttr    =  an attribute in the Ldap entry dn
-     *     EntryAttr =  an attribute in the Ldap entry 
+     *     EntryAttr =  an attribute in the Ldap entry
      *     CertAttr  =  a Component in the Certificate Subject Name
-     *                  (multiple AVA in one RDN not supported) 
+     *                  (multiple AVA in one RDN not supported)
      *     Num       =  the nth value of tha attribute  in the dn or entry.
      *     Constant  =  Constant String, with any accepted ldap string value.
-     * 
+     *
      * 
*

* Example: - * + * *

-     * dnpattern: 
+     * dnpattern:
      *     E=$attr.mail.1, CN=$attr.cn, OU=$attr.ou.2, O=$dn.o, C=US
      * 
- * Ldap entry dn: + * Ldap entry dn: * UID=joesmith, OU=people, O=Acme.com *
- * Ldap attributes: + * Ldap attributes: * cn: Joe Smith * sn: Smith * mail: joesmith@acme.com @@ -214,17 +214,17 @@ public abstract class DirBasedAuthentication *
*

* The subject name formulated in the cert will be :
- * + * *

      *   E=joesmith@acme.com, CN=Joe Smith, OU=Human Resources, O=Acme.com, C=US
-     *   
-     *      E = the first 'mail' ldap attribute value in user's entry - joesmithe@acme.com 
-     *      CN = the (first) 'cn' ldap attribute value in the user's entry - Joe Smith 
+     *
+     *      E = the first 'mail' ldap attribute value in user's entry - joesmithe@acme.com
+     *      CN = the (first) 'cn' ldap attribute value in the user's entry - Joe Smith
      *      OU = the second 'ou' value in the ldap entry - IS
-     *      O = the (first) 'o' value in the user's entry DN - "Acme.com" 
+     *      O = the (first) 'o' value in the user's entry DN - "Acme.com"
      *      C = the constant string "US"
      * 
- * + * * @param name The name for this authentication manager instance. * @param implName The name of the authentication manager plugin. * @param config - The configuration store for this instance. @@ -326,7 +326,7 @@ public abstract class DirBasedAuthentication * Authenticates user through LDAP by a set of credentials. * Resulting AuthToken a TOKEN_CERTINFO field of a X509CertInfo *

- * + * * @param authCred Authentication credentials, CRED_UID and CRED_PWD. * @return A AuthToken with a TOKEN_SUBJECT of X500name type. * @exception com.netscape.certsrv.authentication.EMissingCredential @@ -374,14 +374,14 @@ public abstract class DirBasedAuthentication } catch (IOException e) { } - // set validity if any + // set validity if any try { CertificateValidity validity = (CertificateValidity) certInfo.get(X509CertInfo.VALIDITY); if (validity != null) { - // the gets throws IOException but only if attribute - // not recognized. In these cases they are always. + // the gets throws IOException but only if attribute + // not recognized. In these cases they are always. authToken.set(AuthToken.TOKEN_CERT_NOTBEFORE, (Date) validity.get(CertificateValidity.NOT_BEFORE)); authToken.set(AuthToken.TOKEN_CERT_NOTAFTER, @@ -414,7 +414,7 @@ public abstract class DirBasedAuthentication /** * get the list of required credentials. - * + * * @return list of required credentials as strings. */ public abstract String[] getRequiredCreds(); @@ -423,7 +423,7 @@ public abstract class DirBasedAuthentication * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public abstract String[] getConfigParams(); @@ -445,7 +445,7 @@ public abstract class DirBasedAuthentication /** * Gets the configuration substore used by this authentication manager - * + * * @return configuration store */ public IConfigStore getConfigStore() { @@ -454,7 +454,7 @@ public abstract class DirBasedAuthentication /** * Authenticates a user through directory based a set of credentials. - * + * * @param authCreds The authentication credentials. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the uid and password are not valid @@ -466,7 +466,7 @@ public abstract class DirBasedAuthentication /** * Formulate the cert info. - * + * * @param conn A LDAP Connection authenticated to user to use. * @param userdn The user's dn. * @param certinfo A certinfo object to fill. @@ -482,7 +482,7 @@ public abstract class DirBasedAuthentication // get ldap attributes to retrieve. String[] attrs = getLdapAttrs(); - // retrieve the attributes. + // retrieve the attributes. try { if (conn != null) { LDAPEntry entry = null; @@ -496,7 +496,7 @@ public abstract class DirBasedAuthentication } entry = results.next(); - // formulate the subject dn + // formulate the subject dn try { dn = formSubjectName(entry); } catch (EBaseException e) { @@ -510,7 +510,7 @@ public abstract class DirBasedAuthentication } // add anything else in cert info such as validity, extensions - // (nothing now) + // (nothing now) // pack the dn into X500name and set subject name. if (dn.length() == 0) { @@ -610,7 +610,7 @@ public abstract class DirBasedAuthentication /** * Return a list of LDAP attributes with String values to retrieve. * Subclasses can override to return any set of attributes. - * + * * @return Array of LDAP attributes to retrieve from the directory. */ protected String[] getLdapAttrs() { @@ -620,7 +620,7 @@ public abstract class DirBasedAuthentication /** * Return a list of LDAP attributes with byte[] values to retrieve. * Subclasses can override to return any set of attributes. - * + * * @return Array of LDAP attributes to retrieve from the directory. */ protected String[] getLdapByteAttrs() { @@ -629,7 +629,7 @@ public abstract class DirBasedAuthentication /** * Formulate the subject name - * + * * @param entry The LDAP entry * @return The subject name string. * @exception EBaseException If an internal error occurs. @@ -654,7 +654,7 @@ public abstract class DirBasedAuthentication /** * Logs a message for this class in the system log file. - * + * * @param level The log level. * @param msg The message to log. * @see com.netscape.certsrv.logging.ILogger diff --git a/base/common/src/com/netscape/cms/authentication/FlatFileAuth.java b/base/common/src/com/netscape/cms/authentication/FlatFileAuth.java index f60110b0b..2394ede4c 100644 --- a/base/common/src/com/netscape/cms/authentication/FlatFileAuth.java +++ b/base/common/src/com/netscape/cms/authentication/FlatFileAuth.java @@ -51,7 +51,7 @@ import com.netscape.certsrv.request.IRequest; /** * This represents the authentication manager that authenticates * user against a file where id, and password are stored. - * + * * @version $Revision$, $Date$ */ public class FlatFileAuth @@ -110,7 +110,7 @@ public class FlatFileAuth /** * This array is created as to include all the requested attributes - * + * */ String[] reqCreds = null; @@ -127,7 +127,7 @@ public class FlatFileAuth * Get the named property * If the property is not set, use s as the default, and create * a new value for the property in the config file. - * + * * @param propertyName Property name * @param s The default value of the property */ @@ -152,7 +152,7 @@ public class FlatFileAuth * Get the named property, * If the property is not set, use b as the default, and create * a new value for the property in the config file. - * + * * @param propertyName Property name * @param b The default value of the property */ @@ -220,7 +220,7 @@ public class FlatFileAuth /** * Log a message. - * + * * @param level The logging level. * @param msg The message to log. */ @@ -398,7 +398,7 @@ public class FlatFileAuth /** * Read a file with the following format: *

- * + * *

      * param1: valuea
      * param2: valueb
@@ -406,7 +406,7 @@ public class FlatFileAuth
      * param1: valuec
      * param2: valued
      * 
- * + * * @param f The file to read * @param keys The parameters to concat together to form the hash * key @@ -506,7 +506,7 @@ public class FlatFileAuth /** * Compare attributes provided by the user with those in * in flat file. - * + * */ private IAuthToken doAuthentication(Hashtable user, IAuthCredentials authCred) @@ -543,7 +543,7 @@ public class FlatFileAuth /** * Authenticate the request - * + * */ public IAuthToken authenticate(IAuthCredentials authCred) throws EMissingCredential, EInvalidCredentials, EBaseException { @@ -586,7 +586,7 @@ public class FlatFileAuth } } - // if a dn was specified in the password file for this user, + // if a dn was specified in the password file for this user, // replace the requested dn with the one in the pwfile if (user != null) { String dn = (String) user.get("dn"); @@ -610,7 +610,7 @@ public class FlatFileAuth /** * Return a list of HTTP parameters which will be taken from the * request posting and placed into the AuthCredentials block - * + * * Note that this method will not be called until after the * init() method is called */ diff --git a/base/common/src/com/netscape/cms/authentication/HashAuthData.java b/base/common/src/com/netscape/cms/authentication/HashAuthData.java index 3a447d282..0635c445a 100644 --- a/base/common/src/com/netscape/cms/authentication/HashAuthData.java +++ b/base/common/src/com/netscape/cms/authentication/HashAuthData.java @@ -26,7 +26,7 @@ import java.util.Vector; * the agent-initiated user enrollment, and whom agents enable this feature, * and the value of the timeout. *

- * + * * @version $Revision$, $Date$ */ public class HashAuthData extends Hashtable> { diff --git a/base/common/src/com/netscape/cms/authentication/HashAuthentication.java b/base/common/src/com/netscape/cms/authentication/HashAuthentication.java index 2537efa10..b9808e639 100644 --- a/base/common/src/com/netscape/cms/authentication/HashAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/HashAuthentication.java @@ -42,7 +42,7 @@ import com.netscape.cmsutil.util.Utils; /** * Hash uid/pwd directory based authentication manager *

- * + * * @version $Revision$, $Date$ */ public class HashAuthentication implements IAuthManager, IExtendedPluginInfo { @@ -210,7 +210,7 @@ public class HashAuthentication implements IAuthManager, IExtendedPluginInfo { /** * Authenticates a user based on uid, pwd in the directory. - * + * * @param authCreds The authentication credentials. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the uid and password are not valid @@ -238,7 +238,7 @@ public class HashAuthentication implements IAuthManager, IExtendedPluginInfo { /** * Returns array of required credentials for this authentication manager. - * + * * @return Array of required credentials. */ public String[] getRequiredCreds() { @@ -247,7 +247,7 @@ public class HashAuthentication implements IAuthManager, IExtendedPluginInfo { /** * Gets the configuration substore used by this authentication manager - * + * * @return configuration store */ public IConfigStore getConfigStore() { @@ -279,7 +279,7 @@ public class HashAuthentication implements IAuthManager, IExtendedPluginInfo { * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams() { diff --git a/base/common/src/com/netscape/cms/authentication/PortalEnroll.java b/base/common/src/com/netscape/cms/authentication/PortalEnroll.java index 38a3e6fcf..2e5b9d394 100644 --- a/base/common/src/com/netscape/cms/authentication/PortalEnroll.java +++ b/base/common/src/com/netscape/cms/authentication/PortalEnroll.java @@ -51,7 +51,7 @@ import com.netscape.certsrv.logging.ILogger; /** * uid/pwd directory based authentication manager *

- * + * * @version $Revision$, $Date$ */ public class PortalEnroll extends DirBasedAuthentication { @@ -125,7 +125,7 @@ public class PortalEnroll extends DirBasedAuthentication { /** * Initializes the PortalEnrollment auth manager. *

- * + * * @param name - The name for this authentication manager instance. * @param implName - The name of the authentication manager plugin. * @param config - The configuration store for this instance. @@ -161,7 +161,7 @@ public class PortalEnroll extends DirBasedAuthentication { /** * Authenticates a user based on uid, pwd in the directory. - * + * * @param authCreds The authentication credentials. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the uid and password are not valid @@ -259,7 +259,7 @@ public class PortalEnroll extends DirBasedAuthentication { * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams() { @@ -306,7 +306,7 @@ public class PortalEnroll extends DirBasedAuthentication { /** * Returns array of required credentials for this authentication manager. - * + * * @return Array of required credentials. */ public String[] getRequiredCreds() { @@ -315,7 +315,7 @@ public class PortalEnroll extends DirBasedAuthentication { /** * adds a user to the directory. - * + * * @return dn upon success and null upon failure. * @param token authentication token * @param uid the user's id. diff --git a/base/common/src/com/netscape/cms/authentication/RDNPattern.java b/base/common/src/com/netscape/cms/authentication/RDNPattern.java index 722aefbc3..35e3eb59a 100644 --- a/base/common/src/com/netscape/cms/authentication/RDNPattern.java +++ b/base/common/src/com/netscape/cms/authentication/RDNPattern.java @@ -32,45 +32,45 @@ import com.netscape.certsrv.base.EBaseException; * class for parsing a DN pattern used to construct a certificate * subject name from ldap attributes and dn. *

- * + * * dnpattern is a string representing a subject name pattern to formulate from the directory attributes and entry dn. If * empty or not set, the ldap entry DN will be used as the certificate subject name. *

- * + * * The syntax is - * + * *

  * 	dnPattern := rdnPattern *[ "," rdnPattern ]
  * 	rdnPattern := avaPattern *[ "+" avaPattern ]
- * 		avaPattern := name "=" value | 
- * 			      name "=" "$attr" "." attrName [ "." attrNumber ] | 
- * 			      name "=" "$dn" "." attrName [ "." attrNumber ] | 
+ * 		avaPattern := name "=" value |
+ * 			      name "=" "$attr" "." attrName [ "." attrNumber ] |
+ * 			      name "=" "$dn" "." attrName [ "." attrNumber ] |
  * 			 	  "$dn" "." "$rdn" "." number
  * 
- * + * *
  * Example1: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US 
  * Ldap entry: dn:  UID=jjames, OU=IS, OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example2: E=$attr.mail.1, CN=$attr.cn, OU=$dn.ou.2, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* E=jjames@acme.org, CN=Jesse James, OU=people, O=acme.org, C=US - *

+ *

* E = the first 'mail' ldap attribute value in user's entry.
* CN = the (first) 'cn' ldap attribute value in the user's entry.
* OU = the second 'ou' value in the user's entry DN. note multiple AVAs @@ -79,40 +79,40 @@ import com.netscape.certsrv.base.EBaseException; * C = the string "US" *

*

- * + * *
  * Example3: CN=$attr.cn, $rdn.2, O=$dn.o, C=US
  * Ldap entry: dn:  UID=jjames, OU=IS+OU=people, O=acme.org
- * Ldap attributes: cn: Jesse James 
+ * Ldap attributes: cn: Jesse James
  * Ldap attributes: mail: jjames@acme.org
  * 

* The subject name formulated will be :
* CN=Jesse James, OU=IS+OU=people, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
* followed by the second RDN in the user's entry DN.
* O = the (first) 'o' value in the user's entry DN.
- * C = the string "US" + * C = the string "US" *

* Example4: CN=$attr.cn, OU=$dn.ou.2+OU=$dn.ou.1, O=$dn.o, C=US * Ldap entry: dn: UID=jjames, OU=IS+OU=people, O=acme.org - * Ldap attributes: cn: Jesse James + * Ldap attributes: cn: Jesse James * Ldap attributes: mail: jjames@acme.org *

* The subject name formulated will be :
* CN=Jesse James, OU=people+OU=IS, O=acme.org, C=US - *

+ *

* CN = the (first) 'cn' ldap attribute value in the user's entry.
- * OU = the second 'ou' value in the user's entry DN followed by the + * OU = the second 'ou' value in the user's entry DN followed by the * first 'ou' value in the user's entry. note multiple AVAs * in a RDN in this example.
* O = the (first) 'o' value in the user's entry DN.
* C = the string "US" *

*

- * + * * If an attribute or subject DN component does not exist the attribute is skipped. - * + * * @version $Revision$, $Date$ */ class RDNPattern { @@ -130,14 +130,14 @@ class RDNPattern { /** * Construct a DN pattern by parsing a pattern string. - * + * * @param pattenr the DN pattern * @exception EBaseException If parsing error occurs. */ public RDNPattern(String pattern) throws EAuthException { if (pattern == null || pattern.equals("")) { - // create an attribute list that is the dn. + // create an attribute list that is the dn. mLdapAttrs = new String[] { "dn" }; } else { mPatternString = pattern; @@ -179,7 +179,7 @@ class RDNPattern { if (lastChar != -1) { try { - in.unread(lastChar); // pushback last , + in.unread(lastChar); // pushback last , } catch (IOException e) { throw new EAuthException(CMS.getUserMessage("CMS_AUTHENTICATION_INTERNAL_ERROR", e.toString())); } @@ -203,7 +203,7 @@ class RDNPattern { /** * Form a Ldap v3 DN string from results of a ldap search. - * + * * @param entry LDAPentry from a ldap search * @return Ldap v3 DN string to use for a subject name. */ diff --git a/base/common/src/com/netscape/cms/authentication/SSLclientCertAuthentication.java b/base/common/src/com/netscape/cms/authentication/SSLclientCertAuthentication.java index 35c23bd0f..dbae4a1ca 100644 --- a/base/common/src/com/netscape/cms/authentication/SSLclientCertAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/SSLclientCertAuthentication.java @@ -48,10 +48,10 @@ import com.netscape.certsrv.usrgrp.Certificates; /** * Certificate server SSL client authentication. - * + * * @author Christina Fu *

- * + * */ public class SSLclientCertAuthentication implements IAuthManager, IProfileAuthenticator { @@ -85,7 +85,7 @@ public class SSLclientCertAuthentication implements IAuthManager, * initializes the SSLClientCertAuthentication auth manager *

* called by AuthSubsystem init() method, when initializing all available authentication managers. - * + * * @param name The name of this authentication manager instance. * @param implName The name of the authentication manager plugin. * @param config The configuration store for this authentication manager. @@ -119,11 +119,11 @@ public class SSLclientCertAuthentication implements IAuthManager, * authenticates user by certificate *

* called by other subsystems or their servlets to authenticate users - * + * * @param authCred - authentication credential that contains * an usrgrp.Certificates of the user (agent) * @return the authentication token that contains the following - * + * * @exception EMissingCredential If a required credential for this * authentication manager is missing. * @exception EInvalidCredentials If credentials cannot be authenticated. @@ -270,7 +270,7 @@ public class SSLclientCertAuthentication implements IAuthManager, * the servlets that handle agent operations to authenticate its * users. It calls this method to know which are the * required credentials from the user (e.g. Javascript form data) - * + * * @return attribute names in Vector */ public String[] getRequiredCreds() { @@ -283,7 +283,7 @@ public class SSLclientCertAuthentication implements IAuthManager, * the Certificate Server Console to display the table for * configuration purposes. CertUserDBAuthentication is currently not * exposed in this case, so this method is not to be used. - * + * * @return configuration parameter names in Hashtable of Vectors * where each hashtable entry's key is the substore name, value is a * Vector of parameter names. If no substore, the parameter name @@ -302,7 +302,7 @@ public class SSLclientCertAuthentication implements IAuthManager, /** * gets the configuretion substore used by this authentication * manager - * + * * @return configuration store */ public IConfigStore getConfigStore() { diff --git a/base/common/src/com/netscape/cms/authentication/TokenAuthentication.java b/base/common/src/com/netscape/cms/authentication/TokenAuthentication.java index f8e0669e9..10cb94299 100644 --- a/base/common/src/com/netscape/cms/authentication/TokenAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/TokenAuthentication.java @@ -49,7 +49,7 @@ import com.netscape.cmsutil.xml.XMLObject; * Token authentication. * Checked if the given token is valid. *

- * + * * @version $Revision$, $Date$ */ public class TokenAuthentication implements IAuthManager, @@ -80,7 +80,7 @@ public class TokenAuthentication implements IAuthManager, * initializes the TokenAuthentication auth manager *

* called by AuthSubsystem init() method, when initializing all available authentication managers. - * + * * @param name The name of this authentication manager instance. * @param implName The name of the authentication manager plugin. * @param config The configuration store for this authentication manager. @@ -116,7 +116,7 @@ public class TokenAuthentication implements IAuthManager, * authenticates user(agent) by certificate *

* called by other subsystems or their servlets to authenticate users (agents) - * + * * @param authCred - authentication credential that contains * an usrgrp.Certificates of the user (agent) * @return the authentication token that contains the following @@ -217,7 +217,7 @@ public class TokenAuthentication implements IAuthManager, * the servlets that handle agent operations to authenticate its * users. It calls this method to know which are the * required credentials from the user (e.g. Javascript form data) - * + * * @return attribute names in Vector */ public String[] getRequiredCreds() { @@ -230,7 +230,7 @@ public class TokenAuthentication implements IAuthManager, * the Certificate Server Console to display the table for * configuration purposes. CertUserDBAuthentication is currently not * exposed in this case, so this method is not to be used. - * + * * @return configuration parameter names in Hashtable of Vectors * where each hashtable entry's key is the substore name, value is a * Vector of parameter names. If no substore, the parameter name @@ -249,7 +249,7 @@ public class TokenAuthentication implements IAuthManager, /** * gets the configuretion substore used by this authentication * manager - * + * * @return configuration store */ public IConfigStore getConfigStore() { diff --git a/base/common/src/com/netscape/cms/authentication/UdnPwdDirAuthentication.java b/base/common/src/com/netscape/cms/authentication/UdnPwdDirAuthentication.java index c9fbbf9ac..2f9fc43bd 100644 --- a/base/common/src/com/netscape/cms/authentication/UdnPwdDirAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/UdnPwdDirAuthentication.java @@ -35,7 +35,7 @@ import com.netscape.certsrv.logging.ILogger; /** * udn/pwd directory based authentication manager *

- * + * * @version $Revision$, $Date$ */ public class UdnPwdDirAuthentication extends DirBasedAuthentication { @@ -81,7 +81,7 @@ public class UdnPwdDirAuthentication extends DirBasedAuthentication { /** * Initializes the UdnPwdDirAuthentication auth manager. *

- * + * * @param name - The name for this authentication manager instance. * @param implName - The name of the authentication manager plugin. * @param config - The configuration store for this instance. @@ -94,7 +94,7 @@ public class UdnPwdDirAuthentication extends DirBasedAuthentication { /** * Authenticates a user based on udn, pwd in the directory. - * + * * @param authCreds The authentication credentials. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the udn and password are not valid @@ -170,7 +170,7 @@ public class UdnPwdDirAuthentication extends DirBasedAuthentication { * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams() { @@ -179,7 +179,7 @@ public class UdnPwdDirAuthentication extends DirBasedAuthentication { /** * Returns array of required credentials for this authentication manager. - * + * * @return Array of required credentials. */ public String[] getRequiredCreds() { diff --git a/base/common/src/com/netscape/cms/authentication/UidPwdDirAuthentication.java b/base/common/src/com/netscape/cms/authentication/UidPwdDirAuthentication.java index d4a9de108..ffa8ea42f 100644 --- a/base/common/src/com/netscape/cms/authentication/UidPwdDirAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/UidPwdDirAuthentication.java @@ -49,7 +49,7 @@ import com.netscape.certsrv.request.IRequest; /** * uid/pwd directory based authentication manager *

- * + * * @version $Revision$, $Date$ */ public class UidPwdDirAuthentication extends DirBasedAuthentication @@ -96,7 +96,7 @@ public class UidPwdDirAuthentication extends DirBasedAuthentication /** * Authenticates a user based on uid, pwd in the directory. - * + * * @param authCreds The authentication credentials. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the uid and password are not valid @@ -185,7 +185,7 @@ public class UidPwdDirAuthentication extends DirBasedAuthentication * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams() { @@ -194,7 +194,7 @@ public class UidPwdDirAuthentication extends DirBasedAuthentication /** * Returns array of required credentials for this authentication manager. - * + * * @return Array of required credentials. */ public String[] getRequiredCreds() { diff --git a/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java b/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java index 880b7c767..65cf75651 100644 --- a/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java +++ b/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java @@ -55,7 +55,7 @@ import com.netscape.certsrv.request.IRequest; /** * uid/pwd/pin directory based authentication manager *

- * + * * @version $Revision$, $Date$ */ public class UidPwdPinDirAuthentication extends DirBasedAuthentication @@ -179,7 +179,7 @@ public class UidPwdPinDirAuthentication extends DirBasedAuthentication /** * Authenticates a user based on its uid, pwd, pin in the directory. - * + * * @param authCreds The authentication credentials with uid, pwd, pin. * @return The user's ldap entry dn. * @exception EInvalidCredentials If the uid and password are not valid @@ -242,7 +242,7 @@ public class UidPwdPinDirAuthentication extends DirBasedAuthentication log(ILogger.LL_SECURITY, CMS.getLogMessage("CMS_AUTH_AUTHENTICATED", uid)); // log(ILogger.LL_SECURITY, "found user : " + userdn); - // check pin. + // check pin. checkpin(conn, userdn, uid, pin); // set uid in the token. @@ -376,7 +376,7 @@ public class UidPwdPinDirAuthentication extends DirBasedAuthentication * Returns a list of configuration parameter names. * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams() { @@ -385,7 +385,7 @@ public class UidPwdPinDirAuthentication extends DirBasedAuthentication /** * Returns array of required credentials for this authentication manager. - * + * * @return Array of required credentials. */ public String[] getRequiredCreds() { -- cgit