// GetOTPData returns the OTP Key, Key URL, and the QR code.
334687
func (s *AuthServer) GetOTPData(user string) (string, []byte, error) {
	// get otp key from backend
	otpSecret, err := s.GetTOTP(user)
	if err != nil {
		return "", nil, trace.Wrap(err)
	}

	// create otp url
	params := map[string][]byte{"secret": []byte(otpSecret)}
	otpURL := utils.GenerateOTPURL("totp", user, params)

	// create the qr code
	otpQR, err := utils.GenerateQRCode(otpURL)
	if err != nil {
		return "", nil, trace.Wrap(err)
	}

	return otpURL, otpQR, nil
}
1148699
func (p *Packet) GetTCPBytes() []byte {

	pktBytes := []byte{}
	pktBytes = append(pktBytes, p.ipHdr.Buffer...)
	pktBytes = append(pktBytes, p.tcpHdr.tcpOptions...)
	pktBytes = append(pktBytes, p.tcpHdr.tcpData...)
	return pktBytes
}
591496
func (h *MPL115A2Driver) getData() (p, t float32, err error) {
	var temperature uint16
	var pressure uint16
	var pressureComp float32

	if _, err = h.connection.Write([]byte{MPL115A2_REGISTER_STARTCONVERSION, 0}); err != nil {
		return
	}
	time.Sleep(5 * time.Millisecond)

	if _, err = h.connection.Write([]byte{MPL115A2_REGISTER_PRESSURE_MSB}); err != nil {
		return
	}

	data := []byte{0, 0, 0, 0}
	bytesRead, err1 := h.connection.Read(data)
	if err1 != nil {
		err = err1
		return
	}

	if bytesRead == 4 {
		buf := bytes.NewBuffer(data)
		binary.Read(buf, binary.BigEndian, &pressure)
		binary.Read(buf, binary.BigEndian, &temperature)

		temperature = temperature >> 6
		pressure = pressure >> 6

		pressureComp = float32(h.A0) + (float32(h.B1)+float32(h.C12)*float32(temperature))*float32(pressure) + float32(h.B2)*float32(temperature)
		p = (65.0/1023.0)*pressureComp + 50.0
		t = ((float32(temperature) - 498.0) / -5.35) + 25.0
	}

	return
}
1133190
func (j *Journal) GetData(field string) (string, error) {
	d, l, err := j.getData(field)
	if err != nil {
		return "", err
	}

	return C.GoStringN((*C.char)(d), l), nil
}
1102286
func (tq TrackerQuery) GetETagData() []interface{} {
	// using the 'ID' and 'UpdatedAt' (converted to number of seconds since epoch) fields
	return []interface{}{tq.ID, strconv.FormatInt(tq.UpdatedAt.Unix(), 10)}
}
343736
func GetTpCtx(r *http.Request) string {
	tp, ok := r.Context().Value(ctxTp).(string)
	if !ok {
		apiLog.Trace("ticket pool interval not set")
		return ""
	}
	return tp
}
49974
func (p *Packet) ReadTCPData() []byte {
	return p.ipHdr.Buffer[uint16(p.ipHdr.ipHeaderLen)+p.TCPDataStartBytes():]
}
970263
func (s *AuthServer) getOTPType(user string) (string, error) {
	_, err := s.GetHOTP(user)
	if err != nil {
		if trace.IsNotFound(err) {
			return teleport.TOTP, nil
		}
		return "", trace.Wrap(err)
	}
	return teleport.HOTP, nil
}
1359119
func (u *UserMigration) GetUpdatedAt() string {
	if u == nil || u.UpdatedAt == nil {
		return ""
	}
	return *u.UpdatedAt
}
896629
func (m Comment) GetETagData() []interface{} {
	// using the 'ID' and 'UpdatedAt' (converted to number of seconds since epoch) fields
	return []interface{}{m.ID, strconv.FormatInt(m.UpdatedAt.Unix(), 10)}
}
49809
func GetData(err error, key DataKey) interface{} {
	cast, ok := err.(*Error)
	if ok {
		return cast.GetData(key)
	}
	return nil
}
778444
func getData(data []byte, start uint64, size uint64) []byte {
	length := uint64(len(data))
	if start > length {
		start = length
	}
	end := start + size
	if end > length {
		end = length
	}
	return common.RightPadBytes(data[start:end], int(size))
}
236810
func (c *Client) GetSignupTokenData(token string) (user string, otpQRCode []byte, e error) {
	out, err := c.Get(c.Endpoint("signuptokens", token), url.Values{})
	if err != nil {
		return "", nil, err
	}

	var tokenData getSignupTokenDataResponse
	if err := json.Unmarshal(out.Bytes(), &tokenData); err != nil {
		return "", nil, err
	}

	return tokenData.User, tokenData.QRImg, nil
}
1342480
func (s *AuthServer) GetSignupTokenData(token string) (user string, qrCode []byte, err error) {
	// Rotate OTP secret before the signup data is fetched (signup page is
	// rendered). This mitigates attacks where an attacker just views the signup
	// link, extracts the OTP secret from the QR code, then closes the window.
	// Then when the user signs up later, the attacker has access to the OTP
	// secret.
	st, err := s.rotateAndFetchSignupToken(token)
	if err != nil {
		return "", nil, trace.Wrap(err)
	}

	// TODO(rjones): Remove this check and use compare and swap in the Create*
	// functions below. It's a TOCTOU bug in the making:
	// https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use
	_, err = s.GetPasswordHash(st.User.Name)
	if err == nil {
		return "", nil, trace.Errorf("user %q already exists", st.User.Name)
	}

	return st.User.Name, st.OTPQRCode, nil
}
301902
func (sensor *Sensor) GetData(data []float32) (err error) {
	if data == nil {
		return nil
	}
	_data := (*C.float)(unsafe.Pointer(&data[0]))
	_numValues := C.int(len(data))
	err = errorFromInt(int(C.SDL_SensorGetData((*C.SDL_Sensor)(sensor), _data, _numValues)))
	return
}
643095
func (c *client) getRTT() string {
	if c.rtt == 0 {
		// If a real client, go ahead and send ping now to get a value
		// for RTT. For tests and telnet, or if client is closing, etc skip.
		if !c.flags.isSet(clearConnection) && c.flags.isSet(connectReceived) && c.opts.Lang != "" {
			c.sendPing()
		}
		return ""
	}
	var rtt time.Duration
	if c.rtt > time.Microsecond && c.rtt < time.Millisecond {
		rtt = c.rtt.Truncate(time.Microsecond)
	} else {
		rtt = c.rtt.Truncate(time.Millisecond)
	}
	return rtt.String()
}
1229461
func (self *TimedStore) getData(index int) timedStoreData {
	return self.buffer[len(self.buffer)-index-1]
}