Просмотр исходного кода

Fix TLS passthrough message not set

* Fixes BuildHandshakeState not called for protocols not using
  obfuscated session tickets. Calling BuildHandshakeState after setting
  random value, resets that value.
Amir Khan 1 год назад
Родитель
Сommit
1189647787
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      psiphon/tlsDialer.go

+ 8 - 2
psiphon/tlsDialer.go

@@ -458,9 +458,15 @@ func CustomTLSDial(
 
 	useEms := conn.HandshakeState.Hello.Ems
 
-	// Add the obfuscated session ticket or obfuscated PSK.
+	if config.ObfuscatedSessionTicketKey == "" {
+		err = conn.BuildHandshakeState()
+		if err != nil {
+			return nil, errors.Trace(err)
+		}
+
+	} else {
 
-	if config.ObfuscatedSessionTicketKey != "" {
+		// Add the obfuscated session ticket or obfuscated PSK.
 
 		var obfuscatedSessionTicketKey [32]byte