Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ws-proxy] use ecdsa private key for createKey fake api #19211

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions components/ws-proxy/pkg/proxy/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package proxy
import (
"bytes"
"context"
"crypto/ed25519"
"crypto/ecdsa"
"crypto/elliptic"
crand "crypto/rand"
"crypto/tls"
"encoding/base64"
Expand Down Expand Up @@ -202,12 +203,13 @@ func (ir *ideRoutes) HandleCreateKeyRoute(route *mux.Route, hostKeyList []ssh.Si
} `json:"hostKey"`
}{}

_, pvk, err := ed25519.GenerateKey(crand.Reader)
privateKey, err := ecdsa.GenerateKey(elliptic.P256(), crand.Reader)
kylos101 marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
log.WithError(err).Error("failed to generate key")
return
}
block, err := ssh.MarshalPrivateKey(pvk, "")

block, err := ssh.MarshalPrivateKey(privateKey, "")
if err != nil {
log.WithError(err).Error("failed to marshal key")
return
Expand Down
Loading