Skip to content

Commit

Permalink
server: api: rest: Do not encrypt SSH port
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Oct 28, 2024
1 parent 4306296 commit 6c03445
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions server/pkg/api/rest/controller/connectionInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() + ")"
Expand Down

0 comments on commit 6c03445

Please sign in to comment.