Lines Matching refs:constraint
399 func matchEmailConstraint(mailbox rfc2821Mailbox, constraint string) (bool, error) {
402 if strings.Contains(constraint, "@") {
403 constraintMailbox, ok := parseRFC2821Mailbox(constraint)
405 return false, fmt.Errorf("x509: internal error: cannot parse constraint %q", constraint)
412 return matchDomainConstraint(mailbox.domain, constraint)
415 func matchURIConstraint(uri *url.URL, constraint string) (bool, error) {
442 return matchDomainConstraint(host, constraint)
445 func matchIPConstraint(ip net.IP, constraint *net.IPNet) (bool, error) {
446 if len(ip) != len(constraint.IP) {
451 if mask := constraint.Mask[i]; ip[i]&mask != constraint.IP[i]&mask {
459 func matchDomainConstraint(domain, constraint string) (bool, error) {
462 if len(constraint) == 0 {
477 if constraint[0] == '.' {
479 constraint = constraint[1:]
482 constraintLabels, ok := domainToReverseLabels(constraint)
484 return false, fmt.Errorf("x509: internal error: cannot parse domain %q", constraint)
511 match func(parsedName, constraint any) (match bool, err error),
522 constraint := excludedValue.Index(i).Interface()
523 match, err := match(parsedName, constraint)
529 …thorizedForThisName, fmt.Sprintf("%s %q is excluded by constraint %q", nameType, name, constraint)}
542 constraint := permittedValue.Index(i).Interface()
545 if ok, err = match(parsedName, constraint); err != nil {
624 func(parsedName, constraint any) (bool, error) {
625 return matchEmailConstraint(parsedName.(rfc2821Mailbox), constraint.(string))
637 func(parsedName, constraint any) (bool, error) {
638 return matchDomainConstraint(parsedName.(string), constraint.(string))
651 func(parsedName, constraint any) (bool, error) {
652 return matchURIConstraint(parsedName.(*url.URL), constraint.(string))
664 func(parsedName, constraint any) (bool, error) {
665 return matchIPConstraint(parsedName.(net.IP), constraint.(*net.IPNet))
937 if candidate.constraint != nil {
938 if err := candidate.constraint(currentChain); err != nil {