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

Function UpdateMaster

password.go:114–120  ·  view source on GitHub ↗

UpdateMaster takes new master passphrase, old master passphrase as string, new version as int, cipertext as string, and new ScryptParams. It returns and updated hash output string and error.

(newMaster, oldMaster string, newVersion int, ciphertext string, masterparams ScryptParams)

Source from the content-addressed store, hash-verified

112
113// UpdateMaster takes new master passphrase, old master passphrase as string, new version as int, cipertext as string, and new ScryptParams. It returns and updated hash output string and error.
114func UpdateMaster(newMaster, oldMaster string, newVersion int, ciphertext string, masterparams ScryptParams) (pwHashOut string, err error) {
115 parts := strings.Split(ciphertext, "$")
116 if len(parts) == 10 && parts[0] == "secBoxv1" {
117 return updateMasterV1(newMaster, oldMaster, newVersion, parts, masterparams)
118 }
119 return "", ErrCiphertextFormat
120}
121func updateMasterV1(newMaster, oldMaster string, newVersion int, parts []string, masterparams ScryptParams) (newHash string, err error) {
122 sbpVersion := "v1"
123 // Update Secretbox Masterpass version

Callers 2

TestUpdateMasterFunction · 0.85

Calls 1

updateMasterV1Function · 0.85

Tested by 2

TestUpdateMasterFunction · 0.68