mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
rework the file name checking logic
This commit is contained in:
parent
f08a002294
commit
93e44b72d9
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user