Remove erroneous NULLCHECK from CRLSelector_ToString_Helper and fix some NSS_LIBPKIX_BRANCH
authorrichard.freedman%sun.com
Mon, 29 Aug 2005 20:08:44 +0000
branchNSS_LIBPKIX_BRANCH
changeset 6064 918c12d6c56310586396aac1fe20dd56042a37ed
parent 6043 4a525551e5c3b46ac165496e1a17ff9752d79761
child 6066 49ab19fa6fb4dab65445c2483db1a9537dcac5c6
push idunknown
push userunknown
push dateunknown
Remove erroneous NULLCHECK from CRLSelector_ToString_Helper and fix some non-conforming or outdated function descriptions.
security/nss/lib/libpkix/pkix/certsel/pkix_certselector.c
security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c
--- a/security/nss/lib/libpkix/pkix/certsel/pkix_certselector.c
+++ b/security/nss/lib/libpkix/pkix/certsel/pkix_certselector.c
@@ -1144,18 +1144,19 @@ cleanup:
 }
 
 /*
  * FUNCTION: pkix_CertSelector_DefaultMatch
  * DESCRIPTION:
  *
  *  This default match function determines whether the specified Cert pointed
  *  to by "cert" matches the criteria of the CertSelector pointed to by
- *  "selector". If the Cert does not match the CertSelector's criteria, an
- *  Error pointer is returned.
+ *  "selector". If the Cert satisfies the CertSelector's criteria, PKIX_TRUE
+ *  is stored at "pResult". If the Cert does not match the CertSelector's
+ *  criteria, PKIX_FALSE is stored at "pResult". 
  *
  *  This default match function understands how to process the most common
  *  parameters. Any common parameter that is not set is assumed to be disabled,
  *  which means this function will select all certificates without regard to
  *  that particular disabled parameter. For example, if the SerialNumber
  *  parameter is not set, this function will not filter out any certificate
  *  based on its serial number. As such, if no parameters are set, all are
  *  disabled and any certificate will match. If a parameter is disabled, its
--- a/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c
+++ b/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c
@@ -91,34 +91,34 @@ cleanup:
  *  "plContext" - Platform-specific context pointer.
  *
  * THREAD SAFETY:
  *  Conditionally Thread Safe
  *      (see Thread Safety Definitions in Programmer's Guide)
  *
  * RETURNS:
  *  Returns NULL if the function succeeds.
- *  Returns a CRLEntry Error if the function fails in a non-fatal way.
+ *  Returns a CRLSelector Error if the function fails in a non-fatal way.
  *  Returns a Fatal Error if the function fails in an unrecoverable way.
  */
 static PKIX_Error *
 pkix_CRLSelector_ToString_Helper(
         PKIX_CRLSelector *crlSelector,
         PKIX_PL_String **pString,
         void *plContext)
 {
         PKIX_PL_String *crlSelectorString = NULL;
         PKIX_PL_String *formatString = NULL;
         PKIX_PL_String *crlParamsString = NULL;
         PKIX_PL_String *crlContextString = NULL;
         char *asciiFormat = NULL;
 
         PKIX_ENTER(CRLSELECTOR, "pkix_CRLSelector_ToString_Helper");
         PKIX_NULLCHECK_TWO(crlSelector, pString);
-        PKIX_NULLCHECK_TWO(crlSelector->params, crlSelector->context);
+        PKIX_NULLCHECK_ONE(crlSelector->params);
 
         asciiFormat =
                 "\n\t[\n"
                 "\tMatchCallback: 0x%x\n"
                 "\tParams:          %s\n"
                 "\tContext:         %s\n"
                 "\t]\n";
 
@@ -136,23 +136,16 @@ pkix_CRLSelector_ToString_Helper(
                     &crlParamsString,
                     plContext,
                     "pkix_ComCRLSelParams_ToString failed");
 
         /* Context */
         PKIX_TOSTRING(crlSelector->context, &crlContextString, plContext,
                     "PKIX_LIST_ToString failed");
 
-
-
-
-
-
-
-
         PKIX_CHECK(PKIX_PL_Sprintf
                     (&crlSelectorString,
                     plContext,
                     formatString,
                     crlSelector->matchCallback,
                     crlParamsString,
                     crlContextString),
                     "PKIX_PL_Sprintf failed");
@@ -374,37 +367,38 @@ cleanup:
 
         PKIX_RETURN(CRLSELECTOR);
 }
 
 /*
  * FUNCTION: pkix_CRLSelector_DefaultMatch
  *
  * DESCRIPTION:
- *  This functions compares passing-in CRL's Issuer, date, CRL number
- *  with the corresponding parameter values set in CRLSelector's Params.
- *  When this CRL matches all the criteria set in Params, a NULL is returned.
- *  Otherwise, an PKIX_Error is returned.
+ *  This function compares the parameter values (Issuer, date, and CRL number)
+ *  set in the ComCRLSelParams of the CRLSelector pointed to by "selector" with
+ *  the corresponding values in the CRL pointed to by "crl". When all the
+ *  criteria set in the parameter values match the values in "crl", NULL is
+ *  returned. Otherwise, an PKIX_Error is returned.
  *
  * PARAMETERS
  *  "selector"
  *      Address of CRLSelector which is verified for a match
  *      Must be non-NULL.
  *  "crl"
  *      Address of the CRL object to be verified. Must be non-NULL.
  *  "plContext"
  *      Platform-specific context pointer.
  *
  * THREAD SAFETY:
  *  Conditionally Thread Safe
  *      (see Thread Safety Definitions in Programmer's Guide)
  *
  * RETURNS:
  *  Returns NULL if the function succeeds.
- *  Returns a List Error if the function fails in a non-fatal way.
+ *  Returns a CRLSelector Error if the function fails in a non-fatal way.
  *  Returns a Fatal Error if the function fails in an unrecoverable way.
  */
 static PKIX_Error *
 pkix_CRLSelector_DefaultMatch(
         PKIX_CRLSelector *selector,
         PKIX_PL_CRL *crl,
         void *plContext)
 {