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
c7c0a1cd
Commit
c7c0a1cd
authored
Jul 12, 2019
by
Cole Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for unknown elliptic curves
parent
23da4bd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
crypto/key_test.go
crypto/key_test.go
+12
-0
No files found.
crypto/key_test.go
View file @
c7c0a1cd
...
@@ -145,3 +145,15 @@ func (pk testkey) Raw() ([]byte, error) {
...
@@ -145,3 +145,15 @@ func (pk testkey) Raw() ([]byte, error) {
func
(
pk
testkey
)
Equals
(
k
Key
)
bool
{
func
(
pk
testkey
)
Equals
(
k
Key
)
bool
{
return
KeyEqual
(
pk
,
k
)
return
KeyEqual
(
pk
,
k
)
}
}
func
TestUnknownCurveErrors
(
t
*
testing
.
T
)
{
_
,
_
,
err
:=
GenerateEKeyPair
(
"P-256"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
_
,
_
,
err
=
GenerateEKeyPair
(
"error-please"
)
if
err
==
nil
{
t
.
Fatal
(
"expected invalid key type to error"
)
}
}
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