Skip to content

Commit

Permalink
Update transport/internet/reality/reality.go
Browse files Browse the repository at this point in the history
Fixes #2491
  • Loading branch information
RPRX authored and yuhan6665 committed Aug 26, 2023
1 parent e02474a commit 2d5475f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transport/internet/reality/reality.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/ecdh"
"crypto/ed25519"
"crypto/hmac"
"crypto/rand"
Expand Down Expand Up @@ -134,7 +135,8 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
if config.Show {
fmt.Printf("REALITY localAddr: %v\thello.SessionId[:16]: %v\n", localAddr, hello.SessionId[:16])
}
uConn.AuthKey = uConn.HandshakeState.State13.EcdheParams.SharedKey(config.PublicKey)
publicKey, _ := ecdh.X25519().NewPublicKey(config.PublicKey)
uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey)
if uConn.AuthKey == nil {
return nil, errors.New("REALITY: SharedKey == nil")
}
Expand Down

0 comments on commit 2d5475f

Please sign in to comment.