Skip to content
Snippets Groups Projects
Commit 8f6efbd4 authored by Jonah Husson's avatar Jonah Husson
Browse files

Fix passing localstorage object

parent 698869e2
No related branches found
No related tags found
2 merge requests!128Project/base32768,!109Project/haven beta
...@@ -195,7 +195,7 @@ func verifyPassword(externalPassword string) bool { ...@@ -195,7 +195,7 @@ func verifyPassword(externalPassword string) bool {
// initInternalPassword generates a new internal password, stores an encrypted // initInternalPassword generates a new internal password, stores an encrypted
// version in local storage, and returns it. // version in local storage, and returns it.
func initInternalPassword(externalPassword string, func initInternalPassword(externalPassword string,
localStorage *storage.LocalStorage, csprng io.Reader, localStorage storage.LocalStorage, csprng io.Reader,
params argonParams) ([]byte, error) { params argonParams) ([]byte, error) {
internalPassword := make([]byte, internalPasswordLen) internalPassword := make([]byte, internalPasswordLen)
...@@ -250,7 +250,7 @@ func initInternalPassword(externalPassword string, ...@@ -250,7 +250,7 @@ func initInternalPassword(externalPassword string,
// getInternalPassword retrieves the internal password from local storage, // getInternalPassword retrieves the internal password from local storage,
// decrypts it, and returns it. // decrypts it, and returns it.
func getInternalPassword( func getInternalPassword(
externalPassword string, localStorage *storage.LocalStorage) ([]byte, error) { externalPassword string, localStorage storage.LocalStorage) ([]byte, error) {
encryptedInternalPassword, err := localStorage.Get(passwordKey) encryptedInternalPassword, err := localStorage.Get(passwordKey)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, getPasswordStorageErr) return nil, errors.WithMessage(err, getPasswordStorageErr)
......
...@@ -40,7 +40,7 @@ func CheckAndStoreVersions() error { ...@@ -40,7 +40,7 @@ func CheckAndStoreVersions() error {
} }
func checkAndStoreVersions( func checkAndStoreVersions(
currentWasmVer, currentClientVer string, ls *storage.LocalStorage) error { currentWasmVer, currentClientVer string, ls storage.LocalStorage) error {
// Get the stored client version, if it exists // Get the stored client version, if it exists
storedClientVer, err := storedClientVer, err :=
initOrLoadStoredSemver(clientVerKey, currentClientVer, ls) initOrLoadStoredSemver(clientVerKey, currentClientVer, ls)
...@@ -91,7 +91,7 @@ func checkAndStoreVersions( ...@@ -91,7 +91,7 @@ func checkAndStoreVersions(
// local storage. If no version is stored, then the current version is stored // local storage. If no version is stored, then the current version is stored
// and returned. // and returned.
func initOrLoadStoredSemver( func initOrLoadStoredSemver(
key, currentVersion string, ls *storage.LocalStorage) (string, error) { key, currentVersion string, ls storage.LocalStorage) (string, error) {
storedVersion, err := ls.Get(key) storedVersion, err := ls.Get(key)
if err != nil { if err != nil {
if errors.Is(err, os.ErrNotExist) { if errors.Is(err, os.ErrNotExist) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment