// Use this method to specify a list of servers for verification.
// Each server string should contain host + path. 
// Example: "api.yubico.com/wsapi/2.0/verify".
187173
func (ya *YubiAuth) SetApiServerList(urls ...string) {
	// Lock
	ya.use.Lock()
	defer ya.use.Unlock()

	// save setting
	ya.apiServerList = urls

	// rebuild workers (api server url's have changed)
	ya.buildWorkers()
}
607702
func (c *client) ServerList() ([]*Server, error) {
	var out []*Server
	uri := fmt.Sprintf(pathServers, c.addr)
	err := c.get(uri, &out)
	return out, err
}
20398
func (s *SnapshotCreateRepositoryService) Verify(verify bool) *SnapshotCreateRepositoryService {
	s.verify = &verify
	return s
}
744883
func Verify(secret, userResponse string) error {
	// Make sure secret key is not blank
	if len(secret) < 1 {
		return errors.New("Server Error: No reCAPTCHA secret key")
	}
	data := map[string]string{
		"secret":   secret,
		"response": userResponse,
	}
	var result map[string]interface{}
	err := XURLRequest(VerifyURL, data, &result)
	if err != nil {
		return err
	}
	success, ok := result["success"]
	if !ok {
		return errors.New("Response did not contain \"success\"")
	}
	if success != true {
		log.Println("reCAPTCHA verification failed:", result)
		return errors.New("reCAPTCHA was invalid")
	}
	return nil
}
1356897
func (is *identityMapperImpl) Verify(vkID, signature, message []byte) error {
	cert, err := is.Get(vkID)
	if err != nil {
		return err
	}
	return is.mcs.Verify(cert, signature, message)
}
536024
func (cs Checksum) Verify(data interface{}) error {
	if cs != New(data) {
		return errors.ErrCorruptCheckpoint
	}
	return nil
}
478021
func (vind *BinaryMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	out := make([]bool, len(ids))
	for i := range ids {
		out[i] = bytes.Equal(binHash(ids[i].ToBytes()), ksids[i])
	}
	return out, nil
}
770599
func (m *SigningMethodRSAPSS) Verify(signingString, signature string, key interface{}) error {
	var err error

	// Decode the signature
	var sig []byte
	if sig, err = DecodeSegment(signature); err != nil {
		return err
	}

	var rsaKey *rsa.PublicKey
	switch k := key.(type) {
	case *rsa.PublicKey:
		rsaKey = k
	default:
		return ErrInvalidKey
	}

	// Create hasher
	if !m.Hash.Available() {
		return ErrHashUnavailable
	}
	hasher := m.Hash.New()
	hasher.Write([]byte(signingString))

	return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, m.Options)
}
831037
func VerifyVolumePathsForVM(vmMo mo.VirtualMachine, volPaths []string, nodeName string, nodeVolumeMap map[string]map[string]bool) {
	// Verify if the volume paths are present on the VM backing virtual disk devices
	vmDevices := object.VirtualDeviceList(vmMo.Config.Hardware.Device)
	VerifyVolumePathsForVMDevices(vmDevices, volPaths, nodeName, nodeVolumeMap)

}
416777
func (lu *LookupUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	if lu.writeOnly {
		out := make([]bool, len(ids))
		for i := range ids {
			out[i] = true
		}
		return out, nil
	}
	return lu.lkp.Verify(vcursor, ids, ksidsToValues(ksids))
}
149894
func Verify(r *http.Request, opts ...VerifyOption) error {
	o := &VerifyOptions{
		cookieName:    XSRFCookieName,
		headerName:    XSRFHeaderName,
		formFieldName: XSRFFormFieldName,
	}
	for _, opt := range opts {
		opt(o)
	}

	if contains(safeMethods, r.Method) {
		return nil
	}

	referer, err := url.Parse(r.Header.Get("Referer"))
	if err != nil {
		return err
	}
	if referer.String() == "" {
		return ErrNoReferer
	}

	if !(r.Host == referer.Host) {
		return ErrInvalidReferer
	}

	token, err := r.Cookie(o.cookieName)
	if err != nil {
		if err.Error() == "http: named cookie not present" {
			return ErrMissingCookie
		}
		return err
	}

	if contains([]string{"application/x-www-form-urlencoded", "multipart/form-data"}, r.Header.Get("Content-Type")) {
		if r.FormValue(o.formFieldName) == token.Value {
			return nil
		}
	}

	if token.Value == "" {
		return ErrMissingToken
	}

	header := r.Header.Get(o.headerName)

	if header == "" {
		return ErrMissingHeader
	}

	if header == token.Value {
		return nil
	}

	return ErrInvalidToken
}
790223
func (c *Conn) VerifyHostname(host string) error {
	cert, err := c.PeerCertificate()
	if err != nil {
		return err
	}
	return cert.VerifyHostname(host)
}
346853
func (cs Checksums) Verify(d []byte) bool {
	for _, c := range cs {
		if getU32(d, c.Offset) != c.Value {
			return false
		}
	}
	return true
}
1130408
func Verify(srvCertPEM, caCertPEM string, when time.Time) error {
	caCert, err := cert.ParseCert(caCertPEM)
	if err != nil {
		return errors.Annotate(err, "cannot parse CA certificate")
	}
	srvCert, err := cert.ParseCert(srvCertPEM)
	if err != nil {
		return errors.Annotate(err, "cannot parse server certificate")
	}
	pool := x509.NewCertPool()
	pool.AddCert(caCert)
	opts := x509.VerifyOptions{
		Roots:       pool,
		CurrentTime: when,
	}
	_, err = srvCert.Verify(opts)
	return err
}
1164468
func (pwl pathWithLeaf) verify(root []byte) cmn.Error {
	leafHash := pwl.Leaf.Hash()
	return pwl.Path.verify(leafHash, root)
}
286373
func (a *awsNodeVerifier) VerifyIdentity(ctx context.Context) ([]byte, error) {
	errs := make(chan error, 0)
	doneCh := make(chan []byte, 0)

	go func() {
		encoded, err := func() ([]byte, error) {
			// @step: create a metadata client
			client := ec2metadata.New(session.New())

			// @step: get the pkcs7 signature from the metadata service
			signature, err := client.GetDynamicData("/instance-identity/pkcs7")
			if err != nil {
				return []byte{}, err
			}

			// @step: construct request for the request
			request := &Request{
				Document: []byte(signature),
			}

			return json.Marshal(request)
		}()
		if err != nil {
			errs <- err
			return
		}

		doneCh <- encoded
	}()

	select {
	case <-ctx.Done():
		return nil, ctx.Err()
	case err := <-errs:
		return nil, err
	case req := <-doneCh:
		return req, nil
	}
}
755779
func (v *CommandOverrideVerifier) Verify(path string) []error {
	if v.root == nil {
		return []error{fmt.Errorf("unable to verify path with nil root")}
	}

	// extract the plugin binary name
	segs := strings.Split(path, "/")
	binName := segs[len(segs)-1]

	cmdPath := strings.Split(binName, "-")
	if len(cmdPath) > 1 {
		// the first argument is always "kubectl" for a plugin binary
		cmdPath = cmdPath[1:]
	}

	errors := []error{}

	if isExec, err := isExecutable(path); err == nil && !isExec {
		errors = append(errors, fmt.Errorf("warning: %s identified as a kubectl plugin, but it is not executable", path))
	} else if err != nil {
		errors = append(errors, fmt.Errorf("error: unable to identify %s as an executable file: %v", path, err))
	}

	if existingPath, ok := v.seenPlugins[binName]; ok {
		errors = append(errors, fmt.Errorf("warning: %s is overshadowed by a similarly named plugin: %s", path, existingPath))
	} else {
		v.seenPlugins[binName] = path
	}

	if cmd, _, err := v.root.Find(cmdPath); err == nil {
		errors = append(errors, fmt.Errorf("warning: %s overwrites existing command: %q", binName, cmd.CommandPath()))
	}

	return errors
}