forked from TrueCloudLab/frostfs-api-go
session: remove trivial defaultCurve function
This commit is contained in:
parent
701bbafcf1
commit
f0867036fb
2 changed files with 2 additions and 7 deletions
|
@ -2,6 +2,7 @@ package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
|
"crypto/elliptic"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
|
||||||
crypto "github.com/nspcc-dev/neofs-crypto"
|
crypto "github.com/nspcc-dev/neofs-crypto"
|
||||||
|
@ -16,7 +17,7 @@ type pToken struct {
|
||||||
//
|
//
|
||||||
// Returns non-nil error on key generation error.
|
// Returns non-nil error on key generation error.
|
||||||
func NewPrivateToken() (PrivateToken, error) {
|
func NewPrivateToken() (PrivateToken, error) {
|
||||||
sk, err := ecdsa.GenerateKey(defaultCurve(), rand.Reader)
|
sk, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package session
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/elliptic"
|
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,11 +10,6 @@ type mapTokenStore struct {
|
||||||
tokens map[TokenID]PrivateToken
|
tokens map[TokenID]PrivateToken
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO get curve from neofs-crypto
|
|
||||||
func defaultCurve() elliptic.Curve {
|
|
||||||
return elliptic.P256()
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewMapTokenStore creates new PrivateTokenStore instance.
|
// NewMapTokenStore creates new PrivateTokenStore instance.
|
||||||
//
|
//
|
||||||
// The elements of the instance are stored in the map.
|
// The elements of the instance are stored in the map.
|
||||||
|
|
Loading…
Reference in a new issue