Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-core
Commits
1461eb16
Commit
1461eb16
authored
Aug 01, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use fallback comparison for ed25519 keys
parent
33faefeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
crypto/ed25519.go
crypto/ed25519.go
+2
-2
No files found.
crypto/ed25519.go
View file @
1461eb16
...
@@ -68,7 +68,7 @@ func (k *Ed25519PrivateKey) pubKeyBytes() []byte {
...
@@ -68,7 +68,7 @@ func (k *Ed25519PrivateKey) pubKeyBytes() []byte {
func
(
k
*
Ed25519PrivateKey
)
Equals
(
o
Key
)
bool
{
func
(
k
*
Ed25519PrivateKey
)
Equals
(
o
Key
)
bool
{
edk
,
ok
:=
o
.
(
*
Ed25519PrivateKey
)
edk
,
ok
:=
o
.
(
*
Ed25519PrivateKey
)
if
!
ok
{
if
!
ok
{
return
false
return
basicEquals
(
k
,
o
)
}
}
return
subtle
.
ConstantTimeCompare
(
k
.
k
,
edk
.
k
)
==
1
return
subtle
.
ConstantTimeCompare
(
k
.
k
,
edk
.
k
)
==
1
...
@@ -103,7 +103,7 @@ func (k *Ed25519PublicKey) Raw() ([]byte, error) {
...
@@ -103,7 +103,7 @@ func (k *Ed25519PublicKey) Raw() ([]byte, error) {
func
(
k
*
Ed25519PublicKey
)
Equals
(
o
Key
)
bool
{
func
(
k
*
Ed25519PublicKey
)
Equals
(
o
Key
)
bool
{
edk
,
ok
:=
o
.
(
*
Ed25519PublicKey
)
edk
,
ok
:=
o
.
(
*
Ed25519PublicKey
)
if
!
ok
{
if
!
ok
{
return
false
return
basicEquals
(
k
,
o
)
}
}
return
bytes
.
Equal
(
k
.
k
,
edk
.
k
)
return
bytes
.
Equal
(
k
.
k
,
edk
.
k
)
...
...
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