Update from stable branch.
[openssl.git] / ssl / t1_lib.c
index 615a1c4f54d244da6efc92bd07d78b89d59cbb22..16c4f08e78a918eebe6565f9f1f8021597803cb6 100644 (file)
@@ -196,7 +196,9 @@ static int nid_list[] =
 int tls1_ec_curve_id2nid(int curve_id)
        {
        /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */
-       if ((curve_id < 1) || (curve_id > sizeof(nid_list)/sizeof(nid_list[0]))) return 0;
+       if ((curve_id < 1) || ((unsigned int)curve_id >
+                               sizeof(nid_list)/sizeof(nid_list[0])))
+               return 0;
        return nid_list[curve_id-1];
        }
 
@@ -559,7 +561,9 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
 
                if (data+size > (d+n))
                        return 1;
+#if 0
                fprintf(stderr,"Received extension type %d size %d\n",type,size);
+#endif
                if (s->tlsext_debug_cb)
                        s->tlsext_debug_cb(s, 0, type, data, size,
                                                s->tlsext_debug_arg);
@@ -1058,7 +1062,8 @@ int ssl_prepare_clienthello_tlsext(SSL *s)
                        SSLerr(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT,ERR_R_MALLOC_FAILURE);
                        return -1;
                        }
-               for (i = 1, j = s->tlsext_ellipticcurvelist; i <= sizeof(nid_list)/sizeof(nid_list[0]); i++)
+               for (i = 1, j = s->tlsext_ellipticcurvelist; (unsigned int)i <=
+                               sizeof(nid_list)/sizeof(nid_list[0]); i++)
                        s2n(i,j);
                }
 #endif /* OPENSSL_NO_EC */
@@ -1496,7 +1501,9 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen,
                        memcpy(sess->session_id, sess_id, sesslen);
                sess->session_id_length = sesslen;
                *psess = sess;
-               s->tlsext_ticket_expected = 0;
+               /*** TEST ***/
+               s->tlsext_ticket_expected = 1;
+               /*s->tlsext_ticket_expected = 0;*/
                return 1;
                }
        /* If session decrypt failure indicate a cache miss and set state to