mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-26 06:39:20 +02:00
fix ecdh crash in reality
This commit is contained in:
parent
01c14a5994
commit
b7f21be8bc
|
@ -136,7 +136,10 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
|
||||||
if config.Show {
|
if config.Show {
|
||||||
newError(fmt.Sprintf("REALITY localAddr: %v\thello.SessionId[:16]: %v\n", localAddr, hello.SessionId[:16])).WriteToLog(session.ExportIDToError(ctx))
|
newError(fmt.Sprintf("REALITY localAddr: %v\thello.SessionId[:16]: %v\n", localAddr, hello.SessionId[:16])).WriteToLog(session.ExportIDToError(ctx))
|
||||||
}
|
}
|
||||||
publicKey, _ := ecdh.X25519().NewPublicKey(config.PublicKey)
|
publicKey, err := ecdh.X25519().NewPublicKey(config.PublicKey)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("REALITY: publicKey == nil")
|
||||||
|
}
|
||||||
uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey)
|
uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey)
|
||||||
if uConn.AuthKey == nil {
|
if uConn.AuthKey == nil {
|
||||||
return nil, errors.New("REALITY: SharedKey == nil")
|
return nil, errors.New("REALITY: SharedKey == nil")
|
||||||
|
|
Loading…
Reference in New Issue