More tweaks for comments due indent issues
[openssl.git] / ssl / s3_srvr.c
index 01c982893e102f077d9ce20830b429e8e8aae871..d8155c3ac945060f65cfe9e9d2d03b1afc22870d 100644 (file)
@@ -446,20 +446,11 @@ int ssl3_accept(SSL *s)
                case SSL3_ST_SW_KEY_EXCH_B:
                        alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
 
-                       /* clear this, it may get reset by
-                        * send_server_key_exchange */
-                       if ((s->options & SSL_OP_EPHEMERAL_RSA)
-#ifndef OPENSSL_NO_KRB5
-                               && !(alg_k & SSL_kKRB5)
-#endif /* OPENSSL_NO_KRB5 */
-                               )
-                               /* option SSL_OP_EPHEMERAL_RSA sends temporary RSA key
-                                * even when forbidden by protocol specs
-                                * (handshake may fail as clients are not required to
-                                * be able to handle this) */
-                               s->s3->tmp.use_rsa_tmp=1;
-                       else
-                               s->s3->tmp.use_rsa_tmp=0;
+                       /*
+                        * clear this, it may get reset by
+                        * send_server_key_exchange
+                        */
+                       s->s3->tmp.use_rsa_tmp=0;
 
 
                        /* only send if a DH key exchange, fortezza or
@@ -473,7 +464,7 @@ int ssl3_accept(SSL *s)
                         * server certificate contains the server's
                         * public key for key exchange.
                         */
-                       if (s->s3->tmp.use_rsa_tmp
+                       if (0
                        /* PSK: send ServerKeyExchange if PSK identity
                         * hint if provided */
 #ifndef OPENSSL_NO_PSK
@@ -1053,8 +1044,9 @@ int ssl3_get_client_hello(SSL *s)
                                        }
                                /* else cookie verification succeeded */
                                }
+                       /* default verification */
                        else if ( memcmp(s->d1->rcvd_cookie, s->d1->cookie, 
-                                                 s->d1->cookie_len) != 0) /* default verification */
+                                                 s->d1->cookie_len) != 0)
                                {
                                        al=SSL_AD_HANDSHAKE_FAILURE;
                                        SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, 
@@ -1307,7 +1299,8 @@ int ssl3_get_client_hello(SSL *s)
        else if (s->hit)
                comp = NULL;
        else if (!(s->options & SSL_OP_NO_COMPRESSION) && s->ctx->comp_methods)
-               { /* See if we have a match */
+               {
+               /* See if we have a match */
                int m,nn,o,v,done=0;
 
                nn=sk_SSL_COMP_num(s->ctx->comp_methods);
@@ -1432,7 +1425,8 @@ int ssl3_get_client_hello(SSL *s)
                        goto f_err;
                }
        
-       /* we now have the following setup. 
+       /*-
+        * we now have the following setup. 
         * client_random
         * cipher_list          - our prefered list of ciphers
         * ciphers              - the clients prefered list of ciphers
@@ -1490,7 +1484,8 @@ int ssl3_send_server_hello(SSL *s)
                memcpy(p,s->s3->server_random,SSL3_RANDOM_SIZE);
                p+=SSL3_RANDOM_SIZE;
 
-               /* There are several cases for the session ID to send
+               /*-
+                * There are several cases for the session ID to send
                 * back in the server hello:
                 * - For session reuse from the session cache,
                 *   we send back the old session ID.
@@ -2169,7 +2164,7 @@ int ssl3_get_client_key_exchange(SSL *s)
                SSL3_ST_SR_KEY_EXCH_A,
                SSL3_ST_SR_KEY_EXCH_B,
                SSL3_MT_CLIENT_KEY_EXCHANGE,
-               2048, /* ??? */
+               2048,
                &ok);
 
        if (!ok) return((int)n);
@@ -2597,11 +2592,11 @@ int ssl3_get_client_key_exchange(SSL *s)
                        }
 
 
-               /*  Was doing kssl_ctx_free() here,
-               **  but it caused problems for apache.
-               **  kssl_ctx = kssl_ctx_free(kssl_ctx);
-               **  if (s->kssl_ctx)  s->kssl_ctx = NULL;
-               */
+               /*- Was doing kssl_ctx_free() here,
+                *  but it caused problems for apache.
+                *  kssl_ctx = kssl_ctx_free(kssl_ctx);
+                *  if (s->kssl_ctx)  s->kssl_ctx = NULL;
+                */
                }
        else
 #endif /* OPENSSL_NO_KRB5 */
@@ -3025,7 +3020,7 @@ int ssl3_get_cert_verify(SSL *s)
        if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY)
                {
                s->s3->tmp.reuse_message=1;
-               if ((peer != NULL) && (type & EVP_PKT_SIGN))
+               if (peer != NULL)
                        {
                        al=SSL_AD_UNEXPECTED_MESSAGE;
                        SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE);
@@ -3478,7 +3473,8 @@ int ssl3_send_newsession_ticket(SSL *s)
                i2d_SSL_SESSION(sess, &p);
                SSL_SESSION_free(sess);
 
-               /* Grow buffer if need be: the length calculation is as
+               /*-
+                * Grow buffer if need be: the length calculation is as
                 * follows handshake_header_length +
                 * 4 (ticket lifetime hint) + 2 (ticket length) +
                 * 16 (key name) + max_iv_len (iv length) +
@@ -3562,7 +3558,8 @@ int ssl3_send_cert_status(SSL *s)
        if (s->state == SSL3_ST_SW_CERT_STATUS_A)
                {
                unsigned char *p;
-               /* Grow buffer if need be: the length calculation is as
+               /*-
+                * Grow buffer if need be: the length calculation is as
                 * follows 1 (message type) + 3 (message length) +
                 * 1 (ocsp response type) + 3 (ocsp response length)
                 * + (ocsp response)
@@ -3610,11 +3607,12 @@ int ssl3_get_next_proto(SSL *s)
                return -1;
                }
 
+       /* See the payload format below */
        n=s->method->ssl_get_message(s,
                SSL3_ST_SR_NEXT_PROTO_A,
                SSL3_ST_SR_NEXT_PROTO_B,
                SSL3_MT_NEXT_PROTO,
-               514,  /* See the payload format below */
+               514,
                &ok);
 
        if (!ok)
@@ -3634,7 +3632,8 @@ int ssl3_get_next_proto(SSL *s)
 
        p=(unsigned char *)s->init_msg;
 
-       /* The payload looks like:
+       /*-
+        * The payload looks like:
         *   uint8 proto_len;
         *   uint8 proto[proto_len];
         *   uint8 padding_len;