Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
8f6efbd4
Commit
8f6efbd4
authored
1 year ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Fix passing localstorage object
parent
698869e2
No related branches found
No related tags found
2 merge requests
!128
Project/base32768
,
!109
Project/haven beta
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
storage/password.go
+2
-2
2 additions, 2 deletions
storage/password.go
storage/version.go
+2
-2
2 additions, 2 deletions
storage/version.go
with
4 additions
and
4 deletions
storage/password.go
+
2
−
2
View file @
8f6efbd4
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
storage/version.go
+
2
−
2
View file @
8f6efbd4
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment