diff --git a/conn.go b/conn.go index 45acba33..8d2bc36c 100644 --- a/conn.go +++ b/conn.go @@ -16,7 +16,6 @@ type PeerInfo struct { IP string PubKeyBytes []byte IsPrivate bool - KeyGenOpt string MetaData map[string]string } diff --git a/mocks/mock_key_service.go b/mocks/mock_key_service.go index 6c377810..5f2bd418 100644 --- a/mocks/mock_key_service.go +++ b/mocks/mock_key_service.go @@ -146,18 +146,9 @@ func (recoverer *MockECDSAKeyRecoverer) RecoverKeyFromByte(keyBytes []byte, isPr return nil, errors.New("isPrivateKey value should be true or false") } -func curveFromString(keyGenOpt string) elliptic.Curve { - switch keyGenOpt { - case "P-384": - return elliptic.P384() - } - return nil -} - type mockKeyFile struct { KeyBytes []byte IsPrivateKey bool - KeyGenOpt string } func MockStoreKey(key bifrost.Key, keyDirPath string) error { @@ -175,10 +166,9 @@ func MockStoreKey(key bifrost.Key, keyDirPath string) error { // byte formatted key keyBytes := key.ToByte() isPrivateKey := key.IsPrivate() - keyGenOpt := key.KeyGenOpt() // make json marshal - jsonKeyFile, err := json.Marshal(mockKeyFile{KeyBytes: keyBytes, IsPrivateKey: isPrivateKey, KeyGenOpt: keyGenOpt}) + jsonKeyFile, err := json.Marshal(mockKeyFile{KeyBytes: keyBytes, IsPrivateKey: isPrivateKey}) if err != nil { return err } diff --git a/server/server_internal_test.go b/server/server_internal_test.go index 284653d5..5490813c 100644 --- a/server/server_internal_test.go +++ b/server/server_internal_test.go @@ -71,7 +71,6 @@ func TestServer_validateRequestPeerInfo_whenInValidPeerInfo(t *testing.T) { IP: "127.0.0.1", PubKeyBytes: []byte("123"), IsPrivate: false, - KeyGenOpt: "P-384", } keyOpt := bifrost.KeyOpts{ diff --git a/server/server_test.go b/server/server_test.go index 9165affb..72cd0f5e 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -19,7 +19,6 @@ func TestServer_validateRequestPeerInfo_whenValidPeerInfo(t *testing.T) { IP: "127.0.0.1", PubKeyBytes: keyOpt.PubKey.ToByte(), IsPrivate: keyOpt.PubKey.IsPrivate(), - KeyGenOpt: keyOpt.PubKey.KeyGenOpt(), } mockServer := mocks.NewMockServer() @@ -49,7 +48,6 @@ func TestServer_BifrostStream(t *testing.T) { IP: "127.0.0.1", PubKeyBytes: keyOpt.PubKey.ToByte(), IsPrivate: keyOpt.PubKey.IsPrivate(), - KeyGenOpt: keyOpt.PubKey.KeyGenOpt(), } mockStreamServer := mocks.NewMockStreamServer(*peerInfo) diff --git a/util.go b/util.go index fecbb8df..4daea2f1 100644 --- a/util.go +++ b/util.go @@ -47,7 +47,6 @@ func BuildResponsePeerInfo(pubKey Key, metaData map[string]string) (*pb.Envelope pi := &PeerInfo{ PubKeyBytes: b, IsPrivate: pubKey.IsPrivate(), - KeyGenOpt: pubKey.KeyGenOpt(), MetaData: metaData, }