MCPcopy Create free account
hub / github.com/dwin/goSecretBoxPassword / Verify

Function Verify

password.go:75–81  ·  view source on GitHub ↗

Verify takes passphrase, masterpassphrase and ciphertext as strings and returns error if verification fails, else returns nil upon success

(userpass, masterpass, ciphertext string)

Source from the content-addressed store, hash-verified

73
74// Verify takes passphrase, masterpassphrase and ciphertext as strings and returns error if verification fails, else returns nil upon success
75func Verify(userpass, masterpass, ciphertext string) error {
76 parts := strings.Split(ciphertext, "$")
77 if len(parts) == 10 && parts[0] == "secBoxv1" {
78 return verifyV1(userpass, masterpass, parts)
79 }
80 return ErrCiphertextVer
81}
82
83// GetHashVersion takes ciphertext string and returns goSecretBoxPassword version as int and error.
84func GetHashVersion(ciphertext string) (version int, err error) {

Callers 11

TestHashFunction · 0.85
TestUpdateMasterFunction · 0.85
TestVerifyFunction · 0.85
TestVerifyFormatFunction · 0.85
TestVerifyVersionFunction · 0.85
TestVerifyParseParamsFunction · 0.85
TestVerifyBadParamsFunction · 0.85
TestVerifyBadPassphraseFunction · 0.85
TestVerifyBadMasterPassFunction · 0.85
TestVerifyBadSaltFunction · 0.85

Calls 1

verifyV1Function · 0.85

Tested by 11

TestHashFunction · 0.68
TestUpdateMasterFunction · 0.68
TestVerifyFunction · 0.68
TestVerifyFormatFunction · 0.68
TestVerifyVersionFunction · 0.68
TestVerifyParseParamsFunction · 0.68
TestVerifyBadParamsFunction · 0.68
TestVerifyBadPassphraseFunction · 0.68
TestVerifyBadMasterPassFunction · 0.68
TestVerifyBadSaltFunction · 0.68