matched = compareDNSN2C(&uri, &current->name.name.other);
matched = compareURIN2C(&uri, &current->name.name.other);
cert_CompareNameWithConstraints(CERTGeneralName     *name, 				CERTNameConstraint  *constraints,				PRBool              excluded){    SECStatus           rv     = SECSuccess;    SECStatus           matched = SECFailure;    CERTNameConstraint  *current;    PORT_Assert(constraints);  /* caller should not call with NULL */    if (!constraints) {	PORT_SetError(SEC_ERROR_INVALID_ARGS);        return SECFailure;    }    current = constraints;    do {	rv = SECSuccess;	matched = SECFailure;	PORT_Assert(name->type == current->name.type);	switch (name->type) {	case certDNSName:	    matched = compareDNSN2C(&name->name.other, 	                            &current->name.name.other);	    break;	case certRFC822Name:	    matched = compareRFC822N2C(&name->name.other, 	                               &current->name.name.other);	    break;	case certURI:	    {		/* make a modifiable copy of the URI SECItem. */		SECItem uri = name->name.other;		/* find the hostname in the URI */		rv = parseUriHostname(&uri);		if (rv == SECSuccess) {		    /* does our hostname meet the constraint? */		    matched = compareDNSN2C(&uri, &current->name.name.other);		}	    }	    break;	case certDirectoryName:	    /* Determine if the constraint directory name is a "prefix"	    ** for the directory name being tested. 	    */	  {	    /* status defaults to SECEqual, so that a constraint with 	    ** no AVAs will be a wildcard, matching all directory names.	    */	    SECComparison   status = SECEqual;	    const CERTRDN **cRDNs = current->name.name.directoryName.rdns;  	    const CERTRDN **nRDNs = name->name.directoryName.rdns;	    while (cRDNs && *cRDNs && nRDNs && *nRDNs) { 		/* loop over name RDNs and constraint RDNs in lock step */		const CERTRDN *cRDN = *cRDNs++;		const CERTRDN *nRDN = *nRDNs++;		CERTAVA **cAVAs = cRDN->avas;		while (cAVAs && *cAVAs) { /* loop over constraint AVAs */		    CERTAVA *cAVA = *cAVAs++;		    CERTAVA **nAVAs = nRDN->avas;		    while (nAVAs && *nAVAs) { /* loop over name AVAs */			CERTAVA *nAVA = *nAVAs++;			status = CERT_CompareAVA(cAVA, nAVA);			if (status == SECEqual) 			    break;		    } /* loop over name AVAs */		    if (status != SECEqual) 			break;		} /* loop over constraint AVAs */		if (status != SECEqual) 		    break;	    } /* loop over name RDNs and constraint RDNs */	    matched = (status == SECEqual) ? SECSuccess : SECFailure;	    break;	  }	case certIPAddress:	/* type 8 */	    matched = compareIPaddrN2C(&name->name.other, 	                               &current->name.name.other);	    break;	/* NSS does not know how to compare these "Other" type names with 	** their respective constraints.  But it does know how to tell	** if the constraint applies to the type of name (by comparing	** the constraint OID to the name OID).  NSS makes no use of "Other"	** type names at all, so NSS errs on the side of leniency for these 	** types, provided that their OIDs match.  So, when an "Other"	** name constraint appears in an excluded subtree, it never causes	** a name to fail.  When an "Other" name constraint appears in a	** permitted subtree, AND the constraint's OID matches the name's	** OID, then name is treated as if it matches the constraint.	*/	case certOtherName:	/* type 1 */	    matched = (!excluded &&		       name->type == current->name.type &&		       SECITEM_ItemsAreEqual(&name->name.OthName.oid,					     &current->name.name.OthName.oid))		 ? SECSuccess : SECFailure;	    break;	/* NSS does not know how to compare these types of names with their	** respective constraints.  But NSS makes no use of these types of 	** names at all, so it errs on the side of leniency for these types.	** Constraints for these types of names never cause the name to 	** fail the constraints test.  NSS behaves as if the name matched	** for permitted constraints, and did not match for excluded ones.	*/	case certX400Address:	/* type 4 */	case certEDIPartyName:  /* type 6 */	case certRegisterID:	/* type 9 */	    matched = excluded ? SECFailure : SECSuccess;	    break;	default: /* non-standard types are not supported */	    rv = SECFailure;	    break;	}	if (matched == SECSuccess || rv != SECSuccess)	    break;	current = cert_get_next_name_constraint(current);    } while (current != constraints);    if (rv == SECSuccess) {        if (matched == SECSuccess) 	    rv = excluded ? SECFailure : SECSuccess;	else	    rv = excluded ? SECSuccess : SECFailure;	return rv;    }    return SECFailure;}