code: func (p *UserPrivileges) ConnectionVerification(user, host string, authentication, salt []byte) (u string, h string, success bool) {
  	if SkipWithGrant {
  		p.user = user
  		p.host = host
  		success = true
  		return
  	}
  
  	mysqlPriv := p.Handle.Get()
  	record := mysqlPriv.connectionVerification(user, host)
  	if record == nil {
  		logutil.Logger(context.Background()).Error("get user privilege record fail",
  			zap.String("user", user), zap.String("host", host))
  		return
  	}
  
  	u = record.User
  	h = record.Host
  
  	// Login a locked account is not allowed.
  	locked := record.AccountLocked
  	if locked {
  		logutil.Logger(context.Background()).Error("try to login a locked account",
  			zap.String("user", user), zap.String("host", host))
  		success = false
  		return
  	}
  
  	pwd := record.Password
  	if len(pwd) != 0 && len(pwd) != mysql.PWDHashLen+1 {
  		logutil.Logger(context.Background()).Error("user password from system DB not like sha1sum", zap.String("user", user))
  		return
  	}
  
  	// empty password
  	if len(pwd) == 0 && len(authentication) == 0 {
  		p.user = user
  		p.host = host
  		success = true
  		return
  	}
  
  	if len(pwd) == 0 || len(authentication) == 0 {
  		return
  	}
  
  	hpwd, err := auth.DecodePassword(pwd)
  	if err != nil {
  		logutil.Logger(context.Background()).Error("decode password string failed", zap.Error(err))
  		return
  	}
  
  	if !auth.CheckScrambledPassword(salt, hpwd, authentication) {
  		return
  	}
  
  	p.user = user
  	p.host = host
  	success = true
  	return
  }
docs: // ConnectionVerification implements the Manager interface.