Merge branch 'apernet:master' into master

This commit is contained in:
cedar2025 2023-10-23 06:39:29 +05:30 committed by GitHub
commit d056811eb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 10 deletions

View File

@ -16,6 +16,10 @@ jobs:
- name: Check out
uses: actions/checkout@v4
- name: Get version
id: get_version
run: echo "version=$(git describe --tags --always --match 'app/v*' | sed -n 's|app/\([^/-]*\)\(-.*\)\{0,1\}|\1|p')" >> $GITHUB_OUTPUT
- name: Setup Go
uses: actions/setup-go@v4
with:
@ -46,11 +50,21 @@ jobs:
sha256sum $file >> build/hashes.txt
done
- name: Upload
- name: Upload GitHub
uses: softprops/action-gh-release@v1
with:
files: build/*
- name: Upload CF bucket
uses: shallwefootball/upload-s3-action@v1.3.3
with:
aws_key_id: ${{ secrets.CF_KEY_ID }}
aws_secret_access_key: ${{ secrets.CF_KEY }}
aws_bucket: "hydownload"
endpoint: "https://bea223c61d5a41250d127bd67f51dfec.r2.cloudflarestorage.com/"
source_dir: "build"
destination_dir: "app/${{ steps.get_version.outputs.version }}"
- name: Publish to API
run: |
export HY_API_POST_KEY=${{ secrets.HY2_API_POST_KEY }}

View File

@ -18,7 +18,7 @@ require (
)
require (
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f // indirect
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703 // indirect
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect

View File

@ -40,8 +40,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY=
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM=
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f h1:h8DPiFzBfRyrsf6ZSdusyw+eDT3qrMEUkp0O06uL3R4=
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703 h1:BLyttelGGoJVL6eqQdXBSq57GUMh+1qzlMxEtmVuAHY=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=

View File

@ -3,7 +3,7 @@ module github.com/apernet/hysteria/core
go 1.21
require (
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703
github.com/stretchr/testify v1.8.4
go.uber.org/goleak v1.2.1
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db

View File

@ -1,5 +1,5 @@
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f h1:h8DPiFzBfRyrsf6ZSdusyw+eDT3qrMEUkp0O06uL3R4=
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703 h1:BLyttelGGoJVL6eqQdXBSq57GUMh+1qzlMxEtmVuAHY=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=

View File

@ -212,6 +212,10 @@ func ParseUDPMessage(msg []byte) (*UDPMessage, error) {
return nil, errors.ProtocolError{Message: "invalid address length"}
}
bs := buf.Bytes()
if len(bs) <= int(lAddr) {
// We use <= instead of < here as we expect at least one byte of data after the address
return nil, errors.ProtocolError{Message: "invalid message length"}
}
m.Addr = string(bs[:lAddr])
m.Data = bs[lAddr:]
return m, nil

View File

@ -14,7 +14,7 @@ require (
)
require (
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f // indirect
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect

View File

@ -1,5 +1,5 @@
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f h1:h8DPiFzBfRyrsf6ZSdusyw+eDT3qrMEUkp0O06uL3R4=
github.com/apernet/quic-go v0.39.1-0.20231011033454-52db2775486f/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703 h1:BLyttelGGoJVL6eqQdXBSq57GUMh+1qzlMxEtmVuAHY=
github.com/apernet/quic-go v0.39.2-0.20231020024223-8002a2f97703/go.mod h1:UwsoszQlzTm+dBDuFEwWBYt46K56WqlFEN0RWLvQ0rE=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=