mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-23 18:34:14 +00:00
Refine unsafe usage
This commit is contained in:
parent
d8557bf279
commit
bcb11ad45f
1 changed files with 3 additions and 4 deletions
|
@ -129,10 +129,9 @@ func printTLSConnDetail(tlsConn *gotls.Conn) {
|
||||||
tlsVersion = "TLS 1.2"
|
tlsVersion = "TLS 1.2"
|
||||||
}
|
}
|
||||||
fmt.Println("TLS Version:", tlsVersion)
|
fmt.Println("TLS Version:", tlsVersion)
|
||||||
p, _ := reflect.TypeOf(tlsConn).Elem().FieldByName("curveID")
|
curveID := *(*gotls.CurveID)(unsafe.Pointer(reflect.ValueOf(tlsConn).Elem().FieldByName("curveID").UnsafeAddr()))
|
||||||
curveID := (*gotls.CurveID)(unsafe.Pointer(uintptr(unsafe.Pointer(tlsConn)) + p.Offset))
|
if curveID != 0 {
|
||||||
if curveID != nil {
|
PostQuantum := (curveID == gotls.X25519MLKEM768)
|
||||||
PostQuantum := (*curveID == gotls.X25519MLKEM768)
|
|
||||||
fmt.Println("Post-Quantum key exchange:", PostQuantum, "("+curveID.String()+")")
|
fmt.Println("Post-Quantum key exchange:", PostQuantum, "("+curveID.String()+")")
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Post-Quantum key exchange: false (RSA Exchange)")
|
fmt.Println("Post-Quantum key exchange: false (RSA Exchange)")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue