gnutls_assert();
return ret;
}
- } else {
- _gnutls_extension_list_add(session, type);
}
DECR_LENGTH_RET(next, 2, 0);
continue;
}
+ /* only store the extension number if we support it */
+ if (session->security_parameters.entity == GNUTLS_SERVER) {
+ _gnutls_extension_list_add(session, type);
+ }
+
_gnutls_handshake_log
("EXT[%p]: Parsing extension '%s/%d' (%d bytes)\n",
session, _gnutls_extension_get_name(type), type,
}
/* Adds the extension we want to send in the extensions list.
- * This list is used to check whether the (later) received
+ * This list is used in client side to check whether the (later) received
* extensions are the ones we requested.
+ *
+ * In server side, this list is used to ensure we don't send
+ * extensions that we didn't receive a corresponding value.
*/
void _gnutls_extension_list_add(gnutls_session_t session, uint16_t type)
{