]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make the two branches of tor_tls_used_v1_handshake into one.
authorNick Mathewson <nickm@torproject.org>
Thu, 21 Aug 2014 14:12:54 +0000 (10:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Aug 2014 14:12:54 +0000 (10:12 -0400)
(Coverity thinks that "if (a) X; else X;" is probably a bug.)

[Coverity CID 1232086]

src/common/tortls.c

index 0f989684cfc75fb4f6806c39b159bf30c12416a0..5fe8d81c591d2c1259f933faa30869e84bbbb55d 100644 (file)
@@ -2611,16 +2611,20 @@ check_no_tls_errors_(const char *fname, int line)
 int
 tor_tls_used_v1_handshake(tor_tls_t *tls)
 {
+#if defined(V2_HANDSHAKE_SERVER) && defined(V2_HANDSHAKE_CLIENT)
+  return ! tls->wasV2Handshake;
+#else
   if (tls->isServer) {
-#ifdef V2_HANDSHAKE_SERVER
+# ifdef V2_HANDSHAKE_SERVER
     return ! tls->wasV2Handshake;
-#endif
+# endif
   } else {
-#ifdef V2_HANDSHAKE_CLIENT
+# ifdef V2_HANDSHAKE_CLIENT
     return ! tls->wasV2Handshake;
-#endif
+# endif
   }
   return 1;
+#endif
 }
 
 /** Return true iff <b>name</b> is a DN of a kind that could only