Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
4e6d8b34
Commit
4e6d8b34
authored
Mar 02, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts: fix go vet warnings
parent
85e6c40c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
accounts_test.go
accounts/accounts_test.go
+1
-1
key_store_passphrase.go
accounts/key_store_passphrase.go
+2
-2
key_store_passphrase_test.go
accounts/key_store_passphrase_test.go
+2
-2
No files found.
accounts/accounts_test.go
View file @
4e6d8b34
...
...
@@ -120,7 +120,7 @@ func TestSignRace(t *testing.T) {
}
if
err
:=
am
.
TimedUnlock
(
a1
.
Address
,
""
,
15
*
time
.
Millisecond
);
err
!=
nil
{
t
.
Fatal
f
(
"could not unlock the test account"
,
err
)
t
.
Fatal
(
"could not unlock the test account"
,
err
)
}
end
:=
time
.
Now
()
.
Add
(
500
*
time
.
Millisecond
)
for
time
.
Now
()
.
Before
(
end
)
{
...
...
accounts/key_store_passphrase.go
View file @
4e6d8b34
...
...
@@ -295,13 +295,13 @@ func getKDFKey(cryptoJSON cryptoJSON, auth string) ([]byte, error) {
c
:=
ensureInt
(
cryptoJSON
.
KDFParams
[
"c"
])
prf
:=
cryptoJSON
.
KDFParams
[
"prf"
]
.
(
string
)
if
prf
!=
"hmac-sha256"
{
return
nil
,
fmt
.
Errorf
(
"Unsupported PBKDF2 PRF: "
,
prf
)
return
nil
,
fmt
.
Errorf
(
"Unsupported PBKDF2 PRF:
%s
"
,
prf
)
}
key
:=
pbkdf2
.
Key
(
authArray
,
salt
,
c
,
dkLen
,
sha256
.
New
)
return
key
,
nil
}
return
nil
,
fmt
.
Errorf
(
"Unsupported KDF: "
,
cryptoJSON
.
KDF
)
return
nil
,
fmt
.
Errorf
(
"Unsupported KDF:
%s
"
,
cryptoJSON
.
KDF
)
}
// TODO: can we do without this when unmarshalling dynamic JSON?
...
...
accounts/key_store_passphrase_test.go
View file @
4e6d8b34
...
...
@@ -32,7 +32,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
for
i
:=
0
;
i
<
3
;
i
++
{
// Try a bad password first
if
_
,
err
:=
DecryptKey
(
keyjson
,
password
+
"bad"
);
err
==
nil
{
t
.
Error
(
"test %d: json key decrypted with bad password"
,
i
)
t
.
Error
f
(
"test %d: json key decrypted with bad password"
,
i
)
}
// Decrypt with the correct password
key
,
err
:=
DecryptKey
(
keyjson
,
password
)
...
...
@@ -45,7 +45,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
// Recrypt with a new password and start over
password
+=
"new data appended"
if
keyjson
,
err
=
EncryptKey
(
key
,
password
,
LightScryptN
,
LightScryptP
);
err
!=
nil
{
t
.
Errorf
(
"test %d: failed to recrypt key %v"
,
err
)
t
.
Errorf
(
"test %d: failed to recrypt key %v"
,
i
,
err
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment