Verifies a verification code received on a trusted device
977267
def validate_verification_code(self, device, code):
        
        device.update({
            'verificationCode': code,
            'trustBrowser': True
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                '%s/validateVerificationCode' % self._setup_endpoint,
                params=self.params,
                data=data
            )
        except PyiCloudAPIResponseError as error:
            if error.code == -21669:
                # Wrong verification code
                return False
            raise

        # Re-authenticate, which will both update the HSA data, and
        # ensure that we save the X-APPLE-WEBAUTH-HSA-TRUST cookie.
        self.authenticate()

        return not self.requires_2sa
1002421
function verify(postedMessage) {
		if (
			// Check incoming message is valid
			typeof postedMessage === 'object' &&
			typeof postedMessage.uuid === 'string' &&
			postedMessage._respondable === true
		) {
			var messageSource = _getSource();
			return (
				// Check the version matches
				postedMessage._source === messageSource ||
				// Allow free communication with axe test
				postedMessage._source === 'axeAPI.x.y.z' ||
				messageSource === 'axeAPI.x.y.z'
			);
		}
		return false;
	}
474621
def verify(api_key = nil)
      raise ConfigurationError, "You must provide an API key to verify" if api_key.nil? && self.api_key.nil?
      perform(:verify, { :providerkey => provider_key, :apikey => api_key || self.api_key }, :get, Success)
    end
10634
def verify(self, sig, msg):
        '''
        
        '''
        return lib.ed25519_VerifySignature(
            sig, self.__verifyingkey, msg, len(msg)) == 1
422015
def verify(ctx, file, account):
    
    if not file:
        print_message("Prompting for message. Terminate with CTRL-D", "info")
        file = click.get_text_stream("stdin")
    m = Message(file.read(), bitshares_instance=ctx.bitshares)
    try:
        if m.verify():
            print_message("Verified", "success")
        else:
            print_message("not verified", "error")
    except InvalidMessageSignature:
        print_message("Signature INVALID!", "error")
1263970
def verify(self, otp, for_time=None, valid_window=0):
        
        if for_time is None:
            for_time = datetime.datetime.now()

        if valid_window:
            for i in range(-valid_window, valid_window + 1):
                if utils.strings_equal(str(otp), str(self.at(for_time, i))):
                    return True
            return False

        return utils.strings_equal(str(otp), str(self.at(for_time)))
1367488
def verify_message(self, message):
        """"""
        if verify_checksum(
                message,
                self.in_checksum.get(message.id, 0),
        ):
            self.in_checksum[message.id] = message.checksum[1]

            if message.flags == FlagsType.none:
                self.in_checksum.pop(message.id)
        else:
            self.in_checksum.pop(message.id, None)
            raise InvalidChecksumError(
                description="Checksum does not match!",
                id=message.id,
            )
803788
def isSignatureValid(expected, received):
    
    if expected:
        if not received or expected != received:
            return False
    else:
        if received:
            return False
    return True
562468
def _verify_auth(self):
        '''
        
        '''

        return self.token and bool(self.application.auth.get_tok(self.token))
558700
def trusted=(val)
      if ! [ true, false ].include?(val)
        raise ArgumentError, "value must be a boolean"
      end
      @o_dev[I_DEVICE]['Trusted'] = val
    end
460240
function onReauthConfirmPhoneVerification() {
  var verificationId = $('#link-reauth-phone-verification-id').val();
  var verificationCode = $('#link-reauth-phone-verification-code').val();
  var credential = firebase.auth.PhoneAuthProvider.credential(
      verificationId, verificationCode);
  activeUser().reauthenticateWithCredential(credential)
      .then(function(result) {
        logAdditionalUserInfo(result);
        refreshUserData();
        alertSuccess('User reauthenticated!');
      }, onAuthError);
}
776027
def verify_message(address, message, signature):
    
    bitcoin_message = BitcoinMessage(message)
    verified = VerifyMessage(address, bitcoin_message, signature)
    return verified
914766
def _verify(leniency, numobj, candidate, matcher):
    """"""
    if leniency == Leniency.POSSIBLE:
        return is_possible_number(numobj)
    elif leniency == Leniency.VALID:
        if (not is_valid_number(numobj) or
            not _contains_only_valid_x_chars(numobj, candidate)):
            return False
        return _is_national_prefix_present_if_required(numobj)
    elif leniency == Leniency.STRICT_GROUPING:
        return _verify_strict_grouping(numobj, candidate, matcher)
    elif leniency == Leniency.EXACT_GROUPING:
        return _verify_exact_grouping(numobj, candidate, matcher)
    else:
        raise Exception("Error: unsupported Leniency value %s" % leniency)
969649
def verify(self, data, signature=None, keyrings=None, homedir=None):
        '''
        
        '''

        if isinstance(data, six.text_type):
            data = data.encode('utf-8')

        tmpdir = tempfile.mkdtemp()
        data_file, data_path = tempfile.mkstemp(dir=tmpdir)
        data_file = os.fdopen(data_file, 'wb')
        data_file.write(data)
        data_file.close()
        if signature:
            sig_file, sig_path = tempfile.mkstemp(dir=tmpdir)
            sig_file = os.fdopen(sig_file, 'wb')
            sig_file.write(signature)
            sig_file.close()
        else:
            sig_path = None
        try:
            return self.verify_from_file(
                data_path,
                sig_path=sig_path,
                keyrings=keyrings,
                homedir=homedir
            )
        finally:
            shutil.rmtree(tmpdir)
335739
def is_verified(self):
        
        if self._verified is None:
            signature = self._data.get('Signature')
            if not signature:
                self._verified = False
                return self._verified

            # Decode the signature from base64
            signature = bytes(base64.b64decode(signature))

            # Get the message to sign
            sign_bytes = self._get_bytes_to_sign()
            if not sign_bytes:
                self._verified = False
                return self._verified

            if not self.certificate:
                self._verified = False
                return self._verified

            # Extract the public key
            pkey = self.certificate.get_pubkey()

            # Use the public key to verify the signature.
            pkey.verify_init()
            pkey.verify_update(sign_bytes)
            verify_result = pkey.verify_final(signature)

            self._verified = verify_result == 1

        return self._verified
643156
public function verify_code() {
		if (!$this->_logincode) return false;
		$t = time().strval(mt_rand(100,999));

			$url = 'https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?uuid='.$this->_logincode.'&tip=0&_='.$t;
			$send_snoopy = new Snoopy; 
			$send_snoopy->referer = "https://wx.qq.com/";
			$send_snoopy->fetch($url);
			$result = $send_snoopy->results;
			$this->log('step1:'.$result);
			if ($result) {
				preg_match("/window\.code=(\d+)/",$result,$matches);
				if(count($matches)>1) {
					$status = intval($matches[1]);
					if ($status==201) $_SESSION['login_step'] = 1;
					if ($status==200) {
						preg_match("/ticket=([0-9a-z-_]+)&lang=zh_CN&scan=(\d+)/",$result,$matches);
						preg_match("/window.redirect_uri=\"([^\"]+)\"/",$result,$matcheurl);
						$this->log('step2:'.print_r($matches,true));
						if (count($matcheurl)>1) {
							$ticket = $matches[1];
							$scan = $matches[2];
							//$loginurl = 'https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket='.$ticket.'&lang=zh_CN&scan='.$scan.'&fun=new';
							$loginurl = str_replace("wx.qq.com", "wx2.qq.com", $matcheurl[1]).'&fun=old';
							$urlpart = parse_url($loginurl);
							$send_snoopy = new Snoopy; 
							$send_snoopy->referer = "https://{$urlpart['host']}/cgi-bin/mmwebwx-bin/webwxindex?t=chat";
							$send_snoopy->fetch($loginurl);
							$result = $send_snoopy->results;
							$xml = simplexml_load_string($result);
							if ($xml->ret=="0") $this->skey = $xml->skey;
							foreach ($send_snoopy->headers as $key => $value) {
								$value = trim($value);
								if(strpos($value,'Set-Cookie: ') !== false){
									$tmp = str_replace("Set-Cookie: ","",$value);
									$tmparray = explode(';', $tmp);
									$item = trim($tmparray[0]);
									$cookie.=$item.';';
								}
							}
							$cookie .="Domain=.qq.com;";
							$this->cookie = $cookie;
							$this->log('step3:'.$loginurl.';cookie:'.$cookie.';respond:'.$result);
							
							$this->saveCookie($this->_cookiename,$this->cookie);
						}
					}
					return $status;
				}
			}
		return false;
	}
1090866
def verify(
    signature: Ed25519Signature, digest: bytes, pub_key: Ed25519PublicPoint
) -> None:
    """"""
    # XXX this *might* change to bool function
    _ed25519.checkvalid(signature, digest, pub_key)