cosmetic changes
[openssl.git] / ssl / ssltest.c
index 91813dc7da4d1ebb03ec435e6068d6c0eb794652..9a8f90bb8eb222f2d6e7eb924edb27d976f6bb47 100644 (file)
@@ -448,6 +448,9 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count)
                 * BIO pairs are symmetric.  A BIO pair behaves similar
                 * to a non-blocking socketpair (but both endpoints must
                 * be handled by the same thread).
+                * [Here we could connect client and server to the ends
+                * of a single BIO pair, but then this code would be less
+                * suitable as an example for BIO pairs in general.]
                 *
                 * Useful functions for querying the state of BIO pair endpoints:
                 *
@@ -705,9 +708,21 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count)
 
                        if (!progress && !prev_progress)
                                if (cw_num > 0 || cr_num > 0 || sw_num > 0 || sr_num > 0)
-                                        /* can't happen */
                                        {
                                        fprintf(stderr, "ERROR: got stuck\n");
+                                       if (strcmp("SSLv2", SSL_get_version(c_ssl)) == 0)
+                                               {
+                                               fprintf(stderr, "This can happen for SSL2 because "
+                                                       "CLIENT-FINISHED and SERVER-VERIFY are written \n"
+                                                       "concurrently ...");
+                                               if (strncmp("2SCF", SSL_state_string(c_ssl), 4) == 0
+                                                       && strncmp("2SSV", SSL_state_string(s_ssl), 4) == 0)
+                                                       {
+                                                       fprintf(stderr, " ok.\n");
+                                                       goto end;
+                                                       }
+                                               }
+                                       fprintf(stderr, " ERROR.\n");
                                        goto err;
                                        }
                        prev_progress = progress;
@@ -721,6 +736,7 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count)
                        SSL_get_version(c_ssl),
                        SSL_CIPHER_get_version(ciph),
                        SSL_CIPHER_get_name(ciph));
+ end:
        ret = 0;
 
  err: