1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-16 12:45:24 +00:00

rework the file name checking logic

This commit is contained in:
Shelikhoo 2021-04-03 10:14:23 +01:00
parent f08a002294
commit 93e44b72d9
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 3 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes"
"crypto/sha256"
"encoding/hex"
"path/filepath"
"strings"
"github.com/v2fly/VSign/insmgr"
@ -18,7 +19,8 @@ type EmbeddedHashProtectedLoader struct {
}
func (e EmbeddedHashProtectedLoader) VerifyAndLoad(filename string) ([]byte, error) {
filecontent, err := filesystem.ReadFile(platform.GetAssetLocation(filename))
platformFileName := filepath.FromSlash(filename)
filecontent, err := filesystem.ReadFile(platform.GetAssetLocation(platformFileName))
if err != nil {
return nil, newError("Cannot find file", filename).Base(err)
}

View File

@ -1,9 +1,6 @@
package securedload
import "path/filepath"
func GetAssetSecured(name string) ([]byte, error) {
name = filepath.FromSlash(name)
var err error
for k, v := range knownProtectedLoader {