Validates the digest challenge.
194969
protected function validate(): bool
    {
        $A2 = $this->request->getMethod().':'.$this->digestParts['uri'];

        if ('auth-int' === $this->digestParts['qop']) {
            // Making sure we support this qop value
            if (!($this->qop & self::QOP_AUTHINT)) {
                return false;
            }
            // We need to add an md5 of the entire request body to the A2 part of the hash
            $body = $this->request->getBody($asString = true);
            $this->request->setBody($body);
            $A2 .= ':'.md5($body);
        } elseif (!($this->qop & self::QOP_AUTH)) {
            return false;
        }

        $A2 = md5($A2);

        $validResponse = md5("{$this->A1}:{$this->digestParts['nonce']}:{$this->digestParts['nc']}:{$this->digestParts['cnonce']}:{$this->digestParts['qop']}:{$A2}");

        return $this->digestParts['response'] === $validResponse;
    }
70060
private function validate() {
        foreach ($this->entries as $entry) {
            // first call the entry's own validation method
            // which will throw an exception if there's anything wrong
            $entry->validate();
            // now make sure that all links are in place
            foreach ($entry->links as $linkedid => $rel) {
                // the linked to entry exists
                if (!array_key_exists($linkedid, $this->entries)) {
                    $a = (object)array('rel' => $rel->type, 'to' => $linkedid, 'from' => $entry->id);
                    throw new portfolio_format_leap2a_exception('leap2a_nonexistantlink', 'portfolio', '', $a);
                }
                // and contains a link back to us
                if (!array_key_exists($entry->id, $this->entries[$linkedid]->links)) {

                }
                // we could later check that the reltypes were properly inverse, but nevermind for now.
            }
        }
    }
382179
def validate(self, input, is_substitute): # ToDo: apply 'no substitute' for initial load validations
        
        constraint = self.__get_constraint(input)
        to_validate = self.__get_to_validate(input)
        return self.__compare(to_validate, constraint)
650390
def Validate(self,
               problems=None,
               validate_children=True,
               today=None,
               service_gap_interval=None):
    """"""

    if not problems:
      problems = self.problem_reporter

    self.ValidateAgenciesHaveSameAgencyTimezone(problems)
    self.ValidateFeedInfoLangMatchesAgencyLang(problems)
    self.ValidateServiceRangeAndExceptions(problems, today,
                                           service_gap_interval)
    # TODO: Check Trip fields against valid values
    self.ValidateStops(problems, validate_children)
    #TODO: check that every station is used.
    # Then uncomment testStationWithoutReference.
    self.ValidateNearbyStops(problems)
    self.ValidateRouteNames(problems, validate_children)
    self.ValidateTrips(problems)
    self.ValidateRouteAgencyId(problems)
    self.ValidateTripStopTimes(problems)
    self.ValidateUnusedShapes(problems)
1316797
private byte[] validateChallenge(byte[] nonce, byte[] encryptedChallenge)
    throws GeneralSecurityException {

    byte[] challenge = decrypt(encryptedChallenge);
    checkSubArray(appId, challenge, 0);
    checkSubArray(nonce, challenge, appId.length);
    return Arrays.copyOfRange(challenge, appId.length + nonce.length, challenge.length);
  }
593412
void validate() {
        validateCassandraParams();

        if (pageSize <= 0) {
            throw new IllegalArgumentException("pageSize cannot be zero");
        }

        

        validateConsistencyLevels();

        TableMetadata tableMetadata = fetchTableMetadata();

        validateTableMetadata(tableMetadata);
        validateAdditionalFilters(tableMetadata);

        if (!(this.isBisectModeSet && this.isSplitModeSet)) {
            if (this.isBisectModeSet) {
                if (this.bisectFactor != Constants.DEFAULT_BISECT_FACTOR
                        && !this.checkIsPowerOfTwo(this.bisectFactor)) {
                    throw new IllegalArgumentException(
                            "Bisect factor should be greater than zero and a power of 2");
                }
            } else if (this.isSplitModeSet) {
                if (this.splitSize <= 0) {
                    throw new IllegalArgumentException(
                            "The split size must be a positve integer");
                }
            } else {
                throw new IllegalArgumentException(
                        "One split mode must be defined, please choose between Split or Bisect");
            }
        } else {
            throw new IllegalArgumentException(
                    "Only one split mode can be defined, please choose between Split or Bisect");
        }
    }
970340
def verify_challenge(uri):
    
    while True:
        try:
            resp = urlopen(uri)
            challenge_status = json.loads(resp.read().decode('utf8'))
        except IOError as e:
            raise ValueError("Error checking challenge: {0} {1}".format(
                e.code, json.loads(e.read().decode('utf8'))))
        if challenge_status['status'] == "pending":
            time.sleep(2)
        elif challenge_status['status'] == "valid":
            LOGGER.info("Domain verified!")
            break
        else:
            raise ValueError("Domain challenge did not pass: {0}".format(
                challenge_status))
1033242
void validate(ServerResponse serverResponse) throws GeneralSecurityException {
    byte[] response = validateChallenge(authNonce, serverResponse.response);

    byte[] expected = rawResponse(challenge);
    Preconditions.checkArgument(Arrays.equals(expected, response));

    byte[] nonce = decrypt(serverResponse.nonce);
    byte[] inputIv = decrypt(serverResponse.inputIv);
    byte[] outputIv = decrypt(serverResponse.outputIv);

    SecretKeySpec sessionKey = generateKey(conf.keyFactoryAlgorithm(), conf.keyFactoryIterations(),
      nonce, conf.encryptionKeyLength());
    this.sessionCipher = new TransportCipher(cryptoConf, conf.cipherTransformation(), sessionKey,
      inputIv, outputIv);
  }
37102
public void validate() {

        if (CmsStringUtil.isEmpty(getNewPwd())) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_NEWPWD_0));
        }
        if (!getNewPwd().equals(getConfirmation())) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NEWPWD_MISMATCH_0));
        }
    }
59454
def validate(self):
        """"""
        super().validate()
        nb_entities = len(self.entities)
        if nb_entities != self.rows:
            raise self.error(
                'Number of entities: %s != number of rows: %s' % (
                    nb_entities, self.rows))
1265250
private void validateCoefficients() {
        if (coefsValid)
            return;

        if (n >= 2) {
            double xBar = (double) sumX / n;
            double yBar = (double) sumY / n;

            a1 = (double) ((n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX));
            a0 = (double) (yBar - a1 * xBar);
        } else {
            a0 = a1 = Double.NaN;
        }

        coefsValid = true;
    }
617452
def validate(self):
        """"""
        if self.error:
            return False

        for v in self.validators:
            self.error = v(self.value)
            if self.error:
                return False

        return True
141994
private void doValidate() {
        List<String> errors = new ArrayList<>();
        // Strip off user from repository name
        String image = user != null ? repository.substring(user.length() + 1) : repository;
        Object[] checks = new Object[] {
            "registry", DOMAIN_REGEXP, registry,
            "image", IMAGE_NAME_REGEXP, image,
            "user", NAME_COMP_REGEXP, user,
            "tag", TAG_REGEXP, tag,
            "digest", DIGEST_REGEXP, digest
        };
        for (int i = 0; i < checks.length; i +=3) {
            String value = (String) checks[i + 2];
            Pattern checkPattern = (Pattern) checks[i + 1];
            if (value != null &&
                !checkPattern.matcher(value).matches()) {
                errors.add(String.format("%s part '%s' doesn't match allowed pattern '%s'",
                                         checks[i], value, checkPattern.pattern()));
            }
        }
        if (errors.size() > 0) {
            StringBuilder buf = new StringBuilder();
            buf.append(String.format("Given Docker name '%s' is invalid:\n", getFullName()));
            for (String error : errors) {
                buf.append(String.format("   * %s\n",error));
            }
            buf.append("See http://bit.ly/docker_image_fmt for more details");
            throw new IllegalArgumentException(buf.toString());
        }
    }
1044877
def validate(self):
        

        extents_valid = (0 <= self.lower_extent <= self.upper_extent
            <= self.global_size)

        if not extents_valid:
            raise ValueError("Dimension '{d}' fails 0 <= {el} <= {eu} <= {gs}"
                .format(d=self.name, gs=self.global_size,
                    el=self.lower_extent, eu=self.upper_extent))
389921
def verify(data, digest)
      if valid_digest?(data, digest)
        true
      else
        raise DynamicImage::Errors::InvalidSignature
      end
    end
934654
def validate():
    ''''''
    with current_app.test_request_context():
        schema = json.loads(json.dumps(api.__schema__))
    try:
        schemas.validate(schema)
        success('API specifications are valid')
    except schemas.SchemaValidationError as e:
        exit_with_error('API specifications are not valid', e)
223794
def validate_proof(self, proof, target_hash, merkle_root):
        
        return validate_proof(proof, target_hash, merkle_root, self.hash_f)