ssl/statem/extensions.c:1048: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: 29 by call to `check_in_list`.
Showing all 9 steps of the trace


ssl/t1_lib.c:176:1: Array declaration
174.   
175.   /* The default curves */
176. > static const unsigned char eccurves_default[] = {
177.       0, 29,                      /* X25519 (29) */
178.       0, 23,                      /* secp256r1 (23) */

ssl/statem/extensions.c:1048:21: Call
1046.                   group_id = bytestogroup(pcurvestmp);
1047.   
1048.                   if (check_in_list(s, group_id, clntcurves, clnt_num_curves, 1))
                            ^
1049.                       break;
1050.               }

ssl/statem/statem_lib.c:1749:1: Parameter `*groups`
  1747.    */
  1748.   #ifndef OPENSSL_NO_EC
  1749. > int check_in_list(SSL *s, unsigned int group_id, const unsigned char *groups,
  1750.                     size_t num_groups, int checkallow)
  1751.   {

ssl/statem/statem_lib.c:1762:24: Call
  1760.           if (group_id == share_id
  1761.                   && (!checkallow
  1762.                       || tls_curve_allowed(s, groups, SSL_SECOP_CURVE_CHECK))) {
                                 ^
  1763.               break;
  1764.           }

ssl/t1_lib.c:268:1: <Offset trace>
266.   
267.   /* See if curve is allowed by security callback */
268. > int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
269.   {
270.       const tls_curve_info *cinfo;

ssl/t1_lib.c:268:1: Parameter `*curve`
    266.   
    267.   /* See if curve is allowed by security callback */
    268. > int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
    269.   {
    270.       const tls_curve_info *cinfo;

ssl/t1_lib.c:137:1: <Length trace>
135.    * table: the index of each entry is one less than the TLS curve id.
136.    */
137. > static const tls_curve_info nid_list[] = {
138.       {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
139.       {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */

ssl/t1_lib.c:137:1: Array declaration
    135.    * table: the index of each entry is one less than the TLS curve id.
    136.    */
    137. > static const tls_curve_info nid_list[] = {
    138.       {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
    139.       {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */

ssl/t1_lib.c:275:5: Array access: Offset: [-1, +oo] Size: 29 by call to `check_in_list` 
    273.       if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list)))
    274.           return 0;
    275.       cinfo = &nid_list[curve[1] - 1];
               ^
    276.   # ifdef OPENSSL_NO_EC2M
    277.       if (cinfo->flags & TLS_CURVE_CHAR2)

int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
{
    const tls_curve_info *cinfo;
    if (curve[0])
        return 1;
    if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list)))
        return 0;
    cinfo = &nid_list[curve[1] - 1];
# ifdef OPENSSL_NO_EC2M
    if (cinfo->flags & TLS_CURVE_CHAR2)
        return 0;
# endif
    return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);
}
['static int final_key_share(SSL *s, unsigned int context, int sent, int *al)\n{\n    if (!SSL_IS_TLS13(s))\n        return 1;\n    if (!s->server\n            && !sent\n            && (!s->hit\n                || (s->ext.psk_kex_mode & TLSEXT_KEX_MODE_FLAG_KE) == 0)) {\n        *al = SSL_AD_HANDSHAKE_FAILURE;\n        SSLerr(SSL_F_FINAL_KEY_SHARE, SSL_R_NO_SUITABLE_KEY_SHARE);\n        return 0;\n    }\n    if (s->server && s->s3->peer_tmp == NULL) {\n        if (s->hello_retry_request == 0 && sent\n                && (!s->hit\n                    || (s->ext.psk_kex_mode & TLSEXT_KEX_MODE_FLAG_KE_DHE)\n                       != 0)) {\n            const unsigned char *pcurves, *pcurvestmp, *clntcurves;\n            size_t num_curves, clnt_num_curves, i;\n            unsigned int group_id = 0;\n            if (!tls1_get_curvelist(s, 1, &clntcurves, &clnt_num_curves)) {\n                *al = SSL_AD_INTERNAL_ERROR;\n                SSLerr(SSL_F_FINAL_KEY_SHARE, ERR_R_INTERNAL_ERROR);\n                return 0;\n            }\n            if (!tls1_get_curvelist(s, 0, &pcurves, &num_curves)) {\n                *al = SSL_AD_INTERNAL_ERROR;\n                SSLerr(SSL_F_FINAL_KEY_SHARE, ERR_R_INTERNAL_ERROR);\n                return 0;\n            }\n            for (i = 0, pcurvestmp = pcurves; i < num_curves;\n                 i++, pcurvestmp += 2) {\n                group_id = bytestogroup(pcurvestmp);\n                if (check_in_list(s, group_id, clntcurves, clnt_num_curves, 1))\n                    break;\n            }\n            if (i < num_curves) {\n                s->s3->group_id = group_id;\n                s->hello_retry_request = 1;\n                return 1;\n            }\n        }\n        if (!s->hit\n                || (s->ext.psk_kex_mode & TLSEXT_KEX_MODE_FLAG_KE) == 0) {\n            *al = SSL_AD_HANDSHAKE_FAILURE;\n            SSLerr(SSL_F_FINAL_KEY_SHARE, SSL_R_NO_SUITABLE_KEY_SHARE);\n            return 0;\n        }\n    }\n    if (s->server)\n        s->hello_retry_request = 0;\n    if (!sent && !s->server && !tls13_generate_handshake_secret(s, NULL, 0)) {\n        *al = SSL_AD_INTERNAL_ERROR;\n        SSLerr(SSL_F_FINAL_KEY_SHARE, ERR_R_INTERNAL_ERROR);\n        return 0;\n    }\n    return 1;\n}', 'int check_in_list(SSL *s, unsigned int group_id, const unsigned char *groups,\n                  size_t num_groups, int checkallow)\n{\n    size_t i;\n    if (groups == NULL || num_groups == 0)\n        return 0;\n    for (i = 0; i < num_groups; i++, groups += 2) {\n        unsigned int share_id = (groups[0] << 8) | (groups[1]);\n        if (group_id == share_id\n                && (!checkallow\n                    || tls_curve_allowed(s, groups, SSL_SECOP_CURVE_CHECK))) {\n            break;\n        }\n    }\n    return i < num_groups;\n}', 'int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)\n{\n    const tls_curve_info *cinfo;\n    if (curve[0])\n        return 1;\n    if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list)))\n        return 0;\n    cinfo = &nid_list[curve[1] - 1];\n# ifdef OPENSSL_NO_EC2M\n    if (cinfo->flags & TLS_CURVE_CHAR2)\n        return 0;\n# endif\n    return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);\n}']