From 6c034451b1476811bcf1636ca6b531eebb7c6cec Mon Sep 17 00:00:00 2001 From: ish Date: Tue, 29 Oct 2024 01:20:01 +0900 Subject: [PATCH] server: api: rest: Do not encrypt SSH port --- server/pkg/api/rest/controller/connectionInfo.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/pkg/api/rest/controller/connectionInfo.go b/server/pkg/api/rest/controller/connectionInfo.go index 935dbc7..f922724 100644 --- a/server/pkg/api/rest/controller/connectionInfo.go +++ b/server/pkg/api/rest/controller/connectionInfo.go @@ -41,15 +41,6 @@ func checkPort(port string) error { } func encryptSecrets(connectionInfo *model.ConnectionInfo) (*model.ConnectionInfo, error) { - rsaEncryptedSSHPort, err := rsautil.EncryptWithPublicKey([]byte(connectionInfo.SSHPort), serverCommon.PubKey) - if err != nil { - errMsg := "error occurred while encrypting the ssh port (" + err.Error() + ")" - logger.Println(logger.ERROR, true, errMsg) - return nil, errors.New(errMsg) - } - base64EncodedEncryptedSSHPort := base64.StdEncoding.EncodeToString(rsaEncryptedSSHPort) - connectionInfo.SSHPort = base64EncodedEncryptedSSHPort - rsaEncryptedUser, err := rsautil.EncryptWithPublicKey([]byte(connectionInfo.User), serverCommon.PubKey) if err != nil { errMsg := "error occurred while encrypting the user (" + err.Error() + ")"