Skip to content

Commit 39ca671

Browse files
committed
[ws-proxy] use ecdsa private key for createKey fake api
1 parent ba07eb9 commit 39ca671

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/ws-proxy/pkg/proxy/routes.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ package proxy
77
import (
88
"bytes"
99
"context"
10-
"crypto/ed25519"
10+
"crypto/ecdsa"
11+
"crypto/elliptic"
1112
crand "crypto/rand"
1213
"crypto/tls"
1314
"encoding/base64"
@@ -202,12 +203,13 @@ func (ir *ideRoutes) HandleCreateKeyRoute(route *mux.Route, hostKeyList []ssh.Si
202203
} `json:"hostKey"`
203204
}{}
204205

205-
_, pvk, err := ed25519.GenerateKey(crand.Reader)
206+
privateKey, err := ecdsa.GenerateKey(elliptic.P256(), crand.Reader)
206207
if err != nil {
207208
log.WithError(err).Error("failed to generate key")
208209
return
209210
}
210-
block, err := ssh.MarshalPrivateKey(pvk, "")
211+
212+
block, err := ssh.MarshalPrivateKey(privateKey, "")
211213
if err != nil {
212214
log.WithError(err).Error("failed to marshal key")
213215
return

0 commit comments

Comments
 (0)