readpassword

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package readpassword reads a password from the terminal of from stdin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTrailingGarbage added in v1.2.1

func CheckTrailingGarbage()

CheckTrailingGarbage tries to read one byte from stdin and exits with a fatal error if the read returns any data. This is meant to be called after reading the password, when there is no more data expected. This helps to catch problems with third-party tools that interface with gocryptfs.

This is tested via TestInitTrailingGarbage() in tests/cli/cli_test.go.

func Once

func Once(extpass string) []byte

Once tries to get a password from the user, either from the terminal, extpass or stdin.

func Twice

func Twice(extpass string) []byte

Twice is the same as Once but will prompt twice if we get the password from the terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL