INNER CODE UNIT · Go

scanParameter

GGP1/kure · auth/auth.go:194

func scanParameter(r *bufio.Reader, field string, defaultValue uint32) (uint32, error) {
	valueStr := terminal.Scanln(r, " "+field)
	if valueStr == "" {
		return defaultValue, nil
	}

	v, err := strconv.Atoi(valueStr)
	if err != nil || v < 1 {
		return 0, errors.Wrapf(err, "invalid %s number", strings.ToLower(field))
	}

	return uint32(v), nil
}

// Auth values must be set to the configuration before any encryption/decryption occurs.
func setAuthToConfig(password *memguard.Enclave, params auth.Params) {
	auth := map[string]interface{}{
		"password":   password,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…