INNER CODE UNIT · Go

combineKeys

GGP1/kure · auth/auth.go:161

func combineKeys(r io.Reader, password *memguard.Enclave) (*memguard.Enclave, error) {
	path := config.GetString(keyfilePath)
	if path == "" {
		path = terminal.Scanln(bufio.NewReader(r), "Enter key file path")
		path = strings.Trim(path, "\"")
		if path == "" || path == "." {
			return nil, errors.New("invalid key file path")
		}
	}

	key, err := os.ReadFile(path)
	if err != nil {
		return nil, errors.Wrap(err, "reading key file")
	}
	defer memguard.WipeBytes(key)

	pwdBuf, err := password.Open()
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…