From 97d89549dd4e4903e251a02ddee5e976fe374b93 Mon Sep 17 00:00:00 2001 From: Senis John Date: Tue, 17 Oct 2023 15:36:32 +0800 Subject: [PATCH] Update application version and enhance error handling The commit increases the version number from 0.9.1 to 0.9.2 in version.go. Additionally, an error check has been added in x25519.go to validate the private key size. Also, panel.go has been modified to accept both "NewV2board" and "V2board" as valid panel types. --- cmd/version.go | 2 +- cmd/x25519.go | 4 ++++ panel/panel.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index 294e9b2..215d120 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -7,7 +7,7 @@ import ( ) var ( - version = "0.9.1" + version = "0.9.2" codename = "XrayR" intro = "A Xray backend that supports many panels" ) diff --git a/cmd/x25519.go b/cmd/x25519.go index 43febe5..0a54bb2 100644 --- a/cmd/x25519.go +++ b/cmd/x25519.go @@ -3,6 +3,7 @@ package cmd import ( "crypto/rand" "encoding/base64" + "errors" "fmt" "github.com/spf13/cobra" @@ -39,6 +40,9 @@ func x25519() error { if err != nil { return err } + if len(p) != curve25519.ScalarSize { + return errors.New("invalid private key") + } privateKey = p } diff --git a/panel/panel.go b/panel/panel.go index c789a7f..68c008c 100644 --- a/panel/panel.go +++ b/panel/panel.go @@ -177,7 +177,7 @@ func (p *Panel) Start() { switch nodeConfig.PanelType { case "SSpanel": apiClient = sspanel.New(nodeConfig.ApiConfig) - case "NewV2board": + case "NewV2board", "V2board": apiClient = newV2board.New(nodeConfig.ApiConfig) case "PMpanel": apiClient = pmpanel.New(nodeConfig.ApiConfig)