Replace L suffix with U
[openssl.git] / ssl / d1_lib.c
index 087d6d26679c28632cfa668ef2243ac2a5faa92d..b865ad42b27c0f08796ebda712eaecc4c65b742c 100644 (file)
@@ -77,6 +77,7 @@ static void get_current_time(struct timeval *t);
 static int dtls1_set_handshake_header(SSL *s, int type, unsigned long len);
 static int dtls1_handshake_write(SSL *s);
 int dtls1_listen(SSL *s, struct sockaddr *client);
+static unsigned int dtls1_link_min_mtu(void);
 
 /* XDTLS:  figure out the right values */
 static const unsigned int g_probable_mtu[] = { 1500, 512, 256 };
@@ -872,8 +873,11 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
      */
     SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
 
-    /* Put us into the "init" state so that we don't get our state cleared */
-    ossl_statem_set_in_init(s, 1);
+    /*
+     * Tell the state machine that we've done the initial hello verify
+     * exchange
+     */
+    ossl_statem_set_hello_verify_done(s);
 
     if(BIO_dgram_get_peer(rbio, client) <= 0) {
         SSLerr(SSL_F_DTLS1_LISTEN, ERR_R_INTERNAL_ERROR);
@@ -1014,17 +1018,11 @@ int dtls1_heartbeat(SSL *s)
     }
 
     /* ...and no handshake in progress. */
-    if (SSL_in_init(s) || s->in_handshake) {
+    if (SSL_in_init(s) || ossl_statem_get_in_handshake(s)) {
         SSLerr(SSL_F_DTLS1_HEARTBEAT, SSL_R_UNEXPECTED_MESSAGE);
         return -1;
     }
 
-    /*
-     * Check if padding is too long, payload and padding must not exceed 2^14
-     * - 3 = 16381 bytes in total.
-     */
-    OPENSSL_assert(payload + padding <= 16381);
-
     /*-
      * Create HeartBeat message, we just use a sequence number
      * as payload to distuingish different messages and add
@@ -1132,7 +1130,7 @@ int dtls1_query_mtu(SSL *s)
     return 1;
 }
 
-unsigned int dtls1_link_min_mtu(void)
+static unsigned int dtls1_link_min_mtu(void)
 {
     return (g_probable_mtu[(sizeof(g_probable_mtu) /
                             sizeof(g_probable_mtu[0])) - 1]);