a2d_ASN1_OBJECT:
   52|    474|{
   53|    474|    int i, first, len = 0, c, use_bn;
   54|    474|    char ftmp[24], *tmp = ftmp;
   55|    474|    int tmpsize = sizeof(ftmp);
   56|    474|    const char *p;
   57|    474|    unsigned long l;
   58|    474|    BIGNUM *bl = NULL;
   59|       |
   60|    474|    if (num == 0)
  ------------------
  |  Branch (60:9): [True: 0, False: 474]
  ------------------
   61|      0|        return 0;
   62|    474|    else if (num == -1)
  ------------------
  |  Branch (62:14): [True: 474, False: 0]
  ------------------
   63|    474|        num = strlen(buf);
   64|       |
   65|    474|    p = buf;
   66|    474|    c = *(p++);
   67|    474|    num--;
   68|    474|    if ((c >= '0') && (c <= '2')) {
  ------------------
  |  Branch (68:9): [True: 474, False: 0]
  |  Branch (68:23): [True: 474, False: 0]
  ------------------
   69|    474|        first = c - '0';
   70|    474|    } else {
   71|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|        goto err;
   73|      0|    }
   74|       |
   75|    474|    if (num <= 0) {
  ------------------
  |  Branch (75:9): [True: 0, False: 474]
  ------------------
   76|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   77|      0|        goto err;
   78|      0|    }
   79|    474|    c = *(p++);
   80|    474|    num--;
   81|  4.26k|    for (;;) {
   82|  4.26k|        if (num <= 0)
  ------------------
  |  Branch (82:13): [True: 474, False: 3.79k]
  ------------------
   83|    474|            break;
   84|  3.79k|        if ((c != '.') && (c != ' ')) {
  ------------------
  |  Branch (84:13): [True: 0, False: 3.79k]
  |  Branch (84:27): [True: 0, False: 0]
  ------------------
   85|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|      0|            goto err;
   87|      0|        }
   88|  3.79k|        l = 0;
   89|  3.79k|        use_bn = 0;
   90|  10.4k|        for (;;) {
   91|  10.4k|            if (num <= 0)
  ------------------
  |  Branch (91:17): [True: 474, False: 9.95k]
  ------------------
   92|    474|                break;
   93|  9.95k|            num--;
   94|  9.95k|            c = *(p++);
   95|  9.95k|            if ((c == ' ') || (c == '.'))
  ------------------
  |  Branch (95:17): [True: 0, False: 9.95k]
  |  Branch (95:31): [True: 3.31k, False: 6.63k]
  ------------------
   96|  3.31k|                break;
   97|  6.63k|            if (!ossl_isdigit(c)) {
  ------------------
  |  Branch (97:17): [True: 0, False: 6.63k]
  ------------------
   98|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|                goto err;
  100|      0|            }
  101|  6.63k|            if (!use_bn && l >= ((ULONG_MAX - 80) / 10L)) {
  ------------------
  |  Branch (101:17): [True: 6.63k, False: 0]
  |  Branch (101:28): [True: 0, False: 6.63k]
  ------------------
  102|      0|                use_bn = 1;
  103|      0|                if (bl == NULL)
  ------------------
  |  Branch (103:21): [True: 0, False: 0]
  ------------------
  104|      0|                    bl = BN_new();
  105|      0|                if (bl == NULL || !BN_set_word(bl, l))
  ------------------
  |  Branch (105:21): [True: 0, False: 0]
  |  Branch (105:35): [True: 0, False: 0]
  ------------------
  106|      0|                    goto err;
  107|      0|            }
  108|  6.63k|            if (use_bn) {
  ------------------
  |  Branch (108:17): [True: 0, False: 6.63k]
  ------------------
  109|      0|                if (!BN_mul_word(bl, 10L)
  ------------------
  |  Branch (109:21): [True: 0, False: 0]
  ------------------
  110|      0|                    || !BN_add_word(bl, c - '0'))
  ------------------
  |  Branch (110:24): [True: 0, False: 0]
  ------------------
  111|      0|                    goto err;
  112|      0|            } else
  113|  6.63k|                l = l * 10L + (long)(c - '0');
  114|  6.63k|        }
  115|  3.79k|        if (len == 0) {
  ------------------
  |  Branch (115:13): [True: 474, False: 3.31k]
  ------------------
  116|    474|            if ((first < 2) && (l >= 40)) {
  ------------------
  |  Branch (116:17): [True: 0, False: 474]
  |  Branch (116:32): [True: 0, False: 0]
  ------------------
  117|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|                goto err;
  119|      0|            }
  120|    474|            if (use_bn) {
  ------------------
  |  Branch (120:17): [True: 0, False: 474]
  ------------------
  121|      0|                if (!BN_add_word(bl, first * 40))
  ------------------
  |  Branch (121:21): [True: 0, False: 0]
  ------------------
  122|      0|                    goto err;
  123|      0|            } else
  124|    474|                l += (long)first *40;
  125|    474|        }
  126|  3.79k|        i = 0;
  127|  3.79k|        if (use_bn) {
  ------------------
  |  Branch (127:13): [True: 0, False: 3.79k]
  ------------------
  128|      0|            int blsize;
  129|      0|            blsize = BN_num_bits(bl);
  130|      0|            blsize = (blsize + 6) / 7;
  131|      0|            if (blsize > tmpsize) {
  ------------------
  |  Branch (131:17): [True: 0, False: 0]
  ------------------
  132|      0|                if (tmp != ftmp)
  ------------------
  |  Branch (132:21): [True: 0, False: 0]
  ------------------
  133|      0|                    OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  134|      0|                tmpsize = blsize + 32;
  135|      0|                tmp = OPENSSL_malloc(tmpsize);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|      0|                if (tmp == NULL)
  ------------------
  |  Branch (136:21): [True: 0, False: 0]
  ------------------
  137|      0|                    goto err;
  138|      0|            }
  139|      0|            while (blsize--) {
  ------------------
  |  Branch (139:20): [True: 0, False: 0]
  ------------------
  140|      0|                BN_ULONG t = BN_div_word(bl, 0x80L);
  ------------------
  |  |   37|      0|#  define BN_ULONG        unsigned long
  ------------------
  141|      0|                if (t == (BN_ULONG)-1)
  ------------------
  |  Branch (141:21): [True: 0, False: 0]
  ------------------
  142|      0|                    goto err;
  143|      0|                tmp[i++] = (unsigned char)t;
  144|      0|            }
  145|  3.79k|        } else {
  146|       |
  147|  4.26k|            for (;;) {
  148|  4.26k|                tmp[i++] = (unsigned char)l & 0x7f;
  149|  4.26k|                l >>= 7L;
  150|  4.26k|                if (l == 0L)
  ------------------
  |  Branch (150:21): [True: 3.79k, False: 474]
  ------------------
  151|  3.79k|                    break;
  152|  4.26k|            }
  153|       |
  154|  3.79k|        }
  155|  3.79k|        if (out != NULL) {
  ------------------
  |  Branch (155:13): [True: 1.89k, False: 1.89k]
  ------------------
  156|  1.89k|            if (len + i > olen) {
  ------------------
  |  Branch (156:17): [True: 0, False: 1.89k]
  ------------------
  157|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|                goto err;
  159|      0|            }
  160|  2.13k|            while (--i > 0)
  ------------------
  |  Branch (160:20): [True: 237, False: 1.89k]
  ------------------
  161|    237|                out[len++] = tmp[i] | 0x80;
  162|  1.89k|            out[len++] = tmp[0];
  163|  1.89k|        } else
  164|  1.89k|            len += i;
  165|  3.79k|    }
  166|    474|    if (tmp != ftmp)
  ------------------
  |  Branch (166:9): [True: 0, False: 474]
  ------------------
  167|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  168|    474|    BN_free(bl);
  169|    474|    return len;
  170|      0| err:
  171|      0|    if (tmp != ftmp)
  ------------------
  |  Branch (171:9): [True: 0, False: 0]
  ------------------
  172|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|      0|    BN_free(bl);
  174|      0|    return 0;
  175|    474|}
d2i_ASN1_OBJECT:
  213|    237|{
  214|    237|    const unsigned char *p;
  215|    237|    long len;
  216|    237|    int tag, xclass;
  217|    237|    int inf, i;
  218|    237|    ASN1_OBJECT *ret = NULL;
  219|    237|    p = *pp;
  220|    237|    inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
  221|    237|    if (inf & 0x80) {
  ------------------
  |  Branch (221:9): [True: 0, False: 237]
  ------------------
  222|      0|        i = ASN1_R_BAD_OBJECT_HEADER;
  ------------------
  |  |   28|      0|# define ASN1_R_BAD_OBJECT_HEADER                         102
  ------------------
  223|      0|        goto err;
  224|      0|    }
  225|       |
  226|    237|    if (tag != V_ASN1_OBJECT) {
  ------------------
  |  |   68|    237|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (226:9): [True: 0, False: 237]
  ------------------
  227|      0|        i = ASN1_R_EXPECTING_AN_OBJECT;
  ------------------
  |  |   45|      0|# define ASN1_R_EXPECTING_AN_OBJECT                       116
  ------------------
  228|      0|        goto err;
  229|      0|    }
  230|    237|    ret = ossl_c2i_ASN1_OBJECT(a, &p, len);
  231|    237|    if (ret)
  ------------------
  |  Branch (231:9): [True: 237, False: 0]
  ------------------
  232|    237|        *pp = p;
  233|    237|    return ret;
  234|      0| err:
  235|      0|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|      0|    return NULL;
  237|    237|}
ossl_c2i_ASN1_OBJECT:
  241|    237|{
  242|    237|    ASN1_OBJECT *ret = NULL, tobj;
  243|    237|    const unsigned char *p;
  244|    237|    unsigned char *data;
  245|    237|    int i, length;
  246|       |
  247|       |    /*
  248|       |     * Sanity check OID encoding. Need at least one content octet. MSB must
  249|       |     * be clear in the last octet. can't have leading 0x80 in subidentifiers,
  250|       |     * see: X.690 8.19.2
  251|       |     */
  252|    237|    if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
  ------------------
  |  Branch (252:9): [True: 0, False: 237]
  |  Branch (252:21): [True: 0, False: 237]
  |  Branch (252:38): [True: 0, False: 237]
  |  Branch (252:52): [True: 0, False: 237]
  ------------------
  253|    237|        p[len - 1] & 0x80) {
  ------------------
  |  Branch (253:9): [True: 0, False: 237]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return NULL;
  256|      0|    }
  257|       |    /* Now 0 < len <= INT_MAX, so the cast is safe. */
  258|    237|    length = (int)len;
  259|       |    /*
  260|       |     * Try to lookup OID in table: these are all valid encodings so if we get
  261|       |     * a match we know the OID is valid.
  262|       |     */
  263|    237|    tobj.nid = NID_undef;
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  264|    237|    tobj.data = p;
  265|    237|    tobj.length = length;
  266|    237|    tobj.flags = 0;
  267|    237|    i = OBJ_obj2nid(&tobj);
  268|    237|    if (i != NID_undef) {
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (268:9): [True: 237, False: 0]
  ------------------
  269|       |        /*
  270|       |         * Return shared registered OID object: this improves efficiency
  271|       |         * because we don't have to return a dynamically allocated OID
  272|       |         * and NID lookups can use the cached value.
  273|       |         */
  274|    237|        ret = OBJ_nid2obj(i);
  275|    237|        if (a) {
  ------------------
  |  Branch (275:13): [True: 0, False: 237]
  ------------------
  276|      0|            ASN1_OBJECT_free(*a);
  277|      0|            *a = ret;
  278|      0|        }
  279|    237|        *pp += len;
  280|    237|        return ret;
  281|    237|    }
  282|      0|    for (i = 0; i < length; i++, p++) {
  ------------------
  |  Branch (282:17): [True: 0, False: 0]
  ------------------
  283|      0|        if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
  ------------------
  |  Branch (283:13): [True: 0, False: 0]
  |  Branch (283:28): [True: 0, False: 0]
  |  Branch (283:34): [True: 0, False: 0]
  ------------------
  284|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|            return NULL;
  286|      0|        }
  287|      0|    }
  288|       |
  289|      0|    if ((a == NULL) || ((*a) == NULL) ||
  ------------------
  |  Branch (289:9): [True: 0, False: 0]
  |  Branch (289:24): [True: 0, False: 0]
  ------------------
  290|      0|        !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  ------------------
  |  |  110|      0|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (290:9): [True: 0, False: 0]
  ------------------
  291|      0|        if ((ret = ASN1_OBJECT_new()) == NULL)
  ------------------
  |  Branch (291:13): [True: 0, False: 0]
  ------------------
  292|      0|            return NULL;
  293|      0|    } else {
  294|      0|        ret = (*a);
  295|      0|    }
  296|       |
  297|      0|    p = *pp;
  298|       |    /* detach data from object */
  299|      0|    data = (unsigned char *)ret->data;
  300|      0|    ret->data = NULL;
  301|       |    /* once detached we can change it */
  302|      0|    if ((data == NULL) || (ret->length < length)) {
  ------------------
  |  Branch (302:9): [True: 0, False: 0]
  |  Branch (302:27): [True: 0, False: 0]
  ------------------
  303|      0|        ret->length = 0;
  304|      0|        OPENSSL_free(data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|      0|        data = OPENSSL_malloc(length);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|      0|        if (data == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 0]
  ------------------
  307|      0|            goto err;
  308|      0|        ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
  ------------------
  |  |  113|      0|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  309|      0|    }
  310|      0|    memcpy(data, p, length);
  311|       |    /* If there are dynamic strings, free them here, and clear the flag */
  312|      0|    if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
  ------------------
  |  |  112|      0|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (312:9): [True: 0, False: 0]
  ------------------
  313|      0|        OPENSSL_free((char *)ret->sn);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|      0|        OPENSSL_free((char *)ret->ln);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  315|      0|        ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS;
  ------------------
  |  |  112|      0|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  316|      0|    }
  317|       |    /* reattach data to object, after which it remains const */
  318|      0|    ret->data = data;
  319|      0|    ret->length = length;
  320|      0|    ret->sn = NULL;
  321|      0|    ret->ln = NULL;
  322|       |    /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
  323|      0|    p += length;
  324|       |
  325|      0|    if (a != NULL)
  ------------------
  |  Branch (325:9): [True: 0, False: 0]
  ------------------
  326|      0|        (*a) = ret;
  327|      0|    *pp = p;
  328|      0|    return ret;
  329|      0| err:
  330|      0|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  331|      0|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (331:9): [True: 0, False: 0]
  |  Branch (331:24): [True: 0, False: 0]
  ------------------
  332|      0|        ASN1_OBJECT_free(ret);
  333|      0|    return NULL;
  334|      0|}
ASN1_OBJECT_free:
  348|  2.05k|{
  349|  2.05k|    if (a == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 2.05k]
  ------------------
  350|      0|        return;
  351|  2.05k|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|  2.05k|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (351:9): [True: 0, False: 2.05k]
  ------------------
  352|      0|#ifndef CONST_STRICT
  353|       |        /*
  354|       |         * Disable purely for compile-time strict const checking.  Doing this
  355|       |         * on a "real" compile will cause memory leaks
  356|       |         */
  357|      0|        OPENSSL_free((void*)a->sn);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|      0|        OPENSSL_free((void*)a->ln);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  359|      0|#endif
  360|      0|        a->sn = a->ln = NULL;
  361|      0|    }
  362|  2.05k|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|  2.05k|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (362:9): [True: 0, False: 2.05k]
  ------------------
  363|      0|        OPENSSL_free((void*)a->data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  364|      0|        a->data = NULL;
  365|      0|        a->length = 0;
  366|      0|    }
  367|  2.05k|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|  2.05k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (367:9): [True: 0, False: 2.05k]
  ------------------
  368|      0|        OPENSSL_free(a);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  2.05k|}

EVP_PKEY_asn1_get_count:
   39|    554|{
   40|    554|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|    554|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   41|    554|    if (app_methods)
  ------------------
  |  Branch (41:9): [True: 0, False: 554]
  ------------------
   42|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   43|    554|    return num;
   44|    554|}
EVP_PKEY_asn1_get0:
   47|  8.31k|{
   48|  8.31k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  8.31k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   49|  8.31k|    if (idx < 0)
  ------------------
  |  Branch (49:9): [True: 0, False: 8.31k]
  ------------------
   50|      0|        return NULL;
   51|  8.31k|    if (idx < num)
  ------------------
  |  Branch (51:9): [True: 8.31k, False: 0]
  ------------------
   52|  8.31k|        return standard_methods[idx];
   53|      0|    idx -= num;
   54|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   55|  8.31k|}
EVP_PKEY_asn1_find:
   82|    704|{
   83|    704|    const EVP_PKEY_ASN1_METHOD *t;
   84|       |
   85|    704|    for (;;) {
   86|    704|        t = pkey_asn1_find(type);
   87|    704|        if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS))
  ------------------
  |  | 1606|    558|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (87:13): [True: 146, False: 558]
  |  Branch (87:19): [True: 558, False: 0]
  ------------------
   88|    704|            break;
   89|      0|        type = t->pkey_base_id;
   90|      0|    }
   91|    704|    if (pe) {
  ------------------
  |  Branch (91:9): [True: 704, False: 0]
  ------------------
   92|    704|#ifndef OPENSSL_NO_ENGINE
   93|    704|        ENGINE *e;
   94|       |        /* type will contain the final unaliased type */
   95|    704|        e = ENGINE_get_pkey_asn1_meth_engine(type);
   96|    704|        if (e) {
  ------------------
  |  Branch (96:13): [True: 0, False: 704]
  ------------------
   97|      0|            *pe = e;
   98|      0|            return ENGINE_get_pkey_asn1_meth(e, type);
   99|      0|        }
  100|    704|#endif
  101|    704|        *pe = NULL;
  102|    704|    }
  103|    704|    return t;
  104|    704|}
EVP_PKEY_asn1_find_str:
  108|    553|{
  109|    553|    int i;
  110|    553|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  111|       |
  112|    553|    if (len == -1)
  ------------------
  |  Branch (112:9): [True: 553, False: 0]
  ------------------
  113|    553|        len = strlen(str);
  114|    553|    if (pe) {
  ------------------
  |  Branch (114:9): [True: 553, False: 0]
  ------------------
  115|    553|#ifndef OPENSSL_NO_ENGINE
  116|    553|        ENGINE *e;
  117|    553|        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
  118|    553|        if (ameth) {
  ------------------
  |  Branch (118:13): [True: 0, False: 553]
  ------------------
  119|       |            /*
  120|       |             * Convert structural into functional reference
  121|       |             */
  122|      0|            if (!ENGINE_init(e))
  ------------------
  |  Branch (122:17): [True: 0, False: 0]
  ------------------
  123|      0|                ameth = NULL;
  124|      0|            ENGINE_free(e);
  125|      0|            *pe = e;
  126|      0|            return ameth;
  127|      0|        }
  128|    553|#endif
  129|    553|        *pe = NULL;
  130|    553|    }
  131|  8.84k|    for (i = EVP_PKEY_asn1_get_count(); i-- > 0; ) {
  ------------------
  |  Branch (131:41): [True: 8.29k, False: 553]
  ------------------
  132|  8.29k|        ameth = EVP_PKEY_asn1_get0(i);
  133|  8.29k|        if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
  ------------------
  |  | 1606|  8.29k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (133:13): [True: 2.76k, False: 5.53k]
  ------------------
  134|  2.76k|            continue;
  135|  5.53k|        if ((int)strlen(ameth->pem_str) == len
  ------------------
  |  Branch (135:13): [True: 158, False: 5.37k]
  ------------------
  136|  5.53k|            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
  ------------------
  |  Branch (136:16): [True: 0, False: 158]
  ------------------
  137|      0|            return ameth;
  138|  5.53k|    }
  139|    553|    return NULL;
  140|    553|}
EVP_PKEY_asn1_get0_info:
  199|     15|{
  200|     15|    if (!ameth)
  ------------------
  |  Branch (200:9): [True: 0, False: 15]
  ------------------
  201|      0|        return 0;
  202|     15|    if (ppkey_id)
  ------------------
  |  Branch (202:9): [True: 15, False: 0]
  ------------------
  203|     15|        *ppkey_id = ameth->pkey_id;
  204|     15|    if (ppkey_base_id)
  ------------------
  |  Branch (204:9): [True: 15, False: 0]
  ------------------
  205|     15|        *ppkey_base_id = ameth->pkey_base_id;
  206|     15|    if (ppkey_flags)
  ------------------
  |  Branch (206:9): [True: 15, False: 0]
  ------------------
  207|     15|        *ppkey_flags = ameth->pkey_flags;
  208|     15|    if (pinfo)
  ------------------
  |  Branch (208:9): [True: 0, False: 15]
  ------------------
  209|      0|        *pinfo = ameth->info;
  210|     15|    if (ppem_str)
  ------------------
  |  Branch (210:9): [True: 15, False: 0]
  ------------------
  211|     15|        *ppem_str = ameth->pem_str;
  212|     15|    return 1;
  213|     15|}
ameth_lib.c:pkey_asn1_find:
   58|    704|{
   59|    704|    EVP_PKEY_ASN1_METHOD tmp;
   60|    704|    const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
   61|       |
   62|    704|    tmp.pkey_id = type;
   63|    704|    if (app_methods) {
  ------------------
  |  Branch (63:9): [True: 0, False: 704]
  ------------------
   64|      0|        int idx;
   65|      0|        idx = sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp);
   66|      0|        if (idx >= 0)
  ------------------
  |  Branch (66:13): [True: 0, False: 0]
  ------------------
   67|      0|            return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   68|      0|    }
   69|    704|    ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
  ------------------
  |  |   14|    704|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   70|    704|    if (ret == NULL || *ret == NULL)
  ------------------
  |  Branch (70:9): [True: 146, False: 558]
  |  Branch (70:24): [True: 0, False: 558]
  ------------------
   71|    146|        return NULL;
   72|    558|    return *ret;
   73|    704|}
ameth_lib.c:ameth_cmp:
   31|  2.25k|{
   32|  2.25k|    return ((*a)->pkey_id - (*b)->pkey_id);
   33|  2.25k|}

ossl_err_load_ASN1_strings:
  210|      2|{
  211|      2|#ifndef OPENSSL_NO_ERR
  212|      2|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (212:9): [True: 2, False: 0]
  ------------------
  213|      2|        ERR_load_strings_const(ASN1_str_reasons);
  214|      2|#endif
  215|      2|    return 1;
  216|      2|}

ASN1_get_object:
   48|    237|{
   49|    237|    int i, ret;
   50|    237|    long len;
   51|    237|    const unsigned char *p = *pp;
   52|    237|    int tag, xclass, inf;
   53|    237|    long max = omax;
   54|       |
   55|    237|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 237]
  ------------------
   56|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|    237|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|    237|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|    237|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|    237|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|    237|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|    237|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|    237|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|    237|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 0, False: 237]
  ------------------
   63|      0|        p++;
   64|      0|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            goto err;
   66|      0|        len = 0;
   67|      0|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 0, False: 0]
  ------------------
   68|      0|            len <<= 7L;
   69|      0|            len |= *(p++) & 0x7f;
   70|      0|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 0, False: 0]
  ------------------
   71|      0|                goto err;
   72|      0|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 0, False: 0]
  ------------------
   73|      0|                goto err;
   74|      0|        }
   75|      0|        len <<= 7L;
   76|      0|        len |= *(p++) & 0x7f;
   77|      0|        tag = (int)len;
   78|      0|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 0, False: 0]
  ------------------
   79|      0|            goto err;
   80|    237|    } else {
   81|    237|        tag = i;
   82|    237|        p++;
   83|    237|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 237]
  ------------------
   84|      0|            goto err;
   85|    237|    }
   86|    237|    *ptag = tag;
   87|    237|    *pclass = xclass;
   88|    237|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 0, False: 237]
  ------------------
   89|      0|        goto err;
   90|       |
   91|    237|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|      0|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 0, False: 237]
  |  Branch (91:16): [True: 0, False: 0]
  ------------------
   92|      0|        goto err;
   93|       |
   94|    237|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 0, False: 237]
  ------------------
   95|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|      0|        ret |= 0x80;
  101|      0|    }
  102|    237|    *pp = p;
  103|    237|    return ret | inf;
  104|      0| err:
  105|      0|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|      0|    return 0x80;
  107|    237|}
ASN1_put_object:
  162|    237|{
  163|    237|    unsigned char *p = *pp;
  164|    237|    int i, ttag;
  165|       |
  166|    237|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|      0|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 0, False: 237]
  ------------------
  167|    237|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|    237|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|    237|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 237, False: 0]
  ------------------
  169|    237|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|    237|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|    237|    } else {
  171|      0|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|      0|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|      0|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 0, False: 0]
  ------------------
  173|      0|            ttag >>= 7;
  174|      0|        ttag = i;
  175|      0|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 0, False: 0]
  ------------------
  176|      0|            p[i] = tag & 0x7f;
  177|      0|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 0, False: 0]
  ------------------
  178|      0|                p[i] |= 0x80;
  179|      0|            tag >>= 7;
  180|      0|        }
  181|      0|        p += ttag;
  182|      0|    }
  183|    237|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 237]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|    237|    else
  186|    237|        asn1_put_length(&p, length);
  187|    237|    *pp = p;
  188|    237|}
ASN1_object_size:
  223|    237|{
  224|    237|    int ret = 1;
  225|       |
  226|    237|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 237]
  ------------------
  227|      0|        return -1;
  228|    237|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 0, False: 237]
  ------------------
  229|      0|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 0, False: 0]
  ------------------
  230|      0|            tag >>= 7;
  231|      0|            ret++;
  232|      0|        }
  233|      0|    }
  234|    237|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 237]
  ------------------
  235|      0|        ret += 3;
  236|    237|    } else {
  237|    237|        ret++;
  238|    237|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 0, False: 237]
  ------------------
  239|      0|            int tmplen = length;
  240|      0|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 0, False: 0]
  ------------------
  241|      0|                tmplen >>= 8;
  242|      0|                ret++;
  243|      0|            }
  244|      0|        }
  245|    237|    }
  246|    237|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 237]
  ------------------
  247|      0|        return -1;
  248|    237|    return ret + length;
  249|    237|}
asn1_lib.c:asn1_get_length:
  118|    237|{
  119|    237|    const unsigned char *p = *pp;
  120|    237|    unsigned long ret = 0;
  121|    237|    int i;
  122|       |
  123|    237|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 237]
  ------------------
  124|      0|        return 0;
  125|    237|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 0, False: 237]
  ------------------
  126|      0|        *inf = 1;
  127|      0|        p++;
  128|    237|    } else {
  129|    237|        *inf = 0;
  130|    237|        i = *p & 0x7f;
  131|    237|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 0, False: 237]
  ------------------
  132|      0|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 0, False: 0]
  ------------------
  133|      0|                return 0;
  134|       |            /* Skip leading zeroes */
  135|      0|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 0, False: 0]
  |  Branch (135:29): [True: 0, False: 0]
  ------------------
  136|      0|                p++;
  137|      0|                i--;
  138|      0|            }
  139|      0|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|      0|                return 0;
  141|      0|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 0, False: 0]
  ------------------
  142|      0|                ret <<= 8;
  143|      0|                ret |= *p++;
  144|      0|                i--;
  145|      0|            }
  146|      0|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                return 0;
  148|    237|        } else {
  149|    237|            ret = i;
  150|    237|        }
  151|    237|    }
  152|    237|    *pp = p;
  153|    237|    *rl = (long)ret;
  154|    237|    return 1;
  155|    237|}
asn1_lib.c:asn1_put_length:
  201|    237|{
  202|    237|    unsigned char *p = *pp;
  203|    237|    int i, len;
  204|       |
  205|    237|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 237, False: 0]
  ------------------
  206|    237|        *(p++) = (unsigned char)length;
  207|    237|    } else {
  208|      0|        len = length;
  209|      0|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 0, False: 0]
  ------------------
  210|      0|            len >>= 8;
  211|      0|        *(p++) = i | 0x80;
  212|      0|        len = i;
  213|      0|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|            p[i] = length & 0xff;
  215|      0|            length >>= 8;
  216|      0|        }
  217|      0|        p += len;
  218|      0|    }
  219|    237|    *pp = p;
  220|    237|}

ASN1_item_free:
   19|    948|{
   20|    948|    ossl_asn1_item_embed_free(&val, it, 0);
   21|    948|}
ossl_asn1_item_embed_free:
   29|    948|{
   30|    948|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|    948|    const ASN1_EXTERN_FUNCS *ef;
   32|    948|    const ASN1_AUX *aux = it->funcs;
   33|    948|    ASN1_aux_cb *asn1_cb;
   34|    948|    int i;
   35|       |
   36|    948|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 948]
  ------------------
   37|      0|        return;
   38|    948|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|    948|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 948, False: 0]
  |  Branch (38:48): [True: 948, False: 0]
  ------------------
   39|    948|        return;
   40|      0|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 0, False: 0]
  |  Branch (40:16): [True: 0, False: 0]
  ------------------
   41|      0|        asn1_cb = aux->asn1_cb;
   42|      0|    else
   43|      0|        asn1_cb = 0;
   44|       |
   45|      0|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  ------------------
   46|       |
   47|      0|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|      0|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 0, False: 0]
  ------------------
   48|      0|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            ossl_asn1_template_free(pval, it->templates);
   50|      0|        else
   51|      0|            ossl_asn1_primitive_free(pval, it, embed);
   52|      0|        break;
   53|       |
   54|      0|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|      0|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 0, False: 0]
  ------------------
   55|      0|        ossl_asn1_primitive_free(pval, it, embed);
   56|      0|        break;
   57|       |
   58|      0|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|      0|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 0, False: 0]
  ------------------
   59|      0|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|      0|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|      0|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 0]
  ------------------
   62|      0|                return;
   63|      0|        }
   64|      0|        i = ossl_asn1_get_choice_selector(pval, it);
   65|      0|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 0, False: 0]
  |  Branch (65:25): [True: 0, False: 0]
  ------------------
   66|      0|            ASN1_VALUE **pchval;
   67|       |
   68|      0|            tt = it->templates + i;
   69|      0|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|      0|            ossl_asn1_template_free(pchval, tt);
   71|      0|        }
   72|      0|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  ------------------
   73|      0|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|      0|# define ASN1_OP_FREE_POST       3
  ------------------
   74|      0|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 0, False: 0]
  ------------------
   75|      0|            OPENSSL_free(*pval);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|            *pval = NULL;
   77|      0|        }
   78|      0|        break;
   79|       |
   80|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|      0|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 0, False: 0]
  ------------------
   81|      0|        ef = it->funcs;
   82|      0|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 0, False: 0]
  |  Branch (82:19): [True: 0, False: 0]
  ------------------
   83|      0|            ef->asn1_ex_free(pval, it);
   84|      0|        break;
   85|       |
   86|      0|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|      0|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 0, False: 0]
  ------------------
   87|      0|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|      0|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 0, False: 0]
  ------------------
   88|      0|        if (ossl_asn1_do_lock(pval, -1, it) != 0) {
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  ------------------
   89|       |            /* if error or ref-counter > 0 */
   90|      0|            OPENSSL_assert(embed == 0);
  ------------------
  |  |  438|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   91|      0|            *pval = NULL;
   92|      0|            return;
   93|      0|        }
   94|      0|        if (asn1_cb) {
  ------------------
  |  Branch (94:13): [True: 0, False: 0]
  ------------------
   95|      0|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|      0|# define ASN1_OP_FREE_PRE        2
  ------------------
   96|      0|            if (i == 2)
  ------------------
  |  Branch (96:17): [True: 0, False: 0]
  ------------------
   97|      0|                return;
   98|      0|        }
   99|      0|        ossl_asn1_enc_free(pval, it);
  100|       |        /*
  101|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
  102|       |         * field and we won't be able to determine the type of the field it
  103|       |         * defines. So free up in reverse order.
  104|       |         */
  105|      0|        tt = it->templates + it->tcount;
  106|      0|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (106:21): [True: 0, False: 0]
  ------------------
  107|      0|            ASN1_VALUE **pseqval;
  108|       |
  109|      0|            tt--;
  110|      0|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  111|      0|            if (!seqtt)
  ------------------
  |  Branch (111:17): [True: 0, False: 0]
  ------------------
  112|      0|                continue;
  113|      0|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  114|      0|            ossl_asn1_template_free(pseqval, seqtt);
  115|      0|        }
  116|      0|        if (asn1_cb)
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|      0|# define ASN1_OP_FREE_POST       3
  ------------------
  118|      0|        if (embed == 0) {
  ------------------
  |  Branch (118:13): [True: 0, False: 0]
  ------------------
  119|      0|            OPENSSL_free(*pval);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|      0|            *pval = NULL;
  121|      0|        }
  122|      0|        break;
  123|      0|    }
  124|      0|}

async_local_init:
   28|      2|{
   29|      2|    async_mem_lock = CRYPTO_THREAD_lock_new();
   30|      2|    return async_mem_lock != NULL;
   31|      2|}
async_local_deinit:
   34|      2|{
   35|      2|    CRYPTO_THREAD_lock_free(async_mem_lock);
   36|      2|}

async_init:
  329|      2|{
  330|      2|    if (!CRYPTO_THREAD_init_local(&ctxkey, NULL))
  ------------------
  |  Branch (330:9): [True: 0, False: 2]
  ------------------
  331|      0|        return 0;
  332|       |
  333|      2|    if (!CRYPTO_THREAD_init_local(&poolkey, NULL)) {
  ------------------
  |  Branch (333:9): [True: 0, False: 2]
  ------------------
  334|      0|        CRYPTO_THREAD_cleanup_local(&ctxkey);
  335|      0|        return 0;
  336|      0|    }
  337|       |
  338|      2|    return async_local_init();
  339|      2|}
async_deinit:
  342|      2|{
  343|      2|    CRYPTO_THREAD_cleanup_local(&ctxkey);
  344|      2|    CRYPTO_THREAD_cleanup_local(&poolkey);
  345|      2|    async_local_deinit();
  346|      2|}

ossl_err_load_ASYNC_strings:
   31|      2|{
   32|      2|#ifndef OPENSSL_NO_ERR
   33|      2|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 2, False: 0]
  ------------------
   34|      2|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      2|#endif
   36|      2|    return 1;
   37|      2|}

BIO_ADDR_free:
   64|    158|{
   65|    158|    OPENSSL_free(ap);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|    158|}
BIO_ADDR_clear:
   96|  10.1k|{
   97|  10.1k|    memset(ap, 0, sizeof(*ap));
   98|  10.1k|    ap->sa.sa_family = AF_UNSPEC;
   99|  10.1k|}

ossl_err_load_BIO_strings:
   93|      2|{
   94|      2|#ifndef OPENSSL_NO_ERR
   95|      2|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (95:9): [True: 2, False: 0]
  ------------------
   96|      2|        ERR_load_strings_const(BIO_str_reasons);
   97|      2|#endif
   98|      2|    return 1;
   99|      2|}

BIO_new_ex:
   82|    158|{
   83|    158|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  104|    158|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|    158|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 158]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|    158|    bio->libctx = libctx;
   89|    158|    bio->method = method;
   90|    158|    bio->shutdown = 1;
   91|       |
   92|    158|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 158]
  ------------------
   93|      0|        goto err;
   94|       |
   95|    158|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  241|    158|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 158]
  ------------------
   96|      0|        goto err;
   97|       |
   98|    158|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 158, False: 0]
  |  Branch (98:35): [True: 0, False: 158]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  241|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|    158|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 158]
  ------------------
  104|      0|        bio->init = 1;
  105|       |
  106|    158|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|    158|}
BIO_new:
  115|    158|{
  116|    158|    return BIO_new_ex(NULL, method);
  117|    158|}
BIO_free:
  120|    158|{
  121|    158|    int ret;
  122|       |
  123|    158|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 158]
  ------------------
  124|      0|        return 0;
  125|       |
  126|    158|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 158]
  ------------------
  127|      0|        return 0;
  128|       |
  129|    158|    REF_PRINT_COUNT("BIO", ret, a);
  ------------------
  |  |  301|    158|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    158|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    158|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    158|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|    158|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 0, False: 158]
  ------------------
  131|      0|        return 1;
  132|    158|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|    158|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  133|       |
  134|    158|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|    158|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 158]
  |  |  |  Branch (26:52): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  289|      0|# define BIO_CB_FREE        0x01
  ------------------
  136|      0|        if (ret <= 0)
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|    }
  139|       |
  140|    158|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 158, False: 0]
  |  Branch (140:32): [True: 158, False: 0]
  ------------------
  141|    158|        a->method->destroy(a);
  142|       |
  143|    158|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  241|    158|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|    158|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|    158|    OPENSSL_free(a);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|    158|    return 1;
  150|    158|}
BIO_recvmmsg:
  444|    158|{
  445|    158|    size_t ret;
  446|    158|    BIO_MMSG_CB_ARGS args;
  447|       |
  448|    158|    if (b == NULL) {
  ------------------
  |  Branch (448:9): [True: 0, False: 158]
  ------------------
  449|      0|        *msgs_processed = 0;
  450|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  451|      0|        return 0;
  452|      0|    }
  453|       |
  454|    158|    if (b->method == NULL || b->method->brecvmmsg == NULL) {
  ------------------
  |  Branch (454:9): [True: 0, False: 158]
  |  Branch (454:30): [True: 0, False: 158]
  ------------------
  455|      0|        *msgs_processed = 0;
  456|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  457|      0|        return 0;
  458|      0|    }
  459|       |
  460|    158|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    158|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 158]
  |  |  |  Branch (26:52): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  461|      0|        args.msg            = msg;
  462|      0|        args.stride         = stride;
  463|      0|        args.num_msg        = num_msg;
  464|      0|        args.flags          = flags;
  465|      0|        args.msgs_processed = msgs_processed;
  466|       |
  467|      0|        ret = bio_call_callback(b, BIO_CB_RECVMMSG, (void *)&args,
  ------------------
  |  |  295|      0|# define BIO_CB_RECVMMSG    0x07
  ------------------
  468|      0|                                0, 0, 0, 1, NULL);
  469|      0|        if (ret <= 0)
  ------------------
  |  Branch (469:13): [True: 0, False: 0]
  ------------------
  470|      0|            return 0;
  471|      0|    }
  472|       |
  473|    158|    if (!b->init) {
  ------------------
  |  Branch (473:9): [True: 0, False: 158]
  ------------------
  474|      0|        *msgs_processed = 0;
  475|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  476|      0|        return 0;
  477|      0|    }
  478|       |
  479|    158|    ret = b->method->brecvmmsg(b, msg, stride, num_msg, flags, msgs_processed);
  480|       |
  481|    158|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    158|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 158]
  |  |  |  Branch (26:52): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  482|      0|        ret = (size_t)bio_call_callback(b, BIO_CB_RECVMMSG | BIO_CB_RETURN,
  ------------------
  |  |  295|      0|# define BIO_CB_RECVMMSG    0x07
  ------------------
                      ret = (size_t)bio_call_callback(b, BIO_CB_RECVMMSG | BIO_CB_RETURN,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  483|      0|                                        (void *)&args, ret, 0, 0, ret, NULL);
  484|       |
  485|    158|    return ret;
  486|    158|}
BIO_get_rpoll_descriptor:
  489|    158|{
  490|    158|    return BIO_ctrl(b, BIO_CTRL_GET_RPOLL_DESCRIPTOR, 0, desc);
  ------------------
  |  |  193|    158|# define BIO_CTRL_GET_RPOLL_DESCRIPTOR          91
  ------------------
  491|    158|}
BIO_get_wpoll_descriptor:
  494|    158|{
  495|    158|    return BIO_ctrl(b, BIO_CTRL_GET_WPOLL_DESCRIPTOR, 0, desc);
  ------------------
  |  |  194|    158|# define BIO_CTRL_GET_WPOLL_DESCRIPTOR          92
  ------------------
  496|    158|}
BIO_ctrl:
  661|    869|{
  662|    869|    long ret;
  663|       |
  664|    869|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 869]
  ------------------
  665|      0|        return -1;
  666|    869|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 869]
  |  Branch (666:30): [True: 0, False: 869]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|    869|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    869|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 869]
  |  |  |  Branch (26:52): [True: 0, False: 869]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
  673|      0|        if (ret <= 0)
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            return ret;
  675|      0|    }
  676|       |
  677|    869|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|    869|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    869|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 869]
  |  |  |  Branch (26:52): [True: 0, False: 869]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|    869|    return ret;
  684|    869|}
BIO_free_all:
  850|    316|{
  851|    316|    BIO *b;
  852|    316|    int ref;
  853|       |
  854|    474|    while (bio != NULL) {
  ------------------
  |  Branch (854:12): [True: 158, False: 316]
  ------------------
  855|    158|        b = bio;
  856|    158|        CRYPTO_GET_REF(&b->references, &ref);
  857|    158|        bio = bio->next_bio;
  858|    158|        BIO_free(b);
  859|       |        /* Since ref count > 1, don't free anyone else. */
  860|    158|        if (ref > 1)
  ------------------
  |  Branch (860:13): [True: 0, False: 158]
  ------------------
  861|      0|            break;
  862|    158|    }
  863|    316|}
bio_cleanup:
  947|      2|{
  948|      2|#ifndef OPENSSL_NO_SOCK
  949|      2|    bio_sock_cleanup_int();
  950|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      2|    bio_lookup_lock = NULL;
  952|      2|#endif
  953|      2|    CRYPTO_FREE_REF(&bio_type_count);
  954|      2|}
BIO_err_is_non_fatal:
 1087|    158|{
 1088|    158|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|    158|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|    158|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 158]
  |  |  ------------------
  ------------------
 1089|      0|        return BIO_sock_non_fatal_error(ERR_GET_REASON(errcode));
 1090|    158|    else if (ERR_GET_LIB(errcode) == ERR_LIB_BIO
  ------------------
  |  |   93|    316|# define ERR_LIB_BIO             32
  ------------------
  |  Branch (1090:14): [True: 158, False: 0]
  ------------------
 1091|    158|             && ERR_GET_REASON(errcode) == BIO_R_NON_FATAL)
  ------------------
  |  |   44|    158|# define BIO_R_NON_FATAL                                  112
  ------------------
  |  Branch (1091:17): [True: 158, False: 0]
  ------------------
 1092|    158|        return 1;
 1093|      0|    else
 1094|      0|        return 0;
 1095|    158|}

BIO_meth_new:
   38|      1|{
   39|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|      1|    if (biom == NULL
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      1|            || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:16): [True: 0, False: 1]
  ------------------
   43|      0|        OPENSSL_free(biom);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|      1|    biom->type = type;
   47|      1|    return biom;
   48|      1|}
BIO_meth_free:
   51|      1|{
   52|      1|    if (biom != NULL) {
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        OPENSSL_free(biom->name);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|      1|        OPENSSL_free(biom);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      1|    }
   56|      1|}
BIO_meth_set_write_ex:
  101|      1|{
  102|      1|    biom->bwrite_old = NULL;
  103|      1|    biom->bwrite = bwrite;
  104|      1|    return 1;
  105|      1|}
BIO_meth_set_read_ex:
  149|      1|{
  150|      1|    biom->bread_old = NULL;
  151|      1|    biom->bread = bread;
  152|      1|    return 1;
  153|      1|}
BIO_meth_set_puts:
  164|      1|{
  165|      1|    biom->bputs = bputs;
  166|      1|    return 1;
  167|      1|}
BIO_meth_set_gets:
  178|      1|{
  179|      1|    biom->bgets = bgets;
  180|      1|    return 1;
  181|      1|}
BIO_meth_set_ctrl:
  192|      1|{
  193|      1|    biom->ctrl = ctrl;
  194|      1|    return 1;
  195|      1|}
BIO_meth_set_create:
  205|      1|{
  206|      1|    biom->create = create;
  207|      1|    return 1;
  208|      1|}
BIO_meth_set_destroy:
  218|      1|{
  219|      1|    biom->destroy = destroy;
  220|      1|    return 1;
  221|      1|}

BIO_snprintf:
  932|  1.38k|{
  933|  1.38k|    va_list args;
  934|  1.38k|    int ret;
  935|       |
  936|  1.38k|    va_start(args, format);
  937|       |
  938|  1.38k|    ret = BIO_vsnprintf(buf, n, format, args);
  939|       |
  940|  1.38k|    va_end(args);
  941|  1.38k|    return ret;
  942|  1.38k|}
BIO_vsnprintf:
  945|  2.64k|{
  946|  2.64k|    size_t retlen;
  947|  2.64k|    int truncated;
  948|       |
  949|  2.64k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (949:9): [True: 0, False: 2.64k]
  ------------------
  950|      0|        return -1;
  951|       |
  952|  2.64k|    if (truncated)
  ------------------
  |  Branch (952:9): [True: 0, False: 2.64k]
  ------------------
  953|       |        /*
  954|       |         * In case of truncation, return -1 like traditional snprintf.
  955|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  956|       |         * number of characters that would have been written, had the buffer
  957|       |         * been large enough.)
  958|       |         */
  959|      0|        return -1;
  960|  2.64k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (960:12): [True: 2.64k, False: 0]
  ------------------
  961|  2.64k|}
bio_print.c:_dopr:
   91|  2.64k|{
   92|  2.64k|    char ch;
   93|  2.64k|    int64_t value;
   94|  2.64k|#ifndef OPENSSL_SYS_UEFI
   95|  2.64k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  2.64k|# define LDOUBLE double
  ------------------
   96|  2.64k|#endif
   97|  2.64k|    char *strvalue;
   98|  2.64k|    int min;
   99|  2.64k|    int max;
  100|  2.64k|    int state;
  101|  2.64k|    int flags;
  102|  2.64k|    int cflags;
  103|  2.64k|    size_t currlen;
  104|       |
  105|  2.64k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  2.64k|#define DP_S_DEFAULT    0
  ------------------
  106|  2.64k|    flags = currlen = cflags = min = 0;
  107|  2.64k|    max = -1;
  108|  2.64k|    ch = *format++;
  109|       |
  110|  85.8k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  85.8k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 83.1k, False: 2.64k]
  ------------------
  111|  83.1k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 2.64k, False: 80.5k]
  |  Branch (111:28): [True: 80.5k, False: 0]
  |  Branch (111:46): [True: 0, False: 80.5k]
  ------------------
  112|  2.64k|            state = DP_S_DONE;
  ------------------
  |  |   52|  2.64k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  83.1k|        switch (state) {
  115|  48.3k|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  48.3k|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 48.3k, False: 34.8k]
  ------------------
  116|  48.3k|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 6.44k, False: 41.8k]
  ------------------
  117|  6.44k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  6.44k|#define DP_S_FLAGS      1
  ------------------
  118|  41.8k|            else
  119|  41.8k|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 41.8k]
  ------------------
  120|      0|                    return 0;
  121|  48.3k|            ch = *format++;
  122|  48.3k|            break;
  123|  6.44k|        case DP_S_FLAGS:
  ------------------
  |  |   46|  6.44k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 6.44k, False: 76.7k]
  ------------------
  124|  6.44k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 6.44k]
  ------------------
  126|      0|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|      0|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|      0|                ch = *format++;
  128|      0|                break;
  129|      0|            case '+':
  ------------------
  |  Branch (129:13): [True: 0, False: 6.44k]
  ------------------
  130|      0|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|      0|                ch = *format++;
  132|      0|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 6.44k]
  ------------------
  134|      0|                flags |= DP_F_SPACE;
  ------------------
  |  |   60|      0|#define DP_F_SPACE      (1 << 2)
  ------------------
  135|      0|                ch = *format++;
  136|      0|                break;
  137|      0|            case '#':
  ------------------
  |  Branch (137:13): [True: 0, False: 6.44k]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|      0|            case '0':
  ------------------
  |  Branch (141:13): [True: 0, False: 6.44k]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|  6.44k|            default:
  ------------------
  |  Branch (145:13): [True: 6.44k, False: 0]
  ------------------
  146|  6.44k|                state = DP_S_MIN;
  ------------------
  |  |   47|  6.44k|#define DP_S_MIN        2
  ------------------
  147|  6.44k|                break;
  148|  6.44k|            }
  149|  6.44k|            break;
  150|  6.44k|        case DP_S_MIN:
  ------------------
  |  |   47|  6.44k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 6.44k, False: 76.7k]
  ------------------
  151|  6.44k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 6.44k]
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|  6.44k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 6.44k]
  ------------------
  155|      0|                min = va_arg(args, int);
  156|      0|                ch = *format++;
  157|      0|                state = DP_S_DOT;
  ------------------
  |  |   48|      0|#define DP_S_DOT        3
  ------------------
  158|      0|            } else
  159|  6.44k|                state = DP_S_DOT;
  ------------------
  |  |   48|  6.44k|#define DP_S_DOT        3
  ------------------
  160|  6.44k|            break;
  161|  6.44k|        case DP_S_DOT:
  ------------------
  |  |   48|  6.44k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 6.44k, False: 76.7k]
  ------------------
  162|  6.44k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 6.44k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|  6.44k|                state = DP_S_MOD;
  ------------------
  |  |   50|  6.44k|#define DP_S_MOD        5
  ------------------
  167|  6.44k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 83.1k]
  ------------------
  169|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                if (max < 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    max = 0;
  172|      0|                max = 10 * max + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  173|      0|                ch = *format++;
  174|      0|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 0, False: 0]
  ------------------
  175|      0|                max = va_arg(args, int);
  176|      0|                ch = *format++;
  177|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  178|      0|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|      0|            break;
  181|  6.44k|        case DP_S_MOD:
  ------------------
  |  |   50|  6.44k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 6.44k, False: 76.7k]
  ------------------
  182|  6.44k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 6.44k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  1.38k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 1.38k, False: 5.06k]
  ------------------
  188|  1.38k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 1.38k]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|  1.38k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  1.38k|#define DP_C_LONG       2
  ------------------
  193|  1.38k|                ch = *format++;
  194|  1.38k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 6.44k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 6.44k]
  ------------------
  197|      0|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  198|      0|                ch = *format++;
  199|      0|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 6.44k]
  ------------------
  201|      0|                cflags = DP_C_LDOUBLE;
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  202|      0|                ch = *format++;
  203|      0|                break;
  204|      0|            case 'z':
  ------------------
  |  Branch (204:13): [True: 0, False: 6.44k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|  5.06k|            default:
  ------------------
  |  Branch (208:13): [True: 5.06k, False: 1.38k]
  ------------------
  209|  5.06k|                break;
  210|  6.44k|            }
  211|  6.44k|            state = DP_S_CONV;
  ------------------
  |  |   51|  6.44k|#define DP_S_CONV       6
  ------------------
  212|  6.44k|            break;
  213|  6.44k|        case DP_S_CONV:
  ------------------
  |  |   51|  6.44k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 6.44k, False: 76.7k]
  ------------------
  214|  6.44k|            switch (ch) {
  215|  1.26k|            case 'd':
  ------------------
  |  Branch (215:13): [True: 1.26k, False: 5.18k]
  ------------------
  216|  1.26k|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 6.44k]
  ------------------
  217|  1.26k|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 1.26k]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|      0|                case DP_C_LONG:
  ------------------
  |  |   72|      0|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 0, False: 1.26k]
  ------------------
  222|      0|                    value = va_arg(args, long int);
  223|      0|                    break;
  224|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 0, False: 1.26k]
  ------------------
  225|      0|                    value = va_arg(args, int64_t);
  226|      0|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 1.26k]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|  1.26k|                default:
  ------------------
  |  Branch (230:17): [True: 1.26k, False: 0]
  ------------------
  231|  1.26k|                    value = va_arg(args, int);
  232|  1.26k|                    break;
  233|  1.26k|                }
  234|  1.26k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 1.26k]
  ------------------
  235|  1.26k|                            max, flags))
  236|      0|                    return 0;
  237|  1.26k|                break;
  238|  1.26k|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 6.44k]
  ------------------
  239|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|      0|            case 'x':
  ------------------
  |  Branch (241:13): [True: 0, False: 6.44k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 6.44k]
  ------------------
  243|  1.38k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 1.38k, False: 5.06k]
  ------------------
  244|  1.38k|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  1.38k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  1.38k|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 1.38k]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|  1.38k|                case DP_C_LONG:
  ------------------
  |  |   72|  1.38k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 1.38k, False: 0]
  ------------------
  250|  1.38k|                    value = va_arg(args, unsigned long int);
  251|  1.38k|                    break;
  252|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 0, False: 1.38k]
  ------------------
  253|      0|                    value = va_arg(args, uint64_t);
  254|      0|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 1.38k]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|      0|                default:
  ------------------
  |  Branch (258:17): [True: 0, False: 1.38k]
  ------------------
  259|      0|                    value = va_arg(args, unsigned int);
  260|      0|                    break;
  261|  1.38k|                }
  262|  1.38k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 1.38k]
  ------------------
  263|  1.38k|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 1.38k]
  |  Branch (263:46): [True: 1.38k, False: 0]
  ------------------
  264|  1.38k|                            min, max, flags))
  265|      0|                    return 0;
  266|  1.38k|                break;
  267|  1.38k|#ifndef OPENSSL_SYS_UEFI
  268|  1.38k|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 6.44k]
  ------------------
  269|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (269:21): [True: 0, False: 0]
  ------------------
  270|      0|                    fvalue = va_arg(args, LDOUBLE);
  271|      0|                else
  272|      0|                    fvalue = va_arg(args, double);
  273|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (273:21): [True: 0, False: 0]
  ------------------
  274|      0|                           flags, F_FORMAT))
  ------------------
  |  |   78|      0|#define F_FORMAT        0
  ------------------
  275|      0|                    return 0;
  276|      0|                break;
  277|      0|            case 'E':
  ------------------
  |  Branch (277:13): [True: 0, False: 6.44k]
  ------------------
  278|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  279|       |                /* fall through */
  280|      0|            case 'e':
  ------------------
  |  Branch (280:13): [True: 0, False: 6.44k]
  ------------------
  281|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (281:21): [True: 0, False: 0]
  ------------------
  282|      0|                    fvalue = va_arg(args, LDOUBLE);
  283|      0|                else
  284|      0|                    fvalue = va_arg(args, double);
  285|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                           flags, E_FORMAT))
  ------------------
  |  |   79|      0|#define E_FORMAT        1
  ------------------
  287|      0|                    return 0;
  288|      0|                break;
  289|      0|            case 'G':
  ------------------
  |  Branch (289:13): [True: 0, False: 6.44k]
  ------------------
  290|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  291|       |                /* fall through */
  292|      0|            case 'g':
  ------------------
  |  Branch (292:13): [True: 0, False: 6.44k]
  ------------------
  293|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (293:21): [True: 0, False: 0]
  ------------------
  294|      0|                    fvalue = va_arg(args, LDOUBLE);
  295|      0|                else
  296|      0|                    fvalue = va_arg(args, double);
  297|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (297:21): [True: 0, False: 0]
  ------------------
  298|      0|                           flags, G_FORMAT))
  ------------------
  |  |   80|      0|#define G_FORMAT        2
  ------------------
  299|      0|                    return 0;
  300|      0|                break;
  301|       |#else
  302|       |            case 'f':
  303|       |            case 'E':
  304|       |            case 'e':
  305|       |            case 'G':
  306|       |            case 'g':
  307|       |                /* not implemented for UEFI */
  308|       |                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
  309|       |                return 0;
  310|       |#endif
  311|      0|            case 'c':
  ------------------
  |  Branch (311:13): [True: 0, False: 6.44k]
  ------------------
  312|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|      0|                break;
  316|  3.80k|            case 's':
  ------------------
  |  Branch (316:13): [True: 3.80k, False: 2.64k]
  ------------------
  317|  3.80k|                strvalue = va_arg(args, char *);
  318|  3.80k|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 3.80k, False: 0]
  ------------------
  319|  3.80k|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 3.80k]
  ------------------
  320|      0|                        max = INT_MAX;
  321|  3.80k|                    else
  322|  3.80k|                        max = *maxlen;
  323|  3.80k|                }
  324|  3.80k|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 3.80k]
  ------------------
  325|  3.80k|                            flags, min, max))
  326|      0|                    return 0;
  327|  3.80k|                break;
  328|  3.80k|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 6.44k]
  ------------------
  329|      0|                value = (size_t)va_arg(args, void *);
  330|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                            value, 16, min, max, flags | DP_F_NUM))
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  332|      0|                    return 0;
  333|      0|                break;
  334|      0|            case 'n':
  ------------------
  |  Branch (334:13): [True: 0, False: 6.44k]
  ------------------
  335|      0|                {
  336|      0|                    int *num;
  337|      0|                    num = va_arg(args, int *);
  338|      0|                    *num = currlen;
  339|      0|                }
  340|      0|                break;
  341|      0|            case '%':
  ------------------
  |  Branch (341:13): [True: 0, False: 6.44k]
  ------------------
  342|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                    return 0;
  344|      0|                break;
  345|      0|            case 'w':
  ------------------
  |  Branch (345:13): [True: 0, False: 6.44k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 6.44k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  6.44k|            }
  353|  6.44k|            ch = *format++;
  354|  6.44k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  6.44k|#define DP_S_DEFAULT    0
  ------------------
  355|  6.44k|            flags = cflags = min = 0;
  356|  6.44k|            max = -1;
  357|  6.44k|            break;
  358|  2.64k|        case DP_S_DONE:
  ------------------
  |  |   52|  2.64k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 2.64k, False: 80.5k]
  ------------------
  359|  2.64k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 83.1k]
  ------------------
  361|      0|            break;
  362|  83.1k|        }
  363|  83.1k|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  2.64k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 2.64k, False: 0]
  ------------------
  369|  2.64k|        *truncated = (currlen > *maxlen - 1);
  370|  2.64k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 2.64k]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  2.64k|    }
  373|  2.64k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 2.64k]
  ------------------
  374|      0|        return 0;
  375|  2.64k|    *retlen = currlen - 1;
  376|  2.64k|    return 1;
  377|  2.64k|}
bio_print.c:doapr_outch:
  840|   107k|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|   107k|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|   107k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 107k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|   107k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 107k]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|   107k|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|   107k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   107k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 107k]
  ------------------
  847|      0|        return 0;
  848|       |
  849|   107k|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 0, False: 107k]
  |  Branch (849:19): [True: 0, False: 0]
  ------------------
  850|      0|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  835|      0|#define BUFFER_INC  1024
  ------------------
  |  Branch (850:13): [True: 0, False: 0]
  ------------------
  851|      0|            return 0;
  852|       |
  853|      0|        *maxlen += BUFFER_INC;
  ------------------
  |  |  835|      0|#define BUFFER_INC  1024
  ------------------
  854|      0|        if (*buffer == NULL) {
  ------------------
  |  Branch (854:13): [True: 0, False: 0]
  ------------------
  855|      0|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (855:17): [True: 0, False: 0]
  ------------------
  856|      0|                return 0;
  857|      0|            if (*currlen > 0) {
  ------------------
  |  Branch (857:17): [True: 0, False: 0]
  ------------------
  858|      0|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (858:21): [True: 0, False: 0]
  ------------------
  859|      0|                    return 0;
  860|      0|                memcpy(*buffer, *sbuffer, *currlen);
  861|      0|            }
  862|      0|            *sbuffer = NULL;
  863|      0|        } else {
  864|      0|            char *tmpbuf;
  865|       |
  866|      0|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|                return 0;
  869|      0|            *buffer = tmpbuf;
  870|      0|        }
  871|      0|    }
  872|       |
  873|   107k|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 107k, False: 0]
  ------------------
  874|   107k|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 107k, False: 0]
  ------------------
  875|   107k|            (*sbuffer)[(*currlen)++] = (char)c;
  876|      0|        else
  877|      0|            (*buffer)[(*currlen)++] = (char)c;
  878|   107k|    }
  879|       |
  880|   107k|    return 1;
  881|   107k|}
bio_print.c:fmtint:
  436|  2.64k|{
  437|  2.64k|    int signvalue = 0;
  438|  2.64k|    const char *prefix = "";
  439|  2.64k|    uint64_t uvalue;
  440|  2.64k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  2.64k|    int place = 0;
  442|  2.64k|    int spadlen = 0;
  443|  2.64k|    int zpadlen = 0;
  444|  2.64k|    int caps = 0;
  445|       |
  446|  2.64k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 2.64k, False: 0]
  ------------------
  447|  2.64k|        max = 0;
  448|  2.64k|    uvalue = value;
  449|  2.64k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  2.64k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 1.26k, False: 1.38k]
  ------------------
  450|  1.26k|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 1.26k]
  ------------------
  451|      0|            signvalue = '-';
  452|      0|            uvalue = 0 - (uint64_t)value;
  453|  1.26k|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|  1.26k|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 1.26k]
  ------------------
  454|      0|            signvalue = '+';
  455|  1.26k|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|  1.26k|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 1.26k]
  ------------------
  456|      0|            signvalue = ' ';
  457|  1.26k|    }
  458|  2.64k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  2.64k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 2.64k]
  ------------------
  459|      0|        if (base == 8)
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  ------------------
  460|      0|            prefix = "0";
  461|      0|        if (base == 16)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            prefix = "0x";
  463|      0|    }
  464|  2.64k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  2.64k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 2.64k]
  ------------------
  465|      0|        caps = 1;
  466|  4.17k|    do {
  467|  4.17k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 4.17k]
  ------------------
  468|  4.17k|            [uvalue % (unsigned)base];
  469|  4.17k|        uvalue = (uvalue / (unsigned)base);
  470|  4.17k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 1.53k, False: 2.64k]
  |  Branch (470:24): [True: 1.53k, False: 0]
  ------------------
  471|  2.64k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 2.64k]
  ------------------
  472|      0|        place--;
  473|  2.64k|    convert[place] = 0;
  474|       |
  475|  2.64k|    zpadlen = max - place;
  476|  2.64k|    spadlen =
  477|  2.64k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  2.64k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 2.64k]
  ------------------
  478|  2.64k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 2.64k, False: 0]
  ------------------
  479|  2.64k|        zpadlen = 0;
  480|  2.64k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 2.64k, False: 0]
  ------------------
  481|  2.64k|        spadlen = 0;
  482|  2.64k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  2.64k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 0, False: 2.64k]
  ------------------
  483|      0|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|      0|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  484|      0|        spadlen = 0;
  485|      0|    }
  486|  2.64k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  2.64k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 2.64k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  2.64k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 2.64k]
  ------------------
  491|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            return 0;
  493|      0|        --spadlen;
  494|      0|    }
  495|       |
  496|       |    /* sign */
  497|  2.64k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 2.64k]
  ------------------
  498|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  2.64k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 2.64k]
  ------------------
  503|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            return 0;
  505|      0|        prefix++;
  506|      0|    }
  507|       |
  508|       |    /* zeros */
  509|  2.64k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 0, False: 2.64k]
  ------------------
  510|      0|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 0, False: 0]
  ------------------
  511|      0|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|      0|                return 0;
  513|      0|            --zpadlen;
  514|      0|        }
  515|      0|    }
  516|       |    /* digits */
  517|  6.82k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 4.17k, False: 2.64k]
  ------------------
  518|  4.17k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 4.17k]
  ------------------
  519|      0|            return 0;
  520|  4.17k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  2.64k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 2.64k]
  ------------------
  524|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            return 0;
  526|      0|        ++spadlen;
  527|      0|    }
  528|  2.64k|    return 1;
  529|  2.64k|}
bio_print.c:fmtstr:
  384|  3.80k|{
  385|  3.80k|    int padlen;
  386|  3.80k|    size_t strln;
  387|  3.80k|    int cnt = 0;
  388|       |
  389|  3.80k|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 3.80k]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|  3.80k|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 3.80k]
  ------------------
  393|       |
  394|  3.80k|    padlen = min - strln;
  395|  3.80k|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 3.80k]
  |  Branch (395:20): [True: 3.80k, False: 0]
  ------------------
  396|  3.80k|        padlen = 0;
  397|  3.80k|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 3.80k, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|  3.80k|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 3.80k, False: 0]
  ------------------
  403|  3.80k|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|  3.80k|    }
  407|  3.80k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  3.80k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 3.80k]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|  3.80k|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 3.80k]
  |  Branch (410:29): [True: 0, False: 0]
  |  Branch (410:40): [True: 0, False: 0]
  ------------------
  411|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            return 0;
  413|      0|        --padlen;
  414|      0|        ++cnt;
  415|      0|    }
  416|  62.6k|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 58.8k, False: 3.80k]
  |  Branch (416:26): [True: 0, False: 58.8k]
  |  Branch (416:37): [True: 58.8k, False: 0]
  ------------------
  417|  58.8k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 58.8k]
  ------------------
  418|      0|            return 0;
  419|  58.8k|        --strln;
  420|  58.8k|        ++cnt;
  421|  58.8k|    }
  422|  3.80k|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 3.80k]
  |  Branch (422:29): [True: 0, False: 0]
  |  Branch (422:40): [True: 0, False: 0]
  ------------------
  423|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            return 0;
  425|      0|        ++padlen;
  426|      0|        ++cnt;
  427|      0|    }
  428|  3.80k|    return 1;
  429|  3.80k|}

bio_sock_cleanup_int:
  203|      2|{
  204|       |# ifdef OPENSSL_SYS_WINDOWS
  205|       |    if (wsa_init_done) {
  206|       |        wsa_init_done = 0;
  207|       |        WSACleanup();
  208|       |    }
  209|       |# endif
  210|      2|}

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      4|{
   32|      4|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      4|}

BIO_s_dgram_mem:
  239|    158|{
  240|    158|    return &dgram_mem_method;
  241|    158|}
bss_dgram_pair.c:ring_buf_head_tail:
   63|    158|{
   64|    158|    size_t max_len = r->len - r->idx[idx];
   65|       |
   66|    158|    if (idx == 0 && max_len > r->len - r->count)
  ------------------
  |  Branch (66:9): [True: 0, False: 158]
  |  Branch (66:21): [True: 0, False: 0]
  ------------------
   67|      0|        max_len = r->len - r->count;
   68|    158|    if (idx == 1 && max_len > r->count)
  ------------------
  |  Branch (68:9): [True: 158, False: 0]
  |  Branch (68:21): [True: 158, False: 0]
  ------------------
   69|    158|        max_len = r->count;
   70|       |
   71|    158|    *buf = (uint8_t *)r->start + r->idx[idx];
   72|    158|    *len = max_len;
   73|    158|}
bss_dgram_pair.c:ring_buf_init:
   36|    158|{
   37|    158|    r->start = OPENSSL_malloc(nbytes);
  ------------------
  |  |  102|    158|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|    158|    if (r->start == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 158]
  ------------------
   39|      0|        return 0;
   40|       |
   41|    158|    r->len = nbytes;
   42|    158|    r->idx[0] = r->idx[1] = r->count = 0;
   43|    158|    return 1;
   44|    158|}
bss_dgram_pair.c:dgram_pair_read_actual:
  895|    158|{
  896|    158|    size_t l, trunc = 0, saved_idx, saved_count;
  897|    158|    struct bio_dgram_pair_st *b = bio->ptr, *readb;
  898|    158|    struct dgram_hdr hdr;
  899|       |
  900|    158|    if (!is_multi)
  ------------------
  |  Branch (900:9): [True: 0, False: 158]
  ------------------
  901|      0|        BIO_clear_retry_flags(bio);
  ------------------
  |  |  261|      0|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|      0|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|      0|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|      0|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  902|       |
  903|    158|    if (!bio->init)
  ------------------
  |  Branch (903:9): [True: 0, False: 158]
  ------------------
  904|      0|        return -BIO_R_UNINITIALIZED;
  ------------------
  |  |   62|      0|# define BIO_R_UNINITIALIZED                              120
  ------------------
  905|       |
  906|    158|    if (!ossl_assert(b != NULL))
  ------------------
  |  |   52|    158|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    158|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (906:9): [True: 0, False: 158]
  ------------------
  907|      0|        return -BIO_R_TRANSFER_ERROR;
  ------------------
  |  |   52|      0|# define BIO_R_TRANSFER_ERROR                             104
  ------------------
  908|       |
  909|    158|    if (is_dgram_pair(b))
  ------------------
  |  |  275|    158|#define is_dgram_pair(b) (b->peer != NULL)
  |  |  ------------------
  |  |  |  Branch (275:26): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  910|      0|        readb = b->peer->ptr;
  911|    158|    else
  912|    158|        readb = b;
  913|    158|    if (!ossl_assert(readb != NULL && readb->rbuf.start != NULL))
  ------------------
  |  |   52|    316|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 158, False: 0]
  |  |  |  Branch (52:43): [True: 158, False: 0]
  |  |  ------------------
  |  |   53|    158|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (913:9): [True: 0, False: 158]
  ------------------
  914|      0|        return -BIO_R_TRANSFER_ERROR;
  ------------------
  |  |   52|      0|# define BIO_R_TRANSFER_ERROR                             104
  ------------------
  915|       |
  916|    158|    if (sz > 0 && buf == NULL)
  ------------------
  |  Branch (916:9): [True: 158, False: 0]
  |  Branch (916:19): [True: 0, False: 158]
  ------------------
  917|      0|        return -BIO_R_INVALID_ARGUMENT;
  ------------------
  |  |   35|      0|# define BIO_R_INVALID_ARGUMENT                           125
  ------------------
  918|       |
  919|       |    /* If the caller wants to know the local address, it must be enabled */
  920|    158|    if (local != NULL && b->local_addr_enable == 0)
  ------------------
  |  Branch (920:9): [True: 0, False: 158]
  |  Branch (920:26): [True: 0, False: 0]
  ------------------
  921|      0|        return -BIO_R_LOCAL_ADDR_NOT_AVAILABLE;
  ------------------
  |  |   40|      0|# define BIO_R_LOCAL_ADDR_NOT_AVAILABLE                   111
  ------------------
  922|       |
  923|       |    /* Read the header. */
  924|    158|    saved_idx   = readb->rbuf.idx[1];
  925|    158|    saved_count = readb->rbuf.count;
  926|    158|    l = dgram_pair_read_inner(readb, (uint8_t *)&hdr, sizeof(hdr));
  927|    158|    if (l == 0) {
  ------------------
  |  Branch (927:9): [True: 158, False: 0]
  ------------------
  928|       |        /* Buffer was empty. */
  929|    158|        if (!is_multi)
  ------------------
  |  Branch (929:13): [True: 0, False: 158]
  ------------------
  930|      0|            BIO_set_retry_read(bio);
  ------------------
  |  |  255|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  931|    158|        return -BIO_R_NON_FATAL;
  ------------------
  |  |   44|    158|# define BIO_R_NON_FATAL                                  112
  ------------------
  932|    158|    }
  933|       |
  934|      0|    if (!ossl_assert(l == sizeof(hdr)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (934:9): [True: 0, False: 0]
  ------------------
  935|       |        /*
  936|       |         * This should not be possible as headers (and their following payloads)
  937|       |         * should always be written atomically.
  938|       |         */
  939|      0|        return -BIO_R_BROKEN_PIPE;
  ------------------
  |  |   28|      0|# define BIO_R_BROKEN_PIPE                                124
  ------------------
  940|       |
  941|      0|    if (sz > hdr.len) {
  ------------------
  |  Branch (941:9): [True: 0, False: 0]
  ------------------
  942|      0|        sz = hdr.len;
  943|      0|    } else if (sz < hdr.len) {
  ------------------
  |  Branch (943:16): [True: 0, False: 0]
  ------------------
  944|       |        /* Truncation is occurring. */
  945|      0|        trunc = hdr.len - sz;
  946|      0|        if (b->no_trunc) {
  ------------------
  |  Branch (946:13): [True: 0, False: 0]
  ------------------
  947|       |            /* Restore original state. */
  948|      0|            readb->rbuf.idx[1] = saved_idx;
  949|      0|            readb->rbuf.count  = saved_count;
  950|      0|            return -BIO_R_NON_FATAL;
  ------------------
  |  |   44|      0|# define BIO_R_NON_FATAL                                  112
  ------------------
  951|      0|        }
  952|      0|    }
  953|       |
  954|      0|    l = dgram_pair_read_inner(readb, (uint8_t *)buf, sz);
  955|      0|    if (!ossl_assert(l == sz))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|       |        /* We were somehow not able to read the entire datagram. */
  957|      0|        return -BIO_R_TRANSFER_ERROR;
  ------------------
  |  |   52|      0|# define BIO_R_TRANSFER_ERROR                             104
  ------------------
  958|       |
  959|       |    /*
  960|       |     * If the datagram was truncated due to an inadequate buffer, discard the
  961|       |     * remainder.
  962|       |     */
  963|      0|    if (trunc > 0 && !ossl_assert(dgram_pair_read_inner(readb, NULL, trunc) == trunc))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (963:9): [True: 0, False: 0]
  |  Branch (963:22): [True: 0, False: 0]
  ------------------
  964|       |        /* We were somehow not able to read/skip the entire datagram. */
  965|      0|        return -BIO_R_TRANSFER_ERROR;
  ------------------
  |  |   52|      0|# define BIO_R_TRANSFER_ERROR                             104
  ------------------
  966|       |
  967|      0|    if (local != NULL)
  ------------------
  |  Branch (967:9): [True: 0, False: 0]
  ------------------
  968|      0|        *local = hdr.dst_addr;
  969|      0|    if (peer != NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 0]
  ------------------
  970|      0|        *peer  = hdr.src_addr;
  971|       |
  972|      0|    return (ossl_ssize_t)l;
  973|      0|}
bss_dgram_pair.c:dgram_pair_read_inner:
  850|    158|{
  851|    158|    size_t total_read = 0;
  852|       |
  853|       |    /*
  854|       |     * We repeat pops from the ring buffer for as long as we have more
  855|       |     * application *buffer to fill until we fail. We may not be able to pop
  856|       |     * enough data to fill the buffer in one operation if the ring buffer wraps
  857|       |     * around, but there may still be more data available.
  858|       |     */
  859|    158|    while (sz > 0) {
  ------------------
  |  Branch (859:12): [True: 158, False: 0]
  ------------------
  860|    158|        uint8_t *src_buf = NULL;
  861|    158|        size_t src_len = 0;
  862|       |
  863|       |        /*
  864|       |         * There are two BIO instances, each with a ringbuf. We read from the
  865|       |         * peer ringbuf and write to our own ringbuf.
  866|       |         */
  867|    158|        ring_buf_tail(&b->rbuf, &src_buf, &src_len);
  ------------------
  |  |   76|    158|#define ring_buf_tail(r, buf, len) ring_buf_head_tail((r), 1, (buf), (len))
  ------------------
  868|    158|        if (src_len == 0)
  ------------------
  |  Branch (868:13): [True: 158, False: 0]
  ------------------
  869|    158|            break;
  870|       |
  871|      0|        if (src_len > sz)
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|            src_len = sz;
  873|       |
  874|      0|        if (buf != NULL)
  ------------------
  |  Branch (874:13): [True: 0, False: 0]
  ------------------
  875|      0|            memcpy(buf, src_buf, src_len);
  876|       |
  877|      0|        ring_buf_pop(&b->rbuf, src_len);
  ------------------
  |  |  113|      0|#define ring_buf_pop(r, num_bytes) ring_buf_push_pop((r), 1, (num_bytes))
  ------------------
  878|       |
  879|      0|        if (buf != NULL)
  ------------------
  |  Branch (879:13): [True: 0, False: 0]
  ------------------
  880|      0|            buf += src_len;
  881|      0|        total_read  += src_len;
  882|      0|        sz          -= src_len;
  883|      0|    }
  884|       |
  885|    158|    return total_read;
  886|    158|}
bss_dgram_pair.c:ring_buf_destroy:
   47|    158|{
   48|    158|    OPENSSL_free(r->start);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|    158|    r->start    = NULL;
   50|    158|    r->len      = 0;
   51|    158|    r->count    = 0;
   52|    158|}
bss_dgram_pair.c:dgram_pair_ctrl_destroy_bio_pair:
  403|    158|{
  404|    158|    BIO *bio2;
  405|    158|    struct bio_dgram_pair_st *b1 = bio1->ptr, *b2;
  406|       |
  407|    158|    ring_buf_destroy(&b1->rbuf);
  408|    158|    bio1->init = 0;
  409|       |
  410|    158|    BIO_ADDR_free(b1->local_addr);
  411|       |
  412|       |    /* Early return if we don't have a peer. */
  413|    158|    if (b1->peer == NULL)
  ------------------
  |  Branch (413:9): [True: 158, False: 0]
  ------------------
  414|    158|        return 1;
  415|       |
  416|      0|    bio2 = b1->peer;
  417|      0|    b2 = bio2->ptr;
  418|       |
  419|       |    /* Invariant. */
  420|      0|    if (!ossl_assert(b2->peer == bio1))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (420:9): [True: 0, False: 0]
  ------------------
  421|      0|        return 0;
  422|       |
  423|       |    /* Free buffers. */
  424|      0|    ring_buf_destroy(&b2->rbuf);
  425|       |
  426|      0|    bio2->init = 0;
  427|      0|    b1->peer = NULL;
  428|      0|    b2->peer = NULL;
  429|      0|    return 1;
  430|      0|}
bss_dgram_pair.c:dgram_mem_ctrl:
  653|    869|{
  654|    869|    long ret = 1;
  655|    869|    struct bio_dgram_pair_st *b = bio->ptr;
  656|       |
  657|    869|    if (!ossl_assert(b != NULL))
  ------------------
  |  |   52|    869|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    869|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (657:9): [True: 0, False: 869]
  ------------------
  658|      0|        return 0;
  659|       |
  660|    869|    switch (cmd) {
  661|       |    /*
  662|       |     * BIO_set_write_buf_size: Set the size of the ring buffer used for storing
  663|       |     * datagrams. No more writes can be performed once the buffer is filled up,
  664|       |     * until reads are performed. This cannot be used after a peer is connected.
  665|       |     */
  666|      0|    case BIO_C_SET_WRITE_BUF_SIZE: /* Non-threadsafe */
  ------------------
  |  |  469|      0|# define BIO_C_SET_WRITE_BUF_SIZE                136/* for BIO_s_bio */
  ------------------
  |  Branch (666:5): [True: 0, False: 869]
  ------------------
  667|      0|        ret = (long)dgram_pair_ctrl_set_write_buf_size(bio, (size_t)num);
  668|      0|        break;
  669|       |
  670|       |    /*
  671|       |     * BIO_get_write_buf_size: Get ring buffer size.
  672|       |     */
  673|      0|    case BIO_C_GET_WRITE_BUF_SIZE: /* Non-threadsafe */
  ------------------
  |  |  470|      0|# define BIO_C_GET_WRITE_BUF_SIZE                137
  ------------------
  |  Branch (673:5): [True: 0, False: 869]
  ------------------
  674|      0|        ret = (long)b->req_buf_len;
  675|      0|        break;
  676|       |
  677|       |    /*
  678|       |     * BIO_reset: Clear all data which was written to this side of the pair.
  679|       |     */
  680|      0|    case BIO_CTRL_RESET: /* Non-threadsafe */
  ------------------
  |  |   88|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (680:5): [True: 0, False: 869]
  ------------------
  681|      0|        dgram_pair_ctrl_reset(bio);
  682|      0|        break;
  683|       |
  684|       |    /*
  685|       |     * BIO_get_write_guarantee: Any BIO_write providing a buffer less than or
  686|       |     * equal to this value is guaranteed to succeed.
  687|       |     */
  688|      0|    case BIO_C_GET_WRITE_GUARANTEE: /* Threadsafe */
  ------------------
  |  |  473|      0|# define BIO_C_GET_WRITE_GUARANTEE               140
  ------------------
  |  Branch (688:5): [True: 0, False: 869]
  ------------------
  689|      0|        ret = (long)dgram_pair_ctrl_get_write_guarantee(bio);
  690|      0|        break;
  691|       |
  692|       |    /* BIO_pending: Bytes available to read. */
  693|      0|    case BIO_CTRL_PENDING: /* Threadsafe */
  ------------------
  |  |   97|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (693:5): [True: 0, False: 869]
  ------------------
  694|      0|        ret = (long)dgram_pair_ctrl_pending(bio);
  695|      0|        break;
  696|       |
  697|       |    /* BIO_flush: No-op. */
  698|      0|    case BIO_CTRL_FLUSH: /* Threadsafe */
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (698:5): [True: 0, False: 869]
  ------------------
  699|      0|        break;
  700|       |
  701|       |    /* BIO_dgram_get_no_trunc */
  702|      0|    case BIO_CTRL_DGRAM_GET_NO_TRUNC: /* Non-threadsafe */
  ------------------
  |  |  185|      0|# define BIO_CTRL_DGRAM_GET_NO_TRUNC            88
  ------------------
  |  Branch (702:5): [True: 0, False: 869]
  ------------------
  703|      0|        ret = (long)b->no_trunc;
  704|      0|        break;
  705|       |
  706|       |    /* BIO_dgram_set_no_trunc */
  707|      0|    case BIO_CTRL_DGRAM_SET_NO_TRUNC: /* Non-threadsafe */
  ------------------
  |  |  186|      0|# define BIO_CTRL_DGRAM_SET_NO_TRUNC            89
  ------------------
  |  Branch (707:5): [True: 0, False: 869]
  ------------------
  708|      0|        b->no_trunc = (num > 0);
  709|      0|        break;
  710|       |
  711|       |    /* BIO_dgram_get_local_addr_enable */
  712|      0|    case BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE: /* Non-threadsafe */
  ------------------
  |  |  180|      0|# define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE   83
  ------------------
  |  Branch (712:5): [True: 0, False: 869]
  ------------------
  713|      0|        *(int *)ptr = (int)dgram_pair_ctrl_get_local_addr_enable(bio);
  714|      0|        break;
  715|       |
  716|       |    /* BIO_dgram_set_local_addr_enable */
  717|      0|    case BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE: /* Non-threadsafe */
  ------------------
  |  |  181|      0|# define BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE   84
  ------------------
  |  Branch (717:5): [True: 0, False: 869]
  ------------------
  718|      0|        ret = (long)dgram_pair_ctrl_set_local_addr_enable(bio, num);
  719|      0|        break;
  720|       |
  721|       |    /* BIO_dgram_get_local_addr_cap: Can local addresses be supported? */
  722|      0|    case BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP: /* Non-threadsafe */
  ------------------
  |  |  179|      0|# define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP      82
  ------------------
  |  Branch (722:5): [True: 0, False: 869]
  ------------------
  723|      0|        ret = (long)dgram_pair_ctrl_get_local_addr_cap(bio);
  724|      0|        break;
  725|       |
  726|       |    /* BIO_dgram_get_effective_caps */
  727|    237|    case BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS: /* Non-threadsafe */
  ------------------
  |  |  182|    237|# define BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS      85
  ------------------
  |  Branch (727:5): [True: 237, False: 632]
  ------------------
  728|       |    /* BIO_dgram_get_caps */
  729|    237|    case BIO_CTRL_DGRAM_GET_CAPS: /* Non-threadsafe */
  ------------------
  |  |  183|    237|# define BIO_CTRL_DGRAM_GET_CAPS                86
  ------------------
  |  Branch (729:5): [True: 0, False: 869]
  ------------------
  730|    237|        ret = (long)dgram_pair_ctrl_get_caps(bio);
  731|    237|        break;
  732|       |
  733|       |    /* BIO_dgram_set_caps */
  734|     79|    case BIO_CTRL_DGRAM_SET_CAPS: /* Non-threadsafe */
  ------------------
  |  |  184|     79|# define BIO_CTRL_DGRAM_SET_CAPS                87
  ------------------
  |  Branch (734:5): [True: 79, False: 790]
  ------------------
  735|     79|        ret = (long)dgram_pair_ctrl_set_caps(bio, (uint32_t)num);
  736|     79|        break;
  737|       |
  738|       |    /* BIO_dgram_get_mtu */
  739|     79|    case BIO_CTRL_DGRAM_GET_MTU: /* Non-threadsafe */
  ------------------
  |  |  125|     79|# define BIO_CTRL_DGRAM_GET_MTU            41/* get cached value for MTU */
  ------------------
  |  Branch (739:5): [True: 79, False: 790]
  ------------------
  740|     79|        ret = (long)dgram_pair_ctrl_get_mtu(bio);
  741|     79|        break;
  742|       |
  743|       |    /* BIO_dgram_set_mtu */
  744|      0|    case BIO_CTRL_DGRAM_SET_MTU: /* Non-threadsafe */
  ------------------
  |  |  126|      0|# define BIO_CTRL_DGRAM_SET_MTU            42/* set cached value for MTU.
  ------------------
  |  Branch (744:5): [True: 0, False: 869]
  ------------------
  745|      0|        ret = (long)dgram_pair_ctrl_set_mtu(bio, (uint32_t)num);
  746|      0|        break;
  747|       |
  748|      0|    case BIO_CTRL_DGRAM_SET0_LOCAL_ADDR:
  ------------------
  |  |  196|      0|# define BIO_CTRL_DGRAM_SET0_LOCAL_ADDR         94
  ------------------
  |  Branch (748:5): [True: 0, False: 869]
  ------------------
  749|      0|        ret = (long)dgram_pair_ctrl_set0_local_addr(bio, (BIO_ADDR *)ptr);
  750|      0|        break;
  751|       |
  752|       |    /*
  753|       |     * BIO_eof: Returns whether this half of the BIO pair is empty of data to
  754|       |     * read.
  755|       |     */
  756|      0|    case BIO_CTRL_EOF: /* Non-threadsafe */
  ------------------
  |  |   89|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (756:5): [True: 0, False: 869]
  ------------------
  757|      0|        ret = (long)dgram_pair_ctrl_eof(bio);
  758|      0|        break;
  759|       |
  760|    474|    default:
  ------------------
  |  Branch (760:5): [True: 474, False: 395]
  ------------------
  761|    474|        ret = 0;
  762|    474|        break;
  763|    869|    }
  764|       |
  765|    869|    return ret;
  766|    869|}
bss_dgram_pair.c:dgram_pair_ctrl_get_caps:
  583|    237|{
  584|    237|    struct bio_dgram_pair_st *b = bio->ptr;
  585|       |
  586|    237|    return b->cap;
  587|    237|}
bss_dgram_pair.c:dgram_pair_ctrl_set_caps:
  591|     79|{
  592|     79|    struct bio_dgram_pair_st *b = bio->ptr;
  593|       |
  594|     79|    b->cap = caps;
  595|     79|    return 1;
  596|     79|}
bss_dgram_pair.c:dgram_pair_ctrl_get_mtu:
  620|     79|{
  621|     79|    struct bio_dgram_pair_st *b = bio->ptr;
  622|       |
  623|     79|    return b->mtu;
  624|     79|}
bss_dgram_pair.c:dgram_pair_init:
  278|    158|{
  279|    158|    struct bio_dgram_pair_st *b = OPENSSL_zalloc(sizeof(*b));
  ------------------
  |  |  104|    158|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|       |
  281|    158|    if (b == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 158]
  ------------------
  282|      0|        return 0;
  283|       |
  284|    158|    b->mtu         = 1472;    /* conservative default MTU */
  285|       |    /* default buffer size */
  286|    158|    b->req_buf_len = 9 * (sizeof(struct dgram_hdr) + b->mtu);
  287|       |
  288|    158|    b->lock = CRYPTO_THREAD_lock_new();
  289|    158|    if (b->lock == NULL) {
  ------------------
  |  Branch (289:9): [True: 0, False: 158]
  ------------------
  290|      0|        OPENSSL_free(b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|      0|        return 0;
  292|      0|    }
  293|       |
  294|    158|    bio->ptr = b;
  295|    158|    return 1;
  296|    158|}
bss_dgram_pair.c:dgram_pair_free:
  319|    158|{
  320|    158|    struct bio_dgram_pair_st *b;
  321|       |
  322|    158|    if (bio == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 158]
  ------------------
  323|      0|        return 0;
  324|       |
  325|    158|    b = bio->ptr;
  326|    158|    if (!ossl_assert(b != NULL))
  ------------------
  |  |   52|    158|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    158|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (326:9): [True: 0, False: 158]
  ------------------
  327|      0|        return 0;
  328|       |
  329|       |    /* We are being freed. Disconnect any peer and destroy buffers. */
  330|    158|    dgram_pair_ctrl_destroy_bio_pair(bio);
  331|       |
  332|    158|    CRYPTO_THREAD_lock_free(b->lock);
  333|    158|    OPENSSL_free(b);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  334|    158|    return 1;
  335|    158|}
bss_dgram_pair.c:dgram_pair_recvmmsg:
 1055|    158|{
 1056|    158|    int ret;
 1057|    158|    ossl_ssize_t l;
  ------------------
  |  |  204|    158|#  define ossl_ssize_t ssize_t
  ------------------
 1058|    158|    BIO_MSG *m;
 1059|    158|    size_t i;
 1060|    158|    struct bio_dgram_pair_st *b = bio->ptr, *readb;
 1061|       |
 1062|    158|    if (num_msg == 0) {
  ------------------
  |  Branch (1062:9): [True: 0, False: 158]
  ------------------
 1063|      0|        *num_processed = 0;
 1064|      0|        return 1;
 1065|      0|    }
 1066|       |
 1067|    158|    if (!bio->init) {
  ------------------
  |  Branch (1067:9): [True: 0, False: 158]
  ------------------
 1068|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_BROKEN_PIPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1069|      0|        *num_processed = 0;
 1070|      0|        return 0;
 1071|      0|    }
 1072|       |
 1073|    158|    if (is_dgram_pair(b))
  ------------------
  |  |  275|    158|#define is_dgram_pair(b) (b->peer != NULL)
  |  |  ------------------
  |  |  |  Branch (275:26): [True: 0, False: 158]
  |  |  ------------------
  ------------------
 1074|      0|        readb = b->peer->ptr;
 1075|    158|    else
 1076|    158|        readb = b;
 1077|       |
 1078|    158|    if (CRYPTO_THREAD_write_lock(readb->lock) == 0) {
  ------------------
  |  Branch (1078:9): [True: 0, False: 158]
  ------------------
 1079|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1080|      0|        *num_processed = 0;
 1081|      0|        return 0;
 1082|      0|    }
 1083|       |
 1084|    158|    for (i = 0; i < num_msg; ++i) {
  ------------------
  |  Branch (1084:17): [True: 158, False: 0]
  ------------------
 1085|    158|        m = &BIO_MSG_N(msg, i);
  ------------------
  |  |  197|    158|#define BIO_MSG_N(array, n) (*(BIO_MSG *)((char *)(array) + (n)*stride))
  ------------------
 1086|    158|        l = dgram_pair_read_actual(bio, m->data, m->data_len,
 1087|    158|                                   m->local, m->peer, 1);
 1088|    158|        if (l < 0) {
  ------------------
  |  Branch (1088:13): [True: 158, False: 0]
  ------------------
 1089|    158|            *num_processed = i;
 1090|    158|            if (i > 0) {
  ------------------
  |  Branch (1090:17): [True: 0, False: 158]
  ------------------
 1091|      0|                ret = 1;
 1092|    158|            } else {
 1093|    158|                ERR_raise(ERR_LIB_BIO, -l);
  ------------------
  |  |  401|    158|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    158|    (ERR_new(),                                                 \
  |  |  |  |  404|    158|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    158|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    158|     ERR_set_error)
  |  |  ------------------
  ------------------
 1094|    158|                ret = 0;
 1095|    158|            }
 1096|    158|            goto out;
 1097|    158|        }
 1098|       |
 1099|      0|        m->data_len = l;
 1100|      0|        m->flags    = 0;
 1101|      0|    }
 1102|       |
 1103|      0|    *num_processed = i;
 1104|      0|    ret = 1;
 1105|    158|out:
 1106|    158|    CRYPTO_THREAD_unlock(readb->lock);
 1107|    158|    return ret;
 1108|      0|}
bss_dgram_pair.c:dgram_mem_init:
  299|    158|{
  300|    158|    struct bio_dgram_pair_st *b;
  301|       |
  302|    158|    if (!dgram_pair_init(bio))
  ------------------
  |  Branch (302:9): [True: 0, False: 158]
  ------------------
  303|      0|        return 0;
  304|       |
  305|    158|    b = bio->ptr;
  306|       |
  307|    158|    if (ring_buf_init(&b->rbuf, b->req_buf_len) == 0) {
  ------------------
  |  Branch (307:9): [True: 0, False: 158]
  ------------------
  308|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_BIO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  309|      0|        return 0;
  310|      0|    }
  311|       |
  312|    158|    b->grows_on_write = 1;
  313|       |
  314|    158|    bio->init = 1;
  315|    158|    return 1;
  316|    158|}

BIO_new_file:
   58|      2|{
   59|      2|    BIO  *ret;
   60|      2|    FILE *file = openssl_fopen(filename, mode);
   61|      2|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   83|      2|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|      2|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 2]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  218|      0|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|      2|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      2|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      2|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
   68|      2|                       "calling fopen(%s, %s)",
   69|      2|                       filename, mode);
   70|      2|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 2, False: 0]
  ------------------
   71|      2|#ifdef ENXIO
   72|      2|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 0]
  ------------------
   73|      2|#endif
   74|      2|            )
   75|      2|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|        else
   77|      2|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|      2|        return NULL;
   79|      2|    }
   80|      0|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|        fclose(file);
   82|      0|        return NULL;
   83|      0|    }
   84|       |
   85|       |    /* we did fopen -> we disengage UPLINK */
   86|      0|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   87|      0|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  565|      0|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  437|      0|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   88|      0|    return ret;
   89|      0|}

ossl_err_load_BN_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(BN_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

BN_free:
  227|  3.36k|{
  228|  3.36k|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 3.36k, False: 0]
  ------------------
  229|  3.36k|        return;
  230|      0|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|      0|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        bn_free_d(a, 0);
  232|      0|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|      0|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (232:9): [True: 0, False: 0]
  ------------------
  233|      0|        OPENSSL_free(a);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|      0|}

ossl_bsearch:
   16|  4.88k|{
   17|  4.88k|    const char *base_ = base;
   18|  4.88k|    int l, h, i = 0, c = 0;
   19|  4.88k|    const char *p = NULL;
   20|       |
   21|  4.88k|    if (num == 0)
  ------------------
  |  Branch (21:9): [True: 0, False: 4.88k]
  ------------------
   22|      0|        return NULL;
   23|  4.88k|    l = 0;
   24|  4.88k|    h = num;
   25|  46.5k|    while (l < h) {
  ------------------
  |  Branch (25:12): [True: 44.3k, False: 2.14k]
  ------------------
   26|  44.3k|        i = (l + h) / 2;
   27|  44.3k|        p = &(base_[i * size]);
   28|  44.3k|        c = (*cmp) (key, p);
   29|  44.3k|        if (c < 0)
  ------------------
  |  Branch (29:13): [True: 26.7k, False: 17.5k]
  ------------------
   30|  26.7k|            h = i;
   31|  17.5k|        else if (c > 0)
  ------------------
  |  Branch (31:18): [True: 14.8k, False: 2.73k]
  ------------------
   32|  14.8k|            l = i + 1;
   33|  2.73k|        else
   34|  2.73k|            break;
   35|  44.3k|    }
   36|  4.88k|    if (c != 0 && !(flags & OSSL_BSEARCH_VALUE_ON_NOMATCH))
  ------------------
  |  |  152|  2.14k|# define OSSL_BSEARCH_VALUE_ON_NOMATCH            0x01
  ------------------
  |  Branch (36:9): [True: 2.14k, False: 2.73k]
  |  Branch (36:19): [True: 2.14k, False: 0]
  ------------------
   37|  2.14k|        p = NULL;
   38|  2.73k|    else if (c == 0 && (flags & OSSL_BSEARCH_FIRST_VALUE_ON_MATCH)) {
  ------------------
  |  |  153|  2.73k|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  |  Branch (38:14): [True: 2.73k, False: 0]
  |  Branch (38:24): [True: 0, False: 2.73k]
  ------------------
   39|      0|        while (i > 0 && (*cmp) (key, &(base_[(i - 1) * size])) == 0)
  ------------------
  |  Branch (39:16): [True: 0, False: 0]
  |  Branch (39:25): [True: 0, False: 0]
  ------------------
   40|      0|            i--;
   41|      0|        p = &(base_[i * size]);
   42|      0|    }
   43|  4.88k|    return p;
   44|  4.88k|}

ossl_err_load_BUF_strings:
   24|      2|{
   25|      2|#ifndef OPENSSL_NO_ERR
   26|      2|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  ------------------
   27|      2|        ERR_load_strings_const(BUF_str_reasons);
   28|      2|#endif
   29|      2|    return 1;
   30|      2|}

ossl_err_load_CMP_strings:
  199|      2|{
  200|      2|# ifndef OPENSSL_NO_ERR
  201|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (201:9): [True: 2, False: 0]
  ------------------
  202|      2|        ERR_load_strings_const(CMP_str_reasons);
  203|      2|# endif
  204|      2|    return 1;
  205|      2|}

OSSL_CMP_log_close:
   41|      2|{
   42|      2|    (void)OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, NULL);
  ------------------
  |  |   53|      2|# define OSSL_TRACE_CATEGORY_CMP                13
  ------------------
   43|      2|}

ossl_err_load_CMS_strings:
  175|      2|{
  176|      2|# ifndef OPENSSL_NO_ERR
  177|      2|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (177:9): [True: 2, False: 0]
  ------------------
  178|      2|        ERR_load_strings_const(CMS_str_reasons);
  179|      2|# endif
  180|      2|    return 1;
  181|      2|}

ossl_comp_brotli_cleanup:
  353|      2|{
  354|       |#ifdef BROTLI_SHARED
  355|       |    DSO_free(brotli_encode_dso);
  356|       |    brotli_encode_dso = NULL;
  357|       |    DSO_free(brotli_decode_dso);
  358|       |    brotli_decode_dso = NULL;
  359|       |    p_encode_init = NULL;
  360|       |    p_encode_stream = NULL;
  361|       |    p_encode_has_more = NULL;
  362|       |    p_encode_end = NULL;
  363|       |    p_encode_oneshot = NULL;
  364|       |    p_decode_init = NULL;
  365|       |    p_decode_stream = NULL;
  366|       |    p_decode_has_more = NULL;
  367|       |    p_decode_end = NULL;
  368|       |    p_decode_error = NULL;
  369|       |    p_decode_error_string = NULL;
  370|       |    p_decode_is_finished = NULL;
  371|       |    p_decode_oneshot = NULL;
  372|       |#endif
  373|      2|}

COMP_zlib:
  311|      4|{
  312|      4|    COMP_METHOD *meth = NULL;
  313|       |
  314|       |#ifndef OPENSSL_NO_ZLIB
  315|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  316|       |        meth = &zlib_stateful_method;
  317|       |#endif
  318|       |
  319|      4|    return meth;
  320|      4|}
ossl_comp_zlib_cleanup:
  336|      2|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      2|}

ossl_comp_zstd_cleanup:
  428|      2|{
  429|       |#ifdef ZSTD_SHARED
  430|       |    DSO_free(zstd_dso);
  431|       |    zstd_dso = NULL;
  432|       |    p_createCStream = NULL;
  433|       |    p_initCStream = NULL;
  434|       |    p_freeCStream = NULL;
  435|       |    p_compressStream2 = NULL;
  436|       |    p_flushStream = NULL;
  437|       |    p_endStream = NULL;
  438|       |    p_compress = NULL;
  439|       |    p_createDStream = NULL;
  440|       |    p_initDStream = NULL;
  441|       |    p_freeDStream = NULL;
  442|       |    p_decompressStream = NULL;
  443|       |    p_decompress = NULL;
  444|       |    p_isError = NULL;
  445|       |    p_getErrorName = NULL;
  446|       |    p_DStreamInSize = NULL;
  447|       |    p_CStreamInSize = NULL;
  448|       |#endif
  449|      2|}

ossl_err_load_COMP_strings:
   45|      2|{
   46|      2|# ifndef OPENSSL_NO_ERR
   47|      2|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (47:9): [True: 2, False: 0]
  ------------------
   48|      2|        ERR_load_strings_const(COMP_str_reasons);
   49|      2|# endif
   50|      2|    return 1;
   51|      2|}

COMP_get_type:
   41|      4|{
   42|      4|    if (meth == NULL)
  ------------------
  |  Branch (42:9): [True: 4, False: 0]
  ------------------
   43|      4|        return NID_undef;
  ------------------
  |  |   18|      4|#define NID_undef                       0
  ------------------
   44|      0|    return meth->type;
   45|      4|}

ossl_load_builtin_compressions:
   29|      4|{
   30|      4|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   31|      4|# define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      4|#ifndef OPENSSL_NO_COMP
   32|      4|    SSL_COMP *comp = NULL;
   33|      4|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      4|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   69|      4|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|      4|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|      8|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 4]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        if (comp != NULL) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            comp->method = method;
   41|      0|            comp->id = SSL_COMP_ZLIB_IDX;
  ------------------
  |  |   18|      0|#define SSL_COMP_ZLIB_IDX       1
  ------------------
   42|      0|            comp->name = COMP_get_name(method);
   43|      0|            if (!sk_SSL_COMP_push(comp_methods, comp))
  ------------------
  |  |   77|      0|#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                OPENSSL_free(comp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|        }
   46|      0|    }
   47|      4|#endif
   48|      4|    return comp_methods;
   49|      4|}
ossl_free_compression_methods_int:
   57|      2|{
   58|      2|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   81|      2|#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
  ------------------
   59|      2|}

_CONF_free_data:
  137|      2|{
  138|      2|    if (conf == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 2]
  ------------------
  139|      0|        return;
  140|       |
  141|      2|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|      2|    if (conf->data == NULL)
  ------------------
  |  Branch (142:9): [True: 2, False: 0]
  ------------------
  143|      2|        return;
  144|       |
  145|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  146|      0|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  ------------------
  |  |   83|      0|#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  ------------------
  147|      0|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  148|       |
  149|       |    /*
  150|       |     * We now have only 'section' entries in the hash table. Due to problems
  151|       |     * with
  152|       |     */
  153|       |
  154|      0|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  ------------------
  |  |   84|      0|#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  ------------------
  155|      0|    lh_CONF_VALUE_free(conf->data);
  ------------------
  |  |   72|      0|#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  156|      0|}

NCONF_default:
   87|      2|{
   88|      2|    return &default_method;
   89|      2|}
conf_def.c:def_create:
  112|      2|{
  113|      2|    CONF *ret;
  114|       |
  115|      2|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|      2|    if (ret != NULL)
  ------------------
  |  Branch (116:9): [True: 2, False: 0]
  ------------------
  117|      2|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (117:13): [True: 0, False: 2]
  ------------------
  118|      0|            OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|      0|            ret = NULL;
  120|      0|        }
  121|      2|    return ret;
  122|      2|}
conf_def.c:def_init_default:
  125|      2|{
  126|      2|    if (conf == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 2]
  ------------------
  127|      0|        return 0;
  128|       |
  129|      2|    memset(conf, 0, sizeof(*conf));
  130|      2|    conf->meth = &default_method;
  131|      2|    conf->meth_data = (void *)CONF_type_default;
  132|       |
  133|      2|    return 1;
  134|      2|}
conf_def.c:def_destroy:
  151|      2|{
  152|      2|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (152:9): [True: 2, False: 0]
  ------------------
  153|      2|        OPENSSL_free(conf);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      2|        return 1;
  155|      2|    }
  156|      0|    return 0;
  157|      2|}
conf_def.c:def_destroy_data:
  160|      2|{
  161|      2|    if (conf == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        return 0;
  163|      2|    _CONF_free_data(conf);
  164|      2|    return 1;
  165|      2|}
conf_def.c:def_load:
  168|      2|{
  169|      2|    int ret;
  170|      2|    BIO *in = NULL;
  171|       |
  172|       |#ifdef OPENSSL_SYS_VMS
  173|       |    in = BIO_new_file(name, "r");
  174|       |#else
  175|      2|    in = BIO_new_file(name, "rb");
  176|      2|#endif
  177|      2|    if (in == NULL) {
  ------------------
  |  Branch (177:9): [True: 2, False: 0]
  ------------------
  178|      2|        if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
  ------------------
  |  |   48|      2|# define BIO_R_NO_SUCH_FILE                               128
  ------------------
  |  Branch (178:13): [True: 2, False: 0]
  ------------------
  179|      2|            ERR_raise(ERR_LIB_CONF, CONF_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        else
  181|      2|            ERR_raise(ERR_LIB_CONF, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|      2|        return 0;
  183|      2|    }
  184|       |
  185|      0|    ret = def_load_bio(conf, in, line);
  186|      0|    BIO_free(in);
  187|       |
  188|      0|    return ret;
  189|      2|}

ossl_err_load_CONF_strings:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(CONF_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      2|}

NCONF_new_ex:
  183|      2|{
  184|      2|    CONF *ret;
  185|       |
  186|      2|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 2, False: 0]
  ------------------
  187|      2|        meth = NCONF_default();
  188|       |
  189|      2|    ret = meth->create(meth);
  190|      2|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 2]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|      2|    ret->libctx = libctx;
  195|       |
  196|      2|    return ret;
  197|      2|}
NCONF_free:
  205|      2|{
  206|      2|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|      0|        return;
  208|      2|    conf->meth->destroy(conf);
  209|      2|}
NCONF_load:
  252|      2|{
  253|      2|    if (conf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 2]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|       |
  258|      2|    return conf->meth->load(conf, file, eline);
  259|      2|}

CONF_modules_load_file_ex:
  193|      2|{
  194|      2|    char *file = NULL;
  195|      2|    CONF *conf = NULL;
  196|      2|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  197|       |
  198|      2|    ERR_set_mark();
  199|       |
  200|      2|    if (filename == NULL) {
  ------------------
  |  Branch (200:9): [True: 2, False: 0]
  ------------------
  201|      2|        file = CONF_get1_default_config_file();
  202|      2|        if (file == NULL)
  ------------------
  |  Branch (202:13): [True: 0, False: 2]
  ------------------
  203|      0|            goto err;
  204|      2|        if (*file == '\0') {
  ------------------
  |  Branch (204:13): [True: 0, False: 2]
  ------------------
  205|       |            /* Do not try to load an empty file name but do not error out */
  206|      0|            ret = 1;
  207|      0|            goto err;
  208|      0|        }
  209|      2|    } else {
  210|      0|        file = (char *)filename;
  211|      0|    }
  212|       |
  213|      2|    conf = NCONF_new_ex(libctx, NULL);
  214|      2|    if (conf == NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 2]
  ------------------
  215|      0|        goto err;
  216|       |
  217|      2|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (217:9): [True: 2, False: 0]
  ------------------
  218|      2|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
  ------------------
  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
  |  Branch (218:13): [True: 2, False: 0]
  ------------------
  219|      2|            (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   36|      2|# define CONF_R_NO_SUCH_FILE                              114
  ------------------
  |  Branch (219:13): [True: 2, False: 0]
  ------------------
  220|      2|            ret = 1;
  221|      2|        }
  222|      2|        goto err;
  223|      2|    }
  224|       |
  225|      0|    ret = CONF_modules_load(conf, appname, flags);
  226|       |    /* CONF_modules_load() might change the diagnostics setting, reread it. */
  227|      0|    diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  228|       |
  229|      2| err:
  230|      2|    if (filename == NULL)
  ------------------
  |  Branch (230:9): [True: 2, False: 0]
  ------------------
  231|      2|        OPENSSL_free(file);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      2|    NCONF_free(conf);
  233|       |
  234|      2|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  |  Branch (234:59): [True: 2, False: 0]
  ------------------
  235|      2|        ret = 1;
  236|       |
  237|      2|    if (ret > 0)
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ERR_pop_to_mark();
  239|      0|    else
  240|      0|        ERR_clear_last_mark();
  241|       |
  242|      2|    return ret;
  243|      0|}
CONF_modules_unload:
  517|      2|{
  518|      2|    int i;
  519|      2|    CONF_MODULE *md;
  520|      2|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      2|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      2|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 2]
  ------------------
  525|      0|        return;
  526|       |
  527|      2|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      2|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      2|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      2|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 2]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      2|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      2|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 2]
  ------------------
  541|      0|        md = sk_CONF_MODULE_value(new_modules, i);
  542|       |        /* If static or in use and 'all' not set ignore it */
  543|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (543:14): [True: 0, False: 0]
  |  Branch (543:33): [True: 0, False: 0]
  |  Branch (543:46): [True: 0, False: 0]
  ------------------
  544|      0|            continue;
  545|       |        /* Since we're working in reverse this is OK */
  546|      0|        (void)sk_CONF_MODULE_delete(new_modules, i);
  547|      0|        sk_CONF_MODULE_push(to_delete, md);
  548|      0|    }
  549|       |
  550|      2|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 2, False: 0]
  ------------------
  551|      2|        sk_CONF_MODULE_free(new_modules);
  552|      2|        new_modules = NULL;
  553|      2|    }
  554|       |
  555|      2|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      2|    ossl_rcu_write_unlock(module_list_lock);
  557|      2|    ossl_synchronize_rcu(module_list_lock);
  558|      2|    sk_CONF_MODULE_free(old_modules);
  559|      2|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|       |
  561|      2|}
ossl_config_modules_free:
  632|      2|{
  633|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  634|      2|    module_lists_free();
  635|      2|}
CONF_get1_default_config_file:
  686|      2|{
  687|      2|    const char *t;
  688|      2|    char *file, *sep = "";
  689|      2|    size_t size;
  690|       |
  691|      2|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (691:9): [True: 0, False: 2]
  ------------------
  692|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  693|       |
  694|      2|    t = X509_get_default_cert_area();
  695|       |    /*
  696|       |     * On windows systems with -DOSSL_WINCTX set, if the needed registry
  697|       |     * keys are not yet set, openssl applets will return, due to an inability
  698|       |     * to locate various directories, like the default cert area.  In that
  699|       |     * event, clone an empty string here, so that commands like openssl version
  700|       |     * continue to operate properly without needing to set OPENSSL_CONF.
  701|       |     * Applets like cms will fail gracefully later when they try to parse an
  702|       |     * empty config file
  703|       |     */
  704|      2|    if (t == NULL)
  ------------------
  |  Branch (704:9): [True: 0, False: 2]
  ------------------
  705|      0|        return OPENSSL_strdup("");
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  706|       |
  707|      2|#ifndef OPENSSL_SYS_VMS
  708|      2|    sep = "/";
  709|      2|#endif
  710|      2|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  711|      2|    file = OPENSSL_malloc(size);
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|       |
  713|      2|    if (file == NULL)
  ------------------
  |  Branch (713:9): [True: 0, False: 2]
  ------------------
  714|      0|        return NULL;
  715|      2|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  716|       |
  717|      2|    return file;
  718|      2|}
CONF_parse_list:
  730|    474|{
  731|    474|    int ret;
  732|    474|    const char *lstart, *tmpend, *p;
  733|       |
  734|    474|    if (list_ == NULL) {
  ------------------
  |  Branch (734:9): [True: 0, False: 474]
  ------------------
  735|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  736|      0|        return 0;
  737|      0|    }
  738|       |
  739|    474|    lstart = list_;
  740|  1.18k|    for (;;) {
  741|  1.18k|        if (nospc) {
  ------------------
  |  Branch (741:13): [True: 1.18k, False: 0]
  ------------------
  742|  1.42k|            while (*lstart && isspace((unsigned char)*lstart))
  ------------------
  |  Branch (742:20): [True: 1.42k, False: 0]
  ------------------
  743|    237|                lstart++;
  744|  1.18k|        }
  745|  1.18k|        p = strchr(lstart, sep);
  746|  1.18k|        if (p == lstart || *lstart == '\0')
  ------------------
  |  Branch (746:13): [True: 0, False: 1.18k]
  |  Branch (746:28): [True: 0, False: 1.18k]
  ------------------
  747|      0|            ret = list_cb(NULL, 0, arg);
  748|  1.18k|        else {
  749|  1.18k|            if (p)
  ------------------
  |  Branch (749:17): [True: 711, False: 474]
  ------------------
  750|    711|                tmpend = p - 1;
  751|    474|            else
  752|    474|                tmpend = lstart + strlen(lstart) - 1;
  753|  1.18k|            if (nospc) {
  ------------------
  |  Branch (753:17): [True: 1.18k, False: 0]
  ------------------
  754|  1.18k|                while (isspace((unsigned char)*tmpend))
  755|    237|                    tmpend--;
  756|  1.18k|            }
  757|  1.18k|            ret = list_cb(lstart, tmpend - lstart + 1, arg);
  758|  1.18k|        }
  759|  1.18k|        if (ret <= 0)
  ------------------
  |  Branch (759:13): [True: 0, False: 1.18k]
  ------------------
  760|      0|            return ret;
  761|  1.18k|        if (p == NULL)
  ------------------
  |  Branch (761:13): [True: 474, False: 711]
  ------------------
  762|    474|            return 1;
  763|    711|        lstart = p + 1;
  764|    711|    }
  765|    474|}
conf_mod.c:do_init_module_list_lock:
  101|      2|{
  102|      2|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return 0;
  106|      0|    }
  107|       |
  108|      2|    return 1;
  109|      2|}
conf_mod.c:conf_modules_finish_int:
  574|      2|{
  575|      2|    CONF_IMODULE *imod;
  576|      2|    STACK_OF(CONF_IMODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  577|      2|    STACK_OF(CONF_IMODULE) *new_modules = NULL;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  578|       |
  579|      2|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (579:9): [True: 0, False: 2]
  ------------------
  580|      0|        return 0;
  581|       |
  582|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  583|      2|    if (module_list_lock == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 2]
  ------------------
  584|      0|        return 0;
  585|       |
  586|      2|    ossl_rcu_write_lock(module_list_lock);
  587|      2|    old_modules = ossl_rcu_deref(&initialized_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  588|      2|    ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  589|      2|    ossl_rcu_write_unlock(module_list_lock);
  590|      2|    ossl_synchronize_rcu(module_list_lock);
  591|       |
  592|      2|    while (sk_CONF_IMODULE_num(old_modules) > 0) {
  ------------------
  |  Branch (592:12): [True: 0, False: 2]
  ------------------
  593|      0|        imod = sk_CONF_IMODULE_pop(old_modules);
  594|      0|        module_finish(imod);
  595|      0|    }
  596|      2|    sk_CONF_IMODULE_free(old_modules);
  597|       |
  598|      2|    return 1;
  599|      2|}
conf_mod.c:module_lists_free:
   89|      2|{
   90|      2|    ossl_rcu_lock_free(module_list_lock);
   91|      2|    module_list_lock = NULL;
   92|       |
   93|      2|    sk_CONF_MODULE_free(supported_modules);
   94|      2|    supported_modules = NULL;
   95|       |
   96|      2|    sk_CONF_IMODULE_free(initialized_modules);
   97|      2|    initialized_modules = NULL;
   98|      2|}

ossl_config_int:
   47|      2|{
   48|      2|    int ret = 0;
   49|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   50|      2|    const char *filename;
   51|      2|    const char *appname;
   52|      2|    unsigned long flags;
   53|      2|#endif
   54|       |
   55|      2|    if (openssl_configured)
  ------------------
  |  Branch (55:9): [True: 0, False: 2]
  ------------------
   56|      0|        return 1;
   57|       |
   58|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   59|      2|    filename = settings ? settings->filename : NULL;
  ------------------
  |  Branch (59:16): [True: 0, False: 2]
  ------------------
   60|      2|    appname = settings ? settings->appname : NULL;
  ------------------
  |  Branch (60:15): [True: 0, False: 2]
  ------------------
   61|      2|    flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
  ------------------
  |  |   17|      4|    (CONF_MFLAGS_DEFAULT_SECTION | \
  |  |  ------------------
  |  |  |  |  111|      2|# define CONF_MFLAGS_DEFAULT_SECTION     0x20
  |  |  ------------------
  |  |   18|      4|     CONF_MFLAGS_IGNORE_MISSING_FILE | \
  |  |  ------------------
  |  |  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  |  |  ------------------
  |  |   19|      4|     CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  |  |  ------------------
  ------------------
  |  Branch (61:13): [True: 0, False: 2]
  ------------------
   62|      2|#endif
   63|       |
   64|       |#ifdef OPENSSL_INIT_DEBUG
   65|       |    fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
   66|       |            filename, appname, flags);
   67|       |#endif
   68|       |
   69|      2|#ifndef OPENSSL_SYS_UEFI
   70|      2|    ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
   71|      2|                                    filename, appname, flags);
   72|       |#else
   73|       |    ret = 1;
   74|       |#endif
   75|      2|    openssl_configured = 1;
   76|      2|    return ret;
   77|      2|}

conf_ssl_name_find:
  151|     79|{
  152|     79|    size_t i;
  153|     79|    const struct ssl_conf_name_st *nm;
  154|       |
  155|     79|    if (name == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 79]
  ------------------
  156|      0|        return 0;
  157|     79|    for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) {
  ------------------
  |  Branch (157:33): [True: 0, False: 79]
  ------------------
  158|      0|        if (strcmp(nm->name, name) == 0) {
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            *idx = i;
  160|      0|            return 1;
  161|      0|        }
  162|      0|    }
  163|     79|    return 0;
  164|     79|}

ossl_lib_ctx_write_lock:
   60|      2|{
   61|      2|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      0|        return 0;
   63|      2|    return CRYPTO_THREAD_write_lock(ctx->lock);
   64|      2|}
ossl_lib_ctx_read_lock:
   67|    269|{
   68|    269|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 269]
  ------------------
   69|      0|        return 0;
   70|    269|    return CRYPTO_THREAD_read_lock(ctx->lock);
   71|    269|}
ossl_lib_ctx_unlock:
   74|    271|{
   75|    271|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 271]
  ------------------
   76|      0|        return 0;
   77|    271|    return CRYPTO_THREAD_unlock(ctx->lock);
   78|    271|}
ossl_lib_ctx_default_deinit:
  412|      2|{
  413|      2|    if (!default_context_inited)
  ------------------
  |  Branch (413:9): [True: 0, False: 2]
  ------------------
  414|      0|        return;
  415|      2|    context_deinit(&default_context_int);
  416|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  417|      2|    default_context_inited = 0;
  418|      2|}
OSSL_LIB_CTX_new:
  447|      2|{
  448|      2|    OSSL_LIB_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|       |
  450|      2|    if (ctx != NULL && !context_init(ctx)) {
  ------------------
  |  Branch (450:9): [True: 2, False: 0]
  |  Branch (450:24): [True: 0, False: 2]
  ------------------
  451|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  452|      0|        ctx = NULL;
  453|      0|    }
  454|      2|    return ctx;
  455|      2|}
OSSL_LIB_CTX_get0_global_default:
  512|      2|{
  513|      2|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (513:9): [True: 0, False: 2]
  ------------------
  514|      0|        return NULL;
  515|       |
  516|      2|    return &default_context_int;
  517|      2|}
OSSL_LIB_CTX_set0_default:
  520|     79|{
  521|     79|    OSSL_LIB_CTX *current_defctx;
  522|       |
  523|     79|    if ((current_defctx = get_default_context()) != NULL) {
  ------------------
  |  Branch (523:9): [True: 79, False: 0]
  ------------------
  524|     79|        if (libctx != NULL)
  ------------------
  |  Branch (524:13): [True: 0, False: 79]
  ------------------
  525|      0|            set_default_context(libctx);
  526|     79|        return current_defctx;
  527|     79|    }
  528|       |
  529|      0|    return NULL;
  530|     79|}
ossl_release_default_drbg_ctx:
  533|      1|{
  534|       |    /* early release of the DRBG in global default libctx */
  535|      1|    if (default_context_int.drbg != NULL) {
  ------------------
  |  Branch (535:9): [True: 1, False: 0]
  ------------------
  536|      1|        ossl_rand_ctx_free(default_context_int.drbg);
  537|      1|        default_context_int.drbg = NULL;
  538|      1|    }
  539|      1|}
ossl_lib_ctx_get_concrete:
  543|  33.8k|{
  544|  33.8k|#ifndef FIPS_MODULE
  545|  33.8k|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 32.4k, False: 1.38k]
  ------------------
  546|  32.4k|        return get_default_context();
  547|  1.38k|#endif
  548|  1.38k|    return ctx;
  549|  33.8k|}
ossl_lib_ctx_is_default:
  552|  1.90k|{
  553|  1.90k|#ifndef FIPS_MODULE
  554|  1.90k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (554:9): [True: 1.46k, False: 439]
  |  Branch (554:24): [True: 439, False: 0]
  ------------------
  555|  1.90k|        return 1;
  556|      0|#endif
  557|      0|    return 0;
  558|  1.90k|}
ossl_lib_ctx_is_global_default:
  561|  1.26k|{
  562|  1.26k|#ifndef FIPS_MODULE
  563|  1.26k|    if (ossl_lib_ctx_get_concrete(ctx) == &default_context_int)
  ------------------
  |  Branch (563:9): [True: 1.26k, False: 0]
  ------------------
  564|  1.26k|        return 1;
  565|      0|#endif
  566|      0|    return 0;
  567|  1.26k|}
ossl_lib_ctx_get_data:
  570|  31.0k|{
  571|  31.0k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|  31.0k|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 31.0k]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|  31.0k|    switch (index) {
  576|     36|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|     36|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (576:5): [True: 36, False: 31.0k]
  ------------------
  577|     36|        return ctx->property_string_data;
  578|  16.4k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  16.4k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 16.4k, False: 14.6k]
  ------------------
  579|  16.4k|        return ctx->evp_method_store;
  580|  1.48k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|  1.48k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 1.48k, False: 29.5k]
  ------------------
  581|  1.48k|        return ctx->provider_store;
  582|  12.1k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|  12.1k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 12.1k, False: 18.9k]
  ------------------
  583|  12.1k|        return ctx->namemap;
  584|    271|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    271|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 271, False: 30.7k]
  ------------------
  585|    271|        return ctx->property_defns;
  586|     44|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|     44|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 44, False: 31.0k]
  ------------------
  587|     44|        return ctx->global_properties;
  588|    560|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|    560|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 560, False: 30.4k]
  ------------------
  589|    560|        return ctx->drbg;
  590|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  104|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (590:5): [True: 0, False: 31.0k]
  ------------------
  591|      0|        return ctx->drbg_nonce;
  592|      0|#ifndef FIPS_MODULE
  593|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (593:5): [True: 0, False: 31.0k]
  ------------------
  594|      0|        return ctx->provider_conf;
  595|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (595:5): [True: 0, False: 31.0k]
  ------------------
  596|      0|        return ctx->bio_core;
  597|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (597:5): [True: 0, False: 31.0k]
  ------------------
  598|      0|        return ctx->child_provider;
  599|      2|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|      2|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (599:5): [True: 2, False: 31.0k]
  ------------------
  600|      2|        return ctx->decoder_store;
  601|      5|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|      5|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (601:5): [True: 5, False: 31.0k]
  ------------------
  602|      5|        return ctx->decoder_cache;
  603|      2|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      2|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (603:5): [True: 2, False: 31.0k]
  ------------------
  604|      2|        return ctx->encoder_store;
  605|      2|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (605:5): [True: 2, False: 31.0k]
  ------------------
  606|      2|        return ctx->store_loader_store;
  607|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (607:5): [True: 0, False: 31.0k]
  ------------------
  608|      0|        return ctx->self_test_cb;
  609|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  122|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (609:5): [True: 0, False: 31.0k]
  ------------------
  610|      0|        return ctx->indicator_cb;
  611|      0|#endif
  612|      0|#ifndef OPENSSL_NO_THREAD_POOL
  613|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (613:5): [True: 0, False: 31.0k]
  ------------------
  614|      0|        return ctx->threads;
  615|      0|#endif
  616|       |
  617|       |#ifdef FIPS_MODULE
  618|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  619|       |        return ctx->thread_event_handler;
  620|       |
  621|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  622|       |        return ctx->fips_prov;
  623|       |#endif
  624|       |
  625|     83|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  121|     83|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (625:5): [True: 83, False: 30.9k]
  ------------------
  626|     83|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 31.0k]
  ------------------
  629|      0|        return NULL;
  630|  31.0k|    }
  631|  31.0k|}
OSSL_LIB_CTX_get_data:
  634|     83|{
  635|     83|    return ossl_lib_ctx_get_data(ctx, index);
  636|     83|}
ossl_lib_ctx_get_ex_data_global:
  639|    958|{
  640|    958|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|    958|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 958]
  ------------------
  642|      0|        return NULL;
  643|    958|    return &ctx->global;
  644|    958|}
ossl_lib_ctx_get_descriptor:
  647|  1.26k|{
  648|       |#ifdef FIPS_MODULE
  649|       |    return "FIPS internal library context";
  650|       |#else
  651|  1.26k|    if (ossl_lib_ctx_is_global_default(libctx))
  ------------------
  |  Branch (651:9): [True: 1.26k, False: 0]
  ------------------
  652|  1.26k|        return "Global default library context";
  653|      0|    if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (653:9): [True: 0, False: 0]
  ------------------
  654|      0|        return "Thread-local default library context";
  655|      0|    return "Non-default library context";
  656|      0|#endif
  657|      0|}
OSSL_LIB_CTX_get_conf_diagnostics:
  668|      2|{
  669|      2|    libctx = ossl_lib_ctx_get_concrete(libctx);
  670|      2|    if (libctx == NULL)
  ------------------
  |  Branch (670:9): [True: 0, False: 2]
  ------------------
  671|      0|        return 0;
  672|      2|    return libctx->conf_diagnostics;
  673|      2|}
context.c:context_deinit:
  370|      2|{
  371|      2|    if (ctx == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        return 1;
  373|       |
  374|      2|    ossl_ctx_thread_stop(ctx);
  375|       |
  376|      2|    context_deinit_objs(ctx);
  377|       |
  378|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  379|       |
  380|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  381|      2|    ctx->lock = NULL;
  382|      2|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  383|      2|    return 1;
  384|      2|}
context.c:context_deinit_objs:
  235|      2|{
  236|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  237|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ossl_method_store_free(ctx->evp_method_store);
  239|      2|        ctx->evp_method_store = NULL;
  240|      2|    }
  241|       |
  242|       |    /* P2. */
  243|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (243:9): [True: 1, False: 1]
  ------------------
  244|      1|        ossl_rand_ctx_free(ctx->drbg);
  245|      1|        ctx->drbg = NULL;
  246|      1|    }
  247|       |
  248|      2|#ifndef FIPS_MODULE
  249|       |    /* P2. */
  250|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (250:9): [True: 2, False: 0]
  ------------------
  251|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  252|      2|        ctx->provider_conf = NULL;
  253|      2|    }
  254|       |
  255|       |    /*
  256|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  257|       |     * provider store
  258|       |     */
  259|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (259:9): [True: 2, False: 0]
  ------------------
  260|      2|        ossl_method_store_free(ctx->decoder_store);
  261|      2|        ctx->decoder_store = NULL;
  262|      2|    }
  263|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (263:9): [True: 2, False: 0]
  ------------------
  264|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  265|      2|        ctx->decoder_cache = NULL;
  266|      2|    }
  267|       |
  268|       |
  269|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  270|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (270:9): [True: 2, False: 0]
  ------------------
  271|      2|        ossl_method_store_free(ctx->encoder_store);
  272|      2|        ctx->encoder_store = NULL;
  273|      2|    }
  274|       |
  275|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  276|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  ------------------
  277|      2|        ossl_method_store_free(ctx->store_loader_store);
  278|      2|        ctx->store_loader_store = NULL;
  279|      2|    }
  280|      2|#endif
  281|       |
  282|       |    /* P1. Needs to be freed before the child provider data is freed */
  283|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (283:9): [True: 2, False: 0]
  ------------------
  284|      2|        ossl_provider_store_free(ctx->provider_store);
  285|      2|        ctx->provider_store = NULL;
  286|      2|    }
  287|       |
  288|       |    /* Default priority. */
  289|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (289:9): [True: 2, False: 0]
  ------------------
  290|      2|        ossl_property_string_data_free(ctx->property_string_data);
  291|      2|        ctx->property_string_data = NULL;
  292|      2|    }
  293|       |
  294|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (294:9): [True: 2, False: 0]
  ------------------
  295|      2|        ossl_stored_namemap_free(ctx->namemap);
  296|      2|        ctx->namemap = NULL;
  297|      2|    }
  298|       |
  299|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (299:9): [True: 2, False: 0]
  ------------------
  300|      2|        ossl_property_defns_free(ctx->property_defns);
  301|      2|        ctx->property_defns = NULL;
  302|      2|    }
  303|       |
  304|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (304:9): [True: 2, False: 0]
  ------------------
  305|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  306|      2|        ctx->global_properties = NULL;
  307|      2|    }
  308|       |
  309|      2|#ifndef FIPS_MODULE
  310|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (310:9): [True: 2, False: 0]
  ------------------
  311|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  312|      2|        ctx->bio_core = NULL;
  313|      2|    }
  314|      2|#endif
  315|       |
  316|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (316:9): [True: 2, False: 0]
  ------------------
  317|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  318|      2|        ctx->drbg_nonce = NULL;
  319|      2|    }
  320|       |
  321|      2|#ifndef FIPS_MODULE
  322|      2|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (322:9): [True: 2, False: 0]
  ------------------
  323|      2|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  324|      2|        ctx->indicator_cb = NULL;
  325|      2|    }
  326|       |
  327|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (327:9): [True: 2, False: 0]
  ------------------
  328|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  329|      2|        ctx->self_test_cb = NULL;
  330|      2|    }
  331|      2|#endif
  332|       |
  333|       |#ifdef FIPS_MODULE
  334|       |    if (ctx->thread_event_handler != NULL) {
  335|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  336|       |        ctx->thread_event_handler = NULL;
  337|       |    }
  338|       |
  339|       |    if (ctx->fips_prov != NULL) {
  340|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  341|       |        ctx->fips_prov = NULL;
  342|       |    }
  343|       |#endif
  344|       |
  345|      2|#ifndef OPENSSL_NO_THREAD_POOL
  346|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (346:9): [True: 2, False: 0]
  ------------------
  347|      2|        ossl_threads_ctx_free(ctx->threads);
  348|      2|        ctx->threads = NULL;
  349|      2|    }
  350|      2|#endif
  351|       |
  352|       |    /* Low priority. */
  353|      2|#ifndef FIPS_MODULE
  354|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (354:9): [True: 2, False: 0]
  ------------------
  355|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  356|      2|        ctx->child_provider = NULL;
  357|      2|    }
  358|      2|#endif
  359|       |
  360|      2|#ifndef FIPS_MODULE
  361|      2|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (361:9): [True: 2, False: 0]
  ------------------
  362|      2|        ossl_free_compression_methods_int(ctx->comp_methods);
  363|      2|        ctx->comp_methods = NULL;
  364|      2|    }
  365|      2|#endif
  366|       |
  367|      2|}
context.c:context_init:
   92|      4|{
   93|      4|    int exdata_done = 0;
   94|       |
   95|      4|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (95:9): [True: 0, False: 4]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      4|    ctx->lock = CRYPTO_THREAD_lock_new();
   99|      4|    if (ctx->lock == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 4]
  ------------------
  100|      0|        goto err;
  101|       |
  102|       |    /* Initialize ex_data. */
  103|      4|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (103:9): [True: 0, False: 4]
  ------------------
  104|      0|        goto err;
  105|      4|    exdata_done = 1;
  106|       |
  107|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  108|      4|    ctx->evp_method_store = ossl_method_store_new(ctx);
  109|      4|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 4]
  ------------------
  110|      0|        goto err;
  111|      4|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      4|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      4|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  112|       |
  113|      4|#ifndef FIPS_MODULE
  114|       |    /* P2. Must be freed before the provider store is freed */
  115|      4|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  116|      4|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 4]
  ------------------
  117|      0|        goto err;
  118|      4|#endif
  119|       |
  120|       |    /* P2. */
  121|      4|    ctx->drbg = ossl_rand_ctx_new(ctx);
  122|      4|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 4]
  ------------------
  123|      0|        goto err;
  124|       |
  125|      4|#ifndef FIPS_MODULE
  126|       |    /*
  127|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  128|       |     * provider store
  129|       |     */
  130|      4|    ctx->decoder_store = ossl_method_store_new(ctx);
  131|      4|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        goto err;
  133|      4|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  134|      4|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 4]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  138|      4|    ctx->encoder_store = ossl_method_store_new(ctx);
  139|      4|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 4]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  143|      4|    ctx->store_loader_store = ossl_method_store_new(ctx);
  144|      4|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 4]
  ------------------
  145|      0|        goto err;
  146|      4|#endif
  147|       |
  148|       |    /* P1. Needs to be freed before the child provider data is freed */
  149|      4|    ctx->provider_store = ossl_provider_store_new(ctx);
  150|      4|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 4]
  ------------------
  151|      0|        goto err;
  152|       |
  153|       |    /* Default priority. */
  154|      4|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  155|      4|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 4]
  ------------------
  156|      0|        goto err;
  157|       |
  158|      4|    ctx->namemap = ossl_stored_namemap_new(ctx);
  159|      4|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      0|        goto err;
  161|       |
  162|      4|    ctx->property_defns = ossl_property_defns_new(ctx);
  163|      4|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 4]
  ------------------
  164|      0|        goto err;
  165|       |
  166|      4|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  167|      4|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 4]
  ------------------
  168|      0|        goto err;
  169|       |
  170|      4|#ifndef FIPS_MODULE
  171|      4|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  172|      4|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (172:9): [True: 0, False: 4]
  ------------------
  173|      0|        goto err;
  174|      4|#endif
  175|       |
  176|      4|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  177|      4|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 4]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      4|#ifndef FIPS_MODULE
  181|      4|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  182|      4|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 4]
  ------------------
  183|      0|        goto err;
  184|      4|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  185|      4|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 4]
  ------------------
  186|      0|        goto err;
  187|      4|#endif
  188|       |
  189|       |#ifdef FIPS_MODULE
  190|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  191|       |    if (ctx->thread_event_handler == NULL)
  192|       |        goto err;
  193|       |
  194|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  195|       |    if (ctx->fips_prov == NULL)
  196|       |        goto err;
  197|       |#endif
  198|       |
  199|      4|#ifndef OPENSSL_NO_THREAD_POOL
  200|      4|    ctx->threads = ossl_threads_ctx_new(ctx);
  201|      4|    if (ctx->threads == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 4]
  ------------------
  202|      0|        goto err;
  203|      4|#endif
  204|       |
  205|       |    /* Low priority. */
  206|      4|#ifndef FIPS_MODULE
  207|      4|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  208|      4|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 4]
  ------------------
  209|      0|        goto err;
  210|      4|#endif
  211|       |
  212|       |    /* Everything depends on properties, so we also pre-initialise that */
  213|      4|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (213:9): [True: 0, False: 4]
  ------------------
  214|      0|        goto err;
  215|       |
  216|      4|#ifndef FIPS_MODULE
  217|      4|    ctx->comp_methods = ossl_load_builtin_compressions();
  218|      4|#endif
  219|       |
  220|      4|    return 1;
  221|       |
  222|      0| err:
  223|      0|    context_deinit_objs(ctx);
  224|       |
  225|      0|    if (exdata_done)
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  227|       |
  228|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  229|      0|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  230|      0|    memset(ctx, '\0', sizeof(*ctx));
  231|      0|    return 0;
  232|      4|}
context.c:default_context_do_init:
  395|      2|{
  396|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (396:9): [True: 0, False: 2]
  ------------------
  397|      0|        goto err;
  398|       |
  399|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (399:9): [True: 0, False: 2]
  ------------------
  400|      0|        goto deinit_thread;
  401|       |
  402|      2|    default_context_inited = 1;
  403|      2|    return 1;
  404|       |
  405|      0|deinit_thread:
  406|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  407|      0|err:
  408|      0|    return 0;
  409|      0|}
context.c:get_default_context:
  429|  32.9k|{
  430|  32.9k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  32.9k|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 32.9k, False: 0]
  |  Branch (432:35): [True: 32.9k, False: 0]
  ------------------
  433|  32.9k|        current_defctx = &default_context_int;
  434|  32.9k|    return current_defctx;
  435|  32.9k|}
context.c:get_thread_default_context:
  421|  32.9k|{
  422|  32.9k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  32.9k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 32.9k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 32.9k]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  32.9k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  32.9k|}

ossl_algorithm_do_all:
  149|  1.30k|{
  150|  1.30k|    struct algorithm_data_st cbdata = { 0, };
  151|       |
  152|  1.30k|    cbdata.libctx = libctx;
  153|  1.30k|    cbdata.operation_id = operation_id;
  154|  1.30k|    cbdata.pre = pre;
  155|  1.30k|    cbdata.reserve_store = reserve_store;
  156|  1.30k|    cbdata.fn = fn;
  157|  1.30k|    cbdata.unreserve_store = unreserve_store;
  158|  1.30k|    cbdata.post = post;
  159|  1.30k|    cbdata.data = data;
  160|       |
  161|  1.30k|    if (provider == NULL) {
  ------------------
  |  Branch (161:9): [True: 1.30k, False: 0]
  ------------------
  162|  1.30k|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  163|  1.30k|    } else {
  164|      0|        OSSL_LIB_CTX *libctx2 = ossl_provider_libctx(provider);
  165|       |
  166|       |        /*
  167|       |         * If a provider is given, its library context MUST match the library
  168|       |         * context we're passed.  If this turns out not to be true, there is
  169|       |         * a programming error in the functions up the call stack.
  170|       |         */
  171|      0|        if (!ossl_assert(ossl_lib_ctx_get_concrete(libctx)
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (171:13): [True: 0, False: 0]
  ------------------
  172|      0|                         == ossl_lib_ctx_get_concrete(libctx2)))
  173|      0|            return;
  174|       |
  175|      0|        cbdata.libctx = libctx2;
  176|      0|        algorithm_do_this(provider, &cbdata);
  177|      0|    }
  178|  1.30k|}
ossl_algorithm_get1_first_name:
  181|    269|{
  182|    269|    const char *first_name_end = NULL;
  183|    269|    size_t first_name_len = 0;
  184|    269|    char *ret;
  185|       |
  186|    269|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 269]
  ------------------
  187|      0|        return NULL;
  188|       |
  189|    269|    first_name_end = strchr(algo->algorithm_names, ':');
  190|    269|    if (first_name_end == NULL)
  ------------------
  |  Branch (190:9): [True: 83, False: 186]
  ------------------
  191|     83|        first_name_len = strlen(algo->algorithm_names);
  192|    186|    else
  193|    186|        first_name_len = first_name_end - algo->algorithm_names;
  194|       |
  195|    269|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  121|    269|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    269|    return ret;
  197|    269|}
core_algorithm.c:algorithm_do_this:
  103|  2.61k|{
  104|  2.61k|    struct algorithm_data_st *data = cbdata;
  105|  2.61k|    int first_operation = 1;
  106|  2.61k|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  326|  2.61k|# define OSSL_OP__HIGHEST                           22
  ------------------
  107|  2.61k|    int cur_operation;
  108|  2.61k|    int ok = 1;
  109|       |
  110|  2.61k|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 2.61k, False: 0]
  ------------------
  111|  2.61k|        first_operation = last_operation = data->operation_id;
  112|       |
  113|  2.61k|    for (cur_operation = first_operation;
  114|  5.23k|         cur_operation <= last_operation;
  ------------------
  |  Branch (114:10): [True: 2.61k, False: 2.61k]
  ------------------
  115|  2.61k|         cur_operation++) {
  116|  2.61k|        int no_store = 0;        /* Assume caching is ok */
  117|  2.61k|        const OSSL_ALGORITHM *map = NULL;
  118|  2.61k|        int ret = 0;
  119|       |
  120|  2.61k|        map = ossl_provider_query_operation(provider, cur_operation,
  121|  2.61k|                                            &no_store);
  122|  2.61k|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|  2.61k|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|  2.61k|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 2.61k]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|  2.61k|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 2.61k]
  ------------------
  131|      0|            ok = 0;
  132|  2.61k|    }
  133|       |
  134|  2.61k|    return ok;
  135|  2.61k|}
core_algorithm.c:algorithm_do_map:
   44|  2.61k|{
   45|  2.61k|    struct algorithm_data_st *data = cbdata;
   46|  2.61k|    int ret = 0;
   47|       |
   48|  2.61k|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 2.61k]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|  2.61k|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 2.61k]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|  2.61k|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 2.61k]
  ------------------
   57|  2.61k|                          &ret)) {
   58|       |        /* Error, bail out! */
   59|      0|        ret = -1;
   60|      0|        goto end;
   61|      0|    }
   62|       |
   63|       |    /*
   64|       |     * If pre-condition not fulfilled don't add this set of implementations,
   65|       |     * but do continue with the next.  This simply means that another thread
   66|       |     * got to it first.
   67|       |     */
   68|  2.61k|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 2.60k, False: 12]
  ------------------
   69|  2.60k|        ret = 1;
   70|  2.60k|        goto end;
   71|  2.60k|    }
   72|       |
   73|     12|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 7, False: 5]
  ------------------
   74|      7|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|    276|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 269, False: 7]
  ------------------
   77|    269|            data->fn(provider, thismap, no_store, data->data);
   78|      7|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|     12|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 12]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|     12|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 12]
  ------------------
   85|     12|                           &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|  2.61k| end:
   91|  2.61k|    data->unreserve_store(data->data);
   92|       |
   93|  2.61k|    return ret;
   94|     12|}

ossl_method_construct:
  137|  1.30k|{
  138|  1.30k|    void *method = NULL;
  139|  1.30k|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 1.30k, False: 0]
  ------------------
  140|  1.30k|    struct construct_data_st cbdata;
  141|       |
  142|       |    /*
  143|       |     * We might be tempted to try to look into the method store without
  144|       |     * constructing to see if we can find our method there already.
  145|       |     * Unfortunately that does not work well if the query contains
  146|       |     * optional properties as newly loaded providers can match them better.
  147|       |     * We trust that ossl_method_construct_precondition() and
  148|       |     * ossl_method_construct_postcondition() make sure that the
  149|       |     * ossl_algorithm_do_all() does very little when methods from
  150|       |     * a provider have already been constructed.
  151|       |     */
  152|       |
  153|  1.30k|    cbdata.store = NULL;
  154|  1.30k|    cbdata.force_store = force_store;
  155|  1.30k|    cbdata.mcm = mcm;
  156|  1.30k|    cbdata.mcm_data = mcm_data;
  157|  1.30k|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|  1.30k|                          ossl_method_construct_precondition,
  159|  1.30k|                          ossl_method_construct_reserve_store,
  160|  1.30k|                          ossl_method_construct_this,
  161|  1.30k|                          ossl_method_construct_unreserve_store,
  162|  1.30k|                          ossl_method_construct_postcondition,
  163|  1.30k|                          &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|  1.30k|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 1.30k]
  ------------------
  167|      0|        method = mcm->get(cbdata.store, (const OSSL_PROVIDER **)provider_rw,
  168|      0|                          mcm_data);
  169|       |
  170|       |    /* If no method was found yet, try the global store */
  171|  1.30k|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 1.30k, False: 0]
  ------------------
  172|  1.30k|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|  1.30k|    return method;
  175|  1.30k|}
core_fetch.c:ossl_method_construct_precondition:
   63|  2.61k|{
   64|  2.61k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  2.61k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.61k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (64:9): [True: 0, False: 2.61k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|       |
   69|       |    /* Assume that no bits are set */
   70|  2.61k|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|  2.61k|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 2.61k, False: 0]
  ------------------
   74|  2.61k|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 2.61k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|       |    /*
   78|       |     * The result we get tells if methods have already been constructed.
   79|       |     * However, we want to tell whether construction should happen (true)
   80|       |     * or not (false), which is the opposite of what we got.
   81|       |     */
   82|  2.61k|    *result = !*result;
   83|       |
   84|  2.61k|    return 1;
   85|  2.61k|}
core_fetch.c:is_temporary_method_store:
   29|  5.24k|{
   30|  5.24k|    struct construct_data_st *data = cbdata;
   31|       |
   32|  5.24k|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 5.24k]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|  5.24k|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|  2.61k|{
   37|  2.61k|    struct construct_data_st *data = cbdata;
   38|       |
   39|  2.61k|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 2.61k]
  |  Branch (39:54): [True: 0, False: 0]
  ------------------
   40|       |        /*
   41|       |         * If we have been told not to store the method "permanently", we
   42|       |         * ask for a temporary store, and store the method there.
   43|       |         * The owner of |data->mcm| is completely responsible for managing
   44|       |         * that temporary store.
   45|       |         */
   46|      0|        if ((data->store = data->mcm->get_tmp_store(data->mcm_data)) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return 0;
   48|      0|    }
   49|       |
   50|  2.61k|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|  2.61k|}
core_fetch.c:ossl_method_construct_this:
  106|    269|{
  107|    269|    struct construct_data_st *data = cbdata;
  108|    269|    void *method = NULL;
  109|       |
  110|    269|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (110:9): [True: 0, False: 269]
  ------------------
  111|    269|        == NULL)
  112|      0|        return;
  113|       |
  114|    269|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  293|    269|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    269|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|    269|                "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|    269|                (void *)data->store, no_store);
  117|       |    /*
  118|       |     * Note regarding putting the method in stores:
  119|       |     *
  120|       |     * we don't need to care if it actually got in or not here.
  121|       |     * If it didn't get in, it will simply not be available when
  122|       |     * ossl_method_construct() tries to get it from the store.
  123|       |     *
  124|       |     * It is *expected* that the put function increments the refcnt
  125|       |     * of the passed method.
  126|       |     */
  127|    269|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 269]
  ------------------
  128|    269|                   algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|    269|    data->mcm->destruct(method, data->mcm_data);
  132|    269|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|  2.61k|{
   55|  2.61k|    struct construct_data_st *data = cbdata;
   56|       |
   57|  2.61k|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|  2.61k|}
core_fetch.c:ossl_method_construct_postcondition:
   90|     12|{
   91|     12|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     12|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     12|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 12]
  ------------------
   92|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|     12|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|     12|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 12]
  ------------------
  100|     12|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 12, False: 0]
  ------------------
  101|     12|}

ossl_stored_namemap_new:
   56|      4|{
   57|      4|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   58|       |
   59|      4|    if (namemap != NULL)
  ------------------
  |  Branch (59:9): [True: 4, False: 0]
  ------------------
   60|      4|        namemap->stored = 1;
   61|       |
   62|      4|    return namemap;
   63|      4|}
ossl_stored_namemap_free:
   66|      2|{
   67|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   68|       |
   69|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   71|      2|        namemap->stored = 0;
   72|      2|        ossl_namemap_free(namemap);
   73|      2|    }
   74|      2|}
ossl_namemap_empty:
   82|  12.1k|{
   83|       |#ifdef TSAN_REQUIRES_LOCKING
   84|       |    /* No TSAN support */
   85|       |    int rv;
   86|       |
   87|       |    if (namemap == NULL)
   88|       |        return 1;
   89|       |
   90|       |    if (!CRYPTO_THREAD_read_lock(namemap->lock))
   91|       |        return -1;
   92|       |    rv = namemap->max_number == 0;
   93|       |    CRYPTO_THREAD_unlock(namemap->lock);
   94|       |    return rv;
   95|       |#else
   96|       |    /* Have TSAN support */
   97|  12.1k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|  12.1k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (97:12): [True: 0, False: 12.1k]
  |  Branch (97:31): [True: 1, False: 12.1k]
  ------------------
   98|  12.1k|#endif
   99|  12.1k|}
ossl_namemap_doall_names:
  109|    197|{
  110|    197|    int i;
  111|    197|    NAMES *names;
  112|       |
  113|    197|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (113:9): [True: 0, False: 197]
  |  Branch (113:28): [True: 0, False: 197]
  ------------------
  114|      0|        return 0;
  115|       |
  116|       |    /*
  117|       |     * We duplicate the NAMES stack under a read lock. Subsequently we call
  118|       |     * the user function, so that we're not holding the read lock when in user
  119|       |     * code. This could lead to deadlocks.
  120|       |     */
  121|    197|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (121:9): [True: 0, False: 197]
  ------------------
  122|      0|        return 0;
  123|       |
  124|    197|    names = sk_NAMES_value(namemap->numnames, number - 1);
  125|    197|    if (names != NULL)
  ------------------
  |  Branch (125:9): [True: 197, False: 0]
  ------------------
  126|    197|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  251|    197|#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
  ------------------
  127|       |
  128|    197|    CRYPTO_THREAD_unlock(namemap->lock);
  129|       |
  130|    197|    if (names == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 197]
  ------------------
  131|      0|        return 0;
  132|       |
  133|    618|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  229|    618|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (133:17): [True: 421, False: 197]
  ------------------
  134|    421|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  230|    421|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  135|       |
  136|    197|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  235|    197|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  137|    197|    return i > 0;
  138|    197|}
ossl_namemap_name2num:
  141|  12.4k|{
  142|  12.4k|    int number = 0;
  143|  12.4k|    HT_VALUE *val;
  144|  12.4k|    NAMENUM_KEY key;
  145|       |
  146|  12.4k|#ifndef FIPS_MODULE
  147|  12.4k|    if (namemap == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 12.4k]
  ------------------
  148|      0|        namemap = ossl_namemap_stored(NULL);
  149|  12.4k|#endif
  150|       |
  151|  12.4k|    if (namemap == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 12.4k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|  12.4k|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|  12.4k|#define HT_INIT_KEY(key) do { \
  |  |  108|  12.4k|memset((key), 0, sizeof(*(key))); \
  |  |  109|  12.4k|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|  12.4k|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|  12.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|  12.4k|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|  12.4k|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|  12.4k|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|  12.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  156|       |
  157|  12.4k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|  12.4k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  158|       |
  159|  12.4k|    if (val != NULL)
  ------------------
  |  Branch (159:9): [True: 10.6k, False: 1.79k]
  ------------------
  160|       |        /* We store a (small) int directly instead of a pointer to it. */
  161|  10.6k|        number = (int)(intptr_t)val->value;
  162|       |
  163|  12.4k|    return number;
  164|  12.4k|}
ossl_namemap_name2num_n:
  168|  1.14k|{
  169|  1.14k|    int number = 0;
  170|  1.14k|    HT_VALUE *val;
  171|  1.14k|    NAMENUM_KEY key;
  172|       |
  173|  1.14k|#ifndef FIPS_MODULE
  174|  1.14k|    if (namemap == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 1.14k]
  ------------------
  175|      0|        namemap = ossl_namemap_stored(NULL);
  176|  1.14k|#endif
  177|       |
  178|  1.14k|    if (namemap == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 1.14k]
  ------------------
  179|      0|        return 0;
  180|       |
  181|  1.14k|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|  1.14k|#define HT_INIT_KEY(key) do { \
  |  |  108|  1.14k|memset((key), 0, sizeof(*(key))); \
  |  |  109|  1.14k|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|  1.14k|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|  1.14k|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  182|  1.14k|    HT_SET_KEY_STRING_CASE_N(&key, name, name, name_len);
  ------------------
  |  |  155|  1.14k|#define HT_SET_KEY_STRING_CASE_N(key, member, value, len) do { \
  |  |  156|  1.14k|    if (len < sizeof((key)->keyfields.member)) \
  |  |  ------------------
  |  |  |  Branch (156:9): [True: 1.14k, False: 0]
  |  |  ------------------
  |  |  157|  1.14k|        ossl_ht_strcase((key)->keyfields.member, value, len); \
  |  |  158|  1.14k|    else \
  |  |  159|  1.14k|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  160|  1.14k|} while(0)
  |  |  ------------------
  |  |  |  Branch (160:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  183|       |
  184|  1.14k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|  1.14k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  185|       |
  186|  1.14k|    if (val != NULL)
  ------------------
  |  Branch (186:9): [True: 271, False: 869]
  ------------------
  187|       |        /* We store a (small) int directly instead of a pointer to it. */
  188|    271|        number = (int)(intptr_t)val->value;
  189|       |
  190|  1.14k|    return number;
  191|  1.14k|}
ossl_namemap_add_name:
  289|    648|{
  290|    648|    int tmp_number;
  291|       |
  292|    648|#ifndef FIPS_MODULE
  293|    648|    if (namemap == NULL)
  ------------------
  |  Branch (293:9): [True: 0, False: 648]
  ------------------
  294|      0|        namemap = ossl_namemap_stored(NULL);
  295|    648|#endif
  296|       |
  297|    648|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (297:9): [True: 0, False: 648]
  |  Branch (297:25): [True: 0, False: 648]
  |  Branch (297:39): [True: 0, False: 648]
  ------------------
  298|      0|        return 0;
  299|       |
  300|    648|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (300:9): [True: 0, False: 648]
  ------------------
  301|      0|        return 0;
  302|    648|    tmp_number = namemap_add_name(namemap, number, name);
  303|    648|    CRYPTO_THREAD_unlock(namemap->lock);
  304|    648|    return tmp_number;
  305|    648|}
ossl_namemap_add_names:
  309|    269|{
  310|    269|    char *tmp, *p, *q, *endp;
  311|       |
  312|       |    /* Check that we have a namemap */
  313|    269|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    269|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    269|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (313:9): [True: 0, False: 269]
  ------------------
  314|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  315|      0|        return 0;
  316|      0|    }
  317|       |
  318|    269|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  119|    269|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (318:9): [True: 0, False: 269]
  ------------------
  319|      0|        return 0;
  320|       |
  321|    269|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (321:9): [True: 0, False: 269]
  ------------------
  322|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |    /*
  326|       |     * Check that no name is an empty string, and that all names have at
  327|       |     * most one numeric identity together.
  328|       |     */
  329|    892|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (329:19): [True: 623, False: 269]
  ------------------
  330|    623|        int this_number;
  331|    623|        size_t l;
  332|       |
  333|    623|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (333:13): [True: 269, False: 354]
  ------------------
  334|    269|            l = strlen(p);       /* offset to \0 */
  335|    269|            q = p + l;
  336|    354|        } else {
  337|    354|            l = q - p;           /* offset to the next separator */
  338|    354|            *q++ = '\0';
  339|    354|        }
  340|       |
  341|    623|        if (*p == '\0') {
  ------------------
  |  Branch (341:13): [True: 0, False: 623]
  ------------------
  342|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|            number = 0;
  344|      0|            goto end;
  345|      0|        }
  346|       |
  347|    623|        this_number = ossl_namemap_name2num(namemap, p);
  348|       |
  349|    623|        if (number == 0) {
  ------------------
  |  Branch (349:13): [True: 438, False: 185]
  ------------------
  350|    438|            number = this_number;
  351|    438|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (351:20): [True: 160, False: 25]
  |  Branch (351:40): [True: 0, False: 160]
  ------------------
  352|      0|            ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   25|      0|# define CRYPTO_R_CONFLICTING_NAMES                       118
  ------------------
  353|      0|                           "\"%s\" has an existing different identity %d (from \"%s\")",
  354|      0|                           p, this_number, names);
  355|      0|            number = 0;
  356|      0|            goto end;
  357|      0|        }
  358|    623|    }
  359|    269|    endp = p;
  360|       |
  361|       |    /* Now that we have checked, register all names */
  362|    892|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (362:19): [True: 623, False: 269]
  ------------------
  363|    623|        int this_number;
  364|       |
  365|    623|        q = p + strlen(p) + 1;
  366|       |
  367|    623|        this_number = namemap_add_name(namemap, number, p);
  368|    623|        if (number == 0) {
  ------------------
  |  Branch (368:13): [True: 137, False: 486]
  ------------------
  369|    137|            number = this_number;
  370|    486|        } else if (this_number != number) {
  ------------------
  |  Branch (370:20): [True: 0, False: 486]
  ------------------
  371|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  354|      0|# define ERR_R_INTERNAL_ERROR                    (259|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|      0|                           "Got number %d when expecting %d",
  373|      0|                           this_number, number);
  374|      0|            number = 0;
  375|      0|            goto end;
  376|      0|        }
  377|    623|    }
  378|       |
  379|    269| end:
  380|    269|    CRYPTO_THREAD_unlock(namemap->lock);
  381|    269|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  382|    269|    return number;
  383|    269|}
ossl_namemap_stored:
  481|  12.1k|{
  482|  12.1k|#ifndef FIPS_MODULE
  483|  12.1k|    int nms;
  484|  12.1k|#endif
  485|  12.1k|    OSSL_NAMEMAP *namemap =
  486|  12.1k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  102|  12.1k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  487|       |
  488|  12.1k|    if (namemap == NULL)
  ------------------
  |  Branch (488:9): [True: 0, False: 12.1k]
  ------------------
  489|      0|        return NULL;
  490|       |
  491|  12.1k|#ifndef FIPS_MODULE
  492|  12.1k|    nms = ossl_namemap_empty(namemap);
  493|  12.1k|    if (nms < 0) {
  ------------------
  |  Branch (493:9): [True: 0, False: 12.1k]
  ------------------
  494|       |        /*
  495|       |         * Could not get lock to make the count, so maybe internal objects
  496|       |         * weren't added. This seems safest.
  497|       |         */
  498|      0|        return NULL;
  499|      0|    }
  500|  12.1k|    if (nms == 1) {
  ------------------
  |  Branch (500:9): [True: 1, False: 12.1k]
  ------------------
  501|      1|        int i, end;
  502|       |
  503|       |        /* Before pilfering, we make sure the legacy database is populated */
  504|      1|        OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  468|      1|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  505|      1|                            | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
  ------------------
  |  |  469|      1|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  506|       |
  507|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|      1|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  508|      1|                        get_legacy_cipher_names, namemap);
  509|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|      1|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  510|      1|                        get_legacy_md_names, namemap);
  511|       |
  512|       |        /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
  513|     16|        for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (513:54): [True: 15, False: 1]
  ------------------
  514|     15|            get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
  515|      1|    }
  516|  12.1k|#endif
  517|       |
  518|  12.1k|    return namemap;
  519|  12.1k|}
ossl_namemap_new:
  522|      4|{
  523|      4|    OSSL_NAMEMAP *namemap;
  524|      4|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
  ------------------
  |  |   16|      4|#define NAMEMAP_HT_BUCKETS 2048
  ------------------
  525|       |
  526|      4|    htconf.ctx = libctx;
  527|       |
  528|      4|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (528:9): [True: 0, False: 4]
  ------------------
  529|      0|        goto err;
  530|       |
  531|      4|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 4]
  ------------------
  532|      0|        goto err;
  533|       |
  534|      4|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (534:9): [True: 0, False: 4]
  ------------------
  535|      0|        goto err;
  536|       |
  537|      4|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 4]
  ------------------
  538|      0|        goto err;
  539|       |
  540|      4|    return namemap;
  541|       |
  542|      0| err:
  543|      0|    ossl_namemap_free(namemap);
  544|      0|    return NULL;
  545|      4|}
ossl_namemap_free:
  548|      2|{
  549|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (549:9): [True: 0, False: 2]
  |  Branch (549:28): [True: 0, False: 2]
  ------------------
  550|      0|        return;
  551|       |
  552|      2|    sk_NAMES_pop_free(namemap->numnames, names_free);
  553|       |
  554|      2|    ossl_ht_free(namemap->namenum_ht);
  555|       |
  556|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  557|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      2|}
core_namemap.c:namemap_add_name:
  258|  1.27k|{
  259|  1.27k|    int ret;
  260|  1.27k|    HT_VALUE val = { 0 };
  261|  1.27k|    NAMENUM_KEY key;
  262|       |
  263|       |    /* If it already exists, we don't add it */
  264|  1.27k|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (264:9): [True: 681, False: 590]
  ------------------
  265|    681|        return ret;
  266|       |
  267|    590|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (267:9): [True: 0, False: 590]
  ------------------
  268|      0|        return 0;
  269|       |
  270|       |    /* Using tsan_store alone here is safe since we're under lock */
  271|    590|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|    590|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  272|       |
  273|    590|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    590|#define HT_INIT_KEY(key) do { \
  |  |  108|    590|memset((key), 0, sizeof(*(key))); \
  |  |  109|    590|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    590|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    590|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|    590|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|    590|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|    590|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|    590|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|    590|    val.value = (void *)(intptr_t)number;
  276|    590|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  173|    590|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  277|    590|    if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
  ------------------
  |  |   52|    590|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    590|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (277:9): [True: 0, False: 590]
  ------------------
  278|      0|        return 0;
  279|    590|    if (ret < 1) {
  ------------------
  |  Branch (279:9): [True: 0, False: 590]
  ------------------
  280|       |        /* unable to insert due to too many collisions */
  281|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_NAMES);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return 0;
  283|      0|    }
  284|    590|    return number;
  285|    590|}
core_namemap.c:numname_insert:
  217|    590|{
  218|    590|    NAMES *names;
  219|    590|    char *tmpname;
  220|       |
  221|    590|    if (number > 0) {
  ------------------
  |  Branch (221:9): [True: 335, False: 255]
  ------------------
  222|    335|        names = sk_NAMES_value(namemap->numnames, number - 1);
  223|    335|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   52|    335|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    335|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (223:13): [True: 0, False: 335]
  ------------------
  224|       |            /* cannot happen */
  225|      0|            return 0;
  226|      0|        }
  227|    335|    } else {
  228|       |        /* a completely new entry */
  229|    255|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  232|    255|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  230|    255|        if (names == NULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 255]
  ------------------
  231|      0|            return 0;
  232|    255|    }
  233|       |
  234|    590|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    590|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    590|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    590|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (234:9): [True: 0, False: 590]
  ------------------
  235|      0|        goto err;
  236|       |
  237|    590|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  239|    590|#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
  ------------------
  |  Branch (237:9): [True: 0, False: 590]
  ------------------
  238|      0|        goto err;
  239|    590|    tmpname = NULL;
  240|       |
  241|    590|    if (number <= 0) {
  ------------------
  |  Branch (241:9): [True: 255, False: 335]
  ------------------
  242|    255|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (242:13): [True: 0, False: 255]
  ------------------
  243|      0|            goto err;
  244|    255|        number = sk_NAMES_num(namemap->numnames);
  245|    255|    }
  246|    590|    return number;
  247|       |
  248|      0| err:
  249|      0|    if (number <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|        sk_OPENSSL_STRING_pop_free(names, name_string_free);
  ------------------
  |  |  243|      0|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  251|      0|    OPENSSL_free(tmpname);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  252|      0|    return 0;
  253|    590|}
core_namemap.c:name_string_free:
   44|    590|{
   45|    590|    OPENSSL_free(name);
  ------------------
  |  |  115|    590|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    590|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    590|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|    590|}
core_namemap.c:get_legacy_cipher_names:
  420|    183|{
  421|    183|    const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
  422|       |
  423|    183|    if (cipher != NULL)
  ------------------
  |  Branch (423:9): [True: 183, False: 0]
  ------------------
  424|    183|        get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
  ------------------
  |  |   18|    183|#define NID_undef                       0
  ------------------
  425|    183|}
core_namemap.c:get_legacy_evp_names:
  396|    258|{
  397|    258|    int num = 0;
  398|    258|    ASN1_OBJECT *obj;
  399|       |
  400|    258|    if (base_nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (400:9): [True: 4, False: 254]
  ------------------
  401|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  402|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  403|      4|    }
  404|       |
  405|    258|    if (nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (405:9): [True: 210, False: 48]
  ------------------
  406|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  407|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  408|    210|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (408:13): [True: 210, False: 0]
  ------------------
  409|    210|            char txtoid[OSSL_MAX_NAME_SIZE];
  410|       |
  411|    210|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (411:17): [True: 209, False: 1]
  ------------------
  412|    209|                num = ossl_namemap_add_name(arg, num, txtoid);
  413|    210|        }
  414|    210|    }
  415|    258|    if (pem_name != NULL)
  ------------------
  |  Branch (415:9): [True: 11, False: 247]
  ------------------
  416|     11|        num = ossl_namemap_add_name(arg, num, pem_name);
  417|    258|}
core_namemap.c:get_legacy_md_names:
  428|     59|{
  429|     59|    const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
  430|       |
  431|     59|    if (md != NULL)
  ------------------
  |  Branch (431:9): [True: 59, False: 0]
  ------------------
  432|     59|        get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
  433|     59|}
core_namemap.c:get_legacy_pkey_meth_names:
  437|     15|{
  438|     15|    int nid = 0, base_nid = 0, flags = 0;
  439|     15|    const char *pem_name = NULL;
  440|       |
  441|     15|    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  442|     15|    if (nid != NID_undef) {
  ------------------
  |  |   18|     15|#define NID_undef                       0
  ------------------
  |  Branch (442:9): [True: 15, False: 0]
  ------------------
  443|     15|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1606|     15|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (443:13): [True: 10, False: 5]
  ------------------
  444|     10|            switch (nid) {
  445|      1|            case EVP_PKEY_DHX:
  ------------------
  |  |   72|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5499|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (445:13): [True: 1, False: 9]
  ------------------
  446|       |                /* We know that the name "DHX" is used too */
  447|      1|                get_legacy_evp_names(0, nid, "DHX", arg);
  448|       |                /* FALLTHRU */
  449|     10|            default:
  ------------------
  |  Branch (449:13): [True: 9, False: 1]
  ------------------
  450|     10|                get_legacy_evp_names(0, nid, pem_name, arg);
  451|     10|            }
  452|     10|        } else {
  453|       |            /*
  454|       |             * Treat aliases carefully, some of them are undesirable, or
  455|       |             * should not be treated as such for providers.
  456|       |             */
  457|       |
  458|      5|            switch (nid) {
  459|      1|            case EVP_PKEY_SM2:
  ------------------
  |  |   74|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (459:13): [True: 1, False: 4]
  ------------------
  460|       |                /*
  461|       |                 * SM2 is a separate keytype with providers, not an alias for
  462|       |                 * EC.
  463|       |                 */
  464|      1|                get_legacy_evp_names(0, nid, pem_name, arg);
  465|      1|                break;
  466|      4|            default:
  ------------------
  |  Branch (466:13): [True: 4, False: 1]
  ------------------
  467|       |                /* Use the short name of the base nid as the common reference */
  468|      4|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  469|      5|            }
  470|      5|        }
  471|     15|    }
  472|     15|}
core_namemap.c:names_free:
   49|    255|{
   50|    255|    sk_OPENSSL_STRING_pop_free(n, name_string_free);
  ------------------
  |  |  243|    255|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
   51|    255|}

ossl_err_load_CRYPTO_strings:
   83|      2|{
   84|      2|#ifndef OPENSSL_NO_ERR
   85|      2|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (85:9): [True: 2, False: 0]
  ------------------
   86|      2|        ERR_load_strings_const(CRYPTO_str_reasons);
   87|      2|#endif
   88|      2|    return 1;
   89|      2|}

OPENSSL_cpuid_setup:
   96|      2|{
   97|      2|    static int trigger = 0;
   98|      2|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      2|    IA32CAP vec;
  100|      2|    const variant_char *env;
  101|      2|    int index = 2;
  102|       |
  103|      2|    if (trigger)
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        return;
  105|       |
  106|      2|    trigger = 1;
  107|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      2|#   define ossl_getenv getenv
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (108:19): [True: 0, False: 0]
  ------------------
  109|       |
  110|      0|        vec = ossl_strtouint64(env + off);
  111|       |
  112|      0|        if (off) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            IA32CAP mask = vec;
  114|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  115|      0|            if (mask & (1<<24)) {
  ------------------
  |  Branch (115:17): [True: 0, False: 0]
  ------------------
  116|       |                /*
  117|       |                 * User disables FXSR bit, mask even other capabilities
  118|       |                 * that operate exclusively on XMM, so we don't have to
  119|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  120|       |                 * AES-NI and AVX. Formally speaking we don't have to
  121|       |                 * do it in x86_64 case, but we can safely assume that
  122|       |                 * x86_64 users won't actually flip this flag.
  123|       |                 */
  124|      0|                vec &= ~((IA32CAP)(1<<1|1<<11|1<<25|1<<28) << 32);
  125|      0|            }
  126|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (126:20): [True: 0, False: 0]
  ------------------
  127|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  128|      0|        }
  129|       |
  130|       |        /* Processed indexes 0, 1 */
  131|      0|        if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            env++;
  133|      0|        for (; index < OPENSSL_IA32CAP_P_MAX_INDEXES; index += 2) {
  ------------------
  |  |   39|      0|#  define OPENSSL_IA32CAP_P_MAX_INDEXES 10
  ------------------
  |  Branch (133:16): [True: 0, False: 0]
  ------------------
  134|      0|            if ((env != NULL) && (env[0] != '\0')) {
  ------------------
  |  Branch (134:17): [True: 0, False: 0]
  |  Branch (134:34): [True: 0, False: 0]
  ------------------
  135|       |                /* if env[0] == ':' current index is skipped */
  136|      0|                if (env[0] != ':') {
  ------------------
  |  Branch (136:21): [True: 0, False: 0]
  ------------------
  137|      0|                    IA32CAP vecx;
  138|       |
  139|      0|                    off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (139:27): [True: 0, False: 0]
  ------------------
  140|      0|                    vecx = ossl_strtouint64(env + off);
  141|      0|                    if (off) {
  ------------------
  |  Branch (141:25): [True: 0, False: 0]
  ------------------
  142|      0|                        OPENSSL_ia32cap_P[index] &= ~(unsigned int)vecx;
  143|      0|                        OPENSSL_ia32cap_P[index + 1] &= ~(unsigned int)(vecx >> 32);
  144|      0|                    } else {
  145|      0|                        OPENSSL_ia32cap_P[index] = (unsigned int)vecx;
  146|      0|                        OPENSSL_ia32cap_P[index + 1] = (unsigned int)(vecx >> 32);
  147|      0|                    }
  148|      0|                }
  149|       |                /* skip delimeter */
  150|      0|                if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (150:21): [True: 0, False: 0]
  ------------------
  151|      0|                    env++;
  152|      0|            } else { /* zeroize the next two indexes */
  153|      0|                OPENSSL_ia32cap_P[index] = 0;
  154|      0|                OPENSSL_ia32cap_P[index + 1] = 0;
  155|      0|            }
  156|      0|        }
  157|       |
  158|       |        /* If AVX10 is disabled, zero out its detailed cap bits */
  159|      0|        if (!(OPENSSL_ia32cap_P[6] & (1 << 19)))
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            OPENSSL_ia32cap_P[9] = 0;
  161|      2|    } else {
  162|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  163|      2|    }
  164|       |
  165|       |    /*
  166|       |     * |(1<<10) sets a reserved bit to signal that variable
  167|       |     * was initialized already... This is to avoid interference
  168|       |     * with cpuid snippets in ELF .init segment.
  169|       |     */
  170|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  171|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  172|      2|}

ossl_err_load_CRMF_strings:
   78|      2|{
   79|      2|# ifndef OPENSSL_NO_ERR
   80|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (80:9): [True: 2, False: 0]
  ------------------
   81|      2|        ERR_load_strings_const(CRMF_str_reasons);
   82|      2|# endif
   83|      2|    return 1;
   84|      2|}

ossl_err_load_CT_strings:
   52|      2|{
   53|      2|# ifndef OPENSSL_NO_ERR
   54|      2|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        ERR_load_strings_const(CT_str_reasons);
   56|      2|# endif
   57|      2|    return 1;
   58|      2|}

CTLOG_STORE_new_ex:
  101|     79|{
  102|     79|    CTLOG_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|       |
  104|     79|    if (ret == NULL)
  ------------------
  |  Branch (104:9): [True: 0, False: 79]
  ------------------
  105|      0|        return NULL;
  106|       |
  107|     79|    ret->libctx = libctx;
  108|     79|    if (propq != NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 79]
  ------------------
  109|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (110:13): [True: 0, False: 0]
  ------------------
  111|      0|            goto err;
  112|      0|    }
  113|       |
  114|     79|    ret->logs = sk_CTLOG_new_null();
  ------------------
  |  |   72|     79|#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null())
  ------------------
  115|     79|    if (ret->logs == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 79]
  ------------------
  116|      0|        ERR_raise(ERR_LIB_CT, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|        goto err;
  118|      0|    }
  119|       |
  120|     79|    return ret;
  121|      0|err:
  122|      0|    CTLOG_STORE_free(ret);
  123|      0|    return NULL;
  124|     79|}
CTLOG_STORE_free:
  132|     79|{
  133|     79|    if (store != NULL) {
  ------------------
  |  Branch (133:9): [True: 79, False: 0]
  ------------------
  134|     79|        OPENSSL_free(store->propq);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  135|     79|        sk_CTLOG_pop_free(store->logs, CTLOG_free);
  ------------------
  |  |   83|     79|#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_freefunc_type(freefunc))
  ------------------
  136|     79|        OPENSSL_free(store);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|     79|    }
  138|     79|}

ossl_ctype_check:
  253|    108|{
  254|    108|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|    108|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|    108|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|    108|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 108, False: 0]
  |  Branch (257:22): [True: 108, False: 0]
  |  Branch (257:33): [True: 34, False: 74]
  ------------------
  258|    108|}
ossl_isdigit:
  270|  13.0k|{
  271|  13.0k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  13.0k|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  13.0k|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  13.0k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 13.0k, False: 0]
  |  |  |  Branch (265:43): [True: 6.63k, False: 6.44k]
  |  |  ------------------
  ------------------
  274|  13.0k|}
ossl_tolower:
  297|  70.2k|{
  298|  70.2k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  70.2k|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  70.2k|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  70.2k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 46.0k, False: 24.2k]
  |  |  |  Branch (266:43): [True: 14.4k, False: 31.5k]
  |  |  ------------------
  ------------------
  301|  70.2k|}

ossl_err_load_DH_strings:
   68|      2|{
   69|      2|# ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(DH_str_reasons);
   72|      2|# endif
   73|      2|    return 1;
   74|      2|}

dsa_ameth.c:int_dsa_free:
  268|     79|{
  269|     79|    DSA_free(pkey->pkey.dsa);
  270|     79|}

ossl_err_load_DSA_strings:
   46|      2|{
   47|      2|# ifndef OPENSSL_NO_ERR
   48|      2|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 2, False: 0]
  ------------------
   49|      2|        ERR_load_strings_const(DSA_str_reasons);
   50|      2|# endif
   51|      2|    return 1;
   52|      2|}

DSA_free:
  214|     79|{
  215|     79|    int i;
  216|       |
  217|     79|    if (r == NULL)
  ------------------
  |  Branch (217:9): [True: 79, False: 0]
  ------------------
  218|     79|        return;
  219|       |
  220|      0|    CRYPTO_DOWN_REF(&r->references, &i);
  221|      0|    REF_PRINT_COUNT("DSA", i, r);
  ------------------
  |  |  301|      0|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|      0|    if (i > 0)
  ------------------
  |  Branch (222:9): [True: 0, False: 0]
  ------------------
  223|      0|        return;
  224|      0|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  225|       |
  226|      0|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 0]
  |  Branch (226:28): [True: 0, False: 0]
  ------------------
  227|      0|        r->meth->finish(r);
  228|      0|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  229|      0|    ENGINE_finish(r->engine);
  230|      0|#endif
  231|       |
  232|      0|#ifndef FIPS_MODULE
  233|      0|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  236|      0|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  234|      0|#endif
  235|       |
  236|      0|    CRYPTO_THREAD_lock_free(r->lock);
  237|      0|    CRYPTO_FREE_REF(&r->references);
  238|       |
  239|      0|    ossl_ffc_params_cleanup(&r->params);
  240|      0|    BN_clear_free(r->pub_key);
  241|      0|    BN_clear_free(r->priv_key);
  242|      0|    OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|      0|}

ossl_err_load_DSO_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(DSO_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

DSO_free:
   48|      1|{
   49|      1|    int i;
   50|       |
   51|      1|    if (dso == NULL)
  ------------------
  |  Branch (51:9): [True: 1, False: 0]
  ------------------
   52|      1|        return 1;
   53|       |
   54|      0|    if (CRYPTO_DOWN_REF(&dso->references, &i) <= 0)
  ------------------
  |  Branch (54:9): [True: 0, False: 0]
  ------------------
   55|      0|        return 0;
   56|       |
   57|      0|    REF_PRINT_COUNT("DSO", i, dso);
  ------------------
  |  |  301|      0|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|      0|    if (i > 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        return 1;
   60|      0|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   61|       |
   62|      0|    if ((dso->flags & DSO_FLAG_NO_UNLOAD_ON_FREE) == 0) {
  ------------------
  |  |   46|      0|# define DSO_FLAG_NO_UNLOAD_ON_FREE              0x04
  ------------------
  |  Branch (62:9): [True: 0, False: 0]
  ------------------
   63|      0|        if ((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) {
  ------------------
  |  Branch (63:13): [True: 0, False: 0]
  |  Branch (63:48): [True: 0, False: 0]
  ------------------
   64|      0|            ERR_raise(ERR_LIB_DSO, DSO_R_UNLOAD_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   65|      0|            return 0;
   66|      0|        }
   67|      0|    }
   68|       |
   69|      0|    if ((dso->meth->finish != NULL) && !dso->meth->finish(dso)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 0]
  |  Branch (69:40): [True: 0, False: 0]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_FINISH_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|      0|    sk_void_free(dso->meth_data);
  ------------------
  |  |  204|      0|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   75|      0|    OPENSSL_free(dso->filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|    OPENSSL_free(dso->loaded_filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      0|    CRYPTO_FREE_REF(&dso->references);
   78|      0|    OPENSSL_free(dso);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|    return 1;
   80|      0|}

ossl_err_load_EC_strings:
  127|      2|{
  128|      2|# ifndef OPENSSL_NO_ERR
  129|      2|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 2, False: 0]
  ------------------
  130|      2|        ERR_load_strings_const(EC_str_reasons);
  131|      2|# endif
  132|      2|    return 1;
  133|      2|}

ossl_decoder_store_cache_flush:
  442|      2|{
  443|      2|    OSSL_METHOD_STORE *store = get_decoder_store(libctx);
  444|       |
  445|      2|    if (store != NULL)
  ------------------
  |  Branch (445:9): [True: 2, False: 0]
  ------------------
  446|      2|        return ossl_method_store_cache_flush_all(store);
  447|      0|    return 1;
  448|      2|}
decoder_meth.c:get_decoder_store:
  112|      2|{
  113|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  111|      2|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  114|      2|}

ossl_decoder_cache_new:
  703|      4|{
  704|      4|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      4|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|      4|    if (cache == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 4]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|      4|    cache->lock = CRYPTO_THREAD_lock_new();
  710|      4|    if (cache->lock == NULL) {
  ------------------
  |  Branch (710:9): [True: 0, False: 4]
  ------------------
  711|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|      0|        return NULL;
  713|      0|    }
  714|      4|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  715|      4|                                                  decoder_cache_entry_cmp);
  716|      4|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (716:9): [True: 0, False: 4]
  ------------------
  717|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  718|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  719|      0|        return NULL;
  720|      0|    }
  721|       |
  722|      4|    return cache;
  723|      4|}
ossl_decoder_cache_free:
  726|      2|{
  727|      2|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  728|       |
  729|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  730|      2|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  731|      2|    CRYPTO_THREAD_lock_free(cache->lock);
  732|      2|    OPENSSL_free(cache);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  733|      2|}
ossl_decoder_cache_flush:
  740|      5|{
  741|      5|    DECODER_CACHE *cache
  742|      5|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  120|      5|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  743|       |
  744|      5|    if (cache == NULL)
  ------------------
  |  Branch (744:9): [True: 3, False: 2]
  ------------------
  745|      3|        return 0;
  746|       |
  747|       |
  748|      2|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (748:9): [True: 0, False: 2]
  ------------------
  749|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|        return 0;
  751|      0|    }
  752|       |
  753|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  754|      2|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  755|       |
  756|      2|    CRYPTO_THREAD_unlock(cache->lock);
  757|      2|    return 1;
  758|      2|}

ossl_encoder_store_cache_flush:
  451|      2|{
  452|      2|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  453|       |
  454|      2|    if (store != NULL)
  ------------------
  |  Branch (454:9): [True: 2, False: 0]
  ------------------
  455|      2|        return ossl_method_store_cache_flush_all(store);
  456|      0|    return 1;
  457|      2|}
encoder_meth.c:get_encoder_store:
  112|      2|{
  113|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX);
  ------------------
  |  |  110|      2|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  114|      2|}

ossl_err_load_ENGINE_strings:
   85|      2|{
   86|      2|# ifndef OPENSSL_NO_ERR
   87|      2|    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (87:9): [True: 2, False: 0]
  ------------------
   88|      2|        ERR_load_strings_const(ENGINE_str_reasons);
   89|      2|# endif
   90|      2|    return 1;
   91|      2|}

ENGINE_finish:
  107|  4.18k|{
  108|  4.18k|    int to_return = 1;
  109|       |
  110|  4.18k|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 4.18k, False: 0]
  ------------------
  111|  4.18k|        return 1;
  112|      0|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (112:9): [True: 0, False: 0]
  ------------------
  113|      0|        return 0;
  114|      0|    to_return = engine_unlocked_finish(e, 1);
  115|      0|    CRYPTO_THREAD_unlock(global_engine_lock);
  116|      0|    if (!to_return) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        return 0;
  119|      0|    }
  120|      0|    return to_return;
  121|      0|}

engine_cleanup_int:
  176|      2|{
  177|      2|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      0|                                        engine_cleanup_cb_free);
  180|      0|        cleanup_stack = NULL;
  181|      0|    }
  182|      2|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|      2|    global_engine_lock = NULL;
  184|      2|}
eng_lib.c:do_engine_lock_init:
   22|      1|{
   23|      1|    global_engine_lock = CRYPTO_THREAD_lock_new();
   24|      1|    return global_engine_lock != NULL;
   25|      1|}
eng_lib.c:int_cleanup_check:
  119|      2|{
  120|      2|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 1;
  122|      2|    if (!create)
  ------------------
  |  Branch (122:9): [True: 2, False: 0]
  ------------------
  123|      2|        return 0;
  124|      0|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  125|      0|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|      2|}

ossl_engine_table_select:
  202|  5.99k|{
  203|  5.99k|    ENGINE *ret = NULL;
  204|  5.99k|    ENGINE_PILE tmplate, *fnd = NULL;
  205|  5.99k|    int initres, loop = 0;
  206|       |
  207|  5.99k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
  208|       |    /* Load the config before trying to check if engines are available */
  209|  5.99k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  5.99k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  210|  5.99k|#endif
  211|       |
  212|  5.99k|    if (!(*table)) {
  ------------------
  |  Branch (212:9): [True: 5.99k, False: 0]
  ------------------
  213|  5.99k|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|  5.99k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|  5.99k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  214|  5.99k|                   "%s:%d, nid=%d, nothing registered!\n",
  215|  5.99k|                   f, l, nid);
  216|  5.99k|        return NULL;
  217|  5.99k|    }
  218|       |
  219|      0|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        return NULL;
  221|       |
  222|      0|    ERR_set_mark();
  223|       |    /*
  224|       |     * Check again inside the lock otherwise we could race against cleanup
  225|       |     * operations. But don't worry about a debug printout
  226|       |     */
  227|      0|    if (!int_table_check(table, 0))
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  ------------------
  228|      0|        goto end;
  229|      0|    tmplate.nid = nid;
  230|      0|    fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
  231|      0|    if (!fnd)
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|      0|        goto end;
  233|      0|    if (fnd->funct && engine_unlocked_init(fnd->funct)) {
  ------------------
  |  Branch (233:9): [True: 0, False: 0]
  |  Branch (233:23): [True: 0, False: 0]
  ------------------
  234|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  235|      0|                   "%s:%d, nid=%d, using ENGINE '%s' cached\n",
  236|      0|                   f, l, nid, fnd->funct->id);
  237|      0|        ret = fnd->funct;
  238|      0|        goto end;
  239|      0|    }
  240|      0|    if (fnd->uptodate) {
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        ret = fnd->funct;
  242|      0|        goto end;
  243|      0|    }
  244|      0| trynext:
  245|      0|    ret = sk_ENGINE_value(fnd->sk, loop++);
  246|      0|    if (!ret) {
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  248|      0|                    "%s:%d, nid=%d, "
  249|      0|                    "no registered implementations would initialise\n",
  250|      0|                    f, l, nid);
  251|      0|        goto end;
  252|      0|    }
  253|       |    /* Try to initialise the ENGINE? */
  254|      0|    if ((ret->funct_ref > 0) || !(table_flags & ENGINE_TABLE_FLAG_NOINIT))
  ------------------
  |  |   64|      0|#  define ENGINE_TABLE_FLAG_NOINIT        (unsigned int)0x0001
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  |  Branch (254:33): [True: 0, False: 0]
  ------------------
  255|      0|        initres = engine_unlocked_init(ret);
  256|      0|    else
  257|      0|        initres = 0;
  258|      0|    if (initres) {
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|       |        /* Update 'funct' */
  260|      0|        if ((fnd->funct != ret) && engine_unlocked_init(ret)) {
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  |  Branch (260:36): [True: 0, False: 0]
  ------------------
  261|       |            /* If there was a previous default we release it. */
  262|      0|            if (fnd->funct)
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  ------------------
  263|      0|                engine_unlocked_finish(fnd->funct, 0);
  264|      0|            fnd->funct = ret;
  265|      0|            OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  266|      0|                        "%s:%d, nid=%d, setting default to '%s'\n",
  267|      0|                        f, l, nid, ret->id);
  268|      0|        }
  269|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  270|      0|                    "%s:%d, nid=%d, using newly initialised '%s'\n",
  271|      0|                    f, l, nid, ret->id);
  272|      0|        goto end;
  273|      0|    }
  274|      0|    goto trynext;
  275|      0| end:
  276|       |    /*
  277|       |     * If it failed, it is unlikely to succeed again until some future
  278|       |     * registrations have taken place. In all cases, we cache.
  279|       |     */
  280|      0|    if (fnd)
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|        fnd->uptodate = 1;
  282|      0|    if (ret)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  284|      0|                   "%s:%d, nid=%d, caching ENGINE '%s'\n",
  285|      0|                   f, l, nid, ret->id);
  286|      0|    else
  287|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  288|      0|                    "%s:%d, nid=%d, caching 'no matching ENGINE'\n",
  289|      0|                    f, l, nid);
  290|      0|    CRYPTO_THREAD_unlock(global_engine_lock);
  291|       |    /*
  292|       |     * Whatever happened, any failed init()s are not failures in this
  293|       |     * context, so clear our error state.
  294|       |     */
  295|      0|    ERR_pop_to_mark();
  296|      0|    return ret;
  297|      0|}
engine_table_doall:
  310|    553|{
  311|    553|    ENGINE_PILE_DOALL dall;
  312|    553|    dall.cb = cb;
  313|    553|    dall.arg = arg;
  314|    553|    if (table)
  ------------------
  |  Branch (314:9): [True: 0, False: 553]
  ------------------
  315|      0|        lh_ENGINE_PILE_doall_ENGINE_PILE_DOALL(&table->piles, int_dall, &dall);
  316|    553|}

ENGINE_get_pkey_asn1_meth_engine:
   78|    704|{
   79|    704|    return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
   80|    704|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|    704|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|    704|#   define OPENSSL_LINE __LINE__
  ------------------
   81|    704|}
ENGINE_pkey_asn1_find_str:
  191|    553|{
  192|    553|    ENGINE_FIND_STR fstr;
  193|    553|    fstr.e = NULL;
  194|    553|    fstr.ameth = NULL;
  195|    553|    fstr.str = str;
  196|    553|    fstr.len = len;
  197|       |
  198|    553|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|    553|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 553, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (198:9): [True: 0, False: 553]
  ------------------
  199|       |        /* Maybe this should be raised in do_engine_lock_init() */
  200|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return NULL;
  202|      0|    }
  203|       |
  204|    553|    if (!CRYPTO_THREAD_read_lock(global_engine_lock))
  ------------------
  |  Branch (204:9): [True: 0, False: 553]
  ------------------
  205|      0|        return NULL;
  206|    553|    engine_table_doall(pkey_asn1_meth_table, look_str_cb, &fstr);
  207|       |    /* If found obtain a structural reference to engine */
  208|    553|    if (fstr.e != NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 553]
  ------------------
  209|      0|        int ref;
  210|       |
  211|      0|        if (!CRYPTO_UP_REF(&fstr.e->struct_ref, &ref)) {
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
  213|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return NULL;
  215|      0|        }
  216|      0|        ENGINE_REF_PRINT(fstr.e, 0, 1);
  ------------------
  |  |   29|      0|    OSSL_TRACE6(ENGINE_REF_COUNT,                                       \
  |  |  ------------------
  |  |  |  |  301|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|               "engine: %p %s from %d to %d (%s:%d)\n",                 \
  |  |   31|      0|               (void *)(e), (isfunct ? "funct" : "struct"),             \
  |  |   32|      0|               ((isfunct)                                               \
  |  |   33|      0|                ? ((e)->funct_ref - (diff))                             \
  |  |   34|      0|                : (eng_struct_ref(e) - (diff))),                        \
  |  |   35|      0|               ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)),        \
  |  |   36|      0|               (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  217|      0|    }
  218|    553|    *pe = fstr.e;
  219|    553|    CRYPTO_THREAD_unlock(global_engine_lock);
  220|    553|    return fstr.ameth;
  221|    553|}

ENGINE_get_cipher_engine:
   67|  1.97k|{
   68|  1.97k|    return ossl_engine_table_select(&cipher_table, nid,
   69|  1.97k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  1.97k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  1.97k|#   define OPENSSL_LINE __LINE__
  ------------------
   70|  1.97k|}

ENGINE_get_digest_engine:
   67|  1.26k|{
   68|  1.26k|    return ossl_engine_table_select(&digest_table, nid,
   69|  1.26k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  1.26k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  1.26k|#   define OPENSSL_LINE __LINE__
  ------------------
   70|  1.26k|}

ENGINE_get_pkey_meth_engine:
   68|  2.05k|{
   69|  2.05k|    return ossl_engine_table_select(&pkey_meth_table, nid,
   70|  2.05k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  ------------------
   71|  2.05k|}

ENGINE_get_default_RAND:
   60|      1|{
   61|      1|    return ossl_engine_table_select(&rand_table, dummy_nid,
   62|      1|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  ------------------
   63|      1|}

OSSL_ERR_STATE_free:
  202|     81|{
  203|     81|    int i;
  204|       |
  205|     81|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 81]
  ------------------
  206|      0|        return;
  207|  1.37k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  1.37k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 1.29k, False: 81]
  ------------------
  208|  1.29k|        err_clear(state, i, 1);
  209|  1.29k|    }
  210|     81|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|     81|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|     81|#   define OPENSSL_LINE __LINE__
  ------------------
  211|     81|}
err_cleanup:
  233|      2|{
  234|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  ------------------
  235|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      2|    err_string_lock = NULL;
  238|      2|#ifndef OPENSSL_NO_ERR
  239|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      2|    int_error_hash = NULL;
  241|      2|#endif
  242|      2|}
ossl_err_load_ERR_strings:
  272|     72|{
  273|     72|#ifndef OPENSSL_NO_ERR
  274|     72|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     72|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 72, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 72]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     72|    err_load_strings(ERR_str_libraries);
  278|     72|    err_load_strings(ERR_str_reasons);
  279|     72|#endif
  280|     72|    return 1;
  281|     72|}
ERR_load_strings_const:
  297|     70|{
  298|     70|#ifndef OPENSSL_NO_ERR
  299|     70|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 70]
  ------------------
  300|      0|        return 0;
  301|     70|    err_load_strings(str);
  302|     70|#endif
  303|       |
  304|     70|    return 1;
  305|     70|}
ERR_clear_error:
  335|     81|{
  336|     81|    int i;
  337|     81|    ERR_STATE *es;
  338|       |
  339|     81|    es = ossl_err_get_state_int();
  340|     81|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 81]
  ------------------
  341|      0|        return;
  342|       |
  343|  1.37k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  1.37k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 1.29k, False: 81]
  ------------------
  344|  1.29k|        err_clear(es, i, 0);
  345|  1.29k|    }
  346|     81|    es->top = es->bottom = 0;
  347|     81|}
ERR_peek_last_error:
  410|    162|{
  411|    162|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|    162|}
ERR_reason_error_string:
  613|     70|{
  614|     70|#ifndef OPENSSL_NO_ERR
  615|     70|    ERR_STRING_DATA d, *p = NULL;
  616|     70|    unsigned long l, r;
  617|       |
  618|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 70]
  ------------------
  619|      0|        return NULL;
  620|      0|    }
  621|       |
  622|       |    /*
  623|       |     * ERR_reason_error_string() can't safely return system error strings,
  624|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  625|       |     * haven't got one that would serve any sensible purpose.
  626|       |     */
  627|     70|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     70|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     70|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 70]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     70|    l = ERR_GET_LIB(e);
  631|     70|    r = ERR_GET_REASON(e);
  632|     70|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     70|    p = int_err_get_item(&d);
  634|     70|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 70, False: 0]
  ------------------
  635|     70|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     70|        p = int_err_get_item(&d);
  637|     70|    }
  638|     70|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 70, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     70|}
ossl_err_get_state_int:
  673|  21.8k|{
  674|  21.8k|    ERR_STATE *state;
  675|  21.8k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  21.8k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  21.8k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  21.8k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 21.8k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  21.8k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  21.8k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 21.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 21.8k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  21.8k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  21.8k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 21.8k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  21.8k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 21.8k]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        state = OSSL_ERR_STATE_new();
  692|      2|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 2]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 2]
  ------------------
  698|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 2]
  ------------------
  699|      0|            OSSL_ERR_STATE_free(state);
  700|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  701|      0|            return NULL;
  702|      0|        }
  703|       |
  704|       |        /* Ignore failures from these */
  705|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  21.8k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  21.8k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  21.8k|    return state;
  710|  21.8k|}
err_shelve_state:
  725|      2|{
  726|      2|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
  727|       |
  728|       |    /*
  729|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  730|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  731|       |     * "base" initialization has already been performed, so the below call is a
  732|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  733|       |     *
  734|       |     * If are no other valid callers of this function, the call below can be
  735|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  736|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  737|       |     * call is needed, but some care is required to make sure that the re-entry
  738|       |     * remains a NOOP.
  739|       |     */
  740|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 2]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      2|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 2]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      2|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      2|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 2]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      2|    return 1;
  752|      2|}
err_unshelve_state:
  759|      2|{
  760|      2|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 2, False: 0]
  ------------------
  761|      2|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      2|}
ERR_get_next_error_library:
  765|      3|{
  766|      3|    int ret;
  767|       |
  768|      3|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 3]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      3|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 3]
  ------------------
  772|      0|        return 0;
  773|      3|    ret = int_err_library_number++;
  774|      3|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      3|    return ret;
  776|      3|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  9.64k|{
  173|  9.64k|    unsigned long ret, l;
  174|       |
  175|  9.64k|    l = a->error;
  176|  9.64k|    ret = l ^ ERR_GET_LIB(l);
  177|  9.64k|    return (ret ^ ret % 19 * 13);
  178|  9.64k|}
err.c:err_string_data_cmp:
  182|  6.16k|{
  183|  6.16k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.74k, False: 420]
  ------------------
  184|  5.74k|        return 0;
  185|    420|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 226, False: 194]
  ------------------
  186|  6.16k|}
err.c:err_load_strings:
  260|    214|{
  261|    214|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 214]
  ------------------
  262|      0|        return 0;
  263|  9.71k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 9.50k, False: 214]
  ------------------
  264|  9.50k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  9.71k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  265|    214|                                       (ERR_STRING_DATA *)str);
  266|    214|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    214|    return 1;
  268|    214|}
err.c:get_error_values:
  448|    162|{
  449|    162|    int i = 0;
  450|    162|    ERR_STATE *es;
  451|    162|    unsigned long ret;
  452|       |
  453|    162|    es = ossl_err_get_state_int();
  454|    162|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 162]
  ------------------
  455|      0|        return 0;
  456|       |
  457|       |    /*
  458|       |     * Clear anything that should have been cleared earlier. We do this
  459|       |     * here because this doesn't have constant-time issues.
  460|       |     */
  461|    162|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 162, False: 0]
  ------------------
  462|    162|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|    162|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 162]
  ------------------
  463|      0|            err_clear(es, es->top, 0);
  464|      0|            es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (464:23): [True: 0, False: 0]
  ------------------
  465|      0|            continue;
  466|      0|        }
  467|    162|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|    162|#  define ERR_NUM_ERRORS  16
  ------------------
  468|    162|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|    162|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 162]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|    162|        break;
  474|    162|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|    162|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 0, False: 162]
  ------------------
  478|      0|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|    162|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 162, False: 0]
  ------------------
  482|    162|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|    162|    ret = es->err_buffer[i];
  487|    162|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 162]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|    162|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 162]
  ------------------
  493|      0|        *file = es->err_file[i];
  494|      0|        if (*file == NULL)
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            *file = "";
  496|      0|    }
  497|    162|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 162]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|    162|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 162]
  ------------------
  500|      0|        *func = es->err_func[i];
  501|      0|        if (*func == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            *func = "";
  503|      0|    }
  504|    162|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 162]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|    162|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 162, False: 0]
  ------------------
  507|    162|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 162]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|    162|    } else {
  511|      0|        *data = es->err_data[i];
  512|      0|        if (*data == NULL) {
  ------------------
  |  Branch (512:13): [True: 0, False: 0]
  ------------------
  513|      0|            *data = "";
  514|      0|            if (flags != NULL)
  ------------------
  |  Branch (514:17): [True: 0, False: 0]
  ------------------
  515|      0|                *flags = 0;
  516|      0|        }
  517|      0|    }
  518|    162|    return ret;
  519|    162|}
err.c:int_err_get_item:
  189|    140|{
  190|    140|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    140|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 140]
  ------------------
  193|      0|        return NULL;
  194|    140|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    140|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  195|    140|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    140|    return p;
  198|    140|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    OSSL_ERR_STATE_free(state);
  652|      2|}

ossl_err_load_crypto_strings:
   49|      2|{
   50|      2|    if (0
  ------------------
  |  Branch (50:9): [Folded - Ignored]
  ------------------
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (52:12): [True: 0, False: 2]
  ------------------
   53|      2|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (53:12): [True: 0, False: 2]
  ------------------
   54|      2|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 2]
  ------------------
   55|      2|# ifndef OPENSSL_NO_DH
   56|      2|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (56:12): [True: 0, False: 2]
  ------------------
   57|      2|# endif
   58|      2|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (58:12): [True: 0, False: 2]
  ------------------
   59|      2|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 2]
  ------------------
   60|      2|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 2]
  ------------------
   61|      2|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 2]
  ------------------
   62|      2|# ifndef OPENSSL_NO_DSA
   63|      2|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (63:12): [True: 0, False: 2]
  ------------------
   64|      2|# endif
   65|      2|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      2|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 2]
  ------------------
   67|      2|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      2|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 2]
  ------------------
   69|      2|# ifndef OPENSSL_NO_COMP
   70|      2|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (70:12): [True: 0, False: 2]
  ------------------
   71|      2|# endif
   72|      2|# ifndef OPENSSL_NO_EC
   73|      2|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (73:12): [True: 0, False: 2]
  ------------------
   74|      2|# endif
   75|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   76|      2|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (76:12): [True: 0, False: 2]
  ------------------
   77|      2|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 2]
  ------------------
   78|      2|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 2]
  ------------------
   79|      2|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 2]
  ------------------
   80|      2|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 2]
  ------------------
   81|      2|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 2]
  ------------------
   82|      2|# ifndef OPENSSL_NO_TS
   83|      2|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (83:12): [True: 0, False: 2]
  ------------------
   84|      2|# endif
   85|      2|# ifndef OPENSSL_NO_ENGINE
   86|      2|        || ossl_err_load_ENGINE_strings() == 0
  ------------------
  |  Branch (86:12): [True: 0, False: 2]
  ------------------
   87|      2|# endif
   88|      2|# ifndef OPENSSL_NO_HTTP
   89|      2|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (89:12): [True: 0, False: 2]
  ------------------
   90|      2|# endif
   91|      2|# ifndef OPENSSL_NO_OCSP
   92|      2|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (92:12): [True: 0, False: 2]
  ------------------
   93|      2|# endif
   94|      2|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (94:12): [True: 0, False: 2]
  ------------------
   95|      2|# ifndef OPENSSL_NO_CMS
   96|      2|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (96:12): [True: 0, False: 2]
  ------------------
   97|      2|# endif
   98|      2|# ifndef OPENSSL_NO_CRMF
   99|      2|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (99:12): [True: 0, False: 2]
  ------------------
  100|      2|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (100:12): [True: 0, False: 2]
  ------------------
  101|      2|# endif
  102|      2|# ifndef OPENSSL_NO_CT
  103|      2|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (103:12): [True: 0, False: 2]
  ------------------
  104|      2|# endif
  105|      2|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (105:12): [True: 0, False: 2]
  ------------------
  106|      2|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (106:12): [True: 0, False: 2]
  ------------------
  107|      2|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 2]
  ------------------
  108|      2|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (108:12): [True: 0, False: 2]
  ------------------
  109|      2|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (109:12): [True: 0, False: 2]
  ------------------
  110|      2|#endif
  111|      2|        )
  112|      0|        return 0;
  113|       |
  114|      2|    return 1;
  115|      2|}

ERR_new:
   17|  1.66k|{
   18|  1.66k|    ERR_STATE *es;
   19|       |
   20|  1.66k|    es = ossl_err_get_state_int();
   21|  1.66k|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.66k]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  1.66k|    err_get_slot(es);
   26|  1.66k|    err_clear(es, es->top, 0);
   27|  1.66k|}
ERR_set_debug:
   30|  1.66k|{
   31|  1.66k|    ERR_STATE *es;
   32|       |
   33|  1.66k|    es = ossl_err_get_state_int();
   34|  1.66k|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1.66k]
  ------------------
   35|      0|        return;
   36|       |
   37|  1.66k|    err_set_debug(es, es->top, file, line, func);
   38|  1.66k|}
ERR_set_error:
   41|  1.66k|{
   42|  1.66k|    va_list args;
   43|       |
   44|  1.66k|    va_start(args, fmt);
   45|  1.66k|    ERR_vset_error(lib, reason, fmt, args);
   46|  1.66k|    va_end(args);
   47|  1.66k|}
ERR_vset_error:
   50|  1.66k|{
   51|  1.66k|    ERR_STATE *es;
   52|  1.66k|    char *buf = NULL;
   53|  1.66k|    size_t buf_size = 0;
   54|  1.66k|    unsigned long flags = 0;
   55|  1.66k|    size_t i;
   56|       |
   57|  1.66k|    es = ossl_err_get_state_int();
   58|  1.66k|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1.66k]
  ------------------
   59|      0|        return;
   60|  1.66k|    i = es->top;
   61|       |
   62|  1.66k|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 1.26k, False: 399]
  ------------------
   63|  1.26k|        int printed_len = 0;
   64|  1.26k|        char *rbuf = NULL;
   65|       |
   66|  1.26k|        buf = es->err_data[i];
   67|  1.26k|        buf_size = es->err_data_size[i];
   68|       |
   69|       |        /*
   70|       |         * To protect the string we just grabbed from tampering by other
   71|       |         * functions we may call, or to protect them from freeing a pointer
   72|       |         * that may no longer be valid at that point, we clear away the
   73|       |         * data pointer and the flags.  We will set them again at the end
   74|       |         * of this function.
   75|       |         */
   76|  1.26k|        es->err_data[i] = NULL;
   77|  1.26k|        es->err_data_flags[i] = 0;
   78|       |
   79|       |        /*
   80|       |         * Try to maximize the space available.  If that fails, we use what
   81|       |         * we have.
   82|       |         */
   83|  1.26k|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|  2.53k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 1.26k, False: 0]
  ------------------
   84|  1.26k|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  109|  1.26k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.26k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.26k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 1.26k, False: 0]
  ------------------
   85|  1.26k|            buf = rbuf;
   86|  1.26k|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|  1.26k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|  1.26k|        }
   88|       |
   89|  1.26k|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 1.26k, False: 0]
  ------------------
   90|  1.26k|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|  1.26k|        }
   92|  1.26k|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 1.26k]
  ------------------
   93|      0|            printed_len = 0;
   94|  1.26k|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 1.26k, False: 0]
  ------------------
   95|  1.26k|            buf[printed_len] = '\0';
   96|       |
   97|       |        /*
   98|       |         * Try to reduce the size, but only if we maximized above.  If that
   99|       |         * fails, we keep what we have.
  100|       |         * (According to documentation, realloc leaves the old buffer untouched
  101|       |         * if it fails)
  102|       |         */
  103|  1.26k|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  109|  1.26k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.26k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.26k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 1.26k, False: 0]
  ------------------
  104|  1.26k|            buf = rbuf;
  105|  1.26k|            buf_size = printed_len + 1;
  106|  1.26k|            buf[printed_len] = '\0';
  107|  1.26k|        }
  108|       |
  109|  1.26k|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 1.26k, False: 0]
  ------------------
  110|  1.26k|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  1.26k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  1.26k|# define ERR_TXT_STRING          0x02
  ------------------
  111|  1.26k|    }
  112|       |
  113|  1.66k|    err_clear_data(es, es->top, 0);
  114|  1.66k|    err_set_error(es, es->top, lib, reason);
  115|  1.66k|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 1.26k, False: 399]
  ------------------
  116|  1.26k|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  1.66k|}

err.c:err_clear:
   85|  2.59k|{
   86|  2.59k|    err_clear_data(es, i, (deall));
   87|  2.59k|    es->err_marks[i] = 0;
   88|  2.59k|    es->err_flags[i] = 0;
   89|  2.59k|    es->err_buffer[i] = 0;
   90|  2.59k|    es->err_line[i] = -1;
   91|  2.59k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  2.59k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  2.59k|    es->err_file[i] = NULL;
   93|  2.59k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  2.59k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.59k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.59k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  2.59k|    es->err_func[i] = NULL;
   95|  2.59k|}
err.c:err_clear_data:
   22|  2.59k|{
   23|  2.59k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  2.59k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 83, False: 2.50k]
  ------------------
   24|     83|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 2, False: 81]
  ------------------
   25|      2|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      2|            es->err_data[i] = NULL;
   27|      2|            es->err_data_size[i] = 0;
   28|      2|            es->err_data_flags[i] = 0;
   29|     81|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 81, False: 0]
  ------------------
   30|     81|            es->err_data[i][0] = '\0';
   31|     81|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|     81|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|     81|        }
   33|  2.50k|    } else {
   34|  2.50k|        es->err_data[i] = NULL;
   35|  2.50k|        es->err_data_size[i] = 0;
   36|  2.50k|        es->err_data_flags[i] = 0;
   37|  2.50k|    }
   38|  2.59k|}
err_blocks.c:err_get_slot:
   15|  1.66k|{
   16|  1.66k|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  1.66k|#  define ERR_NUM_ERRORS  16
  ------------------
   17|  1.66k|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 0, False: 1.66k]
  ------------------
   18|      0|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
   19|  1.66k|}
err_blocks.c:err_clear:
   85|  1.66k|{
   86|  1.66k|    err_clear_data(es, i, (deall));
   87|  1.66k|    es->err_marks[i] = 0;
   88|  1.66k|    es->err_flags[i] = 0;
   89|  1.66k|    es->err_buffer[i] = 0;
   90|  1.66k|    es->err_line[i] = -1;
   91|  1.66k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  1.66k|    es->err_file[i] = NULL;
   93|  1.66k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  1.66k|    es->err_func[i] = NULL;
   95|  1.66k|}
err_blocks.c:err_set_debug:
   52|  1.66k|{
   53|       |    /*
   54|       |     * We dup the file and fn strings because they may be provider owned. If the
   55|       |     * provider gets unloaded, they may not be valid anymore.
   56|       |     */
   57|  1.66k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|  1.66k|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (58:9): [True: 0, False: 1.66k]
  |  Branch (58:25): [True: 0, False: 1.66k]
  ------------------
   59|      0|        es->err_file[i] = NULL;
   60|  1.66k|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (60:14): [True: 1.66k, False: 0]
  ------------------
   61|  1.66k|                                              NULL, 0)) != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  1.66k|        strcpy(es->err_file[i], file);
   64|       |
   65|  1.66k|    es->err_line[i] = line;
   66|  1.66k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  1.66k|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 0, False: 1.66k]
  |  Branch (67:23): [True: 0, False: 1.66k]
  ------------------
   68|      0|        es->err_func[i] = NULL;
   69|  1.66k|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 1.66k, False: 0]
  ------------------
   70|  1.66k|                                              NULL, 0)) != NULL)
   71|  1.66k|        strcpy(es->err_func[i], fn);
   72|  1.66k|}
err_blocks.c:err_clear_data:
   22|  3.33k|{
   23|  3.33k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  3.33k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 2.05k, False: 1.27k]
  ------------------
   24|  2.05k|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 2.05k]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  2.05k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 2.05k, False: 0]
  ------------------
   30|  2.05k|            es->err_data[i][0] = '\0';
   31|  2.05k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  2.05k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  2.05k|        }
   33|  2.05k|    } else {
   34|  1.27k|        es->err_data[i] = NULL;
   35|  1.27k|        es->err_data_size[i] = 0;
   36|  1.27k|        es->err_data_flags[i] = 0;
   37|  1.27k|    }
   38|  3.33k|}
err_blocks.c:err_set_error:
   42|  1.66k|{
   43|  1.66k|    es->err_buffer[i] =
   44|  1.66k|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  1.66k|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (44:9): [True: 2, False: 1.66k]
  ------------------
   45|  1.66k|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   46|  1.66k|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  3.32k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  1.66k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  1.66k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  3.32k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  1.66k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   47|  1.66k|}
err_blocks.c:err_set_data:
   76|  1.26k|{
   77|  1.26k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  1.26k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (77:9): [True: 0, False: 1.26k]
  ------------------
   78|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  1.26k|    es->err_data[i] = data;
   80|  1.26k|    es->err_data_size[i] = datasz;
   81|  1.26k|    es->err_data_flags[i] = flags;
   82|  1.26k|}
err_mark.c:err_clear:
   85|  1.66k|{
   86|  1.66k|    err_clear_data(es, i, (deall));
   87|  1.66k|    es->err_marks[i] = 0;
   88|  1.66k|    es->err_flags[i] = 0;
   89|  1.66k|    es->err_buffer[i] = 0;
   90|  1.66k|    es->err_line[i] = -1;
   91|  1.66k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  1.66k|    es->err_file[i] = NULL;
   93|  1.66k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  1.66k|    es->err_func[i] = NULL;
   95|  1.66k|}
err_mark.c:err_clear_data:
   22|  1.66k|{
   23|  1.66k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  1.66k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 1.66k, False: 4]
  ------------------
   24|  1.66k|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 1.66k]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  1.66k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 1.66k, False: 0]
  ------------------
   30|  1.66k|            es->err_data[i][0] = '\0';
   31|  1.66k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  1.66k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  1.66k|        }
   33|  1.66k|    } else {
   34|      4|        es->err_data[i] = NULL;
   35|      4|        es->err_data_size[i] = 0;
   36|      4|        es->err_data_flags[i] = 0;
   37|      4|    }
   38|  1.66k|}

ERR_set_mark:
   16|  8.29k|{
   17|  8.29k|    ERR_STATE *es;
   18|       |
   19|  8.29k|    es = ossl_err_get_state_int();
   20|  8.29k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 8.29k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|  8.29k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 8.29k, False: 0]
  ------------------
   24|  8.29k|        return 0;
   25|      0|    es->err_marks[es->top]++;
   26|      0|    return 1;
   27|  8.29k|}
ERR_pop_to_mark:
   43|  8.29k|{
   44|  8.29k|    ERR_STATE *es;
   45|       |
   46|  8.29k|    es = ossl_err_get_state_int();
   47|  8.29k|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 8.29k]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  9.96k|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 1.66k, False: 8.29k]
  ------------------
   51|  9.96k|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 1.66k, False: 0]
  ------------------
   52|  1.66k|        err_clear(es, es->top, 0);
   53|  1.66k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 1.66k, False: 0]
  ------------------
   54|  1.66k|    }
   55|       |
   56|  8.29k|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 8.29k, False: 0]
  ------------------
   57|  8.29k|        return 0;
   58|      0|    es->err_marks[es->top]--;
   59|      0|    return 1;
   60|  8.29k|}

OSSL_ERR_STATE_new:
   22|     81|{
   23|     81|    return CRYPTO_zalloc(sizeof(ERR_STATE), NULL, 0);
   24|     81|}

ossl_err_load_ESS_strings:
   42|      2|{
   43|      2|#ifndef OPENSSL_NO_ERR
   44|      2|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 2, False: 0]
  ------------------
   45|      2|        ERR_load_strings_const(ESS_str_reasons);
   46|      2|#endif
   47|      2|    return 1;
   48|      2|}

openssl_add_all_ciphers_int:
   18|      2|{
   19|       |
   20|      2|#ifndef OPENSSL_NO_DES
   21|      2|    EVP_add_cipher(EVP_des_cfb());
  ------------------
  |  | 1003|      2|#  define EVP_des_cfb EVP_des_cfb64
  ------------------
   22|      2|    EVP_add_cipher(EVP_des_cfb1());
   23|      2|    EVP_add_cipher(EVP_des_cfb8());
   24|      2|    EVP_add_cipher(EVP_des_ede_cfb());
  ------------------
  |  | 1007|      2|#  define EVP_des_ede_cfb EVP_des_ede_cfb64
  ------------------
   25|      2|    EVP_add_cipher(EVP_des_ede3_cfb());
  ------------------
  |  | 1009|      2|#  define EVP_des_ede3_cfb EVP_des_ede3_cfb64
  ------------------
   26|      2|    EVP_add_cipher(EVP_des_ede3_cfb1());
   27|      2|    EVP_add_cipher(EVP_des_ede3_cfb8());
   28|       |
   29|      2|    EVP_add_cipher(EVP_des_ofb());
   30|      2|    EVP_add_cipher(EVP_des_ede_ofb());
   31|      2|    EVP_add_cipher(EVP_des_ede3_ofb());
   32|       |
   33|      2|    EVP_add_cipher(EVP_desx_cbc());
   34|      2|    EVP_add_cipher_alias(SN_desx_cbc, "DESX");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   35|      2|    EVP_add_cipher_alias(SN_desx_cbc, "desx");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   36|       |
   37|      2|    EVP_add_cipher(EVP_des_cbc());
   38|      2|    EVP_add_cipher_alias(SN_des_cbc, "DES");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   39|      2|    EVP_add_cipher_alias(SN_des_cbc, "des");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   40|      2|    EVP_add_cipher(EVP_des_ede_cbc());
   41|      2|    EVP_add_cipher(EVP_des_ede3_cbc());
   42|      2|    EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   43|      2|    EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   44|       |
   45|      2|    EVP_add_cipher(EVP_des_ecb());
   46|      2|    EVP_add_cipher(EVP_des_ede());
   47|      2|    EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   48|      2|    EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   49|      2|    EVP_add_cipher(EVP_des_ede3());
   50|      2|    EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   51|      2|    EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   52|      2|    EVP_add_cipher(EVP_des_ede3_wrap());
   53|      2|    EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   54|      2|#endif
   55|       |
   56|      2|#ifndef OPENSSL_NO_RC4
   57|      2|    EVP_add_cipher(EVP_rc4());
   58|      2|    EVP_add_cipher(EVP_rc4_40());
   59|      2|# ifndef OPENSSL_NO_MD5
   60|      2|    EVP_add_cipher(EVP_rc4_hmac_md5());
   61|      2|# endif
   62|      2|#endif
   63|       |
   64|      2|#ifndef OPENSSL_NO_IDEA
   65|      2|    EVP_add_cipher(EVP_idea_ecb());
   66|      2|    EVP_add_cipher(EVP_idea_cfb());
  ------------------
  |  | 1036|      2|#  define EVP_idea_cfb EVP_idea_cfb64
  ------------------
   67|      2|    EVP_add_cipher(EVP_idea_ofb());
   68|      2|    EVP_add_cipher(EVP_idea_cbc());
   69|      2|    EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   70|      2|    EVP_add_cipher_alias(SN_idea_cbc, "idea");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   71|      2|#endif
   72|       |
   73|      2|#ifndef OPENSSL_NO_SEED
   74|      2|    EVP_add_cipher(EVP_seed_ecb());
   75|      2|    EVP_add_cipher(EVP_seed_cfb());
  ------------------
  |  | 1190|      2|#  define EVP_seed_cfb EVP_seed_cfb128
  ------------------
   76|      2|    EVP_add_cipher(EVP_seed_ofb());
   77|      2|    EVP_add_cipher(EVP_seed_cbc());
   78|      2|    EVP_add_cipher_alias(SN_seed_cbc, "SEED");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   79|      2|    EVP_add_cipher_alias(SN_seed_cbc, "seed");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   80|      2|#endif
   81|       |
   82|      2|#ifndef OPENSSL_NO_SM4
   83|      2|    EVP_add_cipher(EVP_sm4_ecb());
   84|      2|    EVP_add_cipher(EVP_sm4_cbc());
   85|      2|    EVP_add_cipher(EVP_sm4_cfb());
  ------------------
  |  | 1198|      2|#  define EVP_sm4_cfb EVP_sm4_cfb128
  ------------------
   86|      2|    EVP_add_cipher(EVP_sm4_ofb());
   87|      2|    EVP_add_cipher(EVP_sm4_ctr());
   88|      2|    EVP_add_cipher_alias(SN_sm4_cbc, "SM4");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   89|      2|    EVP_add_cipher_alias(SN_sm4_cbc, "sm4");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   90|      2|#endif
   91|       |
   92|      2|#ifndef OPENSSL_NO_RC2
   93|      2|    EVP_add_cipher(EVP_rc2_ecb());
   94|      2|    EVP_add_cipher(EVP_rc2_cfb());
  ------------------
  |  | 1046|      2|#  define EVP_rc2_cfb EVP_rc2_cfb64
  ------------------
   95|      2|    EVP_add_cipher(EVP_rc2_ofb());
   96|      2|    EVP_add_cipher(EVP_rc2_cbc());
   97|      2|    EVP_add_cipher(EVP_rc2_40_cbc());
   98|      2|    EVP_add_cipher(EVP_rc2_64_cbc());
   99|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  100|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  101|      2|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  102|      2|    EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  103|      2|    EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  104|      2|#endif
  105|       |
  106|      2|#ifndef OPENSSL_NO_BF
  107|      2|    EVP_add_cipher(EVP_bf_ecb());
  108|      2|    EVP_add_cipher(EVP_bf_cfb());
  ------------------
  |  | 1053|      2|#  define EVP_bf_cfb EVP_bf_cfb64
  ------------------
  109|      2|    EVP_add_cipher(EVP_bf_ofb());
  110|      2|    EVP_add_cipher(EVP_bf_cbc());
  111|      2|    EVP_add_cipher_alias(SN_bf_cbc, "BF");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  112|      2|    EVP_add_cipher_alias(SN_bf_cbc, "bf");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  113|      2|    EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  114|      2|#endif
  115|       |
  116|      2|#ifndef OPENSSL_NO_CAST
  117|      2|    EVP_add_cipher(EVP_cast5_ecb());
  118|      2|    EVP_add_cipher(EVP_cast5_cfb());
  ------------------
  |  | 1060|      2|#  define EVP_cast5_cfb EVP_cast5_cfb64
  ------------------
  119|      2|    EVP_add_cipher(EVP_cast5_ofb());
  120|      2|    EVP_add_cipher(EVP_cast5_cbc());
  121|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  122|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "cast");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  123|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  124|      2|    EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  125|      2|#endif
  126|       |
  127|      2|#ifndef OPENSSL_NO_RC5
  128|      2|    EVP_add_cipher(EVP_rc5_32_12_16_ecb());
  129|      2|    EVP_add_cipher(EVP_rc5_32_12_16_cfb());
  ------------------
  |  | 1067|      2|#  define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
  ------------------
  130|      2|    EVP_add_cipher(EVP_rc5_32_12_16_ofb());
  131|      2|    EVP_add_cipher(EVP_rc5_32_12_16_cbc());
  132|      2|    EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  133|      2|    EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  134|      2|#endif
  135|       |
  136|      2|    EVP_add_cipher(EVP_aes_128_ecb());
  137|      2|    EVP_add_cipher(EVP_aes_128_cbc());
  138|      2|    EVP_add_cipher(EVP_aes_128_cfb());
  ------------------
  |  | 1075|      2|# define EVP_aes_128_cfb EVP_aes_128_cfb128
  ------------------
  139|      2|    EVP_add_cipher(EVP_aes_128_cfb1());
  140|      2|    EVP_add_cipher(EVP_aes_128_cfb8());
  141|      2|    EVP_add_cipher(EVP_aes_128_ofb());
  142|      2|    EVP_add_cipher(EVP_aes_128_ctr());
  143|      2|    EVP_add_cipher(EVP_aes_128_gcm());
  144|      2|#ifndef OPENSSL_NO_OCB
  145|      2|    EVP_add_cipher(EVP_aes_128_ocb());
  146|      2|#endif
  147|      2|    EVP_add_cipher(EVP_aes_128_xts());
  148|      2|    EVP_add_cipher(EVP_aes_128_ccm());
  149|      2|    EVP_add_cipher(EVP_aes_128_wrap());
  150|      2|    EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  151|      2|    EVP_add_cipher(EVP_aes_128_wrap_pad());
  152|      2|    EVP_add_cipher_alias(SN_id_aes128_wrap_pad, "aes128-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  153|      2|    EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  154|      2|    EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  155|      2|    EVP_add_cipher(EVP_aes_192_ecb());
  156|      2|    EVP_add_cipher(EVP_aes_192_cbc());
  157|      2|    EVP_add_cipher(EVP_aes_192_cfb());
  ------------------
  |  | 1091|      2|# define EVP_aes_192_cfb EVP_aes_192_cfb128
  ------------------
  158|      2|    EVP_add_cipher(EVP_aes_192_cfb1());
  159|      2|    EVP_add_cipher(EVP_aes_192_cfb8());
  160|      2|    EVP_add_cipher(EVP_aes_192_ofb());
  161|      2|    EVP_add_cipher(EVP_aes_192_ctr());
  162|      2|    EVP_add_cipher(EVP_aes_192_gcm());
  163|      2|#ifndef OPENSSL_NO_OCB
  164|      2|    EVP_add_cipher(EVP_aes_192_ocb());
  165|      2|#endif
  166|      2|    EVP_add_cipher(EVP_aes_192_ccm());
  167|      2|    EVP_add_cipher(EVP_aes_192_wrap());
  168|      2|    EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  169|      2|    EVP_add_cipher(EVP_aes_192_wrap_pad());
  170|      2|    EVP_add_cipher_alias(SN_id_aes192_wrap_pad, "aes192-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  171|      2|    EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  172|      2|    EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  173|      2|    EVP_add_cipher(EVP_aes_256_ecb());
  174|      2|    EVP_add_cipher(EVP_aes_256_cbc());
  175|      2|    EVP_add_cipher(EVP_aes_256_cfb());
  ------------------
  |  | 1106|      2|# define EVP_aes_256_cfb EVP_aes_256_cfb128
  ------------------
  176|      2|    EVP_add_cipher(EVP_aes_256_cfb1());
  177|      2|    EVP_add_cipher(EVP_aes_256_cfb8());
  178|      2|    EVP_add_cipher(EVP_aes_256_ofb());
  179|      2|    EVP_add_cipher(EVP_aes_256_ctr());
  180|      2|    EVP_add_cipher(EVP_aes_256_gcm());
  181|      2|#ifndef OPENSSL_NO_OCB
  182|      2|    EVP_add_cipher(EVP_aes_256_ocb());
  183|      2|#endif
  184|      2|    EVP_add_cipher(EVP_aes_256_xts());
  185|      2|    EVP_add_cipher(EVP_aes_256_ccm());
  186|      2|    EVP_add_cipher(EVP_aes_256_wrap());
  187|      2|    EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  188|      2|    EVP_add_cipher(EVP_aes_256_wrap_pad());
  189|      2|    EVP_add_cipher_alias(SN_id_aes256_wrap_pad, "aes256-wrap-pad");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  190|      2|    EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  191|      2|    EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  192|      2|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
  193|      2|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
  194|      2|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
  195|      2|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
  196|      2|#ifndef OPENSSL_NO_ARIA
  197|      2|    EVP_add_cipher(EVP_aria_128_ecb());
  198|      2|    EVP_add_cipher(EVP_aria_128_cbc());
  199|      2|    EVP_add_cipher(EVP_aria_128_cfb());
  ------------------
  |  | 1127|      2|#  define EVP_aria_128_cfb EVP_aria_128_cfb128
  ------------------
  200|      2|    EVP_add_cipher(EVP_aria_128_cfb1());
  201|      2|    EVP_add_cipher(EVP_aria_128_cfb8());
  202|      2|    EVP_add_cipher(EVP_aria_128_ctr());
  203|      2|    EVP_add_cipher(EVP_aria_128_ofb());
  204|      2|    EVP_add_cipher(EVP_aria_128_gcm());
  205|      2|    EVP_add_cipher(EVP_aria_128_ccm());
  206|      2|    EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  207|      2|    EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  208|      2|    EVP_add_cipher(EVP_aria_192_ecb());
  209|      2|    EVP_add_cipher(EVP_aria_192_cbc());
  210|      2|    EVP_add_cipher(EVP_aria_192_cfb());
  ------------------
  |  | 1137|      2|#  define EVP_aria_192_cfb EVP_aria_192_cfb128
  ------------------
  211|      2|    EVP_add_cipher(EVP_aria_192_cfb1());
  212|      2|    EVP_add_cipher(EVP_aria_192_cfb8());
  213|      2|    EVP_add_cipher(EVP_aria_192_ctr());
  214|      2|    EVP_add_cipher(EVP_aria_192_ofb());
  215|      2|    EVP_add_cipher(EVP_aria_192_gcm());
  216|      2|    EVP_add_cipher(EVP_aria_192_ccm());
  217|      2|    EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  218|      2|    EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  219|      2|    EVP_add_cipher(EVP_aria_256_ecb());
  220|      2|    EVP_add_cipher(EVP_aria_256_cbc());
  221|      2|    EVP_add_cipher(EVP_aria_256_cfb());
  ------------------
  |  | 1147|      2|#  define EVP_aria_256_cfb EVP_aria_256_cfb128
  ------------------
  222|      2|    EVP_add_cipher(EVP_aria_256_cfb1());
  223|      2|    EVP_add_cipher(EVP_aria_256_cfb8());
  224|      2|    EVP_add_cipher(EVP_aria_256_ctr());
  225|      2|    EVP_add_cipher(EVP_aria_256_ofb());
  226|      2|    EVP_add_cipher(EVP_aria_256_gcm());
  227|      2|    EVP_add_cipher(EVP_aria_256_ccm());
  228|      2|    EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  229|      2|    EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  230|      2|#endif
  231|       |
  232|      2|#ifndef OPENSSL_NO_CAMELLIA
  233|      2|    EVP_add_cipher(EVP_camellia_128_ecb());
  234|      2|    EVP_add_cipher(EVP_camellia_128_cbc());
  235|      2|    EVP_add_cipher(EVP_camellia_128_cfb());
  ------------------
  |  | 1159|      2|#  define EVP_camellia_128_cfb EVP_camellia_128_cfb128
  ------------------
  236|      2|    EVP_add_cipher(EVP_camellia_128_cfb1());
  237|      2|    EVP_add_cipher(EVP_camellia_128_cfb8());
  238|      2|    EVP_add_cipher(EVP_camellia_128_ofb());
  239|      2|    EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  240|      2|    EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  241|      2|    EVP_add_cipher(EVP_camellia_192_ecb());
  242|      2|    EVP_add_cipher(EVP_camellia_192_cbc());
  243|      2|    EVP_add_cipher(EVP_camellia_192_cfb());
  ------------------
  |  | 1167|      2|#  define EVP_camellia_192_cfb EVP_camellia_192_cfb128
  ------------------
  244|      2|    EVP_add_cipher(EVP_camellia_192_cfb1());
  245|      2|    EVP_add_cipher(EVP_camellia_192_cfb8());
  246|      2|    EVP_add_cipher(EVP_camellia_192_ofb());
  247|      2|    EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  248|      2|    EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  249|      2|    EVP_add_cipher(EVP_camellia_256_ecb());
  250|      2|    EVP_add_cipher(EVP_camellia_256_cbc());
  251|      2|    EVP_add_cipher(EVP_camellia_256_cfb());
  ------------------
  |  | 1175|      2|#  define EVP_camellia_256_cfb EVP_camellia_256_cfb128
  ------------------
  252|      2|    EVP_add_cipher(EVP_camellia_256_cfb1());
  253|      2|    EVP_add_cipher(EVP_camellia_256_cfb8());
  254|      2|    EVP_add_cipher(EVP_camellia_256_ofb());
  255|      2|    EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  256|      2|    EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
  ------------------
  |  |  710|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
  257|      2|    EVP_add_cipher(EVP_camellia_128_ctr());
  258|      2|    EVP_add_cipher(EVP_camellia_192_ctr());
  259|      2|    EVP_add_cipher(EVP_camellia_256_ctr());
  260|      2|#endif
  261|       |
  262|      2|#ifndef OPENSSL_NO_CHACHA
  263|      2|    EVP_add_cipher(EVP_chacha20());
  264|      2|# ifndef OPENSSL_NO_POLY1305
  265|      2|    EVP_add_cipher(EVP_chacha20_poly1305());
  266|      2|# endif
  267|      2|#endif
  268|      2|}

openssl_add_all_digests_int:
   18|      2|{
   19|      2|#ifndef OPENSSL_NO_MD4
   20|      2|    EVP_add_digest(EVP_md4());
   21|      2|#endif
   22|      2|#ifndef OPENSSL_NO_MD5
   23|      2|    EVP_add_digest(EVP_md5());
   24|      2|    EVP_add_digest_alias(SN_md5, "ssl3-md5");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   25|      2|    EVP_add_digest(EVP_md5_sha1());
   26|      2|#endif
   27|      2|    EVP_add_digest(EVP_sha1());
   28|      2|    EVP_add_digest_alias(SN_sha1, "ssl3-sha1");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   29|      2|    EVP_add_digest_alias(SN_sha1WithRSAEncryption, SN_sha1WithRSA);
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   30|      2|#if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
   31|      2|    EVP_add_digest(EVP_mdc2());
   32|      2|#endif
   33|      2|#ifndef OPENSSL_NO_RMD160
   34|      2|    EVP_add_digest(EVP_ripemd160());
   35|      2|    EVP_add_digest_alias(SN_ripemd160, "ripemd");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   36|      2|    EVP_add_digest_alias(SN_ripemd160, "rmd160");
  ------------------
  |  |  712|      2|        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  |  |  ------------------
  |  |                       OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
  |  |  ------------------
  |  |  |  |   33|      2|# define OBJ_NAME_ALIAS                  0x8000
  |  |  ------------------
  ------------------
   37|      2|#endif
   38|      2|    EVP_add_digest(EVP_sha224());
   39|      2|    EVP_add_digest(EVP_sha256());
   40|      2|    EVP_add_digest(EVP_sha384());
   41|      2|    EVP_add_digest(EVP_sha512());
   42|      2|    EVP_add_digest(EVP_sha512_224());
   43|      2|    EVP_add_digest(EVP_sha512_256());
   44|      2|#ifndef OPENSSL_NO_WHIRLPOOL
   45|      2|    EVP_add_digest(EVP_whirlpool());
   46|      2|#endif
   47|      2|#ifndef OPENSSL_NO_SM3
   48|      2|    EVP_add_digest(EVP_sm3());
   49|      2|#endif
   50|      2|#ifndef OPENSSL_NO_BLAKE2
   51|      2|    EVP_add_digest(EVP_blake2b512());
   52|      2|    EVP_add_digest(EVP_blake2s256());
   53|      2|#endif
   54|      2|    EVP_add_digest(EVP_sha3_224());
   55|      2|    EVP_add_digest(EVP_sha3_256());
   56|      2|    EVP_add_digest(EVP_sha3_384());
   57|      2|    EVP_add_digest(EVP_sha3_512());
   58|      2|    EVP_add_digest(EVP_shake128());
   59|      2|    EVP_add_digest(EVP_shake256());
   60|      2|}

evp_md_new:
  942|     27|{
  943|     27|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  104|     27|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  944|       |
  945|     27|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (945:9): [True: 27, False: 0]
  |  Branch (945:23): [True: 0, False: 27]
  ------------------
  946|      0|        OPENSSL_free(md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  947|      0|        return NULL;
  948|      0|    }
  949|     27|    return md;
  950|     27|}
EVP_MD_fetch:
 1164|  1.26k|{
 1165|  1.26k|    EVP_MD *md =
 1166|  1.26k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  310|  1.26k|# define OSSL_OP_DIGEST                              1
  ------------------
 1167|  1.26k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1168|       |
 1169|  1.26k|    return md;
 1170|  1.26k|}
EVP_MD_up_ref:
 1173|    745|{
 1174|    745|    int ref = 0;
 1175|       |
 1176|    745|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    745|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1176:9): [True: 745, False: 0]
  ------------------
 1177|    745|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1178|    745|    return 1;
 1179|    745|}
EVP_MD_free:
 1182|    772|{
 1183|    772|    int i;
 1184|       |
 1185|    772|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    772|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1185:9): [True: 0, False: 772]
  |  Branch (1185:23): [True: 0, False: 772]
  ------------------
 1186|      0|        return;
 1187|       |
 1188|    772|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1189|    772|    if (i > 0)
  ------------------
  |  Branch (1189:9): [True: 745, False: 27]
  ------------------
 1190|    745|        return;
 1191|     27|    evp_md_free_int(md);
 1192|     27|}
digest.c:evp_md_from_algorithm:
 1018|     27|{
 1019|     27|    const OSSL_DISPATCH *fns = algodef->implementation;
 1020|     27|    EVP_MD *md = NULL;
 1021|     27|    int fncnt = 0;
 1022|       |
 1023|       |    /* EVP_MD_fetch() will set the legacy NID if available */
 1024|     27|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 27]
  ------------------
 1025|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1026|      0|        return NULL;
 1027|      0|    }
 1028|       |
 1029|     27|#ifndef FIPS_MODULE
 1030|     27|    md->type = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
 1031|     27|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (1031:9): [True: 0, False: 27]
  ------------------
 1032|     27|            || md->type == -1) {
  ------------------
  |  Branch (1032:16): [True: 0, False: 27]
  ------------------
 1033|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1034|      0|        goto err;
 1035|      0|    }
 1036|     27|#endif
 1037|       |
 1038|     27|    md->name_id = name_id;
 1039|     27|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1039:9): [True: 0, False: 27]
  ------------------
 1040|      0|        goto err;
 1041|       |
 1042|     27|    md->description = algodef->algorithm_description;
 1043|       |
 1044|    302|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1044:12): [True: 275, False: 27]
  ------------------
 1045|    275|        switch (fns->function_id) {
  ------------------
  |  Branch (1045:17): [True: 0, False: 275]
  ------------------
 1046|     27|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  330|     27|# define OSSL_FUNC_DIGEST_NEWCTX                     1
  ------------------
  |  Branch (1046:9): [True: 27, False: 248]
  ------------------
 1047|     27|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1047:17): [True: 27, False: 0]
  ------------------
 1048|     27|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1049|     27|                fncnt++;
 1050|     27|            }
 1051|     27|            break;
 1052|     27|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  331|     27|# define OSSL_FUNC_DIGEST_INIT                       2
  ------------------
  |  Branch (1052:9): [True: 27, False: 248]
  ------------------
 1053|     27|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1053:17): [True: 27, False: 0]
  ------------------
 1054|     27|                md->dinit = OSSL_FUNC_digest_init(fns);
 1055|     27|                fncnt++;
 1056|     27|            }
 1057|     27|            break;
 1058|     27|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  332|     27|# define OSSL_FUNC_DIGEST_UPDATE                     3
  ------------------
  |  Branch (1058:9): [True: 27, False: 248]
  ------------------
 1059|     27|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1059:17): [True: 27, False: 0]
  ------------------
 1060|     27|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1061|     27|                fncnt++;
 1062|     27|            }
 1063|     27|            break;
 1064|     27|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  333|     27|# define OSSL_FUNC_DIGEST_FINAL                      4
  ------------------
  |  Branch (1064:9): [True: 27, False: 248]
  ------------------
 1065|     27|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1065:17): [True: 27, False: 0]
  ------------------
 1066|     27|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1067|     27|                fncnt++;
 1068|     27|            }
 1069|     27|            break;
 1070|      4|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  343|      4|# define OSSL_FUNC_DIGEST_SQUEEZE                   14
  ------------------
  |  Branch (1070:9): [True: 4, False: 271]
  ------------------
 1071|      4|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (1071:17): [True: 4, False: 0]
  ------------------
 1072|      4|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
 1073|      4|                fncnt++;
 1074|      4|            }
 1075|      4|            break;
 1076|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  334|      0|# define OSSL_FUNC_DIGEST_DIGEST                     5
  ------------------
  |  Branch (1076:9): [True: 0, False: 275]
  ------------------
 1077|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1077:17): [True: 0, False: 0]
  ------------------
 1078|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1079|       |            /* We don't increment fnct for this as it is stand alone */
 1080|      0|            break;
 1081|     27|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  335|     27|# define OSSL_FUNC_DIGEST_FREECTX                    6
  ------------------
  |  Branch (1081:9): [True: 27, False: 248]
  ------------------
 1082|     27|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1082:17): [True: 27, False: 0]
  ------------------
 1083|     27|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1084|     27|                fncnt++;
 1085|     27|            }
 1086|     27|            break;
 1087|     27|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  336|     27|# define OSSL_FUNC_DIGEST_DUPCTX                     7
  ------------------
  |  Branch (1087:9): [True: 27, False: 248]
  ------------------
 1088|     27|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1088:17): [True: 27, False: 0]
  ------------------
 1089|     27|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1090|     27|            break;
 1091|     27|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  337|     27|# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
  ------------------
  |  Branch (1091:9): [True: 27, False: 248]
  ------------------
 1092|     27|            if (md->get_params == NULL)
  ------------------
  |  Branch (1092:17): [True: 27, False: 0]
  ------------------
 1093|     27|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1094|     27|            break;
 1095|      8|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  338|      8|# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS             9
  ------------------
  |  Branch (1095:9): [True: 8, False: 267]
  ------------------
 1096|      8|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1096:17): [True: 8, False: 0]
  ------------------
 1097|      8|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1098|      8|            break;
 1099|      6|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  339|      6|# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1099:9): [True: 6, False: 269]
  ------------------
 1100|      6|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1100:17): [True: 6, False: 0]
  ------------------
 1101|      6|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1102|      6|            break;
 1103|     27|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  340|     27|# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS           11
  ------------------
  |  Branch (1103:9): [True: 27, False: 248]
  ------------------
 1104|     27|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1104:17): [True: 27, False: 0]
  ------------------
 1105|     27|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1106|     27|            break;
 1107|      8|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  341|      8|# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS       12
  ------------------
  |  Branch (1107:9): [True: 8, False: 267]
  ------------------
 1108|      8|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1108:17): [True: 8, False: 0]
  ------------------
 1109|      8|                md->settable_ctx_params =
 1110|      8|                    OSSL_FUNC_digest_settable_ctx_params(fns);
 1111|      8|            break;
 1112|      6|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  342|      6|# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1112:9): [True: 6, False: 269]
  ------------------
 1113|      6|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1113:17): [True: 6, False: 0]
  ------------------
 1114|      6|                md->gettable_ctx_params =
 1115|      6|                    OSSL_FUNC_digest_gettable_ctx_params(fns);
 1116|      6|            break;
 1117|     27|        case OSSL_FUNC_DIGEST_COPYCTX:
  ------------------
  |  |  344|     27|# define OSSL_FUNC_DIGEST_COPYCTX                   15
  ------------------
  |  Branch (1117:9): [True: 27, False: 248]
  ------------------
 1118|     27|            if (md->copyctx == NULL)
  ------------------
  |  Branch (1118:17): [True: 27, False: 0]
  ------------------
 1119|     27|                md->copyctx =
 1120|     27|                    OSSL_FUNC_digest_copyctx(fns);
 1121|     27|            break;
 1122|    275|        }
 1123|    275|    }
 1124|     27|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (1124:10): [True: 27, False: 0]
  |  Branch (1124:24): [True: 4, False: 23]
  |  Branch (1124:38): [True: 0, False: 4]
  ------------------
 1125|     27|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1125:13): [True: 0, False: 27]
  |  Branch (1125:27): [True: 0, False: 0]
  ------------------
 1126|       |        /*
 1127|       |         * In order to be a consistent set of functions we either need the
 1128|       |         * whole set of init/update/final etc functions or none of them.
 1129|       |         * The "digest" function can standalone. We at least need one way to
 1130|       |         * generate digests.
 1131|       |         */
 1132|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1133|      0|        goto err;
 1134|      0|    }
 1135|     27|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (1135:9): [True: 27, False: 0]
  |  Branch (1135:25): [True: 0, False: 27]
  ------------------
 1136|      0|        goto err;
 1137|       |
 1138|     27|    md->prov = prov;
 1139|       |
 1140|     27|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 27]
  ------------------
 1141|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        goto err;
 1143|      0|    }
 1144|       |
 1145|     27|    return md;
 1146|       |
 1147|      0|err:
 1148|      0|    EVP_MD_free(md);
 1149|      0|    return NULL;
 1150|     27|}
digest.c:set_legacy_nid:
  959|     71|{
  960|     71|    int nid;
  961|     71|    int *legacy_nid = vlegacy_nid;
  962|       |    /*
  963|       |     * We use lowest level function to get the associated method, because
  964|       |     * higher level functions such as EVP_get_digestbyname() have changed
  965|       |     * to look at providers too.
  966|       |     */
  967|     71|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     71|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  968|       |
  969|     71|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (969:9): [True: 0, False: 71]
  ------------------
  970|      0|        return;
  971|       |
  972|     71|    if (legacy_method == NULL)
  ------------------
  |  Branch (972:9): [True: 48, False: 23]
  ------------------
  973|     48|        return;
  974|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  559|     23|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  975|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|     46|#define NID_undef                       0
  ------------------
  |  Branch (975:9): [True: 4, False: 19]
  |  Branch (975:37): [True: 0, False: 4]
  ------------------
  976|      0|        *legacy_nid = -1;
  977|      0|        return;
  978|      0|    }
  979|     23|    *legacy_nid = nid;
  980|     23|}
digest.c:evp_md_cache_constants:
  984|     27|{
  985|     27|    int ok, xof = 0, algid_absent = 0;
  986|     27|    size_t blksz = 0;
  987|     27|    size_t mdsize = 0;
  988|     27|    OSSL_PARAM params[5];
  989|       |
  990|       |    /*
  991|       |     * Note that these parameters are 'constants' that are only set up
  992|       |     * during the EVP_MD_fetch(). For this reason the XOF functions set the
  993|       |     * md_size to 0, since the output size is unknown.
  994|       |     */
  995|     27|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  220|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  996|     27|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  223|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  997|     27|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  225|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  998|     27|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  219|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  999|     27|                                         &algid_absent);
 1000|     27|    params[4] = OSSL_PARAM_construct_end();
 1001|     27|    ok = evp_do_md_getparams(md, params) > 0;
 1002|     27|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (1002:9): [True: 0, False: 27]
  |  Branch (1002:29): [True: 0, False: 27]
  ------------------
 1003|      0|        ok = 0;
 1004|     27|    if (ok) {
  ------------------
  |  Branch (1004:9): [True: 27, False: 0]
  ------------------
 1005|     27|        md->block_size = (int)blksz;
 1006|     27|        md->md_size = (int)mdsize;
 1007|     27|        if (xof)
  ------------------
  |  Branch (1007:13): [True: 4, False: 23]
  ------------------
 1008|      4|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  184|      4|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
 1009|     27|        if (algid_absent)
  ------------------
  |  Branch (1009:13): [True: 18, False: 9]
  ------------------
 1010|     18|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  196|     18|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
 1011|     27|    }
 1012|     27|    return ok;
 1013|     27|}
digest.c:evp_md_up_ref:
 1153|    745|{
 1154|    745|    return EVP_MD_up_ref(md);
 1155|    745|}
digest.c:evp_md_free:
 1158|     61|{
 1159|     61|    EVP_MD_free(md);
 1160|     61|}

EVP_aes_128_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cbc:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ecb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ofb:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb128:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb1:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb8:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ctr:
  442|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_gcm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_xts:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_xts:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ccm:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_wrap:
 3772|      2|{
 3773|      2|    return &aes_128_wrap;
 3774|      2|}
EVP_aes_192_wrap:
 3786|      2|{
 3787|      2|    return &aes_192_wrap;
 3788|      2|}
EVP_aes_256_wrap:
 3800|      2|{
 3801|      2|    return &aes_256_wrap;
 3802|      2|}
EVP_aes_128_wrap_pad:
 3814|      2|{
 3815|      2|    return &aes_128_wrap_pad;
 3816|      2|}
EVP_aes_192_wrap_pad:
 3828|      2|{
 3829|      2|    return &aes_192_wrap_pad;
 3830|      2|}
EVP_aes_256_wrap_pad:
 3842|      2|{
 3843|      2|    return &aes_256_wrap_pad;
 3844|      2|}
EVP_aes_128_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ocb:
  468|      2|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      2|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  195|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 2, False: 0]
  |  |  ------------------
  ------------------

EVP_aes_128_cbc_hmac_sha1:
  956|      2|{
  957|      2|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ?
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (957:13): [True: 2, False: 0]
  ------------------
  958|      2|            &aesni_128_cbc_hmac_sha1_cipher : NULL);
  959|      2|}
EVP_aes_256_cbc_hmac_sha1:
  962|      2|{
  963|      2|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ?
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (963:13): [True: 2, False: 0]
  ------------------
  964|      2|            &aesni_256_cbc_hmac_sha1_cipher : NULL);
  965|      2|}

EVP_aes_128_cbc_hmac_sha256:
  933|      2|{
  934|      2|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) &&
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (934:13): [True: 2, False: 0]
  ------------------
  935|      2|            aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ?
  ------------------
  |  Branch (935:13): [True: 2, False: 0]
  ------------------
  936|      2|            &aesni_128_cbc_hmac_sha256_cipher : NULL);
  937|      2|}
EVP_aes_256_cbc_hmac_sha256:
  940|      2|{
  941|      2|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) &&
  ------------------
  |  |   47|      2|# define AESNI_CAPABLE   (1<<(57-32))
  ------------------
  |  Branch (941:13): [True: 2, False: 0]
  ------------------
  942|      2|            aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ?
  ------------------
  |  Branch (942:13): [True: 2, False: 0]
  ------------------
  943|      2|            &aesni_256_cbc_hmac_sha256_cipher : NULL);
  944|      2|}

EVP_aria_128_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_192_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_256_ctr:
  172|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  173|      2|{ return &aria_##keylen##_##mode; }
EVP_aria_128_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_192_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_256_gcm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_128_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_192_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }
EVP_aria_256_ccm:
  775|      2|const EVP_CIPHER *EVP_aria_##keylen##_##mode(void) \
  776|      2|{ return (EVP_CIPHER*)&aria_##keylen##_##mode; }

EVP_camellia_128_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_128_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_192_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cbc:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ecb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ofb:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb128:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb1:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_cfb8:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }
EVP_camellia_256_ctr:
  177|      2|const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
  178|      2|{ return &camellia_##keylen##_##mode; }

EVP_chacha20:
  146|      2|{
  147|      2|    return &chacha20;
  148|      2|}
EVP_chacha20_poly1305:
  631|      2|{
  632|      2|    return(&chacha20_poly1305);
  633|      2|}

EVP_des_ede:
  303|      2|{
  304|      2|    return &des_ede_ecb;
  305|      2|}
EVP_des_ede3:
  308|      2|{
  309|      2|    return &des_ede3_ecb;
  310|      2|}
EVP_des_ede3_wrap:
  423|      2|{
  424|      2|    return &des3_wrap;
  425|      2|}

EVP_rc2_64_cbc:
   83|      2|{
   84|      2|    return &r2_64_cbc_cipher;
   85|      2|}
EVP_rc2_40_cbc:
   88|      2|{
   89|      2|    return &r2_40_cbc_cipher;
   90|      2|}

EVP_rc4:
   68|      2|{
   69|      2|    return &r4_cipher;
   70|      2|}
EVP_rc4_40:
   73|      2|{
   74|      2|    return &r4_40_cipher;
   75|      2|}

EVP_rc4_hmac_md5:
  270|      2|{
  271|      2|    return &r4_hmac_md5_cipher;
  272|      2|}

EVP_sm4_cbc:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ecb:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ofb:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_cfb128:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }
EVP_sm4_ctr:
   46|      2|const EVP_CIPHER *EVP_sm4_##mode(void) \
   47|      2|{ return &sm4_##mode; }

EVP_desx_cbc:
   56|      2|{
   57|      2|    return &d_xcbc_cipher;
   58|      2|}

EVP_CIPHER_CTX_reset:
   34|    158|{
   35|    158|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 158]
  ------------------
   36|      0|        return 1;
   37|       |
   38|    158|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 158]
  |  Branch (38:32): [True: 0, False: 158]
  ------------------
   39|      0|        goto legacy;
   40|       |
   41|    158|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 158, False: 0]
  ------------------
   42|    158|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 158, False: 0]
  ------------------
   43|    158|            ctx->cipher->freectx(ctx->algctx);
   44|    158|        ctx->algctx = NULL;
   45|    158|    }
   46|    158|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 158, False: 0]
  ------------------
   47|    158|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|    158|    memset(ctx, 0, sizeof(*ctx));
   49|    158|    ctx->iv_len = -1;
   50|       |
   51|    158|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|      0| legacy:
   55|       |
   56|      0|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        if (ctx->cipher->cleanup && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  |  Branch (57:37): [True: 0, False: 0]
  ------------------
   58|      0|            return 0;
   59|       |        /* Cleanse cipher context data */
   60|      0|        if (ctx->cipher_data && ctx->cipher->ctx_size)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  |  Branch (60:33): [True: 0, False: 0]
  ------------------
   61|      0|            OPENSSL_cleanse(ctx->cipher_data, ctx->cipher->ctx_size);
   62|      0|    }
   63|      0|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|      0|    ENGINE_finish(ctx->engine);
   66|      0|#endif
   67|      0|    memset(ctx, 0, sizeof(*ctx));
   68|      0|    ctx->iv_len = -1;
   69|      0|    return 1;
   70|      0|}
EVP_CIPHER_CTX_new:
   73|    158|{
   74|    158|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|    158|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|    158|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|    158|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 158]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|    158|    ctx->iv_len = -1;
   81|    158|    return ctx;
   82|    158|}
EVP_CIPHER_CTX_free:
   85|    158|{
   86|    158|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 158]
  ------------------
   87|      0|        return;
   88|    158|    EVP_CIPHER_CTX_reset(ctx);
   89|    158|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|    158|}
EVP_CipherInit_ex2:
  637|     79|{
  638|     79|    return evp_cipher_init_internal(ctx, cipher, NULL, key, iv, enc, 0, params);
  639|     79|}
EVP_CipherInit_ex:
  652|    158|{
  653|    158|    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, 0, NULL);
  654|    158|}
EVP_EncryptInit_ex:
  818|    158|{
  819|    158|    return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1);
  820|    158|}
EVP_EncryptInit_ex2:
  825|     79|{
  826|     79|    return EVP_CipherInit_ex2(ctx, cipher, key, iv, 1, params);
  827|     79|}
EVP_CIPHER_get_params:
 1641|  1.10k|{
 1642|  1.10k|    if (cipher != NULL && cipher->get_params != NULL)
  ------------------
  |  Branch (1642:9): [True: 1.10k, False: 0]
  |  Branch (1642:27): [True: 1.10k, False: 0]
  ------------------
 1643|  1.10k|        return cipher->get_params(params);
 1644|      0|    return 0;
 1645|  1.10k|}
EVP_CIPHER_gettable_ctx_params:
 1699|    130|{
 1700|    130|    void *provctx;
 1701|       |
 1702|    130|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1702:9): [True: 130, False: 0]
  |  Branch (1702:27): [True: 130, False: 0]
  ------------------
 1703|    130|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1704|    130|        return cipher->gettable_ctx_params(NULL, provctx);
 1705|    130|    }
 1706|      0|    return NULL;
 1707|    130|}
evp_cipher_new:
 1842|    130|{
 1843|    130|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |  104|    130|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1844|       |
 1845|    130|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1845:9): [True: 130, False: 0]
  |  Branch (1845:27): [True: 0, False: 130]
  ------------------
 1846|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1847|      0|        return NULL;
 1848|      0|    }
 1849|    130|    return cipher;
 1850|    130|}
EVP_CIPHER_fetch:
 2073|  1.97k|{
 2074|  1.97k|    EVP_CIPHER *cipher =
 2075|  1.97k|        evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  311|  1.97k|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 2076|  1.97k|                          evp_cipher_from_algorithm, evp_cipher_up_ref,
 2077|  1.97k|                          evp_cipher_free);
 2078|       |
 2079|  1.97k|    return cipher;
 2080|  1.97k|}
EVP_CIPHER_up_ref:
 2103|  1.56k|{
 2104|  1.56k|    int ref = 0;
 2105|       |
 2106|  1.56k|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  1.56k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2106:9): [True: 1.56k, False: 0]
  ------------------
 2107|  1.56k|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 2108|  1.56k|    return 1;
 2109|  1.56k|}
evp_cipher_free_int:
 2112|    130|{
 2113|    130|    OPENSSL_free(cipher->type_name);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2114|    130|    ossl_provider_free(cipher->prov);
 2115|    130|    CRYPTO_FREE_REF(&cipher->refcnt);
 2116|    130|    OPENSSL_free(cipher);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2117|    130|}
EVP_CIPHER_free:
 2120|  1.85k|{
 2121|  1.85k|    int i;
 2122|       |
 2123|  1.85k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  1.69k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2123:9): [True: 158, False: 1.69k]
  |  Branch (2123:27): [True: 0, False: 1.69k]
  ------------------
 2124|    158|        return;
 2125|       |
 2126|  1.69k|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2127|  1.69k|    if (i > 0)
  ------------------
  |  Branch (2127:9): [True: 1.56k, False: 130]
  ------------------
 2128|  1.56k|        return;
 2129|    130|    evp_cipher_free_int(cipher);
 2130|    130|}
evp_enc.c:evp_cipher_init_internal:
   98|    237|{
   99|    237|    int n;
  100|    237|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  101|    237|    ENGINE *tmpimpl = NULL;
  102|    237|#endif
  103|       |
  104|       |    /*
  105|       |     * enc == 1 means we are encrypting.
  106|       |     * enc == 0 means we are decrypting.
  107|       |     * enc == -1 means, use the previously initialised value for encrypt/decrypt
  108|       |     */
  109|    237|    if (enc == -1) {
  ------------------
  |  Branch (109:9): [True: 0, False: 237]
  ------------------
  110|      0|        enc = ctx->encrypt;
  111|    237|    } else {
  112|    237|        if (enc)
  ------------------
  |  Branch (112:13): [True: 237, False: 0]
  ------------------
  113|    237|            enc = 1;
  114|    237|        ctx->encrypt = enc;
  115|    237|    }
  116|       |
  117|    237|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (117:9): [True: 79, False: 158]
  |  Branch (117:27): [True: 0, False: 79]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        return 0;
  120|      0|    }
  121|       |
  122|       |    /* Code below to be removed when legacy support is dropped. */
  123|    237|    if (is_pipeline)
  ------------------
  |  Branch (123:9): [True: 0, False: 237]
  ------------------
  124|      0|        goto nonlegacy;
  125|       |
  126|    237|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  127|       |    /*
  128|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  129|       |     * this context may already have an ENGINE! Try to avoid releasing the
  130|       |     * previous handle, re-querying for an ENGINE, and having a
  131|       |     * reinitialisation, when it may all be unnecessary.
  132|       |     */
  133|    237|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (133:9): [True: 0, False: 237]
  |  Branch (133:24): [True: 0, False: 0]
  ------------------
  134|    237|        && (cipher == NULL || cipher->nid == ctx->cipher->nid))
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  |  Branch (134:31): [True: 0, False: 0]
  ------------------
  135|      0|        goto skip_to_init;
  136|       |
  137|    237|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (137:9): [True: 158, False: 79]
  |  Branch (137:27): [True: 158, False: 0]
  ------------------
  138|       |         /* Ask if an ENGINE is reserved for this job */
  139|    158|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  140|    158|    }
  141|    237|#endif
  142|       |
  143|       |    /*
  144|       |     * If there are engines involved then we should use legacy handling for now.
  145|       |     */
  146|    237|    if (ctx->engine != NULL
  ------------------
  |  Branch (146:9): [True: 0, False: 237]
  ------------------
  147|    237|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  148|    237|            || tmpimpl != NULL
  ------------------
  |  Branch (148:16): [True: 0, False: 237]
  ------------------
  149|    237|#endif
  150|    237|            || impl != NULL
  ------------------
  |  Branch (150:16): [True: 0, False: 237]
  ------------------
  151|    237|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|    158|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (151:17): [True: 158, False: 79]
  |  Branch (151:35): [True: 0, False: 158]
  ------------------
  152|    237|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (152:17): [True: 79, False: 158]
  |  Branch (152:35): [True: 79, False: 0]
  ------------------
  153|    237|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|     79|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (153:35): [True: 0, False: 79]
  ------------------
  154|      0|        if (ctx->cipher == ctx->fetched_cipher)
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            ctx->cipher = NULL;
  156|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  157|      0|        ctx->fetched_cipher = NULL;
  158|      0|        goto legacy;
  159|      0|    }
  160|       |    /*
  161|       |     * Ensure a context left lying around from last time is cleared
  162|       |     * (legacy code)
  163|       |     */
  164|    237|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (164:9): [True: 158, False: 79]
  |  Branch (164:27): [True: 0, False: 158]
  ------------------
  165|      0|        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  |  Branch (165:45): [True: 0, False: 0]
  ------------------
  166|      0|            return 0;
  167|      0|        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  168|      0|        ctx->cipher_data = NULL;
  169|      0|    }
  170|       |
  171|       |    /* Start of non-legacy code below */
  172|    237|nonlegacy:
  173|       |    /* Ensure a context left lying around from last time is cleared */
  174|    237|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (174:9): [True: 158, False: 79]
  |  Branch (174:27): [True: 0, False: 158]
  ------------------
  175|      0|        unsigned long flags = ctx->flags;
  176|       |
  177|      0|        EVP_CIPHER_CTX_reset(ctx);
  178|       |        /* Restore encrypt and flags */
  179|      0|        ctx->encrypt = enc;
  180|      0|        ctx->flags = flags;
  181|      0|    }
  182|       |
  183|    237|    if (cipher == NULL)
  ------------------
  |  Branch (183:9): [True: 79, False: 158]
  ------------------
  184|     79|        cipher = ctx->cipher;
  185|       |
  186|    237|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 237]
  ------------------
  187|       |#ifdef FIPS_MODULE
  188|       |        /* We only do explicit fetches inside the FIPS module */
  189|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  190|       |        return 0;
  191|       |#else
  192|      0|        EVP_CIPHER *provciph =
  193|      0|            EVP_CIPHER_fetch(NULL,
  194|      0|                             cipher->nid == NID_undef ? "NULL"
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (194:30): [True: 0, False: 0]
  ------------------
  195|      0|                                                      : OBJ_nid2sn(cipher->nid),
  196|      0|                             "");
  197|       |
  198|      0|        if (provciph == NULL)
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|            return 0;
  200|      0|        cipher = provciph;
  201|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  202|      0|        ctx->fetched_cipher = provciph;
  203|      0|#endif
  204|      0|    }
  205|       |
  206|    237|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|    237|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    237|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (206:9): [True: 0, False: 237]
  ------------------
  207|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  208|      0|        return 0;
  209|      0|    }
  210|       |
  211|    237|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (211:9): [True: 158, False: 79]
  ------------------
  212|    158|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (212:13): [True: 0, False: 158]
  ------------------
  213|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return 0;
  215|      0|        }
  216|    158|        EVP_CIPHER_free(ctx->fetched_cipher);
  217|       |        /* Coverity false positive, the reference counting is confusing it */
  218|       |        /* coverity[use_after_free] */
  219|    158|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  220|    158|    }
  221|    237|    ctx->cipher = cipher;
  222|       |
  223|    237|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (223:9): [True: 0, False: 237]
  |  Branch (223:24): [True: 0, False: 0]
  ------------------
  224|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_PIPELINE_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|        return 0;
  226|      0|    }
  227|       |
  228|    237|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (228:9): [True: 158, False: 79]
  ------------------
  229|    158|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  230|    158|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (230:13): [True: 0, False: 158]
  ------------------
  231|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|            return 0;
  233|      0|        }
  234|    158|    }
  235|       |
  236|    237|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  346|    237|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (236:9): [True: 0, False: 237]
  ------------------
  237|       |        /*
  238|       |         * If this ctx was already set up for no padding then we need to tell
  239|       |         * the new cipher about it.
  240|       |         */
  241|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|            return 0;
  243|      0|    }
  244|       |
  245|    237|#ifndef FIPS_MODULE
  246|       |    /*
  247|       |     * Fix for CVE-2023-5363
  248|       |     * Passing in a size as part of the init call takes effect late
  249|       |     * so, force such to occur before the initialisation.
  250|       |     *
  251|       |     * The FIPS provider's internal library context is used in a manner
  252|       |     * such that this is not an issue.
  253|       |     */
  254|    237|    if (params != NULL) {
  ------------------
  |  Branch (254:9): [True: 0, False: 237]
  ------------------
  255|      0|        OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  256|      0|                                     OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  257|      0|        OSSL_PARAM *q = param_lens;
  258|      0|        const OSSL_PARAM *p;
  259|       |
  260|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|      0|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  261|      0|        if (p != NULL)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            memcpy(q++, p, sizeof(*q));
  263|       |
  264|       |        /*
  265|       |         * Note that OSSL_CIPHER_PARAM_AEAD_IVLEN is a synonym for
  266|       |         * OSSL_CIPHER_PARAM_IVLEN so both are covered here.
  267|       |         */
  268|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|      0|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  269|      0|        if (p != NULL)
  ------------------
  |  Branch (269:13): [True: 0, False: 0]
  ------------------
  270|      0|            memcpy(q++, p, sizeof(*q));
  271|       |
  272|      0|        if (q != param_lens) {
  ------------------
  |  Branch (272:13): [True: 0, False: 0]
  ------------------
  273|      0|            if (!EVP_CIPHER_CTX_set_params(ctx, param_lens)) {
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  ------------------
  274|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|                return 0;
  276|      0|            }
  277|      0|        }
  278|      0|    }
  279|    237|#endif
  280|       |
  281|    237|    if (is_pipeline)
  ------------------
  |  Branch (281:9): [True: 0, False: 237]
  ------------------
  282|      0|        return 1;
  283|       |
  284|    237|    if (enc) {
  ------------------
  |  Branch (284:9): [True: 237, False: 0]
  ------------------
  285|    237|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (285:13): [True: 0, False: 237]
  ------------------
  286|       |            /*
  287|       |             * We still should be able to set the IV using the new API
  288|       |             * if the key is not specified and old API is not available
  289|       |             */
  290|      0|            if (key == NULL && ctx->cipher->einit_skey != NULL) {
  ------------------
  |  Branch (290:17): [True: 0, False: 0]
  |  Branch (290:32): [True: 0, False: 0]
  ------------------
  291|      0|                return ctx->cipher->einit_skey(ctx->algctx, NULL,
  292|      0|                                               iv,
  293|      0|                                               iv == NULL ? 0
  ------------------
  |  Branch (293:48): [True: 0, False: 0]
  ------------------
  294|      0|                                                          : EVP_CIPHER_CTX_get_iv_length(ctx),
  295|      0|                                               params);
  296|      0|            }
  297|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  298|      0|            return 0;
  299|      0|        }
  300|       |
  301|    237|        return ctx->cipher->einit(ctx->algctx,
  302|    237|                                  key,
  303|    237|                                  key == NULL ? 0
  ------------------
  |  Branch (303:35): [True: 79, False: 158]
  ------------------
  304|    237|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  305|    237|                                  iv,
  306|    237|                                  iv == NULL ? 0
  ------------------
  |  Branch (306:35): [True: 237, False: 0]
  ------------------
  307|    237|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  308|    237|                                  params);
  309|    237|    }
  310|       |
  311|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  ------------------
  312|       |        /*
  313|       |         * We still should be able to set the IV using the new API
  314|       |         * if the key is not specified and old API is not available
  315|       |         */
  316|      0|        if (key == NULL && ctx->cipher->dinit_skey != NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 0]
  |  Branch (316:28): [True: 0, False: 0]
  ------------------
  317|      0|            return ctx->cipher->dinit_skey(ctx->algctx, NULL,
  318|      0|                                           iv,
  319|      0|                                           iv == NULL ? 0
  ------------------
  |  Branch (319:44): [True: 0, False: 0]
  ------------------
  320|      0|                                                      : EVP_CIPHER_CTX_get_iv_length(ctx),
  321|      0|                                           params);
  322|      0|        }
  323|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|        return 0;
  325|      0|    }
  326|       |
  327|      0|    return ctx->cipher->dinit(ctx->algctx,
  328|      0|                              key,
  329|      0|                              key == NULL ? 0
  ------------------
  |  Branch (329:31): [True: 0, False: 0]
  ------------------
  330|      0|                                          : EVP_CIPHER_CTX_get_key_length(ctx),
  331|      0|                              iv,
  332|      0|                              iv == NULL ? 0
  ------------------
  |  Branch (332:31): [True: 0, False: 0]
  ------------------
  333|      0|                                         : EVP_CIPHER_CTX_get_iv_length(ctx),
  334|      0|                                  params);
  335|       |
  336|       |    /* Code below to be removed when legacy support is dropped. */
  337|      0| legacy:
  338|       |
  339|      0|    if (cipher != NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|       |        /*
  341|       |         * Ensure a context left lying around from last time is cleared (we
  342|       |         * previously attempted to avoid this if the same ENGINE and
  343|       |         * EVP_CIPHER could be used).
  344|       |         */
  345|      0|        if (ctx->cipher) {
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            unsigned long flags = ctx->flags;
  347|      0|            EVP_CIPHER_CTX_reset(ctx);
  348|       |            /* Restore encrypt and flags */
  349|      0|            ctx->encrypt = enc;
  350|      0|            ctx->flags = flags;
  351|      0|        }
  352|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  353|      0|        if (impl != NULL) {
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  356|      0|                return 0;
  357|      0|            }
  358|      0|        } else {
  359|      0|            impl = tmpimpl;
  360|      0|        }
  361|      0|        if (impl != NULL) {
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|       |            /* There's an ENGINE for this job ... (apparently) */
  363|      0|            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
  364|       |
  365|      0|            if (c == NULL) {
  ------------------
  |  Branch (365:17): [True: 0, False: 0]
  ------------------
  366|       |                /*
  367|       |                 * One positive side-effect of US's export control history,
  368|       |                 * is that we should at least be able to avoid using US
  369|       |                 * misspellings of "initialisation"?
  370|       |                 */
  371|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|                return 0;
  373|      0|            }
  374|       |            /* We'll use the ENGINE's private cipher definition */
  375|      0|            cipher = c;
  376|       |            /*
  377|       |             * Store the ENGINE functional reference so we know 'cipher' came
  378|       |             * from an ENGINE and we need to release it when done.
  379|       |             */
  380|      0|            ctx->engine = impl;
  381|      0|        } else {
  382|      0|            ctx->engine = NULL;
  383|      0|        }
  384|      0|#endif
  385|       |
  386|      0|        ctx->cipher = cipher;
  387|      0|        if (ctx->cipher->ctx_size) {
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->ctx_size);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|      0|            if (ctx->cipher_data == NULL) {
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|                ctx->cipher = NULL;
  391|      0|                return 0;
  392|      0|            }
  393|      0|        } else {
  394|      0|            ctx->cipher_data = NULL;
  395|      0|        }
  396|      0|        ctx->key_len = cipher->key_len;
  397|       |        /* Preserve wrap enable flag, zero everything else */
  398|      0|        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
  ------------------
  |  |  386|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  399|      0|        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
  ------------------
  |  |  342|      0|# define         EVP_CIPH_CTRL_INIT              0x40
  ------------------
  |  Branch (399:13): [True: 0, False: 0]
  ------------------
  400|      0|            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
  ------------------
  |  |  390|      0|# define         EVP_CTRL_INIT                   0x0
  ------------------
  |  Branch (400:17): [True: 0, False: 0]
  ------------------
  401|      0|                ctx->cipher = NULL;
  402|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  403|      0|                return 0;
  404|      0|            }
  405|      0|        }
  406|      0|    }
  407|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|      0| skip_to_init:
  409|      0|#endif
  410|      0|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (410:9): [True: 0, False: 0]
  ------------------
  411|      0|        return 0;
  412|       |
  413|       |    /* we assume block size is a power of 2 in *cryptUpdate */
  414|      0|    OPENSSL_assert(ctx->cipher->block_size == 1
  ------------------
  |  |  438|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:13): [True: 0, False: 0]
  |  |  |  Branch (438:13): [True: 0, False: 0]
  |  |  |  Branch (438:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  415|      0|                   || ctx->cipher->block_size == 8
  416|      0|                   || ctx->cipher->block_size == 16);
  417|       |
  418|      0|    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
  ------------------
  |  |  386|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  |  Branch (418:9): [True: 0, False: 0]
  ------------------
  419|      0|        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  679|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
                      && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  330|      0|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  |  Branch (419:12): [True: 0, False: 0]
  ------------------
  420|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  421|      0|        return 0;
  422|      0|    }
  423|       |
  424|      0|    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
  ------------------
  |  Branch (424:9): [True: 0, False: 0]
  ------------------
  425|      0|                & EVP_CIPH_CUSTOM_IV) == 0) {
  ------------------
  |  |  338|      0|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  426|      0|        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
  ------------------
  |  |  679|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
  427|       |
  428|      0|        case EVP_CIPH_STREAM_CIPHER:
  ------------------
  |  |  321|      0|# define         EVP_CIPH_STREAM_CIPHER          0x0
  ------------------
  |  Branch (428:9): [True: 0, False: 0]
  ------------------
  429|      0|        case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  322|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|            break;
  431|       |
  432|      0|        case EVP_CIPH_CFB_MODE:
  ------------------
  |  |  324|      0|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (432:9): [True: 0, False: 0]
  ------------------
  433|      0|        case EVP_CIPH_OFB_MODE:
  ------------------
  |  |  325|      0|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (433:9): [True: 0, False: 0]
  ------------------
  434|       |
  435|      0|            ctx->num = 0;
  436|       |            /* fall-through */
  437|       |
  438|      0|        case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  323|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|            n = EVP_CIPHER_CTX_get_iv_length(ctx);
  440|      0|            if (n < 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (440:17): [True: 0, False: 0]
  |  Branch (440:26): [True: 0, False: 0]
  ------------------
  441|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  442|      0|                return 0;
  443|      0|            }
  444|      0|            if (iv != NULL)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                memcpy(ctx->oiv, iv, n);
  446|      0|            memcpy(ctx->iv, ctx->oiv, n);
  447|      0|            break;
  448|       |
  449|      0|        case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  326|      0|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  ------------------
  450|      0|            ctx->num = 0;
  451|       |            /* Don't reuse IV for CTR mode */
  452|      0|            if (iv != NULL) {
  ------------------
  |  Branch (452:17): [True: 0, False: 0]
  ------------------
  453|      0|                n = EVP_CIPHER_CTX_get_iv_length(ctx);
  454|      0|                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (454:21): [True: 0, False: 0]
  |  Branch (454:31): [True: 0, False: 0]
  ------------------
  455|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  456|      0|                    return 0;
  457|      0|                }
  458|      0|                memcpy(ctx->iv, iv, n);
  459|      0|            }
  460|      0|            break;
  461|       |
  462|      0|        default:
  ------------------
  |  Branch (462:9): [True: 0, False: 0]
  ------------------
  463|      0|            return 0;
  464|      0|        }
  465|      0|    }
  466|       |
  467|      0|    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
  ------------------
  |  |  340|      0|# define         EVP_CIPH_ALWAYS_CALL_INIT       0x20
  ------------------
  |  Branch (467:9): [True: 0, False: 0]
  |  Branch (467:24): [True: 0, False: 0]
  ------------------
  468|      0|        if (!ctx->cipher->init(ctx, key, iv, enc))
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|            return 0;
  470|      0|    }
  471|      0|    ctx->buf_len = 0;
  472|      0|    ctx->final_used = 0;
  473|      0|    ctx->block_mask = ctx->cipher->block_size - 1;
  474|      0|    return 1;
  475|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1886|    130|{
 1887|    130|    const OSSL_DISPATCH *fns = algodef->implementation;
 1888|    130|    EVP_CIPHER *cipher = NULL;
 1889|    130|    int fnciphcnt = 0, encinit = 0, decinit = 0, fnpipecnt = 0, fnctxcnt = 0;
 1890|       |
 1891|    130|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 130]
  ------------------
 1892|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1893|      0|        return NULL;
 1894|      0|    }
 1895|       |
 1896|    130|#ifndef FIPS_MODULE
 1897|    130|    cipher->nid = NID_undef;
  ------------------
  |  |   18|    130|#define NID_undef                       0
  ------------------
 1898|    130|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1898:9): [True: 0, False: 130]
  ------------------
 1899|    130|            || cipher->nid == -1) {
  ------------------
  |  Branch (1899:16): [True: 0, False: 130]
  ------------------
 1900|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1901|      0|        goto err;
 1902|      0|    }
 1903|    130|#endif
 1904|       |
 1905|    130|    cipher->name_id = name_id;
 1906|    130|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1906:9): [True: 0, False: 130]
  ------------------
 1907|      0|        goto err;
 1908|       |
 1909|    130|    cipher->description = algodef->algorithm_description;
 1910|       |
 1911|  2.07k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1911:12): [True: 1.94k, False: 130]
  ------------------
 1912|  1.94k|        switch (fns->function_id) {
  ------------------
  |  Branch (1912:17): [True: 0, False: 1.94k]
  ------------------
 1913|    130|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  378|    130|# define OSSL_FUNC_CIPHER_NEWCTX                     1
  ------------------
  |  Branch (1913:9): [True: 130, False: 1.81k]
  ------------------
 1914|    130|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1914:17): [True: 0, False: 130]
  ------------------
 1915|      0|                break;
 1916|    130|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1917|    130|            fnctxcnt++;
 1918|    130|            break;
 1919|    130|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  379|    130|# define OSSL_FUNC_CIPHER_ENCRYPT_INIT               2
  ------------------
  |  Branch (1919:9): [True: 130, False: 1.81k]
  ------------------
 1920|    130|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1920:17): [True: 0, False: 130]
  ------------------
 1921|      0|                break;
 1922|    130|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1923|    130|            encinit = 1;
 1924|    130|            break;
 1925|    130|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  380|    130|# define OSSL_FUNC_CIPHER_DECRYPT_INIT               3
  ------------------
  |  Branch (1925:9): [True: 130, False: 1.81k]
  ------------------
 1926|    130|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1926:17): [True: 0, False: 130]
  ------------------
 1927|      0|                break;
 1928|    130|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1929|    130|            decinit = 1;
 1930|    130|            break;
 1931|     68|        case OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT:
  ------------------
  |  |  396|     68|# define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT         19
  ------------------
  |  Branch (1931:9): [True: 68, False: 1.87k]
  ------------------
 1932|     68|            if (cipher->einit_skey != NULL)
  ------------------
  |  Branch (1932:17): [True: 0, False: 68]
  ------------------
 1933|      0|                break;
 1934|     68|            cipher->einit_skey = OSSL_FUNC_cipher_encrypt_skey_init(fns);
 1935|     68|            encinit = 1;
 1936|     68|            break;
 1937|     68|        case OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT:
  ------------------
  |  |  397|     68|# define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT         20
  ------------------
  |  Branch (1937:9): [True: 68, False: 1.87k]
  ------------------
 1938|     68|            if (cipher->dinit_skey != NULL)
  ------------------
  |  Branch (1938:17): [True: 0, False: 68]
  ------------------
 1939|      0|                break;
 1940|     68|            cipher->dinit_skey = OSSL_FUNC_cipher_decrypt_skey_init(fns);
 1941|     68|            decinit = 1;
 1942|     68|            break;
 1943|    130|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  381|    130|# define OSSL_FUNC_CIPHER_UPDATE                     4
  ------------------
  |  Branch (1943:9): [True: 130, False: 1.81k]
  ------------------
 1944|    130|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1944:17): [True: 0, False: 130]
  ------------------
 1945|      0|                break;
 1946|    130|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1947|    130|            fnciphcnt++;
 1948|    130|            break;
 1949|    130|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  382|    130|# define OSSL_FUNC_CIPHER_FINAL                      5
  ------------------
  |  Branch (1949:9): [True: 130, False: 1.81k]
  ------------------
 1950|    130|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1950:17): [True: 0, False: 130]
  ------------------
 1951|      0|                break;
 1952|    130|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1953|    130|            fnciphcnt++;
 1954|    130|            break;
 1955|    118|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  383|    118|# define OSSL_FUNC_CIPHER_CIPHER                     6
  ------------------
  |  Branch (1955:9): [True: 118, False: 1.82k]
  ------------------
 1956|    118|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1956:17): [True: 0, False: 118]
  ------------------
 1957|      0|                break;
 1958|    118|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1959|    118|            break;
 1960|      0|        case OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT:
  ------------------
  |  |  392|      0|# define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT     15
  ------------------
  |  Branch (1960:9): [True: 0, False: 1.94k]
  ------------------
 1961|      0|            if (cipher->p_einit != NULL)
  ------------------
  |  Branch (1961:17): [True: 0, False: 0]
  ------------------
 1962|      0|                break;
 1963|      0|            cipher->p_einit = OSSL_FUNC_cipher_pipeline_encrypt_init(fns);
 1964|      0|            fnpipecnt++;
 1965|      0|            break;
 1966|      0|        case OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT:
  ------------------
  |  |  393|      0|# define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT     16
  ------------------
  |  Branch (1966:9): [True: 0, False: 1.94k]
  ------------------
 1967|      0|            if (cipher->p_dinit != NULL)
  ------------------
  |  Branch (1967:17): [True: 0, False: 0]
  ------------------
 1968|      0|                break;
 1969|      0|            cipher->p_dinit = OSSL_FUNC_cipher_pipeline_decrypt_init(fns);
 1970|      0|            fnpipecnt++;
 1971|      0|            break;
 1972|      0|        case OSSL_FUNC_CIPHER_PIPELINE_UPDATE:
  ------------------
  |  |  394|      0|# define OSSL_FUNC_CIPHER_PIPELINE_UPDATE           17
  ------------------
  |  Branch (1972:9): [True: 0, False: 1.94k]
  ------------------
 1973|      0|            if (cipher->p_cupdate != NULL)
  ------------------
  |  Branch (1973:17): [True: 0, False: 0]
  ------------------
 1974|      0|                break;
 1975|      0|            cipher->p_cupdate = OSSL_FUNC_cipher_pipeline_update(fns);
 1976|      0|            fnpipecnt++;
 1977|      0|            break;
 1978|      0|        case OSSL_FUNC_CIPHER_PIPELINE_FINAL:
  ------------------
  |  |  395|      0|# define OSSL_FUNC_CIPHER_PIPELINE_FINAL            18
  ------------------
  |  Branch (1978:9): [True: 0, False: 1.94k]
  ------------------
 1979|      0|            if (cipher->p_cfinal != NULL)
  ------------------
  |  Branch (1979:17): [True: 0, False: 0]
  ------------------
 1980|      0|                break;
 1981|      0|            cipher->p_cfinal = OSSL_FUNC_cipher_pipeline_final(fns);
 1982|      0|            fnpipecnt++;
 1983|      0|            break;
 1984|    130|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  384|    130|# define OSSL_FUNC_CIPHER_FREECTX                    7
  ------------------
  |  Branch (1984:9): [True: 130, False: 1.81k]
  ------------------
 1985|    130|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1985:17): [True: 0, False: 130]
  ------------------
 1986|      0|                break;
 1987|    130|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1988|    130|            fnctxcnt++;
 1989|    130|            break;
 1990|    129|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  385|    129|# define OSSL_FUNC_CIPHER_DUPCTX                     8
  ------------------
  |  Branch (1990:9): [True: 129, False: 1.81k]
  ------------------
 1991|    129|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1991:17): [True: 0, False: 129]
  ------------------
 1992|      0|                break;
 1993|    129|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 1994|    129|            break;
 1995|    130|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  386|    130|# define OSSL_FUNC_CIPHER_GET_PARAMS                 9
  ------------------
  |  Branch (1995:9): [True: 130, False: 1.81k]
  ------------------
 1996|    130|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (1996:17): [True: 0, False: 130]
  ------------------
 1997|      0|                break;
 1998|    130|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 1999|    130|            break;
 2000|    130|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  387|    130|# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS            10
  ------------------
  |  Branch (2000:9): [True: 130, False: 1.81k]
  ------------------
 2001|    130|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (2001:17): [True: 0, False: 130]
  ------------------
 2002|      0|                break;
 2003|    130|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 2004|    130|            break;
 2005|    130|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  388|    130|# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS            11
  ------------------
  |  Branch (2005:9): [True: 130, False: 1.81k]
  ------------------
 2006|    130|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (2006:17): [True: 0, False: 130]
  ------------------
 2007|      0|                break;
 2008|    130|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 2009|    130|            break;
 2010|    130|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  389|    130|# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS           12
  ------------------
  |  Branch (2010:9): [True: 130, False: 1.81k]
  ------------------
 2011|    130|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (2011:17): [True: 0, False: 130]
  ------------------
 2012|      0|                break;
 2013|    130|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 2014|    130|            break;
 2015|    130|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  390|    130|# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (2015:9): [True: 130, False: 1.81k]
  ------------------
 2016|    130|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (2016:17): [True: 0, False: 130]
  ------------------
 2017|      0|                break;
 2018|    130|            cipher->gettable_ctx_params =
 2019|    130|                OSSL_FUNC_cipher_gettable_ctx_params(fns);
 2020|    130|            break;
 2021|    130|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  391|    130|# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS       14
  ------------------
  |  Branch (2021:9): [True: 130, False: 1.81k]
  ------------------
 2022|    130|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (2022:17): [True: 0, False: 130]
  ------------------
 2023|      0|                break;
 2024|    130|            cipher->settable_ctx_params =
 2025|    130|                OSSL_FUNC_cipher_settable_ctx_params(fns);
 2026|    130|            break;
 2027|  1.94k|        }
 2028|  1.94k|    }
 2029|    130|    fnciphcnt += encinit + decinit;
 2030|    130|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (2030:10): [True: 130, False: 0]
  |  Branch (2030:28): [True: 130, False: 0]
  |  Branch (2030:46): [True: 0, False: 130]
  ------------------
 2031|    130|            || (fnciphcnt == 0 && cipher->ccipher == NULL && fnpipecnt == 0)
  ------------------
  |  Branch (2031:17): [True: 0, False: 130]
  |  Branch (2031:35): [True: 0, False: 0]
  |  Branch (2031:62): [True: 0, False: 0]
  ------------------
 2032|    130|            || (fnpipecnt != 0 && (fnpipecnt < 3 || cipher->p_cupdate == NULL
  ------------------
  |  Branch (2032:17): [True: 0, False: 130]
  |  Branch (2032:36): [True: 0, False: 0]
  |  Branch (2032:53): [True: 0, False: 0]
  ------------------
 2033|      0|                                   || cipher->p_cfinal == NULL))
  ------------------
  |  Branch (2033:39): [True: 0, False: 0]
  ------------------
 2034|    130|            || fnctxcnt != 2) {
  ------------------
  |  Branch (2034:16): [True: 0, False: 130]
  ------------------
 2035|       |        /*
 2036|       |         * In order to be a consistent set of functions we must have at least
 2037|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 2038|       |         * functions, or a single "cipher" function. In all cases we need both
 2039|       |         * the "newctx" and "freectx" functions.
 2040|       |         */
 2041|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2042|      0|        goto err;
 2043|      0|    }
 2044|    130|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (2044:9): [True: 130, False: 0]
  |  Branch (2044:25): [True: 0, False: 130]
  ------------------
 2045|      0|        goto err;
 2046|       |
 2047|    130|    cipher->prov = prov;
 2048|       |
 2049|    130|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (2049:9): [True: 0, False: 130]
  ------------------
 2050|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2051|      0|        goto err;
 2052|      0|    }
 2053|       |
 2054|    130|    return cipher;
 2055|       |
 2056|      0|err:
 2057|      0|    EVP_CIPHER_free(cipher);
 2058|      0|    return NULL;
 2059|    130|}
evp_enc.c:set_legacy_nid:
 1860|    243|{
 1861|    243|    int nid;
 1862|    243|    int *legacy_nid = vlegacy_nid;
 1863|       |    /*
 1864|       |     * We use lowest level function to get the associated method, because
 1865|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1866|       |     * to look at providers too.
 1867|       |     */
 1868|    243|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|    243|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
 1869|       |
 1870|    243|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (1870:9): [True: 0, False: 243]
  ------------------
 1871|      0|        return;
 1872|    243|    if (legacy_method == NULL)
  ------------------
  |  Branch (1872:9): [True: 109, False: 134]
  ------------------
 1873|    109|        return;
 1874|    134|    nid = EVP_CIPHER_get_nid(legacy_method);
 1875|    134|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|    268|#define NID_undef                       0
  ------------------
  |  Branch (1875:9): [True: 26, False: 108]
  |  Branch (1875:37): [True: 0, False: 26]
  ------------------
 1876|      0|        *legacy_nid = -1;
 1877|      0|        return;
 1878|      0|    }
 1879|    134|    *legacy_nid = nid;
 1880|    134|}
evp_enc.c:evp_cipher_up_ref:
 2062|  1.40k|{
 2063|  1.40k|    return EVP_CIPHER_up_ref(cipher);
 2064|  1.40k|}
evp_enc.c:evp_cipher_free:
 2067|    273|{
 2068|    273|    EVP_CIPHER_free(cipher);
 2069|    273|}

ossl_err_load_EVP_strings:
  227|      2|{
  228|      2|#ifndef OPENSSL_NO_ERR
  229|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (229:9): [True: 2, False: 0]
  ------------------
  230|      2|        ERR_load_strings_const(EVP_str_reasons);
  231|      2|#endif
  232|      2|    return 1;
  233|      2|}

evp_generic_fetch:
  397|  10.5k|{
  398|  10.5k|    struct evp_method_data_st methdata;
  399|  10.5k|    void *method;
  400|       |
  401|  10.5k|    methdata.libctx = libctx;
  402|  10.5k|    methdata.tmp_store = NULL;
  403|  10.5k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  404|  10.5k|                                     name, properties,
  405|  10.5k|                                     new_method, up_ref_method, free_method);
  406|  10.5k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  407|  10.5k|    return method;
  408|  10.5k|}
evp_method_store_cache_flush:
  437|      2|{
  438|      2|    OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
  439|       |
  440|      2|    if (store != NULL)
  ------------------
  |  Branch (440:9): [True: 2, False: 0]
  ------------------
  441|      2|        return ossl_method_store_cache_flush_all(store);
  442|      0|    return 1;
  443|      2|}
evp_names_do_all:
  673|    197|{
  674|    197|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  675|    197|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  676|       |
  677|    197|    return ossl_namemap_doall_names(namemap, number, fn, data);
  678|    197|}
evp_fetch.c:inner_evp_generic_fetch:
  259|  10.5k|{
  260|  10.5k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  261|  10.5k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  262|       |#ifdef FIPS_MODULE
  263|       |    /*
  264|       |     * The FIPS provider has its own internal library context where only it
  265|       |     * is loaded.  Consequently, property queries aren't relevant because
  266|       |     * there is only one fetchable algorithm and it is assumed that the
  267|       |     * FIPS-ness is handled by the using algorithm.
  268|       |     */
  269|       |    const char *const propq = "";
  270|       |#else
  271|  10.5k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (271:31): [True: 0, False: 10.5k]
  ------------------
  272|  10.5k|#endif  /* FIPS_MODULE */
  273|  10.5k|    uint32_t meth_id = 0;
  274|  10.5k|    void *method = NULL;
  275|  10.5k|    int unsupported, name_id;
  276|       |
  277|  10.5k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 10.5k]
  |  Branch (277:26): [True: 0, False: 10.5k]
  ------------------
  278|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|      0|        return NULL;
  280|      0|    }
  281|       |
  282|       |    /*
  283|       |     * If there's ever an operation_id == 0 passed, we have an internal
  284|       |     * programming error.
  285|       |     */
  286|  10.5k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  10.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  10.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (286:9): [True: 0, False: 10.5k]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        return NULL;
  289|      0|    }
  290|       |
  291|       |    /* If we haven't received a name id yet, try to get one for the name */
  292|  10.5k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (292:15): [True: 10.5k, False: 0]
  ------------------
  293|       |
  294|       |    /*
  295|       |     * If we have a name id, calculate a method id with evp_method_id().
  296|       |     *
  297|       |     * evp_method_id returns 0 if we have too many operations (more than
  298|       |     * about 2^8) or too many names (more than about 2^24).  In that case,
  299|       |     * we can't create any new method.
  300|       |     * For all intents and purposes, this is an internal error.
  301|       |     */
  302|  10.5k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (302:9): [True: 9.64k, False: 871]
  |  Branch (302:25): [True: 0, False: 9.64k]
  ------------------
  303|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|        return NULL;
  305|      0|    }
  306|       |
  307|       |    /*
  308|       |     * If we haven't found the name yet, chances are that the algorithm to
  309|       |     * be fetched is unsupported.
  310|       |     */
  311|  10.5k|    unsupported = name_id == 0;
  312|       |
  313|  10.5k|    if (meth_id == 0
  ------------------
  |  Branch (313:9): [True: 871, False: 9.64k]
  ------------------
  314|  10.5k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (314:12): [True: 437, False: 9.20k]
  ------------------
  315|  1.30k|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  316|  1.30k|            get_tmp_evp_method_store,
  317|  1.30k|            reserve_evp_method_store,
  318|  1.30k|            unreserve_evp_method_store,
  319|  1.30k|            get_evp_method_from_store,
  320|  1.30k|            put_evp_method_in_store,
  321|  1.30k|            construct_evp_method,
  322|  1.30k|            destruct_evp_method
  323|  1.30k|        };
  324|       |
  325|  1.30k|        methdata->operation_id = operation_id;
  326|  1.30k|        methdata->name_id = name_id;
  327|  1.30k|        methdata->names = name;
  328|  1.30k|        methdata->propquery = propq;
  329|  1.30k|        methdata->method_from_algorithm = new_method;
  330|  1.30k|        methdata->refcnt_up_method = up_ref_method;
  331|  1.30k|        methdata->destruct_method = free_method;
  332|  1.30k|        methdata->flag_construct_error_occurred = 0;
  333|  1.30k|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (333:13): [True: 44, False: 1.26k]
  ------------------
  334|  1.30k|                                            &prov, 0 /* !force_cache */,
  335|  1.30k|                                            &mcm, methdata)) != NULL) {
  336|       |            /*
  337|       |             * If construction did create a method for us, we know that
  338|       |             * there is a correct name_id and meth_id, since those have
  339|       |             * already been calculated in get_evp_method_from_store() and
  340|       |             * put_evp_method_in_store() above.
  341|       |             * Note that there is a corner case here, in which, if a user
  342|       |             * passes a name of the form name1:name2:..., then the construction
  343|       |             * will create a method against all names, but the lookup will fail
  344|       |             * as ossl_namemap_name2num treats the name string as a single name
  345|       |             * rather than introducing new features where in the EVP_<obj>_fetch
  346|       |             * parses the string and queries for each, return an error.
  347|       |             */
  348|     44|            if (name_id == 0)
  ------------------
  |  Branch (348:17): [True: 2, False: 42]
  ------------------
  349|      2|                name_id = ossl_namemap_name2num(namemap, name);
  350|     44|            if (name_id == 0) {
  ------------------
  |  Branch (350:17): [True: 0, False: 44]
  ------------------
  351|      0|                ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|      0|                               "Algorithm %s cannot be found", name);
  353|      0|                free_method(method);
  354|      0|                method = NULL;
  355|     44|            } else {
  356|     44|                meth_id = evp_method_id(name_id, operation_id);
  357|     44|                if (meth_id != 0)
  ------------------
  |  Branch (357:21): [True: 44, False: 0]
  ------------------
  358|     44|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  359|     44|                                                method, up_ref_method, free_method);
  360|     44|            }
  361|     44|        }
  362|       |
  363|       |        /*
  364|       |         * If we never were in the constructor, the algorithm to be fetched
  365|       |         * is unsupported.
  366|       |         */
  367|  1.30k|        unsupported = !methdata->flag_construct_error_occurred;
  368|  1.30k|    }
  369|       |
  370|  10.5k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (370:10): [True: 9.64k, False: 869]
  |  Branch (370:26): [True: 869, False: 0]
  |  Branch (370:43): [True: 1.26k, False: 9.24k]
  ------------------
  371|  1.26k|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  363|  1.26k|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|  1.26k|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|  1.26k|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (371:20): [True: 1.26k, False: 0]
  ------------------
  372|       |
  373|  1.26k|        if (name == NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 1.26k]
  ------------------
  374|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  375|  1.26k|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  403|  1.26k|    (ERR_new(),                                                 \
  |  |  404|  1.26k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|  1.26k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|  1.26k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|  1.26k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  1.26k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   76|  1.26k|# define ERR_LIB_EVP             6
  ------------------
  376|  1.26k|                       "%s, Algorithm (%s : %d), Properties (%s)",
  377|  1.26k|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  378|  1.26k|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (378:24): [True: 0, False: 1.26k]
  ------------------
  379|  1.26k|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (379:24): [True: 1.26k, False: 0]
  ------------------
  380|  9.24k|    } else {
  381|  9.24k|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  297|  9.24k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|  9.24k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  382|  9.24k|                    ossl_lib_ctx_get_descriptor(methdata->libctx),
  383|  9.24k|                    name == NULL ? "<null>" : name, name_id,
  384|  9.24k|                    properties == NULL ? "<null>" : properties);
  385|  9.24k|    }
  386|       |
  387|  10.5k|    return method;
  388|  10.5k|}
evp_fetch.c:evp_method_id:
  117|  10.3k|{
  118|  10.3k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  20.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 10.3k, False: 0]
  |  |  |  Branch (52:43): [True: 10.3k, False: 0]
  |  |  ------------------
  |  |   53|  20.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (118:9): [True: 0, False: 10.3k]
  ------------------
  119|  10.3k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  20.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 10.3k, False: 0]
  |  |  |  Branch (52:43): [True: 10.3k, False: 0]
  |  |  ------------------
  |  |   53|  10.3k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (119:12): [True: 0, False: 10.3k]
  ------------------
  120|  10.3k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  121|      0|        return 0;
  122|  10.3k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|  10.3k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  113|  10.3k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  123|  10.3k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  111|  10.3k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  124|  10.3k|}
evp_fetch.c:reserve_evp_method_store:
   73|  2.61k|{
   74|  2.61k|    struct evp_method_data_st *methdata = data;
   75|       |
   76|  2.61k|    if (store == NULL
  ------------------
  |  Branch (76:9): [True: 2.61k, False: 0]
  ------------------
   77|  2.61k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (77:12): [True: 0, False: 2.61k]
  ------------------
   78|      0|        return 0;
   79|       |
   80|  2.61k|    return ossl_method_lock_store(store);
   81|  2.61k|}
evp_fetch.c:unreserve_evp_method_store:
   84|  2.61k|{
   85|  2.61k|    struct evp_method_data_st *methdata = data;
   86|       |
   87|  2.61k|    if (store == NULL
  ------------------
  |  Branch (87:9): [True: 2.61k, False: 0]
  ------------------
   88|  2.61k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (88:12): [True: 0, False: 2.61k]
  ------------------
   89|      0|        return 0;
   90|       |
   91|  2.61k|    return ossl_method_unlock_store(store);
   92|  2.61k|}
evp_fetch.c:get_evp_method_from_store:
  128|  1.30k|{
  129|  1.30k|    struct evp_method_data_st *methdata = data;
  130|  1.30k|    void *method = NULL;
  131|  1.30k|    int name_id;
  132|  1.30k|    uint32_t meth_id;
  133|       |
  134|       |    /*
  135|       |     * get_evp_method_from_store() is only called to try and get the method
  136|       |     * that evp_generic_fetch() is asking for, and the operation id as well
  137|       |     * as the name or name id are passed via methdata.
  138|       |     */
  139|  1.30k|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (139:9): [True: 871, False: 437]
  |  Branch (139:47): [True: 871, False: 0]
  ------------------
  140|    871|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  141|    871|        const char *names = methdata->names;
  142|    871|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|    871|#define NAME_SEPARATOR ':'
  ------------------
  143|    871|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (143:21): [True: 871, False: 0]
  ------------------
  144|       |
  145|    871|        if (namemap == 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 871]
  ------------------
  146|      0|            return NULL;
  147|    871|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  148|    871|    }
  149|       |
  150|  1.30k|    if (name_id == 0
  ------------------
  |  Branch (150:9): [True: 869, False: 439]
  ------------------
  151|  1.30k|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (151:12): [True: 0, False: 439]
  ------------------
  152|    869|        return NULL;
  153|       |
  154|    439|    if (store == NULL
  ------------------
  |  Branch (154:9): [True: 439, False: 0]
  ------------------
  155|    439|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (155:12): [True: 0, False: 439]
  ------------------
  156|      0|        return NULL;
  157|       |
  158|    439|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (158:9): [True: 395, False: 44]
  ------------------
  159|    439|                                 &method))
  160|    395|        return NULL;
  161|     44|    return method;
  162|    439|}
evp_fetch.c:put_evp_method_in_store:
  168|    269|{
  169|    269|    struct evp_method_data_st *methdata = data;
  170|    269|    OSSL_NAMEMAP *namemap;
  171|    269|    int name_id;
  172|    269|    uint32_t meth_id;
  173|    269|    size_t l = 0;
  174|       |
  175|       |    /*
  176|       |     * put_evp_method_in_store() is only called with an EVP method that was
  177|       |     * successfully created by construct_method() below, which means that
  178|       |     * all the names should already be stored in the namemap with the same
  179|       |     * numeric identity, so just use the first to get that identity.
  180|       |     */
  181|    269|    if (names != NULL) {
  ------------------
  |  Branch (181:9): [True: 269, False: 0]
  ------------------
  182|    269|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|    269|#define NAME_SEPARATOR ':'
  ------------------
  183|       |
  184|    269|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (184:14): [True: 83, False: 186]
  ------------------
  185|    269|    }
  186|       |
  187|    269|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (187:9): [True: 0, False: 269]
  ------------------
  188|    269|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (188:12): [True: 0, False: 269]
  ------------------
  189|    269|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (189:12): [True: 0, False: 269]
  ------------------
  190|      0|        return 0;
  191|       |
  192|    269|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  291|    269|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|    269|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  193|    269|    if (store == NULL
  ------------------
  |  Branch (193:9): [True: 269, False: 0]
  ------------------
  194|    269|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (194:12): [True: 0, False: 269]
  ------------------
  195|      0|        return 0;
  196|       |
  197|    269|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  299|    269|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  283|    269|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  198|    269|                "put_evp_method_in_store: "
  199|    269|                "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  200|    269|                store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  201|    269|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  202|    269|                                 methdata->refcnt_up_method,
  203|    269|                                 methdata->destruct_method);
  204|    269|}
evp_fetch.c:construct_evp_method:
  212|    269|{
  213|       |    /*
  214|       |     * This function is only called if get_evp_method_from_store() returned
  215|       |     * NULL, so it's safe to say that of all the spots to create a new
  216|       |     * namemap entry, this is it.  Should the name already exist there, we
  217|       |     * know that ossl_namemap_add_name() will return its corresponding
  218|       |     * number.
  219|       |     */
  220|    269|    struct evp_method_data_st *methdata = data;
  221|    269|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  222|    269|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  223|    269|    const char *names = algodef->algorithm_names;
  224|    269|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|    269|#define NAME_SEPARATOR ':'
  ------------------
  225|    269|    void *method;
  226|       |
  227|    269|    if (name_id == 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 269]
  ------------------
  228|      0|        return NULL;
  229|       |
  230|    269|    method = methdata->method_from_algorithm(name_id, algodef, prov);
  231|       |
  232|       |    /*
  233|       |     * Flag to indicate that there was actual construction errors.  This
  234|       |     * helps inner_evp_generic_fetch() determine what error it should
  235|       |     * record on inaccessible algorithms.
  236|       |     */
  237|    269|    if (method == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 269]
  ------------------
  238|      0|        methdata->flag_construct_error_occurred = 1;
  239|       |
  240|    269|    return method;
  241|    269|}
evp_fetch.c:destruct_evp_method:
  244|    269|{
  245|    269|    struct evp_method_data_st *methdata = data;
  246|       |
  247|    269|    methdata->destruct_method(method);
  248|    269|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   61|  10.5k|{
   62|  10.5k|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  291|  10.5k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|  10.5k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   63|  10.5k|    if (store != NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 10.5k]
  ------------------
   64|      0|        ossl_method_store_free(store);
   65|  10.5k|}
evp_fetch.c:get_evp_method_store:
   68|  16.4k|{
   69|  16.4k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   98|  16.4k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   70|  16.4k|}

EVP_CIPHER_get_type:
  256|    183|{
  257|    183|    int nid;
  258|    183|    nid = EVP_CIPHER_get_nid(cipher);
  259|       |
  260|    183|    switch (nid) {
  261|       |
  262|      3|    case NID_rc2_cbc:
  ------------------
  |  | 1280|      3|#define NID_rc2_cbc             37
  ------------------
  |  Branch (262:5): [True: 3, False: 180]
  ------------------
  263|      5|    case NID_rc2_64_cbc:
  ------------------
  |  | 1301|      5|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (263:5): [True: 2, False: 181]
  ------------------
  264|      7|    case NID_rc2_40_cbc:
  ------------------
  |  | 1297|      7|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (264:5): [True: 2, False: 181]
  ------------------
  265|       |
  266|      7|        return NID_rc2_cbc;
  ------------------
  |  | 1280|      7|#define NID_rc2_cbc             37
  ------------------
  267|       |
  268|      1|    case NID_rc4:
  ------------------
  |  | 1305|      1|#define NID_rc4         5
  ------------------
  |  Branch (268:5): [True: 1, False: 182]
  ------------------
  269|      2|    case NID_rc4_40:
  ------------------
  |  | 1310|      2|#define NID_rc4_40              97
  ------------------
  |  Branch (269:5): [True: 1, False: 182]
  ------------------
  270|       |
  271|      2|        return NID_rc4;
  ------------------
  |  | 1305|      2|#define NID_rc4         5
  ------------------
  272|       |
  273|      1|    case NID_aes_128_cfb128:
  ------------------
  |  | 3089|      1|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (273:5): [True: 1, False: 182]
  ------------------
  274|      2|    case NID_aes_128_cfb8:
  ------------------
  |  | 3210|      2|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (274:5): [True: 1, False: 182]
  ------------------
  275|      3|    case NID_aes_128_cfb1:
  ------------------
  |  | 3198|      3|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (275:5): [True: 1, False: 182]
  ------------------
  276|       |
  277|      3|        return NID_aes_128_cfb128;
  ------------------
  |  | 3089|      3|#define NID_aes_128_cfb128              421
  ------------------
  278|       |
  279|      1|    case NID_aes_192_cfb128:
  ------------------
  |  | 3127|      1|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (279:5): [True: 1, False: 182]
  ------------------
  280|      2|    case NID_aes_192_cfb8:
  ------------------
  |  | 3214|      2|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (280:5): [True: 1, False: 182]
  ------------------
  281|      3|    case NID_aes_192_cfb1:
  ------------------
  |  | 3202|      3|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (281:5): [True: 1, False: 182]
  ------------------
  282|       |
  283|      3|        return NID_aes_192_cfb128;
  ------------------
  |  | 3127|      3|#define NID_aes_192_cfb128              425
  ------------------
  284|       |
  285|      1|    case NID_aes_256_cfb128:
  ------------------
  |  | 3165|      1|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (285:5): [True: 1, False: 182]
  ------------------
  286|      2|    case NID_aes_256_cfb8:
  ------------------
  |  | 3218|      2|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (286:5): [True: 1, False: 182]
  ------------------
  287|      3|    case NID_aes_256_cfb1:
  ------------------
  |  | 3206|      3|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (287:5): [True: 1, False: 182]
  ------------------
  288|       |
  289|      3|        return NID_aes_256_cfb128;
  ------------------
  |  | 3165|      3|#define NID_aes_256_cfb128              429
  ------------------
  290|       |
  291|      1|    case NID_des_cfb64:
  ------------------
  |  | 2259|      1|#define NID_des_cfb64           30
  ------------------
  |  Branch (291:5): [True: 1, False: 182]
  ------------------
  292|      2|    case NID_des_cfb8:
  ------------------
  |  | 3250|      2|#define NID_des_cfb8            657
  ------------------
  |  Branch (292:5): [True: 1, False: 182]
  ------------------
  293|      3|    case NID_des_cfb1:
  ------------------
  |  | 3246|      3|#define NID_des_cfb1            656
  ------------------
  |  Branch (293:5): [True: 1, False: 182]
  ------------------
  294|       |
  295|      3|        return NID_des_cfb64;
  ------------------
  |  | 2259|      3|#define NID_des_cfb64           30
  ------------------
  296|       |
  297|      1|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2300|      1|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (297:5): [True: 1, False: 182]
  ------------------
  298|      2|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3258|      2|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (298:5): [True: 1, False: 182]
  ------------------
  299|      3|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3254|      3|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (299:5): [True: 1, False: 182]
  ------------------
  300|       |
  301|      3|        return NID_des_cfb64;
  ------------------
  |  | 2259|      3|#define NID_des_cfb64           30
  ------------------
  302|       |
  303|    159|    default:
  ------------------
  |  Branch (303:5): [True: 159, False: 24]
  ------------------
  304|       |#ifdef FIPS_MODULE
  305|       |        return NID_undef;
  306|       |#else
  307|    159|        {
  308|       |            /* Check it has an OID and it is valid */
  309|    159|            ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  310|       |
  311|    159|            if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (311:17): [True: 48, False: 111]
  ------------------
  312|     48|                nid = NID_undef;
  ------------------
  |  |   18|     48|#define NID_undef                       0
  ------------------
  313|    159|            ASN1_OBJECT_free(otmp);
  314|    159|            return nid;
  315|      2|        }
  316|    183|#endif
  317|    183|    }
  318|    183|}
evp_cipher_cache_constants:
  321|    130|{
  322|    130|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  323|    130|    int encrypt_then_mac = 0;
  324|    130|    size_t ivlen = 0;
  325|    130|    size_t blksz = 0;
  326|    130|    size_t keylen = 0;
  327|    130|    unsigned int mode = 0;
  328|    130|    OSSL_PARAM params[11];
  329|       |
  330|    130|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  183|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  331|    130|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  193|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  332|    130|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  194|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  333|    130|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  195|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  334|    130|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  335|    130|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  186|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  336|    130|                                         &custom_iv);
  337|    130|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  184|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  338|    130|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  203|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  339|    130|                                         &multiblock);
  340|    130|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  191|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  341|    130|                                         &randkey);
  342|    130|    params[9] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC,
  ------------------
  |  |  188|    130|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
  343|    130|                                         &encrypt_then_mac);
  344|    130|    params[10] = OSSL_PARAM_construct_end();
  345|    130|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  346|    130|    if (ok) {
  ------------------
  |  Branch (346:9): [True: 130, False: 0]
  ------------------
  347|    130|        cipher->block_size = blksz;
  348|    130|        cipher->iv_len = ivlen;
  349|    130|        cipher->key_len = keylen;
  350|    130|        cipher->flags = mode;
  351|    130|        if (aead)
  ------------------
  |  Branch (351:13): [True: 28, False: 102]
  ------------------
  352|     28|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  368|     28|# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
  ------------------
  353|    130|        if (custom_iv)
  ------------------
  |  Branch (353:13): [True: 41, False: 89]
  ------------------
  354|     41|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  338|     41|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  355|    130|        if (cts)
  ------------------
  |  Branch (355:13): [True: 6, False: 124]
  ------------------
  356|      6|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  366|      6|# define         EVP_CIPH_FLAG_CTS               0x4000
  ------------------
  357|    130|        if (multiblock)
  ------------------
  |  Branch (357:13): [True: 4, False: 126]
  ------------------
  358|      4|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  369|      4|# define         EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  359|    130|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (359:13): [True: 118, False: 12]
  ------------------
  360|    118|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  367|    118|# define         EVP_CIPH_FLAG_CUSTOM_CIPHER     0x100000
  ------------------
  361|    130|        if (randkey)
  ------------------
  |  Branch (361:13): [True: 11, False: 119]
  ------------------
  362|     11|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  348|     11|# define         EVP_CIPH_RAND_KEY               0x200
  ------------------
  363|    130|        if (encrypt_then_mac)
  ------------------
  |  Branch (363:13): [True: 0, False: 130]
  ------------------
  364|      0|            cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC;
  ------------------
  |  |  379|      0|# define         EVP_CIPH_FLAG_ENC_THEN_MAC      0x10000000
  ------------------
  365|    130|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (365:13): [True: 0, False: 130]
  ------------------
  366|    130|                                    OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  181|    130|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
  |  |  ------------------
  |  |  |  |  120|    130|# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
  |  |  ------------------
  ------------------
  367|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  373|      0|# define         EVP_CIPH_FLAG_CUSTOM_ASN1       0x1000000
  ------------------
  368|    130|    }
  369|    130|    return ok;
  370|    130|}
EVP_CIPHER_CTX_get_key_length:
  647|    237|{
  648|    237|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 237]
  ------------------
  649|      0|        return 0;
  650|       |
  651|    237|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (651:9): [True: 158, False: 79]
  |  Branch (651:30): [True: 158, False: 0]
  ------------------
  652|    158|        int ok;
  653|    158|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    158|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    158|    { NULL, 0, NULL, 0, 0 }
  ------------------
  654|    158|        size_t len;
  655|       |
  656|    158|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  194|    158|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  657|    158|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  658|    158|        if (ok <= 0)
  ------------------
  |  Branch (658:13): [True: 0, False: 158]
  ------------------
  659|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  660|       |
  661|       |        /*-
  662|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  663|       |         * less than INT_MAX but best to be safe.
  664|       |         *
  665|       |         * Casting away the const is annoying but required here.  We need to
  666|       |         * cache the result for performance reasons.
  667|       |         */
  668|    158|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (668:13): [True: 0, False: 158]
  ------------------
  669|      0|            return -1;
  670|    158|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  671|    158|    }
  672|    237|    return ctx->key_len;
  673|    237|}
EVP_CIPHER_get_nid:
  676|    317|{
  677|    317|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (677:12): [True: 0, False: 317]
  ------------------
  678|    317|}
EVP_CIPHER_get0_provider:
  732|  1.23k|{
  733|  1.23k|    return cipher->prov;
  734|  1.23k|}
EVP_MD_get0_provider:
  790|    711|{
  791|    711|    return md->prov;
  792|    711|}
EVP_MD_get_type:
  795|     82|{
  796|     82|    return md->type;
  797|     82|}
EVP_MD_get_size:
  814|    553|{
  815|    553|    if (md == NULL) {
  ------------------
  |  Branch (815:9): [True: 0, False: 553]
  ------------------
  816|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  817|      0|        return -1;
  818|      0|    }
  819|    553|    return md->md_size;
  820|    553|}
evp_md_free_int:
  866|     27|{
  867|     27|    OPENSSL_free(md->type_name);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|     27|    ossl_provider_free(md->prov);
  869|     27|    CRYPTO_FREE_REF(&md->refcnt);
  870|     27|    OPENSSL_free(md);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  871|     27|}

EVP_PBE_cleanup:
  296|      2|{
  297|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  298|      2|    pbe_algs = NULL;
  299|      2|}

EVP_RAND_enable_locking:
   95|      1|{
   96|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (96:9): [True: 1, False: 0]
  ------------------
   97|      1|        return rand->meth->enable_locking(rand->algctx);
   98|      1|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|    return 0;
  100|      1|}
EVP_RAND_fetch:
  287|      4|{
  288|      4|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  314|      4|# define OSSL_OP_RAND                                5
  ------------------
  289|      4|                             evp_rand_from_algorithm, evp_rand_up_ref,
  290|      4|                             evp_rand_free);
  291|      4|}
EVP_RAND_up_ref:
  294|      4|{
  295|      4|    return evp_rand_up_ref(rand);
  296|      4|}
EVP_RAND_free:
  299|      8|{
  300|      8|    evp_rand_free(rand);
  301|      8|}
EVP_RAND_get0_provider:
  324|      3|{
  325|      3|    return rand->prov;
  326|      3|}
EVP_RAND_CTX_up_ref:
  336|      3|{
  337|      3|    int ref = 0;
  338|       |
  339|      3|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  340|      3|}
EVP_RAND_CTX_new:
  343|      4|{
  344|      4|    EVP_RAND_CTX *ctx;
  345|      4|    void *parent_ctx = NULL;
  346|      4|    const OSSL_DISPATCH *parent_dispatch = NULL;
  347|       |
  348|      4|    if (rand == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 4]
  ------------------
  349|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|        return NULL;
  351|      0|    }
  352|       |
  353|      4|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  354|      4|    if (ctx == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 4]
  ------------------
  355|      0|        return NULL;
  356|      4|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (356:9): [True: 0, False: 4]
  ------------------
  357|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|      0|        return NULL;
  359|      0|    }
  360|      4|    if (parent != NULL) {
  ------------------
  |  Branch (360:9): [True: 3, False: 1]
  ------------------
  361|      3|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (361:13): [True: 0, False: 3]
  ------------------
  362|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  364|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  365|      0|            return NULL;
  366|      0|        }
  367|      3|        parent_ctx = parent->algctx;
  368|      3|        parent_dispatch = parent->meth->dispatch;
  369|      3|    }
  370|      4|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (370:9): [True: 0, False: 4]
  ------------------
  371|      4|                                    parent_dispatch)) == NULL
  372|      4|            || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 4]
  ------------------
  373|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  374|      0|        rand->freectx(ctx->algctx);
  375|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  376|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  377|      0|        EVP_RAND_CTX_free(parent);
  378|      0|        return NULL;
  379|      0|    }
  380|      4|    ctx->meth = rand;
  381|      4|    ctx->parent = parent;
  382|      4|    return ctx;
  383|      4|}
EVP_RAND_CTX_free:
  386|     10|{
  387|     10|    int ref = 0;
  388|     10|    EVP_RAND_CTX *parent;
  389|       |
  390|     10|    if (ctx == NULL)
  ------------------
  |  Branch (390:9): [True: 3, False: 7]
  ------------------
  391|      3|        return;
  392|       |
  393|      7|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  394|      7|    if (ref > 0)
  ------------------
  |  Branch (394:9): [True: 3, False: 4]
  ------------------
  395|      3|        return;
  396|      4|    parent = ctx->parent;
  397|      4|    ctx->meth->freectx(ctx->algctx);
  398|      4|    ctx->algctx = NULL;
  399|      4|    EVP_RAND_free(ctx->meth);
  400|      4|    CRYPTO_FREE_REF(&ctx->refcnt);
  401|      4|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|      4|    EVP_RAND_CTX_free(parent);
  403|      4|}
EVP_RAND_CTX_settable_params:
  484|      3|{
  485|      3|    void *provctx;
  486|       |
  487|      3|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (487:9): [True: 3, False: 0]
  ------------------
  488|      3|        return NULL;
  489|      0|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  490|      0|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  491|      3|}
EVP_RAND_instantiate:
  525|      4|{
  526|      4|    int res;
  527|       |
  528|      4|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (528:9): [True: 0, False: 4]
  ------------------
  529|      0|        return 0;
  530|      4|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  531|      4|                                      pstr, pstr_len, params);
  532|      4|    evp_rand_unlock(ctx);
  533|      4|    return res;
  534|      4|}
EVP_RAND_generate:
  587|    553|{
  588|    553|    int res;
  589|       |
  590|    553|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (590:9): [True: 0, False: 553]
  ------------------
  591|      0|        return 0;
  592|    553|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  593|    553|                                   prediction_resistance, addin, addin_len);
  594|    553|    evp_rand_unlock(ctx);
  595|    553|    return res;
  596|    553|}
evp_rand.c:evp_rand_from_algorithm:
  120|      6|{
  121|      6|    const OSSL_DISPATCH *fns = algodef->implementation;
  122|      6|    EVP_RAND *rand = NULL;
  123|      6|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  124|       |#ifdef FIPS_MODULE
  125|       |    int fnzeroizecnt = 0;
  126|       |#endif
  127|       |
  128|      6|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 6]
  ------------------
  129|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  130|      0|        return NULL;
  131|      0|    }
  132|      6|    rand->name_id = name_id;
  133|      6|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 6]
  ------------------
  134|      0|        evp_rand_free(rand);
  135|      0|        return NULL;
  136|      0|    }
  137|      6|    rand->description = algodef->algorithm_description;
  138|      6|    rand->dispatch = fns;
  139|     92|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (139:12): [True: 86, False: 6]
  ------------------
  140|     86|        switch (fns->function_id) {
  ------------------
  |  Branch (140:17): [True: 0, False: 86]
  ------------------
  141|      6|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  535|      6|# define OSSL_FUNC_RAND_NEWCTX                        1
  ------------------
  |  Branch (141:9): [True: 6, False: 80]
  ------------------
  142|      6|            if (rand->newctx != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 6]
  ------------------
  143|      0|                break;
  144|      6|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  145|      6|            fnctxcnt++;
  146|      6|            break;
  147|      6|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  536|      6|# define OSSL_FUNC_RAND_FREECTX                       2
  ------------------
  |  Branch (147:9): [True: 6, False: 80]
  ------------------
  148|      6|            if (rand->freectx != NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 6]
  ------------------
  149|      0|                break;
  150|      6|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  151|      6|            fnctxcnt++;
  152|      6|            break;
  153|      6|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  537|      6|# define OSSL_FUNC_RAND_INSTANTIATE                   3
  ------------------
  |  Branch (153:9): [True: 6, False: 80]
  ------------------
  154|      6|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 6]
  ------------------
  155|      0|                break;
  156|      6|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  157|      6|            fnrandcnt++;
  158|      6|            break;
  159|      6|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  538|      6|# define OSSL_FUNC_RAND_UNINSTANTIATE                 4
  ------------------
  |  Branch (159:9): [True: 6, False: 80]
  ------------------
  160|      6|             if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (160:18): [True: 0, False: 6]
  ------------------
  161|      0|                break;
  162|      6|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  163|      6|            fnrandcnt++;
  164|      6|            break;
  165|      6|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  539|      6|# define OSSL_FUNC_RAND_GENERATE                      5
  ------------------
  |  Branch (165:9): [True: 6, False: 80]
  ------------------
  166|      6|            if (rand->generate != NULL)
  ------------------
  |  Branch (166:17): [True: 0, False: 6]
  ------------------
  167|      0|                break;
  168|      6|            rand->generate = OSSL_FUNC_rand_generate(fns);
  169|      6|            fnrandcnt++;
  170|      6|            break;
  171|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  540|      5|# define OSSL_FUNC_RAND_RESEED                        6
  ------------------
  |  Branch (171:9): [True: 5, False: 81]
  ------------------
  172|      5|            if (rand->reseed != NULL)
  ------------------
  |  Branch (172:17): [True: 0, False: 5]
  ------------------
  173|      0|                break;
  174|      5|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  175|      5|            break;
  176|      1|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  541|      1|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (176:9): [True: 1, False: 85]
  ------------------
  177|      1|            if (rand->nonce != NULL)
  ------------------
  |  Branch (177:17): [True: 0, False: 1]
  ------------------
  178|      0|                break;
  179|      1|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  180|      1|            break;
  181|      6|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  542|      6|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (181:9): [True: 6, False: 80]
  ------------------
  182|      6|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (182:17): [True: 0, False: 6]
  ------------------
  183|      0|                break;
  184|      6|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  185|      6|            fnenablelockcnt++;
  186|      6|            break;
  187|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  543|      5|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (187:9): [True: 5, False: 81]
  ------------------
  188|      5|            if (rand->lock != NULL)
  ------------------
  |  Branch (188:17): [True: 0, False: 5]
  ------------------
  189|      0|                break;
  190|      5|            rand->lock = OSSL_FUNC_rand_lock(fns);
  191|      5|            fnlockcnt++;
  192|      5|            break;
  193|      5|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  544|      5|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (193:9): [True: 5, False: 81]
  ------------------
  194|      5|            if (rand->unlock != NULL)
  ------------------
  |  Branch (194:17): [True: 0, False: 5]
  ------------------
  195|      0|                break;
  196|      5|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  197|      5|            fnlockcnt++;
  198|      5|            break;
  199|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  545|      0|# define OSSL_FUNC_RAND_GETTABLE_PARAMS              11
  ------------------
  |  Branch (199:9): [True: 0, False: 86]
  ------------------
  200|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  ------------------
  201|      0|                break;
  202|      0|            rand->gettable_params =
  203|      0|                OSSL_FUNC_rand_gettable_params(fns);
  204|      0|            break;
  205|      6|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  546|      6|# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (205:9): [True: 6, False: 80]
  ------------------
  206|      6|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (206:17): [True: 0, False: 6]
  ------------------
  207|      0|                break;
  208|      6|            rand->gettable_ctx_params =
  209|      6|                OSSL_FUNC_rand_gettable_ctx_params(fns);
  210|      6|            break;
  211|      4|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  547|      4|# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS          13
  ------------------
  |  Branch (211:9): [True: 4, False: 82]
  ------------------
  212|      4|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (212:17): [True: 0, False: 4]
  ------------------
  213|      0|                break;
  214|      4|            rand->settable_ctx_params =
  215|      4|                OSSL_FUNC_rand_settable_ctx_params(fns);
  216|      4|            break;
  217|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  548|      0|# define OSSL_FUNC_RAND_GET_PARAMS                   14
  ------------------
  |  Branch (217:9): [True: 0, False: 86]
  ------------------
  218|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  219|      0|                break;
  220|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  221|      0|            break;
  222|      6|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  549|      6|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (222:9): [True: 6, False: 80]
  ------------------
  223|      6|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (223:17): [True: 0, False: 6]
  ------------------
  224|      0|                break;
  225|      6|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  226|      6|            fnctxcnt++;
  227|      6|            break;
  228|      4|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  550|      4|# define OSSL_FUNC_RAND_SET_CTX_PARAMS               16
  ------------------
  |  Branch (228:9): [True: 4, False: 82]
  ------------------
  229|      4|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (229:17): [True: 0, False: 4]
  ------------------
  230|      0|                break;
  231|      4|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  232|      4|            break;
  233|      5|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  551|      5|# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION           17
  ------------------
  |  Branch (233:9): [True: 5, False: 81]
  ------------------
  234|      5|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (234:17): [True: 0, False: 5]
  ------------------
  235|      0|                break;
  236|      5|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  237|       |#ifdef FIPS_MODULE
  238|       |            fnzeroizecnt++;
  239|       |#endif
  240|      5|            break;
  241|      5|        case OSSL_FUNC_RAND_GET_SEED:
  ------------------
  |  |  552|      5|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (241:9): [True: 5, False: 81]
  ------------------
  242|      5|            if (rand->get_seed != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 5]
  ------------------
  243|      0|                break;
  244|      5|            rand->get_seed = OSSL_FUNC_rand_get_seed(fns);
  245|      5|            break;
  246|      4|        case OSSL_FUNC_RAND_CLEAR_SEED:
  ------------------
  |  |  553|      4|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (246:9): [True: 4, False: 82]
  ------------------
  247|      4|            if (rand->clear_seed != NULL)
  ------------------
  |  Branch (247:17): [True: 0, False: 4]
  ------------------
  248|      0|                break;
  249|      4|            rand->clear_seed = OSSL_FUNC_rand_clear_seed(fns);
  250|      4|            break;
  251|     86|        }
  252|     86|    }
  253|       |    /*
  254|       |     * In order to be a consistent set of functions we must have at least
  255|       |     * a complete set of "rand" functions and a complete set of context
  256|       |     * management functions.  In FIPS mode, we also require the zeroization
  257|       |     * verification function.
  258|       |     *
  259|       |     * In addition, if locking can be enabled, we need a complete set of
  260|       |     * locking functions.
  261|       |     */
  262|      6|    if (fnrandcnt != 3
  ------------------
  |  Branch (262:9): [True: 0, False: 6]
  ------------------
  263|      6|            || fnctxcnt != 3
  ------------------
  |  Branch (263:16): [True: 0, False: 6]
  ------------------
  264|      6|            || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (264:17): [True: 6, False: 0]
  |  Branch (264:41): [True: 0, False: 6]
  ------------------
  265|      6|            || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (265:17): [True: 5, False: 1]
  |  Branch (265:35): [True: 0, False: 5]
  ------------------
  266|       |#ifdef FIPS_MODULE
  267|       |            || fnzeroizecnt != 1
  268|       |#endif
  269|      6|       ) {
  270|      0|        evp_rand_free(rand);
  271|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return NULL;
  273|      0|    }
  274|       |
  275|      6|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (275:9): [True: 6, False: 0]
  |  Branch (275:25): [True: 0, False: 6]
  ------------------
  276|      0|        evp_rand_free(rand);
  277|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  278|      0|        return NULL;
  279|      0|    }
  280|      6|    rand->prov = prov;
  281|       |
  282|      6|    return rand;
  283|      6|}
evp_rand.c:evp_rand_new:
   80|      6|{
   81|      6|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|       |
   83|      6|    if (rand == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 6]
  ------------------
   84|      0|        return NULL;
   85|       |
   86|      6|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 6]
  ------------------
   87|      0|        OPENSSL_free(rand);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|      0|        return NULL;
   89|      0|    }
   90|      6|    return rand;
   91|      6|}
evp_rand.c:evp_rand_up_ref:
   54|     16|{
   55|     16|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|     16|    int ref = 0;
   57|       |
   58|     16|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 16, False: 0]
  ------------------
   59|     16|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|     16|}
evp_rand.c:evp_rand_free:
   64|     22|{
   65|     22|    EVP_RAND *rand = (EVP_RAND *)vrand;
   66|     22|    int ref = 0;
   67|       |
   68|     22|    if (rand == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 22]
  ------------------
   69|      0|        return;
   70|     22|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   71|     22|    if (ref > 0)
  ------------------
  |  Branch (71:9): [True: 16, False: 6]
  ------------------
   72|     16|        return;
   73|      6|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      6|    ossl_provider_free(rand->prov);
   75|      6|    CRYPTO_FREE_REF(&rand->refcnt);
   76|      6|    OPENSSL_free(rand);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      6|}
evp_rand.c:evp_rand_lock:
  104|    557|{
  105|    557|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 1, False: 556]
  ------------------
  106|      1|        return rand->meth->lock(rand->algctx);
  107|    556|    return 1;
  108|    557|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  412|    553|{
  413|    553|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  414|    553|}
evp_rand.c:evp_rand_unlock:
  112|    557|{
  113|    557|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 1, False: 556]
  ------------------
  114|      1|        rand->meth->unlock(rand->algctx);
  115|    557|}
evp_rand.c:evp_rand_instantiate_locked:
  516|      4|{
  517|      4|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  518|      4|                                  pstr, pstr_len, params);
  519|      4|}
evp_rand.c:evp_rand_generate_locked:
  557|    553|{
  558|    553|    size_t chunk, max_request = 0;
  559|    553|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    553|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    553|    { NULL, 0, NULL, 0, 0 }
  ------------------
  560|       |
  561|    553|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  532|    553|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  562|    553|                                            &max_request);
  563|    553|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (563:9): [True: 0, False: 553]
  ------------------
  564|    553|            || max_request == 0) {
  ------------------
  |  Branch (564:16): [True: 0, False: 553]
  ------------------
  565|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  566|      0|        return 0;
  567|      0|    }
  568|  1.10k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (568:12): [True: 553, False: 553]
  ------------------
  569|    553|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (569:17): [True: 0, False: 553]
  ------------------
  570|    553|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (570:13): [True: 0, False: 553]
  ------------------
  571|    553|                                 prediction_resistance, addin, addin_len)) {
  572|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_GENERATE_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  573|      0|            return 0;
  574|      0|        }
  575|       |        /*
  576|       |         * Prediction resistance is only relevant the first time around,
  577|       |         * subsequently, the DRBG has already been properly reseeded.
  578|       |         */
  579|    553|        prediction_resistance = 0;
  580|    553|    }
  581|    553|    return 1;
  582|    553|}

evp_do_ciph_getparams:
   38|    130|int name (const type *obj, OSSL_PARAM params[])                                \
   39|    130|{                                                                              \
   40|    260|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|    130|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   29|    130|        return 0;                                                              \
  |  |   30|    130|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   31|    130|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|    130|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   41|    260|    return obj->func(params);                                                  \
   42|    260|}
evp_do_ciph_ctx_getparams:
   45|    158|int name (const type *obj, void *algctx, OSSL_PARAM params[])                  \
   46|    158|{                                                                              \
   47|    316|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|    158|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 158]
  |  |  ------------------
  |  |   29|    158|        return 0;                                                              \
  |  |   30|    158|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 158]
  |  |  ------------------
  |  |   31|    158|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|    158|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 158]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   48|    316|    return obj->func(algctx, params);                                          \
   49|    316|}
evp_do_md_getparams:
   38|     27|int name (const type *obj, OSSL_PARAM params[])                                \
   39|     27|{                                                                              \
   40|     54|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|     27|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   29|     27|        return 0;                                                              \
  |  |   30|     27|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   31|     27|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|     27|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 27]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   41|     54|    return obj->func(params);                                                  \
   42|     54|}

EVP_KEYEXCH_free:
  154|    174|{
  155|    174|    int i;
  156|       |
  157|    174|    if (exchange == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 174]
  ------------------
  158|      0|        return;
  159|    174|    CRYPTO_DOWN_REF(&exchange->refcnt, &i);
  160|    174|    if (i > 0)
  ------------------
  |  Branch (160:9): [True: 167, False: 7]
  ------------------
  161|    167|        return;
  162|      7|    OPENSSL_free(exchange->type_name);
  ------------------
  |  |  115|      7|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      7|    ossl_provider_free(exchange->prov);
  164|      7|    CRYPTO_FREE_REF(&exchange->refcnt);
  165|      7|    OPENSSL_free(exchange);
  ------------------
  |  |  115|      7|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  166|      7|}
EVP_KEYEXCH_up_ref:
  169|    167|{
  170|    167|    int ref = 0;
  171|       |
  172|    167|    CRYPTO_UP_REF(&exchange->refcnt, &ref);
  173|    167|    return 1;
  174|    167|}
EVP_KEYEXCH_fetch:
  183|    158|{
  184|    158|    return evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties,
  ------------------
  |  |  316|    158|# define OSSL_OP_KEYEXCH                            11
  ------------------
  185|    158|                             evp_keyexch_from_algorithm,
  186|    158|                             evp_keyexch_up_ref,
  187|    158|                             evp_keyexch_free);
  188|    158|}
exchange.c:evp_keyexch_from_algorithm:
   52|      7|{
   53|      7|    const OSSL_DISPATCH *fns = algodef->implementation;
   54|      7|    EVP_KEYEXCH *exchange = NULL;
   55|      7|    int fncnt = 0, sparamfncnt = 0, gparamfncnt = 0;
   56|       |
   57|      7|    if ((exchange = evp_keyexch_new(prov)) == NULL) {
  ------------------
  |  Branch (57:9): [True: 0, False: 7]
  ------------------
   58|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|        goto err;
   60|      0|    }
   61|       |
   62|      7|    exchange->name_id = name_id;
   63|      7|    if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 7]
  ------------------
   64|      0|        goto err;
   65|      7|    exchange->description = algodef->algorithm_description;
   66|       |
   67|     70|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (67:12): [True: 63, False: 7]
  ------------------
   68|     63|        switch (fns->function_id) {
  ------------------
  |  Branch (68:17): [True: 0, False: 63]
  ------------------
   69|      7|        case OSSL_FUNC_KEYEXCH_NEWCTX:
  ------------------
  |  |  762|      7|# define OSSL_FUNC_KEYEXCH_NEWCTX                      1
  ------------------
  |  Branch (69:9): [True: 7, False: 56]
  ------------------
   70|      7|            if (exchange->newctx != NULL)
  ------------------
  |  Branch (70:17): [True: 0, False: 7]
  ------------------
   71|      0|                break;
   72|      7|            exchange->newctx = OSSL_FUNC_keyexch_newctx(fns);
   73|      7|            fncnt++;
   74|      7|            break;
   75|      7|        case OSSL_FUNC_KEYEXCH_INIT:
  ------------------
  |  |  763|      7|# define OSSL_FUNC_KEYEXCH_INIT                        2
  ------------------
  |  Branch (75:9): [True: 7, False: 56]
  ------------------
   76|      7|            if (exchange->init != NULL)
  ------------------
  |  Branch (76:17): [True: 0, False: 7]
  ------------------
   77|      0|                break;
   78|      7|            exchange->init = OSSL_FUNC_keyexch_init(fns);
   79|      7|            fncnt++;
   80|      7|            break;
   81|      4|        case OSSL_FUNC_KEYEXCH_SET_PEER:
  ------------------
  |  |  765|      4|# define OSSL_FUNC_KEYEXCH_SET_PEER                    4
  ------------------
  |  Branch (81:9): [True: 4, False: 59]
  ------------------
   82|      4|            if (exchange->set_peer != NULL)
  ------------------
  |  Branch (82:17): [True: 0, False: 4]
  ------------------
   83|      0|                break;
   84|      4|            exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns);
   85|      4|            break;
   86|      7|        case OSSL_FUNC_KEYEXCH_DERIVE:
  ------------------
  |  |  764|      7|# define OSSL_FUNC_KEYEXCH_DERIVE                      3
  ------------------
  |  Branch (86:9): [True: 7, False: 56]
  ------------------
   87|      7|            if (exchange->derive != NULL)
  ------------------
  |  Branch (87:17): [True: 0, False: 7]
  ------------------
   88|      0|                break;
   89|      7|            exchange->derive = OSSL_FUNC_keyexch_derive(fns);
   90|      7|            fncnt++;
   91|      7|            break;
   92|      7|        case OSSL_FUNC_KEYEXCH_FREECTX:
  ------------------
  |  |  766|      7|# define OSSL_FUNC_KEYEXCH_FREECTX                     5
  ------------------
  |  Branch (92:9): [True: 7, False: 56]
  ------------------
   93|      7|            if (exchange->freectx != NULL)
  ------------------
  |  Branch (93:17): [True: 0, False: 7]
  ------------------
   94|      0|                break;
   95|      7|            exchange->freectx = OSSL_FUNC_keyexch_freectx(fns);
   96|      7|            fncnt++;
   97|      7|            break;
   98|      7|        case OSSL_FUNC_KEYEXCH_DUPCTX:
  ------------------
  |  |  767|      7|# define OSSL_FUNC_KEYEXCH_DUPCTX                      6
  ------------------
  |  Branch (98:9): [True: 7, False: 56]
  ------------------
   99|      7|            if (exchange->dupctx != NULL)
  ------------------
  |  Branch (99:17): [True: 0, False: 7]
  ------------------
  100|      0|                break;
  101|      7|            exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns);
  102|      7|            break;
  103|      7|        case OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS:
  ------------------
  |  |  770|      7|# define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS              9
  ------------------
  |  Branch (103:9): [True: 7, False: 56]
  ------------------
  104|      7|            if (exchange->get_ctx_params != NULL)
  ------------------
  |  Branch (104:17): [True: 0, False: 7]
  ------------------
  105|      0|                break;
  106|      7|            exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns);
  107|      7|            gparamfncnt++;
  108|      7|            break;
  109|      7|        case OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  771|      7|# define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS        10
  ------------------
  |  Branch (109:9): [True: 7, False: 56]
  ------------------
  110|      7|            if (exchange->gettable_ctx_params != NULL)
  ------------------
  |  Branch (110:17): [True: 0, False: 7]
  ------------------
  111|      0|                break;
  112|      7|            exchange->gettable_ctx_params
  113|      7|                = OSSL_FUNC_keyexch_gettable_ctx_params(fns);
  114|      7|            gparamfncnt++;
  115|      7|            break;
  116|      5|        case OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS:
  ------------------
  |  |  768|      5|# define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS              7
  ------------------
  |  Branch (116:9): [True: 5, False: 58]
  ------------------
  117|      5|            if (exchange->set_ctx_params != NULL)
  ------------------
  |  Branch (117:17): [True: 0, False: 5]
  ------------------
  118|      0|                break;
  119|      5|            exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns);
  120|      5|            sparamfncnt++;
  121|      5|            break;
  122|      5|        case OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  769|      5|# define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS         8
  ------------------
  |  Branch (122:9): [True: 5, False: 58]
  ------------------
  123|      5|            if (exchange->settable_ctx_params != NULL)
  ------------------
  |  Branch (123:17): [True: 0, False: 5]
  ------------------
  124|      0|                break;
  125|      5|            exchange->settable_ctx_params
  126|      5|                = OSSL_FUNC_keyexch_settable_ctx_params(fns);
  127|      5|            sparamfncnt++;
  128|      5|            break;
  129|     63|        }
  130|     63|    }
  131|      7|    if (fncnt != 4
  ------------------
  |  Branch (131:9): [True: 0, False: 7]
  ------------------
  132|      7|            || (gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (132:17): [True: 7, False: 0]
  |  Branch (132:37): [True: 0, False: 7]
  ------------------
  133|      7|            || (sparamfncnt != 0 && sparamfncnt != 2)) {
  ------------------
  |  Branch (133:17): [True: 5, False: 2]
  |  Branch (133:37): [True: 0, False: 5]
  ------------------
  134|       |        /*
  135|       |         * In order to be a consistent set of functions we must have at least
  136|       |         * a complete set of "exchange" functions: init, derive, newctx,
  137|       |         * and freectx. The set_ctx_params and settable_ctx_params functions are
  138|       |         * optional, but if one of them is present then the other one must also
  139|       |         * be present. Same goes for get_ctx_params and gettable_ctx_params.
  140|       |         * The dupctx and set_peer functions are optional.
  141|       |         */
  142|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|      0|        goto err;
  144|      0|    }
  145|       |
  146|      7|    return exchange;
  147|       |
  148|      0| err:
  149|      0|    EVP_KEYEXCH_free(exchange);
  150|      0|    return NULL;
  151|      7|}
exchange.c:evp_keyexch_new:
   32|      7|{
   33|      7|    EVP_KEYEXCH *exchange = OPENSSL_zalloc(sizeof(EVP_KEYEXCH));
  ------------------
  |  |  104|      7|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   34|       |
   35|      7|    if (exchange == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 7]
  ------------------
   36|      0|        return NULL;
   37|       |
   38|      7|    if (!CRYPTO_NEW_REF(&exchange->refcnt, 1)
  ------------------
  |  Branch (38:9): [True: 0, False: 7]
  ------------------
   39|      7|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (39:12): [True: 0, False: 7]
  ------------------
   40|      0|        CRYPTO_FREE_REF(&exchange->refcnt);
   41|      0|        OPENSSL_free(exchange);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|      0|        return NULL;
   43|      0|    }
   44|      7|    exchange->prov = prov;
   45|       |
   46|      7|    return exchange;
   47|      7|}
exchange.c:evp_keyexch_up_ref:
   27|    167|{
   28|    167|    return EVP_KEYEXCH_up_ref(data);
   29|    167|}
exchange.c:evp_keyexch_free:
   22|     16|{
   23|     16|    EVP_KEYEXCH_free(data);
   24|     16|}

evp_keymgmt_util_clear_operation_cache:
  223|     79|{
  224|     79|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 79, False: 0]
  ------------------
  225|     79|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|     79|        pk->operation_cache = NULL;
  227|     79|    }
  228|       |
  229|     79|    return 1;
  230|     79|}

EVP_KEYMGMT_fetch:
  287|  6.95k|{
  288|  6.95k|    return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties,
  ------------------
  |  |  315|  6.95k|# define OSSL_OP_KEYMGMT                            10
  ------------------
  289|  6.95k|                             keymgmt_from_algorithm,
  290|  6.95k|                             evp_keymgmt_up_ref,
  291|  6.95k|                             evp_keymgmt_free);
  292|  6.95k|}
EVP_KEYMGMT_up_ref:
  295|  7.01k|{
  296|  7.01k|    int ref = 0;
  297|       |
  298|  7.01k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  299|  7.01k|    return 1;
  300|  7.01k|}
EVP_KEYMGMT_free:
  303|  7.05k|{
  304|  7.05k|    int ref = 0;
  305|       |
  306|  7.05k|    if (keymgmt == NULL)
  ------------------
  |  Branch (306:9): [True: 0, False: 7.05k]
  ------------------
  307|      0|        return;
  308|       |
  309|  7.05k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  310|  7.05k|    if (ref > 0)
  ------------------
  |  Branch (310:9): [True: 7.01k, False: 40]
  ------------------
  311|  7.01k|        return;
  312|     40|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|     40|    ossl_provider_free(keymgmt->prov);
  314|     40|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  315|     40|    OPENSSL_free(keymgmt);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  316|     40|}
EVP_KEYMGMT_get0_provider:
  319|    237|{
  320|    237|    return keymgmt->prov;
  321|    237|}
evp_keymgmt_get_legacy_alg:
  329|  2.05k|{
  330|  2.05k|    return keymgmt->legacy_alg;
  331|  2.05k|}
EVP_KEYMGMT_names_do_all:
  363|     40|{
  364|     40|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (364:9): [True: 40, False: 0]
  ------------------
  365|     40|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  366|       |
  367|      0|    return 1;
  368|     40|}
keymgmt_meth.c:keymgmt_from_algorithm:
   66|     40|{
   67|     40|    const OSSL_DISPATCH *fns = algodef->implementation;
   68|     40|    EVP_KEYMGMT *keymgmt = NULL;
   69|     40|    int setparamfncnt = 0, getparamfncnt = 0;
   70|     40|    int setgenparamfncnt = 0;
   71|     40|    int importfncnt = 0, exportfncnt = 0;
   72|     40|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   73|     40|    int getgenparamfncnt = 0;
   74|       |
   75|     40|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 40]
  ------------------
   76|      0|        return NULL;
   77|       |
   78|     40|    keymgmt->name_id = name_id;
   79|     40|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (79:9): [True: 0, False: 40]
  ------------------
   80|      0|        EVP_KEYMGMT_free(keymgmt);
   81|      0|        return NULL;
   82|      0|    }
   83|     40|    keymgmt->description = algodef->algorithm_description;
   84|       |
   85|    746|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (85:12): [True: 706, False: 40]
  ------------------
   86|    706|        switch (fns->function_id) {
  ------------------
  |  Branch (86:17): [True: 0, False: 706]
  ------------------
   87|     40|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  658|     40|# define OSSL_FUNC_KEYMGMT_NEW                         1
  ------------------
  |  Branch (87:9): [True: 40, False: 666]
  ------------------
   88|     40|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (88:17): [True: 40, False: 0]
  ------------------
   89|     40|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   90|     40|            break;
   91|     37|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  662|     37|# define OSSL_FUNC_KEYMGMT_GEN_INIT                    2
  ------------------
  |  Branch (91:9): [True: 37, False: 669]
  ------------------
   92|     37|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (92:17): [True: 37, False: 0]
  ------------------
   93|     37|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   94|     37|            break;
   95|      5|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  663|      5|# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE            3
  ------------------
  |  Branch (95:9): [True: 5, False: 701]
  ------------------
   96|      5|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (96:17): [True: 5, False: 0]
  ------------------
   97|      5|                keymgmt->gen_set_template =
   98|      5|                    OSSL_FUNC_keymgmt_gen_set_template(fns);
   99|      5|            break;
  100|     37|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  664|     37|# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS              4
  ------------------
  |  Branch (100:9): [True: 37, False: 669]
  ------------------
  101|     37|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (101:17): [True: 37, False: 0]
  ------------------
  102|     37|                setgenparamfncnt++;
  103|     37|                keymgmt->gen_set_params =
  104|     37|                    OSSL_FUNC_keymgmt_gen_set_params(fns);
  105|     37|            }
  106|     37|            break;
  107|     37|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  665|     37|# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS         5
  ------------------
  |  Branch (107:9): [True: 37, False: 669]
  ------------------
  108|     37|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (108:17): [True: 37, False: 0]
  ------------------
  109|     37|                setgenparamfncnt++;
  110|     37|                keymgmt->gen_settable_params =
  111|     37|                    OSSL_FUNC_keymgmt_gen_settable_params(fns);
  112|     37|            }
  113|     37|            break;
  114|      2|        case OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS:
  ------------------
  |  |  668|      2|# define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS              15
  ------------------
  |  Branch (114:9): [True: 2, False: 704]
  ------------------
  115|      2|            if (keymgmt->gen_get_params == NULL) {
  ------------------
  |  Branch (115:17): [True: 2, False: 0]
  ------------------
  116|      2|                getgenparamfncnt++;
  117|      2|                keymgmt->gen_get_params =
  118|      2|                    OSSL_FUNC_keymgmt_gen_get_params(fns);
  119|      2|            }
  120|      2|            break;
  121|      2|        case OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS:
  ------------------
  |  |  669|      2|# define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS         16
  ------------------
  |  Branch (121:9): [True: 2, False: 704]
  ------------------
  122|      2|            if (keymgmt->gen_gettable_params == NULL) {
  ------------------
  |  Branch (122:17): [True: 2, False: 0]
  ------------------
  123|      2|                getgenparamfncnt++;
  124|      2|                keymgmt->gen_gettable_params =
  125|      2|                    OSSL_FUNC_keymgmt_gen_gettable_params(fns);
  126|      2|            }
  127|      2|            break;
  128|     37|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  666|     37|# define OSSL_FUNC_KEYMGMT_GEN                         6
  ------------------
  |  Branch (128:9): [True: 37, False: 669]
  ------------------
  129|     37|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (129:17): [True: 37, False: 0]
  ------------------
  130|     37|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
  131|     37|            break;
  132|     37|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  667|     37|# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP                 7
  ------------------
  |  Branch (132:9): [True: 37, False: 669]
  ------------------
  133|     37|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (133:17): [True: 37, False: 0]
  ------------------
  134|     37|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
  135|     37|            break;
  136|     40|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  694|     40|# define OSSL_FUNC_KEYMGMT_FREE                       10
  ------------------
  |  Branch (136:9): [True: 40, False: 666]
  ------------------
  137|     40|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (137:17): [True: 40, False: 0]
  ------------------
  138|     40|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
  139|     40|            break;
  140|     29|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  689|     29|# define OSSL_FUNC_KEYMGMT_LOAD                        8
  ------------------
  |  Branch (140:9): [True: 29, False: 677]
  ------------------
  141|     29|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (141:17): [True: 29, False: 0]
  ------------------
  142|     29|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
  143|     29|            break;
  144|     37|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  698|     37|#define OSSL_FUNC_KEYMGMT_GET_PARAMS                  11
  ------------------
  |  Branch (144:9): [True: 37, False: 669]
  ------------------
  145|     37|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (145:17): [True: 37, False: 0]
  ------------------
  146|     37|                getparamfncnt++;
  147|     37|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  148|     37|            }
  149|     37|            break;
  150|     37|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  699|     37|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS             12
  ------------------
  |  Branch (150:9): [True: 37, False: 669]
  ------------------
  151|     37|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (151:17): [True: 37, False: 0]
  ------------------
  152|     37|                getparamfncnt++;
  153|     37|                keymgmt->gettable_params =
  154|     37|                    OSSL_FUNC_keymgmt_gettable_params(fns);
  155|     37|            }
  156|     37|            break;
  157|     19|         case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  705|     19|#define OSSL_FUNC_KEYMGMT_SET_PARAMS                  13
  ------------------
  |  Branch (157:10): [True: 19, False: 687]
  ------------------
  158|     19|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (158:17): [True: 19, False: 0]
  ------------------
  159|     19|                setparamfncnt++;
  160|     19|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  161|     19|            }
  162|     19|            break;
  163|     19|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  706|     19|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS             14
  ------------------
  |  Branch (163:9): [True: 19, False: 687]
  ------------------
  164|     19|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (164:17): [True: 19, False: 0]
  ------------------
  165|     19|                setparamfncnt++;
  166|     19|                keymgmt->settable_params =
  167|     19|                    OSSL_FUNC_keymgmt_settable_params(fns);
  168|     19|            }
  169|     19|            break;
  170|      4|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  713|      4|# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME       20
  ------------------
  |  Branch (170:9): [True: 4, False: 702]
  ------------------
  171|      4|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (171:17): [True: 4, False: 0]
  ------------------
  172|      4|                keymgmt->query_operation_name =
  173|      4|                    OSSL_FUNC_keymgmt_query_operation_name(fns);
  174|      4|            break;
  175|     40|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  718|     40|# define OSSL_FUNC_KEYMGMT_HAS                        21
  ------------------
  |  Branch (175:9): [True: 40, False: 666]
  ------------------
  176|     40|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (176:17): [True: 40, False: 0]
  ------------------
  177|     40|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  178|     40|            break;
  179|     33|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  748|     33|# define OSSL_FUNC_KEYMGMT_DUP                        44
  ------------------
  |  Branch (179:9): [True: 33, False: 673]
  ------------------
  180|     33|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (180:17): [True: 33, False: 0]
  ------------------
  181|     33|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  182|     33|            break;
  183|     29|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  722|     29|# define OSSL_FUNC_KEYMGMT_VALIDATE                   22
  ------------------
  |  Branch (183:9): [True: 29, False: 677]
  ------------------
  184|     29|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (184:17): [True: 29, False: 0]
  ------------------
  185|     29|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  186|     29|            break;
  187|     37|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  727|     37|# define OSSL_FUNC_KEYMGMT_MATCH                      23
  ------------------
  |  Branch (187:9): [True: 37, False: 669]
  ------------------
  188|     37|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (188:17): [True: 37, False: 0]
  ------------------
  189|     37|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  190|     37|            break;
  191|     37|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  733|     37|# define OSSL_FUNC_KEYMGMT_IMPORT                     40
  ------------------
  |  Branch (191:9): [True: 37, False: 669]
  ------------------
  192|     37|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (192:17): [True: 37, False: 0]
  ------------------
  193|     37|                importfncnt++;
  194|     37|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  195|     37|            }
  196|     37|            break;
  197|     37|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  734|     37|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES               41
  ------------------
  |  Branch (197:9): [True: 37, False: 669]
  ------------------
  198|     37|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (198:17): [True: 37, False: 0]
  ------------------
  199|     37|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (199:21): [True: 37, False: 0]
  ------------------
  200|     37|                    importfncnt++;
  201|     37|                importtypesfncnt++;
  202|     37|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  203|     37|            }
  204|     37|            break;
  205|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  753|      0|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX            45
  ------------------
  |  Branch (205:9): [True: 0, False: 706]
  ------------------
  206|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (206:17): [True: 0, False: 0]
  ------------------
  207|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (207:21): [True: 0, False: 0]
  ------------------
  208|      0|                    importfncnt++;
  209|      0|                importtypesfncnt++;
  210|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  211|      0|            }
  212|      0|            break;
  213|     37|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  735|     37|# define OSSL_FUNC_KEYMGMT_EXPORT                     42
  ------------------
  |  Branch (213:9): [True: 37, False: 669]
  ------------------
  214|     37|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (214:17): [True: 37, False: 0]
  ------------------
  215|     37|                exportfncnt++;
  216|     37|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  217|     37|            }
  218|     37|            break;
  219|     37|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  736|     37|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES               43
  ------------------
  |  Branch (219:9): [True: 37, False: 669]
  ------------------
  220|     37|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (220:17): [True: 37, False: 0]
  ------------------
  221|     37|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (221:21): [True: 37, False: 0]
  ------------------
  222|     37|                    exportfncnt++;
  223|     37|                exporttypesfncnt++;
  224|     37|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  225|     37|            }
  226|     37|            break;
  227|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  754|      0|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX            46
  ------------------
  |  Branch (227:9): [True: 0, False: 706]
  ------------------
  228|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (228:17): [True: 0, False: 0]
  ------------------
  229|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|                    exportfncnt++;
  231|      0|                exporttypesfncnt++;
  232|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  233|      0|            }
  234|      0|            break;
  235|    706|        }
  236|    706|    }
  237|       |    /*
  238|       |     * Try to check that the method is sensible.
  239|       |     * At least one constructor and the destructor are MANDATORY
  240|       |     * The functions 'has' is MANDATORY
  241|       |     * It makes no sense being able to free stuff if you can't create it.
  242|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  243|       |     * export if you can't import or export.
  244|       |     */
  245|     40|    if (keymgmt->free == NULL
  ------------------
  |  Branch (245:9): [True: 0, False: 40]
  ------------------
  246|     40|        || (keymgmt->new == NULL
  ------------------
  |  Branch (246:13): [True: 0, False: 40]
  ------------------
  247|     40|            && keymgmt->gen == NULL
  ------------------
  |  Branch (247:16): [True: 0, False: 0]
  ------------------
  248|     40|            && keymgmt->load == NULL)
  ------------------
  |  Branch (248:16): [True: 0, False: 0]
  ------------------
  249|     40|        || keymgmt->has == NULL
  ------------------
  |  Branch (249:12): [True: 0, False: 40]
  ------------------
  250|     40|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (250:13): [True: 37, False: 3]
  |  Branch (250:35): [True: 0, False: 37]
  ------------------
  251|     40|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (251:13): [True: 19, False: 21]
  |  Branch (251:35): [True: 0, False: 19]
  ------------------
  252|     40|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (252:13): [True: 37, False: 3]
  |  Branch (252:38): [True: 0, False: 37]
  ------------------
  253|     40|        || (getgenparamfncnt != 0 && getgenparamfncnt != 2)
  ------------------
  |  Branch (253:13): [True: 2, False: 38]
  |  Branch (253:38): [True: 0, False: 2]
  ------------------
  254|     40|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (254:13): [True: 37, False: 3]
  |  Branch (254:33): [True: 0, False: 37]
  ------------------
  255|     40|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (255:13): [True: 37, False: 3]
  |  Branch (255:33): [True: 0, False: 37]
  ------------------
  256|     40|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (256:13): [True: 37, False: 3]
  ------------------
  257|     40|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (257:17): [True: 0, False: 37]
  ------------------
  258|     37|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (258:20): [True: 0, False: 37]
  ------------------
  259|      0|        EVP_KEYMGMT_free(keymgmt);
  260|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|        return NULL;
  262|      0|    }
  263|     40|    keymgmt->prov = prov;
  264|     40|    if (prov != NULL)
  ------------------
  |  Branch (264:9): [True: 40, False: 0]
  ------------------
  265|     40|        ossl_provider_up_ref(prov);
  266|       |
  267|     40|#ifndef FIPS_MODULE
  268|     40|    keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
  269|     40|#endif
  270|       |
  271|     40|    return keymgmt;
  272|     40|}
keymgmt_meth.c:keymgmt_new:
   31|     40|{
   32|     40|    EVP_KEYMGMT *keymgmt = NULL;
   33|       |
   34|     40|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |  104|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (34:9): [True: 0, False: 40]
  ------------------
   35|      0|        return NULL;
   36|     40|    if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
  ------------------
  |  Branch (36:9): [True: 0, False: 40]
  ------------------
   37|      0|        EVP_KEYMGMT_free(keymgmt);
   38|      0|        return NULL;
   39|      0|    }
   40|     40|    return keymgmt;
   41|     40|}
keymgmt_meth.c:get_legacy_alg_type_from_keymgmt:
   54|     40|{
   55|     40|    int type = NID_undef;
  ------------------
  |  |   18|     40|#define NID_undef                       0
  ------------------
   56|       |
   57|     40|    EVP_KEYMGMT_names_do_all(keymgmt, help_get_legacy_alg_type_from_keymgmt,
   58|     40|                             &type);
   59|     40|    return type;
   60|     40|}
keymgmt_meth.c:help_get_legacy_alg_type_from_keymgmt:
   46|    107|{
   47|    107|    int *type = arg;
   48|       |
   49|    107|    if (*type == NID_undef)
  ------------------
  |  |   18|    107|#define NID_undef                       0
  ------------------
  |  Branch (49:9): [True: 84, False: 23]
  ------------------
   50|     84|        *type = evp_pkey_name2type(keytype);
   51|    107|}
keymgmt_meth.c:evp_keymgmt_up_ref:
   26|  7.01k|{
   27|  7.01k|    return EVP_KEYMGMT_up_ref(data);
   28|  7.01k|}
keymgmt_meth.c:evp_keymgmt_free:
   21|     98|{
   22|     98|    EVP_KEYMGMT_free(data);
   23|     98|}

EVP_blake2b512:
   51|      2|{
   52|      2|    return &blake2b_md;
   53|      2|}
EVP_blake2s256:
   66|      2|{
   67|      2|    return &blake2s_md;
   68|      2|}

EVP_md4:
   32|      2|{
   33|      2|    return &md4_md;
   34|      2|}

EVP_md5:
   32|      2|{
   33|      2|    return &md5_md;
   34|      2|}

EVP_md5_sha1:
   39|      2|{
   40|      2|    return &md5_sha1_md;
   41|      2|}

EVP_mdc2:
   33|      2|{
   34|      2|    return &mdc2_md;
   35|      2|}

EVP_ripemd160:
   33|      2|{
   34|      2|    return &ripemd160_md;
   35|      2|}

EVP_sha1:
  103|      2|{
  104|      2|    return &sha1_md;
  105|      2|}
EVP_sha224:
  118|      2|{
  119|      2|    return &sha224_md;
  120|      2|}
EVP_sha256:
  133|      2|{
  134|      2|    return &sha256_md;
  135|      2|}
EVP_sha512_224:
  148|      2|{
  149|      2|    return &sha512_224_md;
  150|      2|}
EVP_sha512_256:
  163|      2|{
  164|      2|    return &sha512_256_md;
  165|      2|}
EVP_sha384:
  178|      2|{
  179|      2|    return &sha384_md;
  180|      2|}
EVP_sha512:
  193|      2|{
  194|      2|    return &sha512_md;
  195|      2|}
EVP_sha3_224:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_256:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_384:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_sha3_512:
  198|      2|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      2|{                                                                              \
  200|      2|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      2|        NID_sha3_##bitlen,                                                     \
  202|      2|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      2|        bitlen / 8,                                                            \
  204|      2|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      2|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      2|                                 sha3_int_final, NULL,                         \
  208|      2|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      2|    };                                                                         \
  210|      2|    return &sha3_##bitlen##_md;                                                \
  211|      2|}
EVP_shake128:
  213|      2|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      2|{                                                                              \
  215|      2|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      2|        NID_shake##bitlen,                                                     \
  217|      2|        0,                                                                     \
  218|      2|        bitlen / 8,                                                            \
  219|      2|        EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  184|      2|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
                      EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  220|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      2|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      2|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      2|    };                                                                         \
  224|      2|    return &shake##bitlen##_md;                                                \
  225|      2|}
EVP_shake256:
  213|      2|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      2|{                                                                              \
  215|      2|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      2|        NID_shake##bitlen,                                                     \
  217|      2|        0,                                                                     \
  218|      2|        bitlen / 8,                                                            \
  219|      2|        EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  184|      2|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
                      EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT,                         \
  ------------------
  |  |  196|      2|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  220|      2|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  253|      2|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      2|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      2|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      2|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      2|    };                                                                         \
  224|      2|    return &shake##bitlen##_md;                                                \
  225|      2|}

EVP_whirlpool:
   33|      2|{
   34|      2|    return &whirlpool_md;
   35|      2|}

EVP_add_cipher:
   20|    288|{
   21|    288|    int r;
   22|       |
   23|    288|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 288]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    288|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    288|                     (const char *)c);
   28|    288|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 288]
  ------------------
   29|      0|        return 0;
   30|    288|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    288|                     (const char *)c);
   32|    288|    return r;
   33|    288|}
EVP_add_digest:
   36|     44|{
   37|     44|    int r;
   38|     44|    const char *name;
   39|       |
   40|     44|    name = OBJ_nid2sn(md->type);
   41|     44|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     44|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 44]
  ------------------
   43|      0|        return 0;
   44|     44|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     44|                     (const char *)md);
   46|     44|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 44]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     44|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 34, False: 10]
  |  Branch (49:26): [True: 32, False: 2]
  ------------------
   50|     32|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     32|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 32]
  ------------------
   53|      0|            return 0;
   54|     32|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     32|    }
   57|     44|    return r;
   58|     44|}
evp_cleanup_int:
  180|      2|{
  181|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  184|       |    /*
  185|       |     * The above calls will only clean out the contents of the name hash
  186|       |     * table, but not the hash table itself.  The following line does that
  187|       |     * part.  -- Richard Levitte
  188|       |     */
  189|      2|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      2|    EVP_PBE_cleanup();
  192|      2|    OBJ_sigid_free();
  193|       |
  194|      2|    evp_app_cleanup_int();
  195|      2|}

EVP_PKEY_set_type:
  724|  2.05k|{
  725|  2.05k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  726|  2.05k|}
EVP_PKEY_type:
 1026|    151|{
 1027|    151|    int ret;
 1028|    151|    const EVP_PKEY_ASN1_METHOD *ameth;
 1029|    151|    ENGINE *e;
 1030|    151|    ameth = EVP_PKEY_asn1_find(&e, type);
 1031|    151|    if (ameth)
  ------------------
  |  Branch (1031:9): [True: 5, False: 146]
  ------------------
 1032|      5|        ret = ameth->pkey_id;
 1033|    146|    else
 1034|    146|        ret = NID_undef;
  ------------------
  |  |   18|    146|#define NID_undef                       0
  ------------------
 1035|    151|# ifndef OPENSSL_NO_ENGINE
 1036|    151|    ENGINE_finish(e);
 1037|    151|# endif
 1038|    151|    return ret;
 1039|    151|}
evp_pkey_name2type:
 1079|     84|{
 1080|     84|    int type;
 1081|     84|    size_t i;
 1082|       |
 1083|  1.05k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|  1.05k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1083:17): [True: 978, False: 78]
  ------------------
 1084|    978|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1084:13): [True: 6, False: 972]
  ------------------
 1085|      6|            return (int)standard_name2type[i].id;
 1086|    978|    }
 1087|       |
 1088|     78|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|     78|#define NID_undef                       0
  ------------------
  |  Branch (1088:9): [True: 5, False: 73]
  ------------------
 1089|      5|        return type;
 1090|     73|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1091|     78|}
EVP_PKEY_new:
 1509|     79|{
 1510|     79|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|       |
 1512|     79|    if (ret == NULL)
  ------------------
  |  Branch (1512:9): [True: 0, False: 79]
  ------------------
 1513|      0|        return NULL;
 1514|       |
 1515|     79|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|     79|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     79|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1516|     79|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|     79|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     79|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1517|       |
 1518|     79|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1518:9): [True: 0, False: 79]
  ------------------
 1519|      0|        goto err;
 1520|       |
 1521|     79|    ret->lock = CRYPTO_THREAD_lock_new();
 1522|     79|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1522:9): [True: 0, False: 79]
  ------------------
 1523|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1524|      0|        goto err;
 1525|      0|    }
 1526|       |
 1527|     79|#ifndef FIPS_MODULE
 1528|     79|    ret->save_parameters = 1;
 1529|     79|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  247|     79|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1529:9): [True: 0, False: 79]
  ------------------
 1530|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1531|      0|        goto err;
 1532|      0|    }
 1533|     79|#endif
 1534|     79|    return ret;
 1535|       |
 1536|      0| err:
 1537|      0|    CRYPTO_FREE_REF(&ret->references);
 1538|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1539|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1540|      0|    return NULL;
 1541|     79|}
EVP_PKEY_up_ref:
 1724|  2.05k|{
 1725|  2.05k|    int i;
 1726|       |
 1727|  2.05k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1727:9): [True: 0, False: 2.05k]
  ------------------
 1728|      0|        return 0;
 1729|       |
 1730|  2.05k|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|  2.05k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  2.05k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  2.05k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  2.05k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  2.05k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  2.05k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
 1732|  2.05k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1732:13): [True: 2.05k, False: 0]
  ------------------
 1733|  2.05k|}
evp_pkey_free_legacy:
 1798|     79|{
 1799|     79|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1800|     79|    ENGINE *tmpe = NULL;
 1801|       |
 1802|     79|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1802:9): [True: 0, False: 79]
  |  Branch (1802:26): [True: 0, False: 0]
  ------------------
 1803|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1804|       |
 1805|     79|    if (ameth != NULL) {
  ------------------
  |  Branch (1805:9): [True: 79, False: 0]
  ------------------
 1806|     79|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 79]
  ------------------
 1807|       |            /*
 1808|       |             * We should never have both a legacy origin key, and a key in the
 1809|       |             * legacy cache.
 1810|       |             */
 1811|      0|            assert(x->pkey.ptr == NULL);
 1812|       |            /*
 1813|       |             * For the purposes of freeing we make the legacy cache look like
 1814|       |             * a legacy origin key.
 1815|       |             */
 1816|      0|            x->pkey = x->legacy_cache_pkey;
 1817|      0|            x->legacy_cache_pkey.ptr = NULL;
 1818|      0|        }
 1819|     79|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1819:13): [True: 79, False: 0]
  ------------------
 1820|     79|            ameth->pkey_free(x);
 1821|     79|        x->pkey.ptr = NULL;
 1822|     79|    }
 1823|     79|# ifndef OPENSSL_NO_ENGINE
 1824|     79|    ENGINE_finish(tmpe);
 1825|     79|    ENGINE_finish(x->engine);
 1826|     79|    x->engine = NULL;
 1827|     79|    ENGINE_finish(x->pmeth_engine);
 1828|     79|    x->pmeth_engine = NULL;
 1829|     79|# endif
 1830|     79|}
EVP_PKEY_free:
 1851|  5.21k|{
 1852|  5.21k|    int i;
 1853|       |
 1854|  5.21k|    if (x == NULL)
  ------------------
  |  Branch (1854:9): [True: 3.08k, False: 2.13k]
  ------------------
 1855|  3.08k|        return;
 1856|       |
 1857|  2.13k|    CRYPTO_DOWN_REF(&x->references, &i);
 1858|  2.13k|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|  2.13k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  2.13k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  2.13k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  2.13k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|  2.13k|    if (i > 0)
  ------------------
  |  Branch (1859:9): [True: 2.05k, False: 79]
  ------------------
 1860|  2.05k|        return;
 1861|     79|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1862|     79|    evp_pkey_free_it(x);
 1863|     79|#ifndef FIPS_MODULE
 1864|     79|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  247|     79|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1865|     79|#endif
 1866|     79|    CRYPTO_THREAD_lock_free(x->lock);
 1867|     79|    CRYPTO_FREE_REF(&x->references);
 1868|     79|#ifndef FIPS_MODULE
 1869|     79|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|     79|#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
  ------------------
 1870|     79|#endif
 1871|     79|    OPENSSL_free(x);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|     79|}
p_lib.c:pkey_set_type:
 1558|  2.05k|{
 1559|  2.05k|#ifndef FIPS_MODULE
 1560|  2.05k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1561|  2.05k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1561:21): [True: 2.05k, False: 0]
  ------------------
 1562|  2.05k|#endif
 1563|       |
 1564|       |    /*
 1565|       |     * The setups can't set both legacy and provider side methods.
 1566|       |     * It is forbidden
 1567|       |     */
 1568|  2.05k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|  4.10k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 2.05k]
  |  |  |  Branch (52:43): [True: 2.05k, False: 0]
  |  |  ------------------
  |  |   53|  4.10k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1568:9): [True: 0, False: 2.05k]
  ------------------
 1569|  2.05k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  2.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.05k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1569:12): [True: 0, False: 2.05k]
  ------------------
 1570|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1571|      0|        return 0;
 1572|      0|    }
 1573|       |
 1574|  2.05k|    if (pkey != NULL) {
  ------------------
  |  Branch (1574:9): [True: 2.05k, False: 0]
  ------------------
 1575|  2.05k|        int free_it = 0;
 1576|       |
 1577|  2.05k|#ifndef FIPS_MODULE
 1578|  2.05k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1578:19): [True: 0, False: 2.05k]
  |  Branch (1578:30): [True: 0, False: 2.05k]
  ------------------
 1579|  2.05k|#endif
 1580|  2.05k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1580:19): [True: 0, False: 2.05k]
  |  Branch (1580:30): [True: 0, False: 2.05k]
  ------------------
 1581|  2.05k|        if (free_it)
  ------------------
  |  Branch (1581:13): [True: 0, False: 2.05k]
  ------------------
 1582|      0|            evp_pkey_free_it(pkey);
 1583|  2.05k|#ifndef FIPS_MODULE
 1584|       |        /*
 1585|       |         * If key type matches and a method exists then this lookup has
 1586|       |         * succeeded once so just indicate success.
 1587|       |         */
 1588|  2.05k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|  2.05k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  4.10k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1588:13): [True: 1.97k, False: 79]
  ------------------
 1589|  2.05k|            && type == pkey->save_type
  ------------------
  |  Branch (1589:16): [True: 1.50k, False: 474]
  ------------------
 1590|  2.05k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1590:16): [True: 1.50k, False: 0]
  ------------------
 1591|  1.50k|            return 1;
 1592|    553|# ifndef OPENSSL_NO_ENGINE
 1593|       |        /* If we have ENGINEs release them */
 1594|    553|        ENGINE_finish(pkey->engine);
 1595|    553|        pkey->engine = NULL;
 1596|    553|        ENGINE_finish(pkey->pmeth_engine);
 1597|    553|        pkey->pmeth_engine = NULL;
 1598|    553|# endif
 1599|    553|#endif
 1600|    553|    }
 1601|    553|#ifndef FIPS_MODULE
 1602|    553|    if (str != NULL)
  ------------------
  |  Branch (1602:9): [True: 0, False: 553]
  ------------------
 1603|      0|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1604|    553|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|    553|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    553|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1604:14): [True: 553, False: 0]
  ------------------
 1605|    553|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1606|    553|# ifndef OPENSSL_NO_ENGINE
 1607|    553|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1607:9): [True: 0, False: 553]
  |  Branch (1607:25): [True: 0, False: 0]
  ------------------
 1608|      0|        ENGINE_finish(e);
 1609|    553|# endif
 1610|    553|#endif
 1611|       |
 1612|       |
 1613|    553|    {
 1614|    553|        int check = 1;
 1615|       |
 1616|    553|#ifndef FIPS_MODULE
 1617|    553|        check = check && ameth == NULL;
  ------------------
  |  Branch (1617:17): [True: 553, False: 0]
  |  Branch (1617:26): [True: 0, False: 553]
  ------------------
 1618|    553|#endif
 1619|    553|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1619:17): [True: 0, False: 553]
  |  Branch (1619:26): [True: 0, False: 0]
  ------------------
 1620|    553|        if (check) {
  ------------------
  |  Branch (1620:13): [True: 0, False: 553]
  ------------------
 1621|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1622|      0|            return 0;
 1623|      0|        }
 1624|    553|    }
 1625|    553|    if (pkey != NULL) {
  ------------------
  |  Branch (1625:9): [True: 553, False: 0]
  ------------------
 1626|    553|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1626:13): [True: 0, False: 553]
  |  Branch (1626:32): [True: 0, False: 0]
  ------------------
 1627|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1628|      0|            return 0;
 1629|      0|        }
 1630|       |
 1631|    553|        pkey->keymgmt = keymgmt;
 1632|       |
 1633|    553|        pkey->save_type = type;
 1634|    553|        pkey->type = type;
 1635|       |
 1636|    553|#ifndef FIPS_MODULE
 1637|       |        /*
 1638|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1639|       |         * The main reason is that |ameth| is one factor to detect that the
 1640|       |         * internal "origin" key is a legacy one.
 1641|       |         */
 1642|    553|        if (keymgmt == NULL)
  ------------------
  |  Branch (1642:13): [True: 553, False: 0]
  ------------------
 1643|    553|            pkey->ameth = ameth;
 1644|       |
 1645|       |        /*
 1646|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1647|       |         * for any key type that has a legacy implementation, regardless of
 1648|       |         * if the internal key is a legacy or a provider side one.  When
 1649|       |         * there is no legacy implementation for the key, the type becomes
 1650|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1651|       |         * with functions that expect legacy internal keys.
 1652|       |         */
 1653|    553|        if (ameth != NULL) {
  ------------------
  |  Branch (1653:13): [True: 553, False: 0]
  ------------------
 1654|    553|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|    553|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    553|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1654:17): [True: 0, False: 553]
  ------------------
 1655|      0|                pkey->type = ameth->pkey_id;
 1656|    553|        } else {
 1657|      0|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|      0|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1658|      0|        }
 1659|    553|# ifndef OPENSSL_NO_ENGINE
 1660|    553|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1660:13): [True: 0, False: 553]
  |  Branch (1660:29): [True: 0, False: 0]
  |  Branch (1660:42): [True: 0, False: 0]
  ------------------
 1661|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1662|      0|            return 0;
 1663|      0|        }
 1664|    553|# endif
 1665|    553|        pkey->engine = e;
 1666|    553|#endif
 1667|    553|    }
 1668|    553|    return 1;
 1669|    553|}
p_lib.c:evp_pkey_free_it:
 1834|     79|{
 1835|       |    /* internal function; x is never NULL */
 1836|     79|    evp_keymgmt_util_clear_operation_cache(x);
 1837|     79|#ifndef FIPS_MODULE
 1838|     79|    evp_pkey_free_legacy(x);
 1839|     79|#endif
 1840|       |
 1841|     79|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1841:9): [True: 0, False: 79]
  ------------------
 1842|      0|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1843|      0|        EVP_KEYMGMT_free(x->keymgmt);
 1844|      0|        x->keymgmt = NULL;
 1845|      0|        x->keydata = NULL;
 1846|      0|    }
 1847|     79|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|     79|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     79|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1848|     79|}

EVP_PKEY_CTX_new_from_pkey:
  354|  2.05k|{
  355|  2.05k|    return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
  356|  2.05k|}
evp_pkey_ctx_free_old_ops:
  359|  2.05k|{
  360|  2.05k|    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)) {
  ------------------
  |  |  741|  2.05k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|  2.05k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|  2.05k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|  2.05k|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|  2.05k|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|  2.05k|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|  2.05k|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|  2.05k|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|  2.05k|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|  2.05k|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|  2.05k|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|  2.05k|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
  361|      0|        if (ctx->op.sig.algctx != NULL && ctx->op.sig.signature != NULL)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  |  Branch (361:43): [True: 0, False: 0]
  ------------------
  362|      0|            ctx->op.sig.signature->freectx(ctx->op.sig.algctx);
  363|      0|        EVP_SIGNATURE_free(ctx->op.sig.signature);
  364|      0|        ctx->op.sig.algctx = NULL;
  365|      0|        ctx->op.sig.signature = NULL;
  366|  2.05k|    } else if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) {
  ------------------
  |  |  744|  2.05k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1773|  2.05k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1755|  2.05k|# define EVP_PKEY_OP_DERIVE              (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
  367|      0|        if (ctx->op.kex.algctx != NULL && ctx->op.kex.exchange != NULL)
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  |  Branch (367:43): [True: 0, False: 0]
  ------------------
  368|      0|            ctx->op.kex.exchange->freectx(ctx->op.kex.algctx);
  369|      0|        EVP_KEYEXCH_free(ctx->op.kex.exchange);
  370|      0|        ctx->op.kex.algctx = NULL;
  371|      0|        ctx->op.kex.exchange = NULL;
  372|  2.05k|    } else if (EVP_PKEY_CTX_IS_KEM_OP(ctx)) {
  ------------------
  |  |  756|  2.05k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1779|  2.05k|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1756|  2.05k|# define EVP_PKEY_OP_ENCAPSULATE         (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1757|  2.05k|# define EVP_PKEY_OP_DECAPSULATE         (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (756:5): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
  373|      0|        if (ctx->op.encap.algctx != NULL && ctx->op.encap.kem != NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  |  Branch (373:45): [True: 0, False: 0]
  ------------------
  374|      0|            ctx->op.encap.kem->freectx(ctx->op.encap.algctx);
  375|      0|        EVP_KEM_free(ctx->op.encap.kem);
  376|      0|        ctx->op.encap.algctx = NULL;
  377|      0|        ctx->op.encap.kem = NULL;
  378|      0|    }
  379|  2.05k|    else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)) {
  ------------------
  |  |  747|  2.05k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1770|  2.05k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1753|  2.05k|# define EVP_PKEY_OP_ENCRYPT             (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1754|  2.05k|# define EVP_PKEY_OP_DECRYPT             (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
  380|      0|        if (ctx->op.ciph.algctx != NULL && ctx->op.ciph.cipher != NULL)
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  |  Branch (380:44): [True: 0, False: 0]
  ------------------
  381|      0|            ctx->op.ciph.cipher->freectx(ctx->op.ciph.algctx);
  382|      0|        EVP_ASYM_CIPHER_free(ctx->op.ciph.cipher);
  383|      0|        ctx->op.ciph.algctx = NULL;
  384|      0|        ctx->op.ciph.cipher = NULL;
  385|  2.05k|    } else if (EVP_PKEY_CTX_IS_GEN_OP(ctx)) {
  ------------------
  |  |  750|  2.05k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1782|  2.05k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1745|  2.05k|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1746|  2.05k|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 2.05k]
  |  |  ------------------
  ------------------
  386|      0|        if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL)
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  |  Branch (386:47): [True: 0, False: 0]
  ------------------
  387|      0|            evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx);
  388|      0|    }
  389|  2.05k|}
EVP_PKEY_CTX_free:
  392|  2.05k|{
  393|  2.05k|    if (ctx == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 2.05k]
  ------------------
  394|      0|        return;
  395|  2.05k|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (395:9): [True: 0, False: 2.05k]
  |  Branch (395:23): [True: 0, False: 0]
  ------------------
  396|      0|        ctx->pmeth->cleanup(ctx);
  397|       |
  398|  2.05k|    evp_pkey_ctx_free_old_ops(ctx);
  399|  2.05k|#ifndef FIPS_MODULE
  400|  2.05k|    evp_pkey_ctx_free_all_cached_data(ctx);
  401|  2.05k|#endif
  402|  2.05k|    EVP_KEYMGMT_free(ctx->keymgmt);
  403|       |
  404|  2.05k|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  115|  2.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  405|  2.05k|    EVP_PKEY_free(ctx->pkey);
  406|  2.05k|    EVP_PKEY_free(ctx->peerkey);
  407|  2.05k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  408|  2.05k|    ENGINE_finish(ctx->engine);
  409|  2.05k|#endif
  410|  2.05k|    BN_free(ctx->rsa_pubexp);
  411|  2.05k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  2.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|  2.05k|}
evp_app_cleanup_int:
  633|      2|{
  634|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 2]
  ------------------
  635|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  636|      2|}
pmeth_lib.c:evp_pkey_meth_find_added_by_application:
   93|  2.05k|{
   94|  2.05k|    if (app_pkey_methods != NULL) {
  ------------------
  |  Branch (94:9): [True: 0, False: 2.05k]
  ------------------
   95|      0|        int idx;
   96|      0|        EVP_PKEY_METHOD tmp;
   97|       |
   98|      0|        tmp.pkey_id = type;
   99|      0|        idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);
  100|      0|        if (idx >= 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
  102|      0|    }
  103|  2.05k|    return NULL;
  104|  2.05k|}
pmeth_lib.c:int_ctx_new:
  163|  2.05k|{
  164|  2.05k|    EVP_PKEY_CTX *ret = NULL;
  165|  2.05k|    const EVP_PKEY_METHOD *pmeth = NULL, *app_pmeth = NULL;
  166|  2.05k|    EVP_KEYMGMT *keymgmt = NULL;
  167|       |
  168|       |    /* Code below to be removed when legacy support is dropped. */
  169|       |    /* BEGIN legacy */
  170|  2.05k|    if (id == -1) {
  ------------------
  |  Branch (170:9): [True: 2.05k, False: 0]
  ------------------
  171|  2.05k|        if (pkey != NULL && !evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  649|  2.05k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (171:13): [True: 2.05k, False: 0]
  |  Branch (171:29): [True: 2.05k, False: 0]
  ------------------
  172|  2.05k|            id = pkey->type;
  173|  2.05k|        } else {
  174|      0|            if (pkey != NULL) {
  ------------------
  |  Branch (174:17): [True: 0, False: 0]
  ------------------
  175|       |                /* Must be provided if we get here */
  176|      0|                keytype = EVP_KEYMGMT_get0_name(pkey->keymgmt);
  177|      0|            }
  178|      0|#ifndef FIPS_MODULE
  179|      0|            if (keytype != NULL) {
  ------------------
  |  Branch (179:17): [True: 0, False: 0]
  ------------------
  180|      0|                id = evp_pkey_name2type(keytype);
  181|      0|                if (id == NID_undef)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (181:21): [True: 0, False: 0]
  ------------------
  182|      0|                    id = -1;
  183|      0|            }
  184|      0|#endif
  185|      0|        }
  186|  2.05k|    }
  187|       |    /* If no ID was found here, we can only resort to find a keymgmt */
  188|  2.05k|    if (id == -1) {
  ------------------
  |  Branch (188:9): [True: 0, False: 2.05k]
  ------------------
  189|      0|#ifndef FIPS_MODULE
  190|       |        /* Using engine with a key without id will not work */
  191|      0|        if (e != NULL) {
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return NULL;
  194|      0|        }
  195|      0|#endif
  196|      0|        goto common;
  197|      0|    }
  198|       |
  199|  2.05k|#ifndef FIPS_MODULE
  200|       |    /*
  201|       |     * Here, we extract what information we can for the purpose of
  202|       |     * supporting usage with implementations from providers, to make
  203|       |     * for a smooth transition from legacy stuff to provider based stuff.
  204|       |     *
  205|       |     * If an engine is given, this is entirely legacy, and we should not
  206|       |     * pretend anything else, so we clear the name.
  207|       |     */
  208|  2.05k|    if (e != NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 2.05k]
  ------------------
  209|      0|        keytype = NULL;
  210|  2.05k|    if (e == NULL && (pkey == NULL || pkey->foreign == 0))
  ------------------
  |  Branch (210:9): [True: 2.05k, False: 0]
  |  Branch (210:23): [True: 0, False: 2.05k]
  |  Branch (210:39): [True: 2.05k, False: 0]
  ------------------
  211|  2.05k|        keytype = OBJ_nid2sn(id);
  212|       |
  213|  2.05k|# ifndef OPENSSL_NO_ENGINE
  214|  2.05k|    if (e == NULL && pkey != NULL)
  ------------------
  |  Branch (214:9): [True: 2.05k, False: 0]
  |  Branch (214:22): [True: 2.05k, False: 0]
  ------------------
  215|  2.05k|        e = pkey->pmeth_engine != NULL ? pkey->pmeth_engine : pkey->engine;
  ------------------
  |  Branch (215:13): [True: 0, False: 2.05k]
  ------------------
  216|       |    /* Try to find an ENGINE which implements this method */
  217|  2.05k|    if (e != NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 2.05k]
  ------------------
  218|      0|        if (!ENGINE_init(e)) {
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|            return NULL;
  221|      0|        }
  222|  2.05k|    } else {
  223|  2.05k|        e = ENGINE_get_pkey_meth_engine(id);
  224|  2.05k|    }
  225|       |
  226|       |    /*
  227|       |     * If an ENGINE handled this method look it up. Otherwise use internal
  228|       |     * tables.
  229|       |     */
  230|  2.05k|    if (e != NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 2.05k]
  ------------------
  231|      0|        pmeth = ENGINE_get_pkey_meth(e, id);
  232|  2.05k|    else
  233|  2.05k|# endif /* OPENSSL_NO_ENGINE */
  234|  2.05k|    if (pkey != NULL && pkey->foreign)
  ------------------
  |  Branch (234:9): [True: 2.05k, False: 0]
  |  Branch (234:25): [True: 0, False: 2.05k]
  ------------------
  235|      0|        pmeth = EVP_PKEY_meth_find(id);
  236|  2.05k|    else
  237|  2.05k|        app_pmeth = pmeth = evp_pkey_meth_find_added_by_application(id);
  238|       |
  239|       |    /* END legacy */
  240|  2.05k|#endif /* FIPS_MODULE */
  241|  2.05k| common:
  242|       |    /*
  243|       |     * If there's no engine and no app supplied pmeth and there's a name, we try
  244|       |     * fetching a provider implementation.
  245|       |     */
  246|  2.05k|    if (e == NULL && app_pmeth == NULL && keytype != NULL) {
  ------------------
  |  Branch (246:9): [True: 2.05k, False: 0]
  |  Branch (246:22): [True: 2.05k, False: 0]
  |  Branch (246:43): [True: 2.05k, False: 0]
  ------------------
  247|       |        /*
  248|       |         * If |pkey| is given and is provided, we take a reference to its
  249|       |         * keymgmt.  Otherwise, we fetch one for the keytype we got. This
  250|       |         * is to ensure that operation init functions can access what they
  251|       |         * need through this single pointer.
  252|       |         */
  253|  2.05k|        if (pkey != NULL && pkey->keymgmt != NULL) {
  ------------------
  |  Branch (253:13): [True: 2.05k, False: 0]
  |  Branch (253:29): [True: 0, False: 2.05k]
  ------------------
  254|      0|            if (!EVP_KEYMGMT_up_ref(pkey->keymgmt))
  ------------------
  |  Branch (254:17): [True: 0, False: 0]
  ------------------
  255|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  256|      0|            else
  257|      0|                keymgmt = pkey->keymgmt;
  258|  2.05k|        } else {
  259|  2.05k|            keymgmt = EVP_KEYMGMT_fetch(libctx, keytype, propquery);
  260|  2.05k|        }
  261|  2.05k|        if (keymgmt == NULL)
  ------------------
  |  Branch (261:13): [True: 0, False: 2.05k]
  ------------------
  262|      0|            return NULL;   /* EVP_KEYMGMT_fetch() recorded an error */
  263|       |
  264|  2.05k|#ifndef FIPS_MODULE
  265|       |        /*
  266|       |         * Chase down the legacy NID, as that might be needed for diverse
  267|       |         * purposes, such as ensure that EVP_PKEY_type() can return sensible
  268|       |         * values. We go through all keymgmt names, because the keytype
  269|       |         * that's passed to this function doesn't necessarily translate
  270|       |         * directly.
  271|       |         */
  272|  2.05k|        if (keymgmt != NULL) {
  ------------------
  |  Branch (272:13): [True: 2.05k, False: 0]
  ------------------
  273|  2.05k|            int tmp_id = evp_keymgmt_get_legacy_alg(keymgmt);
  274|       |
  275|  2.05k|            if (tmp_id != NID_undef) {
  ------------------
  |  |   18|  2.05k|#define NID_undef                       0
  ------------------
  |  Branch (275:17): [True: 2.05k, False: 0]
  ------------------
  276|  2.05k|                if (id == -1) {
  ------------------
  |  Branch (276:21): [True: 0, False: 2.05k]
  ------------------
  277|      0|                    id = tmp_id;
  278|  2.05k|                } else {
  279|       |                    /*
  280|       |                     * It really really shouldn't differ.  If it still does,
  281|       |                     * something is very wrong.
  282|       |                     */
  283|  2.05k|                    if (!ossl_assert(id == tmp_id)) {
  ------------------
  |  |   52|  2.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (283:25): [True: 0, False: 2.05k]
  ------------------
  284|      0|                        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|                        EVP_KEYMGMT_free(keymgmt);
  286|      0|                        return NULL;
  287|      0|                    }
  288|  2.05k|                }
  289|  2.05k|            }
  290|  2.05k|        }
  291|  2.05k|#endif
  292|  2.05k|    }
  293|       |
  294|  2.05k|    if (pmeth == NULL && keymgmt == NULL) {
  ------------------
  |  Branch (294:9): [True: 2.05k, False: 0]
  |  Branch (294:26): [True: 0, False: 2.05k]
  ------------------
  295|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|  2.05k|    } else {
  297|  2.05k|        ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  2.05k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  298|  2.05k|    }
  299|       |
  300|  2.05k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  301|  2.05k|    if ((ret == NULL || pmeth == NULL) && e != NULL)
  ------------------
  |  Branch (301:10): [True: 0, False: 2.05k]
  |  Branch (301:25): [True: 2.05k, False: 0]
  |  Branch (301:43): [True: 0, False: 2.05k]
  ------------------
  302|      0|        ENGINE_finish(e);
  303|  2.05k|#endif
  304|       |
  305|  2.05k|    if (ret == NULL) {
  ------------------
  |  Branch (305:9): [True: 0, False: 2.05k]
  ------------------
  306|      0|        EVP_KEYMGMT_free(keymgmt);
  307|      0|        return NULL;
  308|      0|    }
  309|  2.05k|    if (propquery != NULL) {
  ------------------
  |  Branch (309:9): [True: 0, False: 2.05k]
  ------------------
  310|      0|        ret->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|      0|        if (ret->propquery == NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|      0|            EVP_KEYMGMT_free(keymgmt);
  314|      0|            return NULL;
  315|      0|        }
  316|      0|    }
  317|  2.05k|    ret->libctx = libctx;
  318|  2.05k|    ret->keytype = keytype;
  319|  2.05k|    ret->keymgmt = keymgmt;
  320|  2.05k|    ret->legacy_keytype = id;
  321|  2.05k|    ret->engine = e;
  322|  2.05k|    ret->pmeth = pmeth;
  323|  2.05k|    ret->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|  2.05k|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  324|       |
  325|  2.05k|    if (pkey != NULL && !EVP_PKEY_up_ref(pkey)) {
  ------------------
  |  Branch (325:9): [True: 2.05k, False: 0]
  |  Branch (325:25): [True: 0, False: 2.05k]
  ------------------
  326|      0|        EVP_PKEY_CTX_free(ret);
  327|      0|        return NULL;
  328|      0|    }
  329|       |
  330|  2.05k|    ret->pkey = pkey;
  331|       |
  332|  2.05k|    if (pmeth != NULL && pmeth->init != NULL) {
  ------------------
  |  Branch (332:9): [True: 0, False: 2.05k]
  |  Branch (332:26): [True: 0, False: 0]
  ------------------
  333|      0|        if (pmeth->init(ret) <= 0) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            ret->pmeth = NULL;
  335|      0|            EVP_PKEY_CTX_free(ret);
  336|      0|            return NULL;
  337|      0|        }
  338|      0|    }
  339|       |
  340|  2.05k|    return ret;
  341|  2.05k|}
pmeth_lib.c:decode_cmd:
 1443|  2.05k|{
 1444|  2.05k|    if (cmd == -1) {
  ------------------
  |  Branch (1444:9): [True: 0, False: 2.05k]
  ------------------
 1445|       |        /*
 1446|       |         * The consequence of the assertion not being true is that this
 1447|       |         * function will return -1, which will cause the calling functions
 1448|       |         * to signal that the command is unsupported...  in non-debug mode.
 1449|       |         */
 1450|      0|        if (ossl_assert(name != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:26): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
 1451|      0|            if (strcmp(name, "distid") == 0 || strcmp(name, "hexdistid") == 0)
  ------------------
  |  Branch (1451:17): [True: 0, False: 0]
  |  Branch (1451:48): [True: 0, False: 0]
  ------------------
 1452|      0|                cmd = EVP_PKEY_CTRL_SET1_ID;
  ------------------
  |  | 1807|      0|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1453|      0|    }
 1454|       |
 1455|  2.05k|    return cmd;
 1456|  2.05k|}
pmeth_lib.c:evp_pkey_ctx_free_cached_data:
 1529|  2.05k|{
 1530|  2.05k|    cmd = decode_cmd(cmd, name);
 1531|  2.05k|    switch (cmd) {
  ------------------
  |  Branch (1531:13): [True: 0, False: 2.05k]
  ------------------
 1532|  2.05k|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1807|  2.05k|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
  |  Branch (1532:5): [True: 2.05k, False: 0]
  ------------------
 1533|  2.05k|        OPENSSL_free(ctx->cached_parameters.dist_id);
  ------------------
  |  |  115|  2.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1534|  2.05k|        OPENSSL_free(ctx->cached_parameters.dist_id_name);
  ------------------
  |  |  115|  2.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1535|  2.05k|        ctx->cached_parameters.dist_id = NULL;
 1536|  2.05k|        ctx->cached_parameters.dist_id_name = NULL;
 1537|  2.05k|        break;
 1538|  2.05k|    }
 1539|  2.05k|}
pmeth_lib.c:evp_pkey_ctx_free_all_cached_data:
 1542|  2.05k|{
 1543|  2.05k|    evp_pkey_ctx_free_cached_data(ctx, EVP_PKEY_CTRL_SET1_ID, NULL);
  ------------------
  |  | 1807|  2.05k|# define EVP_PKEY_CTRL_SET1_ID           15
  ------------------
 1544|  2.05k|}

EVP_SIGNATURE_free:
  460|    278|{
  461|    278|    int i;
  462|       |
  463|    278|    if (signature == NULL)
  ------------------
  |  Branch (463:9): [True: 0, False: 278]
  ------------------
  464|      0|        return;
  465|    278|    CRYPTO_DOWN_REF(&signature->refcnt, &i);
  466|    278|    if (i > 0)
  ------------------
  |  Branch (466:9): [True: 219, False: 59]
  ------------------
  467|    219|        return;
  468|     59|    OPENSSL_free(signature->type_name);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  469|     59|    ossl_provider_free(signature->prov);
  470|     59|    CRYPTO_FREE_REF(&signature->refcnt);
  471|     59|    OPENSSL_free(signature);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  472|     59|}
EVP_SIGNATURE_up_ref:
  475|    219|{
  476|    219|    int ref = 0;
  477|       |
  478|    219|    CRYPTO_UP_REF(&signature->refcnt, &ref);
  479|    219|    return 1;
  480|    219|}
EVP_SIGNATURE_fetch:
  489|    158|{
  490|    158|    return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
  ------------------
  |  |  317|    158|# define OSSL_OP_SIGNATURE                          12
  ------------------
  491|    158|                             evp_signature_from_algorithm,
  492|    158|                             evp_signature_up_ref,
  493|    158|                             evp_signature_free);
  494|    158|}
signature.c:evp_signature_from_algorithm:
   55|     59|{
   56|     59|    const OSSL_DISPATCH *fns = algodef->implementation;
   57|     59|    EVP_SIGNATURE *signature = NULL;
   58|     59|    const char *desc;
   59|       |    /* Counts newctx / freectx */
   60|     59|    int ctxfncnt = 0;
   61|       |    /* Counts all init functions  */
   62|     59|    int initfncnt = 0;
   63|       |    /* Counts all parameter functions */
   64|     59|    int gparamfncnt = 0, sparamfncnt = 0, gmdparamfncnt = 0, smdparamfncnt = 0;
   65|     59|    int valid = 0;
   66|       |
   67|     59|    if ((signature = evp_signature_new(prov)) == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 59]
  ------------------
   68|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   69|      0|        goto err;
   70|      0|    }
   71|       |
   72|     59|    signature->name_id = name_id;
   73|     59|    if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 59]
  ------------------
   74|      0|        goto err;
   75|     59|    signature->description = algodef->algorithm_description;
   76|     59|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (76:12): [True: 12, False: 47]
  ------------------
   77|       |
   78|  1.08k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (78:12): [True: 1.02k, False: 59]
  ------------------
   79|  1.02k|        switch (fns->function_id) {
  ------------------
  |  Branch (79:17): [True: 0, False: 1.02k]
  ------------------
   80|     59|        case OSSL_FUNC_SIGNATURE_NEWCTX:
  ------------------
  |  |  792|     59|# define OSSL_FUNC_SIGNATURE_NEWCTX                  1
  ------------------
  |  Branch (80:9): [True: 59, False: 962]
  ------------------
   81|     59|            if (signature->newctx != NULL)
  ------------------
  |  Branch (81:17): [True: 0, False: 59]
  ------------------
   82|      0|                break;
   83|     59|            signature->newctx = OSSL_FUNC_signature_newctx(fns);
   84|     59|            ctxfncnt++;
   85|     59|            break;
   86|     42|        case OSSL_FUNC_SIGNATURE_SIGN_INIT:
  ------------------
  |  |  793|     42|# define OSSL_FUNC_SIGNATURE_SIGN_INIT               2
  ------------------
  |  Branch (86:9): [True: 42, False: 979]
  ------------------
   87|     42|            if (signature->sign_init != NULL)
  ------------------
  |  Branch (87:17): [True: 2, False: 40]
  ------------------
   88|      2|                break;
   89|     40|            signature->sign_init = OSSL_FUNC_signature_sign_init(fns);
   90|     40|            initfncnt++;
   91|     40|            break;
   92|     55|        case OSSL_FUNC_SIGNATURE_SIGN:
  ------------------
  |  |  794|     55|# define OSSL_FUNC_SIGNATURE_SIGN                    3
  ------------------
  |  Branch (92:9): [True: 55, False: 966]
  ------------------
   93|     55|            if (signature->sign != NULL)
  ------------------
  |  Branch (93:17): [True: 0, False: 55]
  ------------------
   94|      0|                break;
   95|     55|            signature->sign = OSSL_FUNC_signature_sign(fns);
   96|     55|            break;
   97|     51|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT:
  ------------------
  |  |  818|     51|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT      27
  ------------------
  |  Branch (97:9): [True: 51, False: 970]
  ------------------
   98|     51|            if (signature->sign_message_init != NULL)
  ------------------
  |  Branch (98:17): [True: 0, False: 51]
  ------------------
   99|      0|                break;
  100|     51|            signature->sign_message_init
  101|     51|                = OSSL_FUNC_signature_sign_message_init(fns);
  102|     51|            initfncnt++;
  103|     51|            break;
  104|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE:
  ------------------
  |  |  819|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE    28
  ------------------
  |  Branch (104:9): [True: 34, False: 987]
  ------------------
  105|     34|            if (signature->sign_message_update != NULL)
  ------------------
  |  Branch (105:17): [True: 0, False: 34]
  ------------------
  106|      0|                break;
  107|     34|            signature->sign_message_update
  108|     34|                = OSSL_FUNC_signature_sign_message_update(fns);
  109|     34|            break;
  110|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL:
  ------------------
  |  |  820|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL     29
  ------------------
  |  Branch (110:9): [True: 34, False: 987]
  ------------------
  111|     34|            if (signature->sign_message_final != NULL)
  ------------------
  |  Branch (111:17): [True: 0, False: 34]
  ------------------
  112|      0|                break;
  113|     34|            signature->sign_message_final
  114|     34|                = OSSL_FUNC_signature_sign_message_final(fns);
  115|     34|            break;
  116|     42|        case OSSL_FUNC_SIGNATURE_VERIFY_INIT:
  ------------------
  |  |  795|     42|# define OSSL_FUNC_SIGNATURE_VERIFY_INIT             4
  ------------------
  |  Branch (116:9): [True: 42, False: 979]
  ------------------
  117|     42|            if (signature->verify_init != NULL)
  ------------------
  |  Branch (117:17): [True: 2, False: 40]
  ------------------
  118|      2|                break;
  119|     40|            signature->verify_init = OSSL_FUNC_signature_verify_init(fns);
  120|     40|            initfncnt++;
  121|     40|            break;
  122|     55|        case OSSL_FUNC_SIGNATURE_VERIFY:
  ------------------
  |  |  796|     55|# define OSSL_FUNC_SIGNATURE_VERIFY                  5
  ------------------
  |  Branch (122:9): [True: 55, False: 966]
  ------------------
  123|     55|            if (signature->verify != NULL)
  ------------------
  |  Branch (123:17): [True: 0, False: 55]
  ------------------
  124|      0|                break;
  125|     55|            signature->verify = OSSL_FUNC_signature_verify(fns);
  126|     55|            break;
  127|     51|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT:
  ------------------
  |  |  821|     51|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT    30
  ------------------
  |  Branch (127:9): [True: 51, False: 970]
  ------------------
  128|     51|            if (signature->verify_message_init != NULL)
  ------------------
  |  Branch (128:17): [True: 0, False: 51]
  ------------------
  129|      0|                break;
  130|     51|            signature->verify_message_init
  131|     51|                = OSSL_FUNC_signature_verify_message_init(fns);
  132|     51|            initfncnt++;
  133|     51|            break;
  134|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE:
  ------------------
  |  |  822|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE  31
  ------------------
  |  Branch (134:9): [True: 34, False: 987]
  ------------------
  135|     34|            if (signature->verify_message_update != NULL)
  ------------------
  |  Branch (135:17): [True: 0, False: 34]
  ------------------
  136|      0|                break;
  137|     34|            signature->verify_message_update
  138|     34|                = OSSL_FUNC_signature_verify_message_update(fns);
  139|     34|            break;
  140|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL:
  ------------------
  |  |  823|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL   32
  ------------------
  |  Branch (140:9): [True: 34, False: 987]
  ------------------
  141|     34|            if (signature->verify_message_final != NULL)
  ------------------
  |  Branch (141:17): [True: 0, False: 34]
  ------------------
  142|      0|                break;
  143|     34|            signature->verify_message_final
  144|     34|                = OSSL_FUNC_signature_verify_message_final(fns);
  145|     34|            break;
  146|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT:
  ------------------
  |  |  797|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT     6
  ------------------
  |  Branch (146:9): [True: 14, False: 1.00k]
  ------------------
  147|     14|            if (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 14]
  ------------------
  148|      0|                break;
  149|     14|            signature->verify_recover_init
  150|     14|                = OSSL_FUNC_signature_verify_recover_init(fns);
  151|     14|            initfncnt++;
  152|     14|            break;
  153|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER:
  ------------------
  |  |  798|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER          7
  ------------------
  |  Branch (153:9): [True: 14, False: 1.00k]
  ------------------
  154|     14|            if (signature->verify_recover != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 14]
  ------------------
  155|      0|                break;
  156|     14|            signature->verify_recover
  157|     14|                = OSSL_FUNC_signature_verify_recover(fns);
  158|     14|            break;
  159|     25|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT:
  ------------------
  |  |  799|     25|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT        8
  ------------------
  |  Branch (159:9): [True: 25, False: 996]
  ------------------
  160|     25|            if (signature->digest_sign_init != NULL)
  ------------------
  |  Branch (160:17): [True: 0, False: 25]
  ------------------
  161|      0|                break;
  162|     25|            signature->digest_sign_init
  163|     25|                = OSSL_FUNC_signature_digest_sign_init(fns);
  164|     25|            initfncnt++;
  165|     25|            break;
  166|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE:
  ------------------
  |  |  800|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE      9
  ------------------
  |  Branch (166:9): [True: 8, False: 1.01k]
  ------------------
  167|      8|            if (signature->digest_sign_update != NULL)
  ------------------
  |  Branch (167:17): [True: 0, False: 8]
  ------------------
  168|      0|                break;
  169|      8|            signature->digest_sign_update
  170|      8|                = OSSL_FUNC_signature_digest_sign_update(fns);
  171|      8|            break;
  172|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL:
  ------------------
  |  |  801|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL      10
  ------------------
  |  Branch (172:9): [True: 8, False: 1.01k]
  ------------------
  173|      8|            if (signature->digest_sign_final != NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 8]
  ------------------
  174|      0|                break;
  175|      8|            signature->digest_sign_final
  176|      8|                = OSSL_FUNC_signature_digest_sign_final(fns);
  177|      8|            break;
  178|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN:
  ------------------
  |  |  802|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN            11
  ------------------
  |  Branch (178:9): [True: 17, False: 1.00k]
  ------------------
  179|     17|            if (signature->digest_sign != NULL)
  ------------------
  |  Branch (179:17): [True: 0, False: 17]
  ------------------
  180|      0|                break;
  181|     17|            signature->digest_sign
  182|     17|                = OSSL_FUNC_signature_digest_sign(fns);
  183|     17|            break;
  184|     21|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT:
  ------------------
  |  |  803|     21|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT     12
  ------------------
  |  Branch (184:9): [True: 21, False: 1.00k]
  ------------------
  185|     21|            if (signature->digest_verify_init != NULL)
  ------------------
  |  Branch (185:17): [True: 0, False: 21]
  ------------------
  186|      0|                break;
  187|     21|            signature->digest_verify_init
  188|     21|                = OSSL_FUNC_signature_digest_verify_init(fns);
  189|     21|            initfncnt++;
  190|     21|            break;
  191|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE:
  ------------------
  |  |  804|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE   13
  ------------------
  |  Branch (191:9): [True: 4, False: 1.01k]
  ------------------
  192|      4|            if (signature->digest_verify_update != NULL)
  ------------------
  |  Branch (192:17): [True: 0, False: 4]
  ------------------
  193|      0|                break;
  194|      4|            signature->digest_verify_update
  195|      4|                = OSSL_FUNC_signature_digest_verify_update(fns);
  196|      4|            break;
  197|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL:
  ------------------
  |  |  805|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL    14
  ------------------
  |  Branch (197:9): [True: 4, False: 1.01k]
  ------------------
  198|      4|            if (signature->digest_verify_final != NULL)
  ------------------
  |  Branch (198:17): [True: 0, False: 4]
  ------------------
  199|      0|                break;
  200|      4|            signature->digest_verify_final
  201|      4|                = OSSL_FUNC_signature_digest_verify_final(fns);
  202|      4|            break;
  203|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY:
  ------------------
  |  |  806|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY          15
  ------------------
  |  Branch (203:9): [True: 17, False: 1.00k]
  ------------------
  204|     17|            if (signature->digest_verify != NULL)
  ------------------
  |  Branch (204:17): [True: 0, False: 17]
  ------------------
  205|      0|                break;
  206|     17|            signature->digest_verify
  207|     17|                = OSSL_FUNC_signature_digest_verify(fns);
  208|     17|            break;
  209|     59|        case OSSL_FUNC_SIGNATURE_FREECTX:
  ------------------
  |  |  807|     59|# define OSSL_FUNC_SIGNATURE_FREECTX                16
  ------------------
  |  Branch (209:9): [True: 59, False: 962]
  ------------------
  210|     59|            if (signature->freectx != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 59]
  ------------------
  211|      0|                break;
  212|     59|            signature->freectx = OSSL_FUNC_signature_freectx(fns);
  213|     59|            ctxfncnt++;
  214|     59|            break;
  215|     59|        case OSSL_FUNC_SIGNATURE_DUPCTX:
  ------------------
  |  |  808|     59|# define OSSL_FUNC_SIGNATURE_DUPCTX                 17
  ------------------
  |  Branch (215:9): [True: 59, False: 962]
  ------------------
  216|     59|            if (signature->dupctx != NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 59]
  ------------------
  217|      0|                break;
  218|     59|            signature->dupctx = OSSL_FUNC_signature_dupctx(fns);
  219|     59|            break;
  220|     55|        case OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS:
  ------------------
  |  |  809|     55|# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS         18
  ------------------
  |  Branch (220:9): [True: 55, False: 966]
  ------------------
  221|     55|            if (signature->get_ctx_params != NULL)
  ------------------
  |  Branch (221:17): [True: 0, False: 55]
  ------------------
  222|      0|                break;
  223|     55|            signature->get_ctx_params
  224|     55|                = OSSL_FUNC_signature_get_ctx_params(fns);
  225|     55|            gparamfncnt++;
  226|     55|            break;
  227|     55|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  810|     55|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS    19
  ------------------
  |  Branch (227:9): [True: 55, False: 966]
  ------------------
  228|     55|            if (signature->gettable_ctx_params != NULL)
  ------------------
  |  Branch (228:17): [True: 0, False: 55]
  ------------------
  229|      0|                break;
  230|     55|            signature->gettable_ctx_params
  231|     55|                = OSSL_FUNC_signature_gettable_ctx_params(fns);
  232|     55|            gparamfncnt++;
  233|     55|            break;
  234|     59|        case OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS:
  ------------------
  |  |  811|     59|# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS         20
  ------------------
  |  Branch (234:9): [True: 59, False: 962]
  ------------------
  235|     59|            if (signature->set_ctx_params != NULL)
  ------------------
  |  Branch (235:17): [True: 0, False: 59]
  ------------------
  236|      0|                break;
  237|     59|            signature->set_ctx_params
  238|     59|                = OSSL_FUNC_signature_set_ctx_params(fns);
  239|     59|            sparamfncnt++;
  240|     59|            break;
  241|     59|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  812|     59|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS    21
  ------------------
  |  Branch (241:9): [True: 59, False: 962]
  ------------------
  242|     59|            if (signature->settable_ctx_params != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 59]
  ------------------
  243|      0|                break;
  244|     59|            signature->settable_ctx_params
  245|     59|                = OSSL_FUNC_signature_settable_ctx_params(fns);
  246|     59|            sparamfncnt++;
  247|     59|            break;
  248|      4|        case OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS:
  ------------------
  |  |  813|      4|# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS      22
  ------------------
  |  Branch (248:9): [True: 4, False: 1.01k]
  ------------------
  249|      4|            if (signature->get_ctx_md_params != NULL)
  ------------------
  |  Branch (249:17): [True: 0, False: 4]
  ------------------
  250|      0|                break;
  251|      4|            signature->get_ctx_md_params
  252|      4|                = OSSL_FUNC_signature_get_ctx_md_params(fns);
  253|      4|            gmdparamfncnt++;
  254|      4|            break;
  255|      4|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  814|      4|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
  ------------------
  |  Branch (255:9): [True: 4, False: 1.01k]
  ------------------
  256|      4|            if (signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (256:17): [True: 0, False: 4]
  ------------------
  257|      0|                break;
  258|      4|            signature->gettable_ctx_md_params
  259|      4|                = OSSL_FUNC_signature_gettable_ctx_md_params(fns);
  260|      4|            gmdparamfncnt++;
  261|      4|            break;
  262|      4|        case OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS:
  ------------------
  |  |  815|      4|# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS      24
  ------------------
  |  Branch (262:9): [True: 4, False: 1.01k]
  ------------------
  263|      4|            if (signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (263:17): [True: 0, False: 4]
  ------------------
  264|      0|                break;
  265|      4|            signature->set_ctx_md_params
  266|      4|                = OSSL_FUNC_signature_set_ctx_md_params(fns);
  267|      4|            smdparamfncnt++;
  268|      4|            break;
  269|      4|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  816|      4|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
  ------------------
  |  Branch (269:9): [True: 4, False: 1.01k]
  ------------------
  270|      4|            if (signature->settable_ctx_md_params != NULL)
  ------------------
  |  Branch (270:17): [True: 0, False: 4]
  ------------------
  271|      0|                break;
  272|      4|            signature->settable_ctx_md_params
  273|      4|                = OSSL_FUNC_signature_settable_ctx_md_params(fns);
  274|      4|            smdparamfncnt++;
  275|      4|            break;
  276|     36|        case OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES:
  ------------------
  |  |  817|     36|# define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES        26
  ------------------
  |  Branch (276:9): [True: 36, False: 985]
  ------------------
  277|     36|            if (signature->query_key_types != NULL)
  ------------------
  |  Branch (277:17): [True: 0, False: 36]
  ------------------
  278|      0|                break;
  279|     36|            signature->query_key_types
  280|     36|                = OSSL_FUNC_signature_query_key_types(fns);
  281|     36|            break;
  282|  1.02k|        }
  283|  1.02k|    }
  284|       |    /*
  285|       |     * In order to be a consistent set of functions we must have at least
  286|       |     * a set of context functions (newctx and freectx) as well as a set of
  287|       |     * "signature" functions.  Because there's an overlap between some sets
  288|       |     * of functions, counters don't always cut it, we must test known
  289|       |     * combinations.
  290|       |     * We start by assuming the implementation is valid, and then look for
  291|       |     * reasons it's not.
  292|       |     */
  293|     59|    valid = 1;
  294|       |    /* Start with the ones where counters say enough */
  295|     59|    if (ctxfncnt != 2) {
  ------------------
  |  Branch (295:9): [True: 0, False: 59]
  ------------------
  296|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  297|      0|                       "missing %s newctx or freectx:%s", signature->type_name, desc);
  298|      0|        valid = 0;
  299|      0|    }
  300|     59|    if (valid
  ------------------
  |  Branch (300:9): [True: 59, False: 0]
  ------------------
  301|     59|        && ((gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (301:14): [True: 55, False: 4]
  |  Branch (301:34): [True: 0, False: 55]
  ------------------
  302|     59|            || (sparamfncnt != 0 && sparamfncnt != 2)
  ------------------
  |  Branch (302:17): [True: 59, False: 0]
  |  Branch (302:37): [True: 0, False: 59]
  ------------------
  303|     59|            || (gmdparamfncnt != 0 && gmdparamfncnt != 2)
  ------------------
  |  Branch (303:17): [True: 4, False: 55]
  |  Branch (303:39): [True: 0, False: 4]
  ------------------
  304|     59|            || (smdparamfncnt != 0 && smdparamfncnt != 2))) {
  ------------------
  |  Branch (304:17): [True: 4, False: 55]
  |  Branch (304:39): [True: 0, False: 4]
  ------------------
  305|       |        /*
  306|       |         * Params functions are optional, but if defined, they must
  307|       |         * be pairwise complete sets, i.e. a getter must have an
  308|       |         * associated gettable, etc
  309|       |         */
  310|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  311|      0|                       "missing %s params getter or setter:%s", signature->type_name, desc);
  312|      0|        valid = 0;
  313|      0|    }
  314|     59|    if (valid && initfncnt == 0) {
  ------------------
  |  Branch (314:9): [True: 59, False: 0]
  |  Branch (314:18): [True: 0, False: 59]
  ------------------
  315|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  316|      0|                       "missing %s init:%s", signature->type_name, desc);
  317|      0|        valid = 0;
  318|      0|    }
  319|       |
  320|       |    /* Now we check for function combinations */
  321|     59|    if (valid
  ------------------
  |  Branch (321:9): [True: 59, False: 0]
  ------------------
  322|     59|        && ((signature->sign_init != NULL
  ------------------
  |  Branch (322:14): [True: 40, False: 19]
  ------------------
  323|     59|             && signature->sign == NULL)
  ------------------
  |  Branch (323:17): [True: 0, False: 40]
  ------------------
  324|     59|            || (signature->sign_message_init != NULL
  ------------------
  |  Branch (324:17): [True: 51, False: 8]
  ------------------
  325|     59|                && signature->sign == NULL
  ------------------
  |  Branch (325:20): [True: 0, False: 51]
  ------------------
  326|     59|                && (signature->sign_message_update == NULL
  ------------------
  |  Branch (326:21): [True: 0, False: 0]
  ------------------
  327|      0|                    || signature->sign_message_final == NULL)))) {
  ------------------
  |  Branch (327:24): [True: 0, False: 0]
  ------------------
  328|       |        /* sign_init function(s) with no signing function?  That's weird */
  329|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  330|      0|                       "missing %s signing function:%s", signature->type_name, desc);
  331|      0|        valid = 0;
  332|      0|    }
  333|     59|    if (valid
  ------------------
  |  Branch (333:9): [True: 59, False: 0]
  ------------------
  334|     59|        && (signature->sign != NULL
  ------------------
  |  Branch (334:13): [True: 55, False: 4]
  ------------------
  335|     59|            || signature->sign_message_update != NULL
  ------------------
  |  Branch (335:16): [True: 0, False: 4]
  ------------------
  336|     59|            || signature->sign_message_final != NULL)
  ------------------
  |  Branch (336:16): [True: 0, False: 4]
  ------------------
  337|     59|        && signature->sign_init == NULL
  ------------------
  |  Branch (337:12): [True: 15, False: 40]
  ------------------
  338|     59|        && signature->sign_message_init == NULL) {
  ------------------
  |  Branch (338:12): [True: 0, False: 15]
  ------------------
  339|       |        /* signing function(s) with no sign_init? That's odd */
  340|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  341|      0|                       "missing %s sign_init or sign_message_init:%s", signature->type_name, desc);
  342|      0|        valid = 0;
  343|      0|    }
  344|       |
  345|     59|    if (valid
  ------------------
  |  Branch (345:9): [True: 59, False: 0]
  ------------------
  346|     59|        && ((signature->verify_init != NULL
  ------------------
  |  Branch (346:14): [True: 40, False: 19]
  ------------------
  347|     59|             && signature->verify == NULL)
  ------------------
  |  Branch (347:17): [True: 0, False: 40]
  ------------------
  348|     59|            || (signature->verify_message_init != NULL
  ------------------
  |  Branch (348:17): [True: 51, False: 8]
  ------------------
  349|     59|                && signature->verify == NULL
  ------------------
  |  Branch (349:20): [True: 0, False: 51]
  ------------------
  350|     59|                && (signature->verify_message_update == NULL
  ------------------
  |  Branch (350:21): [True: 0, False: 0]
  ------------------
  351|      0|                    || signature->verify_message_final == NULL)))) {
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|       |        /* verify_init function(s) with no verification function?  That's weird */
  353|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  354|      0|                       "missing %s verification function:%s", signature->type_name, desc);
  355|      0|        valid = 0;
  356|      0|    }
  357|     59|    if (valid
  ------------------
  |  Branch (357:9): [True: 59, False: 0]
  ------------------
  358|     59|        && (signature->verify != NULL
  ------------------
  |  Branch (358:13): [True: 55, False: 4]
  ------------------
  359|     59|            || signature->verify_message_update != NULL
  ------------------
  |  Branch (359:16): [True: 0, False: 4]
  ------------------
  360|     59|            || signature->verify_message_final != NULL)
  ------------------
  |  Branch (360:16): [True: 0, False: 4]
  ------------------
  361|     59|        && signature->verify_init == NULL
  ------------------
  |  Branch (361:12): [True: 15, False: 40]
  ------------------
  362|     59|            && signature->verify_message_init == NULL) {
  ------------------
  |  Branch (362:16): [True: 0, False: 15]
  ------------------
  363|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  364|      0|                       "missing %s verify_init or verify_message_init:%s",
  365|      0|                       signature->type_name, desc);
  366|       |        /* verification function(s) with no verify_init? That's odd */
  367|      0|        valid = 0;
  368|      0|    }
  369|       |
  370|     59|    if (valid
  ------------------
  |  Branch (370:9): [True: 59, False: 0]
  ------------------
  371|     59|        && (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (371:12): [True: 14, False: 45]
  ------------------
  372|     59|            && (signature->verify_recover == NULL)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 14]
  ------------------
  373|       |        /* verify_recover_init function with no verify_recover?  How quaint */
  374|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  375|      0|                       "missing %s verify_recover:%s", signature->type_name, desc);
  376|      0|        valid = 0;
  377|      0|    }
  378|       |
  379|     59|    if (valid
  ------------------
  |  Branch (379:9): [True: 59, False: 0]
  ------------------
  380|     59|        && (signature->digest_sign_init != NULL
  ------------------
  |  Branch (380:13): [True: 25, False: 34]
  ------------------
  381|     59|            && signature->digest_sign == NULL
  ------------------
  |  Branch (381:16): [True: 8, False: 17]
  ------------------
  382|     59|            && (signature->digest_sign_update == NULL
  ------------------
  |  Branch (382:17): [True: 0, False: 8]
  ------------------
  383|      8|                || signature->digest_sign_final == NULL))) {
  ------------------
  |  Branch (383:20): [True: 0, False: 8]
  ------------------
  384|       |        /* You can't have a digest_sign_init without *some* performing functions */
  385|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  386|      0|                       "missing %s digest_sign function:%s", signature->type_name, desc);
  387|      0|        valid = 0;
  388|      0|    }
  389|       |
  390|     59|    if (valid
  ------------------
  |  Branch (390:9): [True: 59, False: 0]
  ------------------
  391|     59|        && ((signature->digest_verify_init != NULL
  ------------------
  |  Branch (391:14): [True: 21, False: 38]
  ------------------
  392|     59|             && signature->digest_verify == NULL
  ------------------
  |  Branch (392:17): [True: 4, False: 17]
  ------------------
  393|     59|             && (signature->digest_verify_update == NULL
  ------------------
  |  Branch (393:18): [True: 0, False: 4]
  ------------------
  394|      4|                 || signature->digest_verify_final == NULL)))) {
  ------------------
  |  Branch (394:21): [True: 0, False: 4]
  ------------------
  395|       |        /* You can't have a digest_verify_init without *some* performing functions */
  396|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  397|      0|                       "missing %s digest_verify function:%s", signature->type_name, desc);
  398|      0|        valid = 0;
  399|      0|    }
  400|       |
  401|     59|    if (!valid)
  ------------------
  |  Branch (401:9): [True: 0, False: 59]
  ------------------
  402|      0|        goto err;
  403|       |
  404|     59|    if ((signature->digest_sign != NULL
  ------------------
  |  Branch (404:10): [True: 17, False: 42]
  ------------------
  405|     59|         || signature->digest_sign_update != NULL
  ------------------
  |  Branch (405:13): [True: 8, False: 34]
  ------------------
  406|     59|         || signature->digest_sign_final != NULL)
  ------------------
  |  Branch (406:13): [True: 0, False: 34]
  ------------------
  407|     59|        && signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (407:12): [True: 0, False: 25]
  ------------------
  408|       |        /* digest signing function(s) with no digest_sign_init? That's odd */
  409|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  410|      0|                       "missing %s digest_sign_init:%s", signature->type_name, desc);
  411|      0|        goto err;
  412|      0|    }
  413|       |
  414|     59|    if ((signature->digest_verify != NULL
  ------------------
  |  Branch (414:10): [True: 17, False: 42]
  ------------------
  415|     59|         || signature->digest_verify_update != NULL
  ------------------
  |  Branch (415:13): [True: 4, False: 38]
  ------------------
  416|     59|         || signature->digest_verify_final != NULL)
  ------------------
  |  Branch (416:13): [True: 0, False: 38]
  ------------------
  417|     59|        && signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (417:12): [True: 0, False: 21]
  ------------------
  418|       |        /* digest verification function(s) with no digest_verify_init? That's odd */
  419|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  420|      0|                       "missing %s digest_verify_init:%s", signature->type_name, desc);
  421|      0|        goto err;
  422|      0|    }
  423|       |
  424|     59|    if ((signature->sign_message_update == NULL) !=
  ------------------
  |  Branch (424:9): [True: 0, False: 59]
  ------------------
  425|     59|        (signature->sign_message_final == NULL)) {
  426|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  427|      0|                       "only one of %s message signing update and final available:%s",
  428|      0|                       signature->type_name, desc);
  429|      0|        goto err;
  430|      0|    }
  431|     59|    if ((signature->verify_message_update == NULL) !=
  ------------------
  |  Branch (431:9): [True: 0, False: 59]
  ------------------
  432|     59|        (signature->verify_message_final == NULL)) {
  433|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  434|      0|                       "only one of %s message verification update and final available:%s",
  435|      0|                       signature->type_name, desc);
  436|      0|        goto err;
  437|      0|    }
  438|     59|    if ((signature->digest_sign_update == NULL) !=
  ------------------
  |  Branch (438:9): [True: 0, False: 59]
  ------------------
  439|     59|        (signature->digest_sign_final == NULL)) {
  440|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  441|      0|                       "only one of %s digest signing update and final available:%s",
  442|      0|                       signature->type_name, desc);
  443|      0|        goto err;
  444|      0|    }
  445|     59|    if ((signature->digest_verify_update == NULL) !=
  ------------------
  |  Branch (445:9): [True: 0, False: 59]
  ------------------
  446|     59|        (signature->digest_verify_final == NULL)) {
  447|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  448|      0|                       "only one of %s digest verification update and final available:%s",
  449|      0|                       signature->type_name, desc);
  450|      0|        goto err;
  451|      0|    }
  452|       |
  453|     59|    return signature;
  454|      0| err:
  455|      0|    EVP_SIGNATURE_free(signature);
  456|      0|    return NULL;
  457|     59|}
signature.c:evp_signature_new:
   34|     59|{
   35|     59|    EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE));
  ------------------
  |  |  104|     59|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|       |
   37|     59|    if (signature == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 59]
  ------------------
   38|      0|        return NULL;
   39|       |
   40|     59|    if (!CRYPTO_NEW_REF(&signature->refcnt, 1)
  ------------------
  |  Branch (40:9): [True: 0, False: 59]
  ------------------
   41|     59|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (41:12): [True: 0, False: 59]
  ------------------
   42|      0|        CRYPTO_FREE_REF(&signature->refcnt);
   43|      0|        OPENSSL_free(signature);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|     59|    signature->prov = prov;
   48|       |
   49|     59|    return signature;
   50|     59|}
signature.c:evp_signature_up_ref:
   29|    219|{
   30|    219|    return EVP_SIGNATURE_up_ref(data);
   31|    219|}
signature.c:evp_signature_free:
   24|    120|{
   25|    120|    EVP_SIGNATURE_free(data);
   26|    120|}

ossl_do_ex_data_init:
   15|      4|{
   16|      4|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      4|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 4]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      4|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      4|    return global->ex_data_lock != NULL;
   23|      4|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      2|{
   74|      2|    int i;
   75|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      2|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return;
   79|       |
   80|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  248|     38|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 36, False: 2]
  ------------------
   81|     36|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     36|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     36|        ip->meth = NULL;
   85|     36|    }
   86|       |
   87|      2|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      2|    global->ex_data_lock = NULL;
   89|      2|}
ossl_crypto_free_ex_index_ex:
  114|      2|{
  115|      2|    EX_CALLBACKS *ip;
  116|      2|    EX_CALLBACK *a;
  117|      2|    int toret = 0;
  118|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  119|       |
  120|      2|    if (global == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 0;
  122|       |
  123|      2|    ip = get_and_lock(global, class_index, 0);
  124|      2|    if (ip == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 2]
  ------------------
  125|      0|        return 0;
  126|       |
  127|      2|    if (idx < 0 || idx >= sk_EX_CALLBACK_num(ip->meth))
  ------------------
  |  Branch (127:9): [True: 2, False: 0]
  |  Branch (127:20): [True: 0, False: 0]
  ------------------
  128|      2|        goto err;
  129|      0|    a = sk_EX_CALLBACK_value(ip->meth, idx);
  130|      0|    if (a == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|        goto err;
  132|      0|    a->new_func = dummy_new;
  133|      0|    a->dup_func = dummy_dup;
  134|      0|    a->free_func = dummy_free;
  135|      0|    toret = 1;
  136|      2|err:
  137|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  138|      2|    return toret;
  139|      0|}
CRYPTO_free_ex_index:
  142|      2|{
  143|      2|    return ossl_crypto_free_ex_index_ex(NULL, class_index, idx);
  144|      2|}
ossl_crypto_get_ex_new_index_ex:
  155|      2|{
  156|      2|    int toret = -1;
  157|      2|    EX_CALLBACK *a;
  158|      2|    EX_CALLBACKS *ip;
  159|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  160|       |
  161|      2|    if (global == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        return -1;
  163|       |
  164|      2|    ip = get_and_lock(global, class_index, 0);
  165|      2|    if (ip == NULL)
  ------------------
  |  Branch (165:9): [True: 0, False: 2]
  ------------------
  166|      0|        return -1;
  167|       |
  168|      2|    if (ip->meth == NULL) {
  ------------------
  |  Branch (168:9): [True: 2, False: 0]
  ------------------
  169|      2|        ip->meth = sk_EX_CALLBACK_new_null();
  170|       |        /* We push an initial value on the stack because the SSL
  171|       |         * "app_data" routines use ex_data index zero.  See RT 3710. */
  172|      2|        if (ip->meth == NULL
  ------------------
  |  Branch (172:13): [True: 0, False: 2]
  ------------------
  173|      2|            || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (173:16): [True: 0, False: 2]
  ------------------
  174|      0|            sk_EX_CALLBACK_free(ip->meth);
  175|      0|            ip->meth = NULL;
  176|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|      0|            goto err;
  178|      0|        }
  179|      2|    }
  180|       |
  181|      2|    a = (EX_CALLBACK *)OPENSSL_malloc(sizeof(*a));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|      2|    if (a == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        goto err;
  184|      2|    a->argl = argl;
  185|      2|    a->argp = argp;
  186|      2|    a->new_func = new_func;
  187|      2|    a->dup_func = dup_func;
  188|      2|    a->free_func = free_func;
  189|      2|    a->priority = priority;
  190|       |
  191|      2|    if (!sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (191:9): [True: 0, False: 2]
  ------------------
  192|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|        OPENSSL_free(a);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  194|      0|        goto err;
  195|      0|    }
  196|      2|    toret = sk_EX_CALLBACK_num(ip->meth) - 1;
  197|      2|    (void)sk_EX_CALLBACK_set(ip->meth, toret, a);
  198|       |
  199|      2| err:
  200|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  201|      2|    return toret;
  202|      2|}
CRYPTO_get_ex_new_index:
  207|      2|{
  208|      2|    return ossl_crypto_get_ex_new_index_ex(NULL, class_index, argl, argp,
  209|      2|                                           new_func, dup_func, free_func, 0);
  210|      2|}
ossl_crypto_new_ex_data_ex:
  221|    474|{
  222|    474|    int mx, i;
  223|    474|    void *ptr;
  224|    474|    EX_CALLBACK **storage = NULL;
  225|    474|    EX_CALLBACK *stack[10];
  226|    474|    EX_CALLBACKS *ip;
  227|    474|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|    474|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 474]
  ------------------
  230|      0|        return 0;
  231|       |
  232|    474|    ip = get_and_lock(global, class_index, 1);
  233|    474|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 474]
  ------------------
  234|      0|        return 0;
  235|       |
  236|    474|    ad->ctx = ctx;
  237|    474|    ad->sk = NULL;
  238|    474|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|    474|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 474]
  ------------------
  240|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            storage = stack;
  242|      0|        else
  243|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  244|      0|        if (storage != NULL)
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  247|      0|    }
  248|    474|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|    474|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 474]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|    474|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 474]
  ------------------
  253|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  |  Branch (253:35): [True: 0, False: 0]
  ------------------
  254|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  255|      0|            storage[i]->new_func(obj, ptr, ad, i,
  256|      0|                                 storage[i]->argl, storage[i]->argp);
  257|      0|        }
  258|      0|    }
  259|    474|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 474, False: 0]
  ------------------
  260|    474|        OPENSSL_free(storage);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|    474|    return 1;
  262|    474|}
CRYPTO_new_ex_data:
  265|    474|{
  266|    474|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|    474|}
CRYPTO_free_ex_data:
  368|    474|{
  369|    474|    int mx, i;
  370|    474|    EX_CALLBACKS *ip;
  371|    474|    void *ptr;
  372|    474|    const EX_CALLBACK *f;
  373|    474|    struct ex_callback_entry stack[10];
  374|    474|    struct ex_callback_entry *storage = NULL;
  375|    474|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|    474|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 474]
  ------------------
  378|      0|        goto err;
  379|       |
  380|    474|    ip = get_and_lock(global, class_index, 1);
  381|    474|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 474]
  ------------------
  382|      0|        goto err;
  383|       |
  384|    474|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|    474|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 474]
  ------------------
  386|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            storage = stack;
  388|      0|        else
  389|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      0|        if (storage != NULL)
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (391:25): [True: 0, False: 0]
  ------------------
  392|      0|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  393|      0|                storage[i].index = i;
  394|      0|            }
  395|      0|    }
  396|    474|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|    474|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 474]
  ------------------
  399|       |        /* Sort according to priority. High priority first */
  400|      0|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  401|      0|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (401:21): [True: 0, False: 0]
  ------------------
  402|      0|            f = storage[i].excb;
  403|       |
  404|      0|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (404:17): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  406|      0|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  407|      0|            }
  408|      0|        }
  409|      0|    }
  410|       |
  411|    474|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 474, False: 0]
  ------------------
  412|    474|        OPENSSL_free(storage);
  ------------------
  |  |  115|    474|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    474|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    474|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|    474| err:
  414|    474|    sk_void_free(ad->sk);
  ------------------
  |  |  204|    474|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|    474|    ad->sk = NULL;
  416|    474|    ad->ctx = NULL;
  417|    474|}
ex_data.c:cleanup_cb:
   62|      2|{
   63|      2|    OPENSSL_free(funcs);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      2|}
ex_data.c:get_and_lock:
   33|    952|{
   34|    952|    EX_CALLBACKS *ip;
   35|       |
   36|    952|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  248|    952|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 952]
  |  Branch (36:28): [True: 0, False: 952]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|    952|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 952]
  ------------------
   42|       |        /*
   43|       |         * If we get here, someone (who?) cleaned up the lock, so just
   44|       |         * treat it as an error.
   45|       |         */
   46|      0|         return NULL;
   47|      0|    }
   48|       |
   49|    952|    if (read) {
  ------------------
  |  Branch (49:9): [True: 948, False: 4]
  ------------------
   50|    948|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 948]
  ------------------
   51|      0|            return NULL;
   52|    948|    } else {
   53|      4|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 4]
  ------------------
   54|      0|            return NULL;
   55|      4|    }
   56|       |
   57|    952|    ip = &global->ex_data[class_index];
   58|    952|    return ip;
   59|    952|}

ossl_safe_getenv:
   19|      2|{
   20|       |#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
   21|       |    if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
   22|       |        char *val = NULL;
   23|       |        int vallen = 0;
   24|       |        WCHAR *namew = NULL;
   25|       |        WCHAR *valw = NULL;
   26|       |        DWORD envlen = 0;
   27|       |        DWORD dwFlags = MB_ERR_INVALID_CHARS;
   28|       |        int rsize, fsize;
   29|       |        UINT curacp;
   30|       |
   31|       |        curacp = GetACP();
   32|       |
   33|       |        /*
   34|       |         * For the code pages listed below, dwFlags must be set to 0.
   35|       |         * Otherwise, the function fails with ERROR_INVALID_FLAGS.
   36|       |         */
   37|       |        if (curacp == 50220 || curacp == 50221 || curacp == 50222 ||
   38|       |            curacp == 50225 || curacp == 50227 || curacp == 50229 ||
   39|       |            (57002 <= curacp && curacp <=57011) || curacp == 65000 ||
   40|       |            curacp == 42)
   41|       |            dwFlags = 0;
   42|       |
   43|       |        /* query for buffer len */
   44|       |        rsize = MultiByteToWideChar(curacp, dwFlags, name, -1, NULL, 0);
   45|       |        /* if name is valid string and can be converted to wide string */
   46|       |        if (rsize > 0)
   47|       |            namew = _malloca(rsize * sizeof(WCHAR));
   48|       |
   49|       |        if (NULL != namew) {
   50|       |            /* convert name to wide string */
   51|       |            fsize = MultiByteToWideChar(curacp, dwFlags, name, -1, namew, rsize);
   52|       |            /* if conversion is ok, then determine value string size in wchars */
   53|       |            if (fsize > 0)
   54|       |                envlen = GetEnvironmentVariableW(namew, NULL, 0);
   55|       |        }
   56|       |
   57|       |        if (envlen > 0)
   58|       |            valw = _malloca(envlen * sizeof(WCHAR));
   59|       |
   60|       |        if (NULL != valw) {
   61|       |            /* if can get env value as wide string */
   62|       |            if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
   63|       |                /* determine value string size in utf-8 */
   64|       |                vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
   65|       |                                             NULL, NULL);
   66|       |            }
   67|       |        }
   68|       |
   69|       |        if (vallen > 0)
   70|       |            val = OPENSSL_malloc(vallen);
   71|       |
   72|       |        if (NULL != val) {
   73|       |            /* convert value string from wide to utf-8 */
   74|       |            if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
   75|       |                                    NULL, NULL) == 0) {
   76|       |                OPENSSL_free(val);
   77|       |                val = NULL;
   78|       |            }
   79|       |        }
   80|       |
   81|       |        if (NULL != namew)
   82|       |            _freea(namew);
   83|       |
   84|       |        if (NULL != valw)
   85|       |            _freea(valw);
   86|       |
   87|       |        return val;
   88|       |    }
   89|       |#endif
   90|       |
   91|      2|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   92|      2|# if __GLIBC_PREREQ(2, 17)
   93|      2|#  define SECURE_GETENV
   94|      2|    return secure_getenv(name);
   95|      2|# endif
   96|      2|#endif
   97|       |
   98|       |#ifndef SECURE_GETENV
   99|       |    if (OPENSSL_issetugid())
  100|       |        return NULL;
  101|       |    return getenv(name);
  102|       |#endif
  103|      2|}

ossl_fnv1a_hash:
   14|  14.1k|{
   15|  14.1k|    uint64_t hash = 0xcbf29ce484222325ULL;
   16|  14.1k|    size_t i;
   17|       |
   18|   918k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (18:17): [True: 904k, False: 14.1k]
  ------------------
   19|   904k|        hash ^= key[i];
   20|   904k|        hash *= 0x00000100000001B3ULL;
   21|   904k|    }
   22|  14.1k|    return hash;
   23|  14.1k|}

ossl_ht_new:
  176|      4|{
  177|      4|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|       |
  179|      4|    if (new == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 4]
  ------------------
  180|      0|        return NULL;
  181|       |
  182|      4|    new->atomic_lock = CRYPTO_THREAD_lock_new();
  183|      4|    if (new->atomic_lock == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 4]
  ------------------
  184|      0|        goto err;
  185|       |
  186|      4|    memcpy(&new->config, conf, sizeof(*conf));
  187|       |
  188|      4|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (188:9): [True: 4, False: 0]
  ------------------
  189|      4|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  190|       |        /* round up to the next power of 2 */
  191|      4|        new->wpd.neighborhood_len--;
  192|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  193|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  194|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  195|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  196|      4|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  197|      4|        new->wpd.neighborhood_len++;
  198|      4|    } else {
  199|      0|        new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      0|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      0|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  200|      0|    }
  201|       |
  202|      4|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (202:9): [True: 4, False: 0]
  ------------------
  203|      4|        new->config.ht_free_fn = internal_free_nop;
  204|       |
  205|      4|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|      4|    if (new->md == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 4]
  ------------------
  207|      0|        goto err;
  208|       |
  209|      4|    new->md->neighborhoods =
  210|      4|        alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  211|      4|                                    &new->md->neighborhood_ptr_to_free);
  212|      4|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (212:9): [True: 0, False: 4]
  ------------------
  213|      0|        goto err;
  214|      4|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  215|       |
  216|      4|    new->lock = ossl_rcu_lock_new(1, conf->ctx);
  217|      4|    if (new->lock == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 4]
  ------------------
  218|      0|        goto err;
  219|       |
  220|      4|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (220:9): [True: 4, False: 0]
  ------------------
  221|      4|        new->config.ht_hash_fn = ossl_fnv1a_hash;
  222|       |
  223|      4|    return new;
  224|       |
  225|      0|err:
  226|      0|    CRYPTO_THREAD_lock_free(new->atomic_lock);
  227|      0|    ossl_rcu_lock_free(new->lock);
  228|      0|    if (new->md != NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 0]
  ------------------
  229|      0|        OPENSSL_free(new->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      0|    OPENSSL_free(new->md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|    OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      0|    return NULL;
  233|      4|}
ossl_ht_write_lock:
  246|      2|{
  247|      2|    ossl_rcu_write_lock(htable->lock);
  248|      2|    htable->wpd.need_sync = 0;
  249|      2|}
ossl_ht_write_unlock:
  252|      2|{
  253|      2|    int need_sync = htable->wpd.need_sync;
  254|       |
  255|      2|    htable->wpd.need_sync = 0;
  256|      2|    ossl_rcu_write_unlock(htable->lock);
  257|      2|    if (need_sync)
  ------------------
  |  Branch (257:9): [True: 2, False: 0]
  ------------------
  258|      2|        ossl_synchronize_rcu(htable->lock);
  259|      2|}
ossl_ht_free:
  320|      2|{
  321|      2|    if (h == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 2]
  ------------------
  322|      0|        return;
  323|       |
  324|      2|    ossl_ht_write_lock(h);
  325|      2|    ossl_ht_flush_internal(h);
  326|      2|    ossl_ht_write_unlock(h);
  327|       |    /* Freeing the lock does a final sync for us */
  328|      2|    CRYPTO_THREAD_lock_free(h->atomic_lock);
  329|      2|    ossl_rcu_lock_free(h->lock);
  330|      2|    OPENSSL_free(h->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|      2|    OPENSSL_free(h->md);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|      2|    OPENSSL_free(h);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      2|    return;
  334|      2|}
ossl_ht_insert:
  629|    590|{
  630|    590|    struct ht_internal_value_st *newval = NULL;
  631|    590|    uint64_t hash;
  632|    590|    int rc = 0;
  633|    590|    int i;
  634|       |
  635|    590|    if (data->value == NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 590]
  ------------------
  636|      0|        goto out;
  637|       |
  638|    590|    newval = alloc_new_value(h, key, data->value, data->type_id);
  639|    590|    if (newval == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 590]
  ------------------
  640|      0|        goto out;
  641|       |
  642|       |    /*
  643|       |     * we have to take our lock here to prevent other changes
  644|       |     * to the bucket list
  645|       |     */
  646|    590|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  647|       |
  648|    590|    for (i = 0;
  649|    590|         (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (649:10): [True: 0, False: 590]
  ------------------
  650|    590|         && i < 4;
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  ------------------
  651|    590|         ++i)
  652|      0|        if (!grow_hashtable(h, h->wpd.neighborhood_len)) {
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      0|            rc = -1;
  654|      0|            break;
  655|      0|        }
  656|       |
  657|    590|    if (rc <= 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 590]
  ------------------
  658|      0|        free_value(newval);
  659|       |
  660|    590|out:
  661|    590|    return rc;
  662|    590|}
ossl_ht_get:
  665|  13.5k|{
  666|  13.5k|    struct ht_mutable_data_st *md;
  667|  13.5k|    uint64_t hash;
  668|  13.5k|    uint64_t neigh_idx_start;
  669|  13.5k|    uint64_t neigh_idx;
  670|  13.5k|    struct ht_internal_value_st *ival = NULL;
  671|  13.5k|    size_t j;
  672|  13.5k|    uint64_t ehash;
  673|  13.5k|    int lockless_reads = h->config.lockless_reads;
  674|       |
  675|  13.5k|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  676|       |
  677|  13.5k|    md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|  13.5k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  678|  13.5k|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  679|  13.5k|    do {
  680|  13.5k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|  13.5k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  681|  14.3k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  14.3k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  14.3k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (681:21): [True: 14.3k, False: 0]
  ------------------
  682|  14.3k|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|  14.3k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  683|  14.3k|            if (ival == NULL) {
  ------------------
  |  Branch (683:17): [True: 2.66k, False: 11.6k]
  ------------------
  684|  2.66k|                if (lockless_reads)
  ------------------
  |  Branch (684:21): [True: 2.66k, False: 0]
  ------------------
  685|       |                    /* lockless_reads implies no deletion, we can break out */
  686|  2.66k|                    return NULL;
  687|      0|                continue;
  688|  2.66k|            }
  689|  11.6k|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (689:17): [True: 0, False: 11.6k]
  ------------------
  690|  11.6k|                                    &ehash, h->atomic_lock))
  691|      0|                return NULL;
  692|  11.6k|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (692:17): [True: 10.8k, False: 802]
  |  Branch (692:46): [True: 10.8k, False: 0]
  ------------------
  693|  10.8k|                return (HT_VALUE *)ival;
  694|  11.6k|        }
  695|      0|        if (!lockless_reads)
  ------------------
  |  Branch (695:13): [True: 0, False: 0]
  ------------------
  696|      0|            break;
  697|       |        /* Continue search in subsequent neighborhoods */
  698|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  699|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (699:14): [True: 0, False: 0]
  ------------------
  700|       |
  701|      0|    return NULL;
  702|  13.5k|}
hashtable.c:internal_free_nop:
  171|    590|{
  172|    590|    return;
  173|    590|}
hashtable.c:alloc_new_neighborhood_list:
  154|      6|{
  155|      6|    struct ht_neighborhood_st *ret;
  156|       |
  157|      6|    ret = OPENSSL_aligned_alloc(sizeof(struct ht_neighborhood_st) * len,
  ------------------
  |  |  106|      6|        CRYPTO_aligned_alloc(num, alignment, freeptr, \
  |  |  107|      6|                             OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                            OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|      6|                                CACHE_LINE_BYTES, freeptr);
  159|       |
  160|       |    /* fall back to regular malloc */
  161|      6|    if (ret == NULL) {
  ------------------
  |  Branch (161:9): [True: 0, False: 6]
  ------------------
  162|      0|        ret = *freeptr = OPENSSL_malloc(sizeof(struct ht_neighborhood_st) * len);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        if (ret == NULL)
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            return NULL;
  165|      0|    }
  166|      6|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  167|      6|    return ret;
  168|      6|}
hashtable.c:ossl_ht_flush_internal:
  284|      2|{
  285|      2|    struct ht_mutable_data_st *newmd = NULL;
  286|      2|    struct ht_mutable_data_st *oldmd = NULL;
  287|       |
  288|      2|    newmd = OPENSSL_zalloc(sizeof(*newmd));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  289|      2|    if (newmd == NULL)
  ------------------
  |  Branch (289:9): [True: 0, False: 2]
  ------------------
  290|      0|        return 0;
  291|       |
  292|      2|    newmd->neighborhoods = alloc_new_neighborhood_list(DEFAULT_NEIGH_LEN,
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  293|      2|                                                       &newmd->neighborhood_ptr_to_free);
  294|      2|    if (newmd->neighborhoods == NULL) {
  ------------------
  |  Branch (294:9): [True: 0, False: 2]
  ------------------
  295|      0|        OPENSSL_free(newmd);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      0|        return 0;
  297|      0|    }
  298|       |
  299|      2|    newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  300|       |
  301|       |    /* Swap the old and new mutable data sets */
  302|      2|    oldmd = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  303|      2|    ossl_rcu_assign_ptr(&h->md, &newmd);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  304|       |
  305|       |    /* Set the number of entries to 0 */
  306|      2|    h->wpd.value_count = 0;
  307|      2|    h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  308|       |
  309|      2|    ossl_rcu_call(h->lock, free_oldmd, oldmd);
  310|      2|    h->wpd.need_sync = 1;
  311|      2|    return 1;
  312|      2|}
hashtable.c:free_oldmd:
  262|      2|{
  263|      2|    struct ht_mutable_data_st *oldmd = arg;
  264|      2|    size_t i, j;
  265|      2|    size_t neighborhood_len = (size_t)oldmd->neighborhood_mask + 1;
  266|      2|    struct ht_internal_value_st *v;
  267|       |
  268|  4.09k|    for (i = 0; i < neighborhood_len; i++) {
  ------------------
  |  Branch (268:17): [True: 4.09k, False: 2]
  ------------------
  269|  4.09k|        PREFETCH_NEIGHBORHOOD(oldmd->neighborhoods[i + 1]);
  ------------------
  |  |   83|  4.09k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  270|  20.4k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  20.4k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  20.4k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (270:21): [True: 16.3k, False: 4.09k]
  ------------------
  271|  16.3k|            if (oldmd->neighborhoods[i].entries[j].value != NULL) {
  ------------------
  |  Branch (271:17): [True: 590, False: 15.7k]
  ------------------
  272|    590|                v = oldmd->neighborhoods[i].entries[j].value;
  273|    590|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  274|    590|                free_value(v);
  275|    590|            }
  276|  16.3k|        }
  277|  4.09k|    }
  278|       |
  279|      2|    OPENSSL_free(oldmd->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|      2|    OPENSSL_free(oldmd);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      2|}
hashtable.c:alloc_new_value:
  597|    590|{
  598|    590|    struct ht_internal_value_st *tmp;
  599|    590|    size_t nvsize = sizeof(*tmp);
  600|       |
  601|    590|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (601:9): [True: 590, False: 0]
  ------------------
  602|    590|        nvsize += key->keysize;
  603|       |
  604|    590|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  102|    590|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    590|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    590|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  605|       |
  606|    590|    if (tmp == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 590]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|    590|    tmp->ht = h;
  610|    590|    tmp->value.value = data;
  611|    590|    tmp->value.type_id = type;
  612|    590|    tmp->value.key.keybuf = NULL;
  613|    590|    if (h->config.collision_check) {
  ------------------
  |  Branch (613:9): [True: 590, False: 0]
  ------------------
  614|    590|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  615|    590|        tmp->value.key.keysize = key->keysize;
  616|    590|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  617|    590|    }
  618|       |
  619|       |
  620|    590|    return tmp;
  621|    590|}
hashtable.c:ossl_ht_insert_locked:
  532|    590|{
  533|    590|    struct ht_mutable_data_st *md = h->md;
  534|    590|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  535|    590|    uint64_t neigh_idx = neigh_idx_start;
  536|    590|    size_t j;
  537|    590|    uint64_t ihash;
  538|    590|    HT_VALUE *ival;
  539|    590|    size_t empty_idx = SIZE_MAX;
  540|    590|    int lockless_reads = h->config.lockless_reads;
  541|       |
  542|    590|    do {
  543|    590|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|    590|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  544|       |
  545|    667|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|    667|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|    667|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (545:21): [True: 667, False: 0]
  ------------------
  546|    667|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|    667|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  547|    667|            if (ival == NULL) {
  ------------------
  |  Branch (547:17): [True: 590, False: 77]
  ------------------
  548|    590|                empty_idx = j;
  549|       |                /* lockless_reads implies no deletion, we can break out */
  550|    590|                if (lockless_reads)
  ------------------
  |  Branch (550:21): [True: 590, False: 0]
  ------------------
  551|    590|                    goto not_found;
  552|      0|                continue;
  553|    590|            }
  554|     77|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (554:17): [True: 0, False: 77]
  ------------------
  555|     77|                                    &ihash, h->atomic_lock))
  556|      0|                return 0;
  557|     77|            if (compare_hash(hash, ihash) && match_key(&newval->value.key,
  ------------------
  |  Branch (557:17): [True: 0, False: 77]
  |  Branch (557:46): [True: 0, False: 0]
  ------------------
  558|      0|                                                       &ival->key)) {
  559|      0|                if (olddata == NULL) {
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|       |                    /* This would insert a duplicate -> fail */
  561|      0|                    return 0;
  562|      0|                }
  563|       |                /* Do a replacement */
  564|      0|                if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                                         hash, h->atomic_lock))
  566|      0|                    return 0;
  567|      0|                *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  568|      0|                ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
  ------------------
  |  |   31|      0|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  569|      0|                                    &newval);
  570|      0|                ossl_rcu_call(h->lock, free_old_ht_value, *olddata);
  571|      0|                h->wpd.need_sync = 1;
  572|      0|                return 1;
  573|      0|            }
  574|     77|        }
  575|      0|        if (!lockless_reads)
  ------------------
  |  Branch (575:13): [True: 0, False: 0]
  ------------------
  576|      0|            break;
  577|       |        /* Continue search in subsequent neighborhoods */
  578|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  579|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (579:14): [True: 0, False: 0]
  ------------------
  580|       |
  581|    590| not_found:
  582|       |    /* If we get to here, its just an insert */
  583|    590|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (583:9): [True: 0, False: 590]
  ------------------
  584|      0|        return -1; /* out of space */
  585|    590|    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (585:9): [True: 0, False: 590]
  ------------------
  586|    590|                             hash, h->atomic_lock))
  587|      0|        return 0;
  588|    590|    h->wpd.value_count++;
  589|    590|    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   31|    590|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  590|    590|                        &newval);
  591|    590|    return 1;
  592|    590|}
hashtable.c:free_value:
  624|    590|{
  625|    590|    OPENSSL_free(v);
  ------------------
  |  |  115|    590|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    590|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    590|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|    590|}
hashtable.c:compare_hash:
  405|  11.7k|{
  406|  11.7k|    return (hash1 == hash2);
  407|  11.7k|}
hashtable.c:match_key:
  516|  10.8k|{
  517|       |    /*
  518|       |     * keys match if they are both present, the same size
  519|       |     * and compare equal in memory
  520|       |     */
  521|  10.8k|    PREFETCH(a->keybuf);
  ------------------
  |  |   84|  10.8k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  522|  10.8k|    PREFETCH(b->keybuf);
  ------------------
  |  |   84|  10.8k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  523|  10.8k|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (523:9): [True: 10.8k, False: 0]
  |  Branch (523:30): [True: 10.8k, False: 0]
  |  Branch (523:51): [True: 10.8k, False: 0]
  ------------------
  524|  10.8k|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  525|       |
  526|      0|    return 1;
  527|  10.8k|}

ossl_err_load_HTTP_strings:
   80|      2|{
   81|      2|# ifndef OPENSSL_NO_ERR
   82|      2|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        ERR_load_strings_const(HTTP_str_reasons);
   84|      2|# endif
   85|      2|    return 1;
   86|      2|}

ossl_indicator_set_callback_new:
   22|      4|{
   23|      4|    INDICATOR_CB *cb;
   24|       |
   25|      4|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      4|    return cb;
   27|      4|}
ossl_indicator_set_callback_free:
   30|      2|{
   31|      2|    OPENSSL_free(cb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|      2|}

OPENSSL_cleanup:
  378|      2|{
  379|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  380|       |
  381|       |    /*
  382|       |     * At some point we should consider looking at this function with a view to
  383|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  384|       |     */
  385|       |
  386|       |    /* If we've not been inited then no need to deinit */
  387|      2|    if (!base_inited)
  ------------------
  |  Branch (387:9): [True: 0, False: 2]
  ------------------
  388|      0|        return;
  389|       |
  390|       |    /* Might be explicitly called and also by atexit */
  391|      2|    if (stopped)
  ------------------
  |  Branch (391:9): [True: 0, False: 2]
  ------------------
  392|      0|        return;
  393|      2|    stopped = 1;
  394|       |
  395|       |    /*
  396|       |     * Thread stop may not get automatically called by the thread library for
  397|       |     * the very last thread in some situations, so call it directly.
  398|       |     */
  399|      2|    OPENSSL_thread_stop();
  400|       |
  401|      2|    currhandler = stop_handlers;
  402|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (402:12): [True: 0, False: 2]
  ------------------
  403|      0|        currhandler->handler();
  404|      0|        lasthandler = currhandler;
  405|      0|        currhandler = currhandler->next;
  406|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  407|      0|    }
  408|      2|    stop_handlers = NULL;
  409|       |
  410|      2|    CRYPTO_THREAD_lock_free(optsdone_lock);
  411|      2|    optsdone_lock = NULL;
  412|      2|    CRYPTO_THREAD_lock_free(init_lock);
  413|      2|    init_lock = NULL;
  414|       |
  415|      2|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  416|       |
  417|       |    /*
  418|       |     * We assume we are single-threaded for this function, i.e. no race
  419|       |     * conditions for the various "*_inited" vars below.
  420|       |     */
  421|       |
  422|      2|#ifndef OPENSSL_NO_COMP
  423|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      2|    ossl_comp_zlib_cleanup();
  425|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  426|      2|    ossl_comp_brotli_cleanup();
  427|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  428|      2|    ossl_comp_zstd_cleanup();
  429|      2|#endif
  430|       |
  431|      2|    if (async_inited) {
  ------------------
  |  Branch (431:9): [True: 2, False: 0]
  ------------------
  432|      2|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  433|      2|        async_deinit();
  434|      2|    }
  435|       |
  436|       |    /*
  437|       |     * Note that cleanup order is important:
  438|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  439|       |     * must be called before engine_cleanup_int()
  440|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  441|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  442|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  443|       |     * before engine_cleanup_int()
  444|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  445|       |     * ossl_obj_cleanup_int() must be called last
  446|       |     */
  447|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      2|    ossl_rand_cleanup_int();
  449|       |
  450|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      2|    ossl_config_modules_free();
  452|       |
  453|      2|#ifndef OPENSSL_NO_ENGINE
  454|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  455|      2|    engine_cleanup_int();
  456|      2|#endif
  457|       |
  458|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  459|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  460|      2|    ossl_store_cleanup_int();
  461|      2|#endif
  462|       |
  463|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  464|      2|    ossl_lib_ctx_default_deinit();
  465|       |
  466|      2|    ossl_cleanup_thread();
  467|       |
  468|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      2|    bio_cleanup();
  470|       |
  471|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      2|    evp_cleanup_int();
  473|       |
  474|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      2|    ossl_obj_cleanup_int();
  476|       |
  477|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      2|    err_cleanup();
  479|       |
  480|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  481|      2|    CRYPTO_secure_malloc_done();
  482|       |
  483|      2|#ifndef OPENSSL_NO_CMP
  484|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  485|      2|    OSSL_CMP_log_close();
  486|      2|#endif
  487|       |
  488|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  489|      2|    ossl_trace_cleanup();
  490|       |
  491|      2|    base_inited = 0;
  492|      2|}
OPENSSL_init_crypto:
  500|  32.0k|{
  501|  32.0k|    uint64_t tmp;
  502|  32.0k|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|  32.0k|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 32.0k]
  ------------------
  506|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  508|      0|        return 0;
  509|      0|    }
  510|       |
  511|       |    /*
  512|       |     * We ignore failures from this function. It is probably because we are
  513|       |     * on a platform that doesn't support lockless atomic loads (we may not
  514|       |     * have created optsdone_lock yet so we can't use it). This is just an
  515|       |     * optimisation to skip the full checks in this function if we don't need
  516|       |     * to, so we carry on regardless in the event of failure.
  517|       |     *
  518|       |     * There could be a race here with other threads, so that optsdone has not
  519|       |     * been updated yet, even though the options have in fact been initialised.
  520|       |     * This doesn't matter - it just means we will run the full function
  521|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  522|       |     * functions anyway so we are safe.
  523|       |     */
  524|  32.0k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 32.0k, False: 0]
  ------------------
  525|  32.0k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 10.2k, False: 21.8k]
  ------------------
  526|  10.2k|            return 1;
  527|  21.8k|        aloaddone = 1;
  528|  21.8k|    }
  529|       |
  530|       |    /*
  531|       |     * At some point we should look at this function with a view to moving
  532|       |     * most/all of this into OSSL_LIB_CTX.
  533|       |     *
  534|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  535|       |     * *only* option specified.  With that option we return immediately after
  536|       |     * doing the requested limited initialization.  Note that
  537|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  538|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  539|       |     * base already initialized this is a harmless NOOP.
  540|       |     *
  541|       |     * If we remain the only caller of err_shelve_state() the recursion should
  542|       |     * perhaps be removed, but if in doubt, it can be left in place.
  543|       |     */
  544|  21.8k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  21.8k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 21.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 21.8k]
  ------------------
  545|      0|        return 0;
  546|       |
  547|  21.8k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  21.8k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 21.8k, False: 8]
  ------------------
  548|  21.8k|        return 1;
  549|       |
  550|       |    /*
  551|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  552|       |     * same check from above but be sure that it will work even on platforms
  553|       |     * without lockless CRYPTO_atomic_load
  554|       |     */
  555|      8|    if (!aloaddone) {
  ------------------
  |  Branch (555:9): [True: 0, False: 8]
  ------------------
  556|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|            return 0;
  558|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            return 1;
  560|      0|    }
  561|       |
  562|       |    /*
  563|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  564|       |     * should not have the side-effect of setting up exit handlers, and
  565|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  566|       |     * return above.
  567|       |     */
  568|      8|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  485|      8|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (568:9): [True: 0, False: 8]
  ------------------
  569|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (569:13): [True: 0, False: 0]
  ------------------
  570|      0|                          ossl_init_register_atexit))
  571|      0|            return 0;
  572|      8|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      8|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (572:16): [True: 0, False: 8]
  ------------------
  573|      0|        return 0;
  574|      0|    }
  575|       |
  576|      8|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      8|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:9): [True: 0, False: 8]
  ------------------
  577|      0|        return 0;
  578|       |
  579|      8|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  466|      8|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (579:9): [True: 0, False: 8]
  ------------------
  580|      8|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (580:16): [True: 0, False: 0]
  ------------------
  581|      8|                             ossl_init_no_load_crypto_strings,
  582|      8|                             ossl_init_load_crypto_strings))
  583|      0|        return 0;
  584|       |
  585|      8|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  467|      8|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (585:9): [True: 4, False: 4]
  ------------------
  586|      8|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      4|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (586:16): [True: 0, False: 4]
  ------------------
  587|      0|        return 0;
  588|       |
  589|      8|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2806|      8|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (589:9): [True: 0, False: 8]
  ------------------
  590|      8|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (590:12): [True: 0, False: 0]
  ------------------
  591|      8|                         ossl_init_load_ssl_strings))
  592|      0|        return 0;
  593|       |
  594|      8|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2807|      8|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (594:9): [True: 2, False: 6]
  ------------------
  595|      8|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (595:12): [True: 0, False: 2]
  ------------------
  596|      0|        return 0;
  597|       |
  598|      8|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  470|      8|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (598:9): [True: 0, False: 8]
  ------------------
  599|      8|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (599:16): [True: 0, False: 0]
  ------------------
  600|      8|                             ossl_init_add_all_ciphers))
  601|      0|        return 0;
  602|       |
  603|      8|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  468|      8|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (603:9): [True: 2, False: 6]
  ------------------
  604|      8|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (604:16): [True: 0, False: 2]
  ------------------
  605|      0|        return 0;
  606|       |
  607|      8|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  471|      8|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (607:9): [True: 0, False: 8]
  ------------------
  608|      8|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (608:16): [True: 0, False: 0]
  ------------------
  609|      8|                             ossl_init_add_all_digests))
  610|      0|        return 0;
  611|       |
  612|      8|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  469|      8|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (612:9): [True: 2, False: 6]
  ------------------
  613|      8|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (613:16): [True: 0, False: 2]
  ------------------
  614|      0|        return 0;
  615|       |
  616|      8|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  483|      8|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (616:9): [True: 0, False: 8]
  ------------------
  617|      8|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (617:16): [True: 0, False: 0]
  ------------------
  618|      0|        return 0;
  619|       |
  620|      8|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  473|      8|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (620:9): [True: 0, False: 8]
  ------------------
  621|      8|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (621:16): [True: 0, False: 0]
  ------------------
  622|      0|        return 0;
  623|       |
  624|      8|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  472|      8|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (624:9): [True: 4, False: 4]
  ------------------
  625|      4|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  626|       |
  627|       |        /* If called recursively from OBJ_ calls, just skip it. */
  628|      4|        if (!loading) {
  ------------------
  |  Branch (628:13): [True: 2, False: 2]
  ------------------
  629|      2|            int ret;
  630|       |
  631|      2|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (631:17): [True: 0, False: 2]
  ------------------
  632|      0|                return 0;
  633|      2|            if (settings == NULL) {
  ------------------
  |  Branch (633:17): [True: 2, False: 0]
  ------------------
  634|      2|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  635|      2|            } else {
  636|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|                    return 0;
  638|      0|                conf_settings = settings;
  639|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  640|      0|                                   ossl_init_config);
  641|      0|                conf_settings = NULL;
  642|      0|                CRYPTO_THREAD_unlock(init_lock);
  643|      0|            }
  644|       |
  645|      2|            if (ret <= 0)
  ------------------
  |  Branch (645:17): [True: 0, False: 2]
  ------------------
  646|      0|                return 0;
  647|      2|        }
  648|      4|    }
  649|       |
  650|      8|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  474|      8|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (650:9): [True: 2, False: 6]
  ------------------
  651|      8|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (651:16): [True: 0, False: 2]
  ------------------
  652|      0|        return 0;
  653|       |
  654|      8|#ifndef OPENSSL_NO_ENGINE
  655|      8|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  477|      8|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (655:9): [True: 0, False: 8]
  ------------------
  656|      8|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (656:16): [True: 0, False: 0]
  ------------------
  657|      0|        return 0;
  658|      8|# ifndef OPENSSL_NO_RDRAND
  659|      8|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  475|      8|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (659:9): [True: 0, False: 8]
  ------------------
  660|      8|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (660:16): [True: 0, False: 0]
  ------------------
  661|      0|        return 0;
  662|      8|# endif
  663|      8|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  476|      8|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (663:9): [True: 0, False: 8]
  ------------------
  664|      8|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (664:16): [True: 0, False: 0]
  ------------------
  665|      0|        return 0;
  666|      8|# ifndef OPENSSL_NO_STATIC_ENGINE
  667|       |#  ifndef OPENSSL_NO_DEVCRYPTOENG
  668|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  669|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  670|       |        return 0;
  671|       |#  endif
  672|      8|#  if !defined(OPENSSL_NO_PADLOCKENG)
  673|      8|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  480|      8|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (673:9): [True: 0, False: 8]
  ------------------
  674|      8|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (674:16): [True: 0, False: 0]
  ------------------
  675|      0|        return 0;
  676|      8|#  endif
  677|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  678|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  679|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  680|       |        return 0;
  681|       |#  endif
  682|      8|#  if !defined(OPENSSL_NO_AFALGENG)
  683|      8|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  481|      8|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (683:9): [True: 0, False: 8]
  ------------------
  684|      8|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (684:16): [True: 0, False: 0]
  ------------------
  685|      0|        return 0;
  686|      8|#  endif
  687|      8|# endif
  688|      8|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  497|      8|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  475|      8|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  476|      8|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  498|      8|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  478|      8|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  479|      8|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  499|      8|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  480|      8|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (688:9): [True: 0, False: 8]
  ------------------
  689|      8|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  477|      8|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  690|      8|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  481|      8|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  691|      0|        ENGINE_register_all_complete();
  692|      0|    }
  693|      8|#endif
  694|       |
  695|      8|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (695:9): [True: 0, False: 8]
  ------------------
  696|      0|        return 0;
  697|       |
  698|      8|    return 1;
  699|      8|}
init.c:ossl_init_base:
   58|      2|{
   59|       |    /* no need to init trace */
   60|       |
   61|      2|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      2|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  ------------------
   67|      2|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      2|    OPENSSL_cpuid_setup();
   71|       |
   72|      2|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 2]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      2|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 2]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      2|    base_inited = 1;
   79|      2|    return 1;
   80|       |
   81|      0|err:
   82|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   83|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   84|      0|    optsdone_lock = NULL;
   85|      0|    CRYPTO_THREAD_lock_free(init_lock);
   86|      0|    init_lock = NULL;
   87|       |
   88|      0|    return 0;
   89|      2|}
init.c:ossl_init_register_atexit:
  101|      2|{
  102|      2|#ifndef OPENSSL_NO_ATEXIT
  103|       |# ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |# endif
  106|      2|# ifndef OPENSSL_SYS_UEFI
  107|       |#  if defined(_WIN32) && !defined(__BORLANDC__)
  108|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  109|       |    if (_onexit(win32atexit) == NULL)
  110|       |        return 0;
  111|       |#  else
  112|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 2]
  ------------------
  113|      0|        return 0;
  114|      2|#  endif
  115|      2|# endif
  116|      2|#endif
  117|       |
  118|      2|    return 1;
  119|      2|}
init.c:ossl_init_load_crypto_nodelete:
  133|      2|{
  134|      2|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  135|       |
  136|       |#if !defined(OPENSSL_USE_NODELETE) \
  137|       |    && !defined(OPENSSL_NO_PINSHARED)
  138|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  139|       |    {
  140|       |        HMODULE handle = NULL;
  141|       |        BOOL ret;
  142|       |
  143|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  144|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  145|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  146|       |                                (void *)&base_inited, &handle);
  147|       |
  148|       |        OSSL_TRACE1(INIT,
  149|       |                    "ossl_init_load_crypto_nodelete: "
  150|       |                    "obtained DSO reference? %s\n",
  151|       |                    (ret == TRUE ? "No!" : "Yes."));
  152|       |        return (ret == TRUE) ? 1 : 0;
  153|       |    }
  154|       |# elif !defined(DSO_NONE)
  155|       |    /*
  156|       |     * Deliberately leak a reference to ourselves. This will force the library
  157|       |     * to remain loaded until the atexit() handler is run at process exit.
  158|       |     */
  159|       |    {
  160|       |        DSO *dso;
  161|       |        void *err;
  162|       |
  163|       |        if (!err_shelve_state(&err))
  164|       |            return 0;
  165|       |
  166|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  167|       |        /*
  168|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  169|       |         * called. After dlclose() the whole library might have been unloaded
  170|       |         * already.
  171|       |         */
  172|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  173|       |                    (dso == NULL ? "No!" : "Yes."));
  174|       |        DSO_free(dso);
  175|       |        err_unshelve_state(err);
  176|       |    }
  177|       |# endif
  178|       |#endif
  179|       |
  180|      2|    return 1;
  181|      2|}
init.c:ossl_init_load_crypto_strings:
  186|      2|{
  187|      2|    int ret = 1;
  188|       |    /*
  189|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  190|       |     * pulling in all the error strings during static linking
  191|       |     */
  192|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      2|    void *err;
  194|       |
  195|      2|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 2]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      2|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      2|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      2|    err_unshelve_state(err);
  202|      2|#endif
  203|      2|    return ret;
  204|      2|}
init.c:ossl_init_load_ssl_strings:
  216|      2|{
  217|       |    /*
  218|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  219|       |     * pulling in all the error strings during static linking
  220|       |     */
  221|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  222|      2|    OSSL_TRACE(INIT, "ossl_init_load_ssl_strings: ossl_err_load_SSL_strings()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  223|      2|    ossl_err_load_SSL_strings();
  224|      2|#endif
  225|      2|    return 1;
  226|      2|}
init.c:ossl_init_add_all_ciphers:
  237|      2|{
  238|       |    /*
  239|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  240|       |     * pulling in all the ciphers during static linking
  241|       |     */
  242|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  243|      2|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  244|      2|    openssl_add_all_ciphers_int();
  245|      2|#endif
  246|      2|    return 1;
  247|      2|}
init.c:ossl_init_add_all_digests:
  258|      2|{
  259|       |    /*
  260|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  261|       |     * pulling in all the ciphers during static linking
  262|       |     */
  263|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  264|      2|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  265|      2|    openssl_add_all_digests_int();
  266|      2|#endif
  267|      2|    return 1;
  268|      2|}
init.c:ossl_init_config:
  281|      2|{
  282|      2|    int ret = ossl_config_int(NULL);
  283|       |
  284|      2|    config_inited = 1;
  285|      2|    return ret;
  286|      2|}
init.c:ossl_init_async:
  305|      2|{
  306|      2|    OSSL_TRACE(INIT, "async_init()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  307|      2|    if (!async_init())
  ------------------
  |  Branch (307:9): [True: 0, False: 2]
  ------------------
  308|      0|        return 0;
  309|      2|    async_inited = 1;
  310|      2|    return 1;
  311|      2|}

ossl_init_thread:
  203|      2|{
  204|      2|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 2]
  ------------------
  205|      2|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      2|    return 1;
  209|      2|}
ossl_cleanup_thread:
  212|      2|{
  213|      2|    init_thread_deregister(NULL, 1);
  214|      2|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      2|    destructor_key.sane = -1;
  216|      2|}
OPENSSL_thread_stop:
  230|      2|{
  231|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 2, False: 0]
  ------------------
  232|      2|        THREAD_EVENT_HANDLER **hands
  233|      2|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      2|        init_thread_stop(NULL, hands);
  235|       |
  236|      2|        init_thread_remove_handlers(hands);
  237|      2|        OPENSSL_free(hands);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|      2|    }
  239|      2|}
ossl_ctx_thread_stop:
  242|      2|{
  243|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (243:9): [True: 2, False: 0]
  ------------------
  244|      2|        THREAD_EVENT_HANDLER **hands
  245|      2|            = init_get_thread_local(&destructor_key.value, 0, 1);
  246|      2|        init_thread_stop(ctx, hands);
  247|      2|    }
  248|      2|}
ossl_init_thread_start:
  369|      3|{
  370|      3|    THREAD_EVENT_HANDLER **hands;
  371|      3|    THREAD_EVENT_HANDLER *hand;
  372|       |#ifdef FIPS_MODULE
  373|       |    OSSL_LIB_CTX *ctx = arg;
  374|       |
  375|       |    /*
  376|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  377|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  378|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  379|       |     */
  380|       |    CRYPTO_THREAD_LOCAL *local
  381|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
  382|       |#else
  383|       |    /*
  384|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  385|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  386|       |     * thread stop events globally, so we have to ensure all affected
  387|       |     * OSSL_LIB_CTXs are informed.
  388|       |     */
  389|      3|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  390|      3|#endif
  391|       |
  392|      3|    hands = init_get_thread_local(local, 1, 0);
  393|      3|    if (hands == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 3]
  ------------------
  394|      0|        return 0;
  395|       |
  396|       |#ifdef FIPS_MODULE
  397|       |    if (*hands == NULL) {
  398|       |        /*
  399|       |         * We've not yet registered any handlers for this thread. We need to get
  400|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  401|       |         * is a callback to libcrypto defined in fipsprov.c
  402|       |         */
  403|       |        if (!ossl_thread_register_fips(ctx))
  404|       |            return 0;
  405|       |    }
  406|       |#endif
  407|       |
  408|      3|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  102|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  409|      3|    if (hand == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 3]
  ------------------
  410|      0|        return 0;
  411|       |
  412|      3|    hand->handfn = handfn;
  413|      3|    hand->arg = arg;
  414|      3|#ifndef FIPS_MODULE
  415|      3|    hand->index = index;
  416|      3|#endif
  417|      3|    hand->next = *hands;
  418|      3|    *hands = hand;
  419|       |
  420|      3|    return 1;
  421|      3|}
ossl_init_thread_deregister:
  477|      1|{
  478|      1|    return init_thread_deregister(index, 0);
  479|      1|}
initthread.c:init_get_thread_local:
   95|      7|{
   96|      7|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   97|       |
   98|      7|    if (alloc) {
  ------------------
  |  Branch (98:9): [True: 3, False: 4]
  ------------------
   99|      3|        if (hands == NULL) {
  ------------------
  |  Branch (99:13): [True: 2, False: 1]
  ------------------
  100|       |
  101|      2|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (101:17): [True: 0, False: 2]
  ------------------
  102|      0|                return NULL;
  103|       |
  104|      2|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 2]
  ------------------
  105|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|      0|                return NULL;
  107|      0|            }
  108|       |
  109|      2|#ifndef FIPS_MODULE
  110|      2|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (110:17): [True: 0, False: 2]
  ------------------
  111|      0|                CRYPTO_THREAD_set_local(local, NULL);
  112|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|      0|                return NULL;
  114|      0|            }
  115|      2|#endif
  116|      2|        }
  117|      4|    } else if (!keep) {
  ------------------
  |  Branch (117:16): [True: 2, False: 2]
  ------------------
  118|      2|        CRYPTO_THREAD_set_local(local, NULL);
  119|      2|    }
  120|       |
  121|      7|    return hands;
  122|      7|}
initthread.c:init_thread_push_handlers:
  155|      2|{
  156|      2|    int ret;
  157|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  158|       |
  159|      2|    gtr = get_global_tevent_register();
  160|      2|    if (gtr == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        return 0;
  162|       |
  163|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (163:9): [True: 0, False: 2]
  ------------------
  164|      0|        return 0;
  165|      2|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  166|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  167|       |
  168|      2|    return ret;
  169|      2|}
initthread.c:get_global_tevent_register:
   78|      9|{
   79|      9|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      9|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:9): [True: 0, False: 9]
  ------------------
   80|      0|        return NULL;
   81|      9|    return glob_tevent_reg;
   82|      9|}
initthread.c:create_global_tevent_register:
   59|      2|{
   60|      2|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      2|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      0|        return 0;
   63|       |
   64|      2|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   65|      2|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   66|      2|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  |  Branch (66:45): [True: 0, False: 2]
  ------------------
   67|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   68|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   69|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|      0|        glob_tevent_reg = NULL;
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|      2|    return 1;
   75|      2|}
initthread.c:init_thread_remove_handlers:
  172|      2|{
  173|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  174|      2|    int i;
  175|       |
  176|      2|    gtr = get_global_tevent_register();
  177|      2|    if (gtr == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        return;
  179|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        return;
  181|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (181:17): [True: 2, False: 0]
  ------------------
  182|      2|        THREAD_EVENT_HANDLER **hands
  183|      2|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  184|       |
  185|      2|        if (hands == handsin) {
  ------------------
  |  Branch (185:13): [True: 2, False: 0]
  ------------------
  186|      2|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  187|      2|            CRYPTO_THREAD_unlock(gtr->lock);
  188|      2|            return;
  189|      2|        }
  190|      2|    }
  191|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  192|      0|    return;
  193|      2|}
initthread.c:init_thread_stop:
  325|      4|{
  326|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  327|      4|#ifndef FIPS_MODULE
  328|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  329|      4|#endif
  330|       |
  331|       |    /* Can't do much about this */
  332|      4|    if (hands == NULL)
  ------------------
  |  Branch (332:9): [True: 2, False: 2]
  ------------------
  333|      2|        return;
  334|       |
  335|      2|#ifndef FIPS_MODULE
  336|      2|    gtr = get_global_tevent_register();
  337|      2|    if (gtr == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 2]
  ------------------
  338|      0|        return;
  339|       |
  340|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|        return;
  342|      2|#endif
  343|       |
  344|      2|    curr = *hands;
  345|      5|    while (curr != NULL) {
  ------------------
  |  Branch (345:12): [True: 3, False: 2]
  ------------------
  346|      3|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (346:13): [True: 0, False: 3]
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|            prev = curr;
  348|      0|            curr = curr->next;
  349|      0|            continue;
  350|      0|        }
  351|      3|        curr->handfn(curr->arg);
  352|      3|        if (prev == NULL)
  ------------------
  |  Branch (352:13): [True: 3, False: 0]
  ------------------
  353|      3|            *hands = curr->next;
  354|      0|        else
  355|      0|            prev->next = curr->next;
  356|       |
  357|      3|        tmp = curr;
  358|      3|        curr = curr->next;
  359|       |
  360|      3|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  361|      3|    }
  362|      2|#ifndef FIPS_MODULE
  363|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  364|      2|#endif
  365|      2|}
initthread.c:init_thread_deregister:
  425|      3|{
  426|      3|    GLOBAL_TEVENT_REGISTER *gtr;
  427|      3|    int i;
  428|       |
  429|      3|    gtr = get_global_tevent_register();
  430|      3|    if (gtr == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 3]
  ------------------
  431|      0|        return 0;
  432|      3|    if (!all) {
  ------------------
  |  Branch (432:9): [True: 1, False: 2]
  ------------------
  433|      1|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (433:13): [True: 0, False: 1]
  ------------------
  434|      0|            return 0;
  435|      2|    } else {
  436|      2|        glob_tevent_reg = NULL;
  437|      2|    }
  438|      3|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (438:17): [True: 0, False: 3]
  ------------------
  439|      0|        THREAD_EVENT_HANDLER **hands
  440|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  441|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  442|       |
  443|      0|        if (hands == NULL) {
  ------------------
  |  Branch (443:13): [True: 0, False: 0]
  ------------------
  444|      0|            if (!all)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  446|      0|            return 0;
  447|      0|        }
  448|      0|        curr = *hands;
  449|      0|        while (curr != NULL) {
  ------------------
  |  Branch (449:16): [True: 0, False: 0]
  ------------------
  450|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (450:17): [True: 0, False: 0]
  |  Branch (450:24): [True: 0, False: 0]
  ------------------
  451|      0|                if (prev != NULL)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                    prev->next = curr->next;
  453|      0|                else
  454|      0|                    *hands = curr->next;
  455|      0|                tmp = curr;
  456|      0|                curr = curr->next;
  457|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|      0|                continue;
  459|      0|            }
  460|      0|            prev = curr;
  461|      0|            curr = curr->next;
  462|      0|        }
  463|      0|        if (all)
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|      0|    }
  466|      3|    if (all) {
  ------------------
  |  Branch (466:9): [True: 2, False: 1]
  ------------------
  467|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  468|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  469|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|      2|    } else {
  471|      1|        CRYPTO_THREAD_unlock(gtr->lock);
  472|      1|    }
  473|      3|    return 1;
  474|      3|}

OPENSSL_LH_set_thunks:
   52|    684|{
   53|       |
   54|    684|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 684]
  ------------------
   55|      0|        return NULL;
   56|    684|    lh->compw = cw;
   57|    684|    lh->hashw = hw;
   58|    684|    lh->daw = daw;
   59|    684|    lh->daaw = daaw;
   60|    684|    return lh;
   61|    684|}
OPENSSL_LH_new:
   64|    684|{
   65|    684|    OPENSSL_LHASH *ret;
   66|       |
   67|    684|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|    684|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    684|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    684|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 684]
  ------------------
   68|      0|        return NULL;
   69|    684|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|    684|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    684|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    684|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 684]
  ------------------
   70|      0|        goto err;
   71|    684|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 684]
  ------------------
   72|    684|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 684]
  ------------------
   73|    684|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|    684|#define MIN_NODES       16
  ------------------
   74|    684|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|    684|#define MIN_NODES       16
  ------------------
   75|    684|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|    684|#define MIN_NODES       16
  ------------------
   76|    684|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|    684|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|    684|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|    684|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|    684|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|    684|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|    684|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|      0|    return NULL;
   84|    684|}
OPENSSL_LH_free:
   87|    678|{
   88|    678|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 676]
  ------------------
   89|      2|        return;
   90|       |
   91|    676|    OPENSSL_LH_flush(lh);
   92|    676|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|    676|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    676|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    676|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|    676|    OPENSSL_free(lh);
  ------------------
  |  |  115|    676|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    676|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    676|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    676|}
OPENSSL_LH_flush:
   97|    678|{
   98|    678|    unsigned int i;
   99|    678|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|    678|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 678]
  ------------------
  102|      0|        return;
  103|       |
  104|  8.19k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 7.51k, False: 678]
  ------------------
  105|  7.51k|        n = lh->b[i];
  106|  11.3k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 3.82k, False: 7.51k]
  ------------------
  107|  3.82k|            nn = n->next;
  108|  3.82k|            OPENSSL_free(n);
  ------------------
  |  |  115|  3.82k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.82k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.82k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  3.82k|            n = nn;
  110|  3.82k|        }
  111|  7.51k|        lh->b[i] = NULL;
  112|  7.51k|    }
  113|       |
  114|    678|    lh->num_items = 0;
  115|    678|}
OPENSSL_LH_insert:
  118|  10.4k|{
  119|  10.4k|    unsigned long hash;
  120|  10.4k|    OPENSSL_LH_NODE *nn, **rn;
  121|  10.4k|    void *ret;
  122|       |
  123|  10.4k|    lh->error = 0;
  124|  10.4k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  10.4k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 2.09k, False: 8.33k]
  |  Branch (124:76): [True: 0, False: 2.09k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  10.4k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  10.4k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 4.32k, False: 6.10k]
  ------------------
  130|  4.32k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  4.32k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.32k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.32k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 4.32k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  4.32k|        nn->data = data;
  135|  4.32k|        nn->next = NULL;
  136|  4.32k|        nn->hash = hash;
  137|  4.32k|        *rn = nn;
  138|  4.32k|        ret = NULL;
  139|  4.32k|        lh->num_items++;
  140|  6.10k|    } else {                    /* replace same key */
  141|  6.10k|        ret = (*rn)->data;
  142|  6.10k|        (*rn)->data = data;
  143|  6.10k|    }
  144|  10.4k|    return ret;
  145|  10.4k|}
OPENSSL_LH_delete:
  148|    484|{
  149|    484|    unsigned long hash;
  150|    484|    OPENSSL_LH_NODE *nn, **rn;
  151|    484|    void *ret;
  152|       |
  153|    484|    lh->error = 0;
  154|    484|    rn = getrn(lh, data, &hash);
  155|       |
  156|    484|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 484]
  ------------------
  157|      0|        return NULL;
  158|    484|    } else {
  159|    484|        nn = *rn;
  160|    484|        *rn = nn->next;
  161|    484|        ret = nn->data;
  162|    484|        OPENSSL_free(nn);
  ------------------
  |  |  115|    484|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    484|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    484|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|    484|    }
  164|       |
  165|    484|    lh->num_items--;
  166|    484|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|    484|#define MIN_NODES       16
  ------------------
  |  Branch (166:9): [True: 484, False: 0]
  ------------------
  167|    484|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   85|    484|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (167:9): [True: 2, False: 482]
  ------------------
  168|      2|        contract(lh);
  169|       |
  170|    484|    return ret;
  171|    484|}
OPENSSL_LH_retrieve:
  174|  10.3k|{
  175|  10.3k|    unsigned long hash;
  176|  10.3k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|  10.3k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 10.3k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|  10.3k|    rn = getrn(lh, data, &hash);
  182|       |
  183|  10.3k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 408, False: 9.96k]
  ------------------
  184|  10.3k|}
OPENSSL_LH_doall:
  217|    366|{
  218|    366|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 366]
  ------------------
  219|      0|        return;
  220|       |
  221|    366|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|    366|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|    366|}
OPENSSL_LH_doall_arg:
  227|     79|{
  228|     79|    if (lh == NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 79]
  ------------------
  229|      0|        return;
  230|       |
  231|     79|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  232|     79|                  (OPENSSL_LH_DOALL_FUNC)NULL, func, lh->daaw, arg);
  233|     79|}
OPENSSL_LH_doall_arg_thunk:
  238|      2|{
  239|      2|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  240|      2|                  (OPENSSL_LH_DOALL_FUNC)NULL, fn, daaw, arg);
  241|      2|}
OPENSSL_LH_strhash:
  362|  9.66k|{
  363|  9.66k|    unsigned long ret = 0;
  364|  9.66k|    long n;
  365|  9.66k|    unsigned long v;
  366|  9.66k|    int r;
  367|       |
  368|  9.66k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 9.66k]
  |  Branch (368:24): [True: 9.28k, False: 377]
  ------------------
  369|  9.28k|        return ret;
  370|       |
  371|    377|    n = 0x100;
  372|  5.34k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 4.96k, False: 377]
  ------------------
  373|  4.96k|        v = n | (*c);
  374|  4.96k|        n += 0x100;
  375|  4.96k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|  4.96k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|  4.96k|        ret &= 0xFFFFFFFFL;
  379|  4.96k|        ret ^= v * v;
  380|  4.96k|        c++;
  381|  4.96k|    }
  382|    377|    return (ret >> 16) ^ ret;
  383|  9.66k|}
ossl_lh_strcasehash:
  400|  1.98k|{
  401|  1.98k|    unsigned long ret = 0;
  402|  1.98k|    long n;
  403|  1.98k|    unsigned long v;
  404|  1.98k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|  1.98k|    const long int case_adjust = ~0x20;
  409|  1.98k|#endif
  410|       |
  411|  1.98k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 1.98k]
  |  Branch (411:22): [True: 0, False: 1.98k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|  25.0k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 23.1k, False: 1.98k]
  ------------------
  415|  23.1k|        v = n | (case_adjust & *c);
  416|  23.1k|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|  23.1k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|  23.1k|        ret &= 0xFFFFFFFFL;
  420|  23.1k|        ret ^= v * v;
  421|  23.1k|        c++;
  422|  23.1k|    }
  423|  1.98k|    return (ret >> 16) ^ ret;
  424|  1.98k|}
OPENSSL_LH_get_down_load:
  432|     87|{
  433|     87|    return lh->down_load;
  434|     87|}
OPENSSL_LH_set_down_load:
  437|    251|{
  438|    251|    lh->down_load = down_load;
  439|    251|}
OPENSSL_LH_error:
  442|    564|{
  443|    564|    return lh->error;
  444|    564|}
lhash.c:doall_util_fn:
  192|    447|{
  193|    447|    int i;
  194|    447|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|    447|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 447]
  ------------------
  197|      0|        return;
  198|       |
  199|       |    /*
  200|       |     * reverse the order so we search from 'top to bottom' We were having
  201|       |     * memory leaks otherwise
  202|       |     */
  203|  5.16k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 4.71k, False: 447]
  ------------------
  204|  4.71k|        a = lh->b[i];
  205|  6.34k|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 1.63k, False: 4.71k]
  ------------------
  206|  1.63k|            n = a->next;
  207|  1.63k|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 484, False: 1.15k]
  ------------------
  208|    484|                wfunc_arg(a->data, arg, func_arg);
  209|  1.15k|            else
  210|  1.15k|                wfunc(a->data, func);
  211|  1.63k|            a = n;
  212|  1.63k|        }
  213|  4.71k|    }
  214|    447|}
lhash.c:expand:
  244|  2.09k|{
  245|  2.09k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|  2.09k|    unsigned int p, pmax, nni, j;
  247|  2.09k|    unsigned long hash;
  248|       |
  249|  2.09k|    nni = lh->num_alloc_nodes;
  250|  2.09k|    p = lh->p;
  251|  2.09k|    pmax = lh->pmax;
  252|  2.09k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 18, False: 2.07k]
  ------------------
  253|     18|        j = nni * 2;
  254|     18|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|     18|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|     18|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 18]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|     18|        lh->b = n;
  260|     18|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|     18|        lh->pmax = nni;
  262|     18|        lh->num_alloc_nodes = j;
  263|     18|        lh->p = 0;
  264|  2.07k|    } else {
  265|  2.07k|        lh->p++;
  266|  2.07k|    }
  267|       |
  268|  2.09k|    lh->num_nodes++;
  269|  2.09k|    n1 = &(lh->b[p]);
  270|  2.09k|    n2 = &(lh->b[p + pmax]);
  271|  2.09k|    *n2 = NULL;
  272|       |
  273|  8.47k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 6.37k, False: 2.09k]
  ------------------
  274|  6.37k|        hash = np->hash;
  275|  6.37k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 1.10k, False: 5.27k]
  ------------------
  276|  1.10k|            *n1 = (*n1)->next;
  277|  1.10k|            np->next = *n2;
  278|  1.10k|            *n2 = np;
  279|  1.10k|        } else
  280|  5.27k|            n1 = &((*n1)->next);
  281|  6.37k|        np = *n1;
  282|  6.37k|    }
  283|       |
  284|  2.09k|    return 1;
  285|  2.09k|}
lhash.c:contract:
  288|      2|{
  289|      2|    OPENSSL_LH_NODE **n, *n1, *np;
  290|       |
  291|      2|    np = lh->b[lh->p + lh->pmax - 1];
  292|      2|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  293|      2|    if (lh->p == 0) {
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  295|      0|                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
  296|      0|        if (n == NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|       |            /* fputs("realloc error in lhash", stderr); */
  298|      0|            lh->error++;
  299|      0|        } else {
  300|      0|            lh->b = n;
  301|      0|        }
  302|      0|        lh->num_alloc_nodes /= 2;
  303|      0|        lh->pmax /= 2;
  304|      0|        lh->p = lh->pmax - 1;
  305|      0|    } else
  306|      2|        lh->p--;
  307|       |
  308|      2|    lh->num_nodes--;
  309|       |
  310|      2|    n1 = lh->b[(int)lh->p];
  311|      2|    if (n1 == NULL)
  ------------------
  |  Branch (311:9): [True: 2, False: 0]
  ------------------
  312|      2|        lh->b[(int)lh->p] = np;
  313|      0|    else {
  314|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (314:16): [True: 0, False: 0]
  ------------------
  315|      0|            n1 = n1->next;
  316|      0|        n1->next = np;
  317|      0|    }
  318|      2|}
lhash.c:getrn:
  322|  21.2k|{
  323|  21.2k|    OPENSSL_LH_NODE **ret, *n1;
  324|  21.2k|    unsigned long hash, nn;
  325|       |
  326|  21.2k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 21.2k, False: 0]
  ------------------
  327|  21.2k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  21.2k|    *rhash = hash;
  332|       |
  333|  21.2k|    nn = hash % lh->pmax;
  334|  21.2k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 6.08k, False: 15.2k]
  ------------------
  335|  6.08k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  21.2k|    ret = &(lh->b[(int)nn]);
  338|  40.0k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 35.3k, False: 4.73k]
  ------------------
  339|  35.3k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 18.3k, False: 16.9k]
  ------------------
  340|  18.3k|            ret = &(n1->next);
  341|  18.3k|            continue;
  342|  18.3k|        }
  343|       |
  344|  16.9k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 16.9k, False: 0]
  ------------------
  345|  16.9k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 16.5k, False: 420]
  ------------------
  346|  16.5k|                break;
  347|  16.9k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    420|        ret = &(n1->next);
  352|    420|    }
  353|  21.2k|    return ret;
  354|  21.2k|}

CRYPTO_malloc:
  187|  42.2k|{
  188|  42.2k|    void *ptr;
  189|       |
  190|  42.2k|    INCREMENT(malloc_count);
  191|  42.2k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 42.2k]
  ------------------
  192|      0|        ptr = malloc_impl(num, file, line);
  193|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  |  Branch (193:28): [True: 0, False: 0]
  ------------------
  194|      0|            return ptr;
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|  42.2k|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 42.2k]
  ------------------
  199|      0|        return NULL;
  200|       |
  201|  42.2k|    FAILTEST();
  202|  42.2k|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 2, False: 42.2k]
  ------------------
  203|       |        /*
  204|       |         * Disallow customization after the first allocation. We only set this
  205|       |         * if necessary to avoid a store to the same cache line on every
  206|       |         * allocation.
  207|       |         */
  208|      2|        allow_customize = 0;
  209|      2|    }
  210|       |
  211|  42.2k|    ptr = malloc(num);
  212|  42.2k|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 42.2k, False: 0]
  ------------------
  213|  42.2k|        return ptr;
  214|      0| err:
  215|       |    /*
  216|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  217|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  218|       |     */
  219|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  |  Branch (219:25): [True: 0, False: 0]
  ------------------
  220|      0|        ERR_new();
  221|      0|        ERR_set_debug(file, line, NULL);
  222|      0|        ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |  351|      0|# define ERR_R_MALLOC_FAILURE                    (256|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|      0|    }
  224|      0|    return NULL;
  225|  42.2k|}
CRYPTO_zalloc:
  228|  9.38k|{
  229|  9.38k|    void *ret;
  230|       |
  231|  9.38k|    ret = CRYPTO_malloc(num, file, line);
  232|  9.38k|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 9.38k, False: 0]
  ------------------
  233|  9.38k|        memset(ret, 0, num);
  234|       |
  235|  9.38k|    return ret;
  236|  9.38k|}
CRYPTO_aligned_alloc:
  240|      6|{
  241|      6|    void *ret;
  242|       |
  243|      6|    *freeptr = NULL;
  244|       |
  245|       |#if defined(OPENSSL_SMALL_FOOTPRINT)
  246|       |    ret = freeptr = NULL;
  247|       |    return ret;
  248|       |#endif
  249|       |
  250|       |    /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
  251|      6|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (251:9): [True: 6, False: 0]
  ------------------
  252|      6|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  253|      6|        if (posix_memalign(&ret, alignment, num))
  ------------------
  |  Branch (253:13): [True: 0, False: 6]
  ------------------
  254|      0|            return NULL;
  255|      6|        *freeptr = ret;
  256|      6|        return ret;
  257|       |#elif defined(_ISOC11_SOURCE)
  258|       |        ret = *freeptr = aligned_alloc(alignment, num);
  259|       |        return ret;
  260|       |#endif
  261|      6|    }
  262|       |
  263|       |    /* we have to do this the hard way */
  264|       |
  265|       |    /*
  266|       |     * Note: Windows supports an _aligned_malloc call, but we choose
  267|       |     * not to use it here, because allocations from that function
  268|       |     * require that they be freed via _aligned_free.  Given that
  269|       |     * we can't differentiate plain malloc blocks from blocks obtained
  270|       |     * via _aligned_malloc, just avoid its use entirely
  271|       |     */
  272|       |
  273|       |    /*
  274|       |     * Step 1: Allocate an amount of memory that is <alignment>
  275|       |     * bytes bigger than requested
  276|       |     */
  277|      0|    *freeptr = CRYPTO_malloc(num + alignment, file, line);
  278|      0|    if (*freeptr == NULL)
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  ------------------
  279|      0|        return NULL;
  280|       |
  281|       |    /*
  282|       |     * Step 2: Add <alignment - 1> bytes to the pointer
  283|       |     * This will cross the alignment boundary that is
  284|       |     * requested
  285|       |     */
  286|      0|    ret = (void *)((char *)*freeptr + (alignment - 1));
  287|       |
  288|       |    /*
  289|       |     * Step 3: Use the alignment as a mask to translate the
  290|       |     * least significant bits of the allocation at the alignment
  291|       |     * boundary to 0.  ret now holds a pointer to the memory
  292|       |     * buffer at the requested alignment
  293|       |     * NOTE: It is a documented requirement that alignment be a
  294|       |     * power of 2, which is what allows this to work
  295|       |     */
  296|      0|    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
  297|      0|    return ret;
  298|      0|}
CRYPTO_realloc:
  301|  2.96k|{
  302|  2.96k|    INCREMENT(realloc_count);
  303|  2.96k|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 2.96k]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|  2.96k|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 4, False: 2.96k]
  ------------------
  307|      4|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|  2.96k|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 2.96k]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|  2.96k|    FAILTEST();
  315|  2.96k|    return realloc(str, num);
  316|  2.96k|}
CRYPTO_free:
  346|  67.1k|{
  347|  67.1k|    INCREMENT(free_count);
  348|  67.1k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 67.1k]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|  67.1k|    free(str);
  354|  67.1k|}
CRYPTO_clear_free:
  357|    237|{
  358|    237|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 237]
  ------------------
  359|      0|        return;
  360|    237|    if (num)
  ------------------
  |  Branch (360:9): [True: 237, False: 0]
  ------------------
  361|    237|        OPENSSL_cleanse(str, num);
  362|    237|    CRYPTO_free(str, file, line);
  363|    237|}

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_zalloc:
  185|     79|{
  186|     79|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|     79|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 79]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|     79|#endif
  191|     79|    return CRYPTO_zalloc(num, file, line);
  192|     79|}
CRYPTO_secure_free:
  195|     79|{
  196|     79|#ifndef OPENSSL_NO_SECURE_MEMORY
  197|     79|    size_t actual_size;
  198|       |
  199|     79|    if (ptr == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 79]
  ------------------
  200|      0|        return;
  201|     79|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (201:9): [True: 79, False: 0]
  ------------------
  202|     79|        CRYPTO_free(ptr, file, line);
  203|     79|        return;
  204|     79|    }
  205|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (205:9): [True: 0, False: 0]
  ------------------
  206|      0|        return;
  207|      0|    actual_size = sh_actual_size(ptr);
  208|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  209|      0|    secure_mem_used -= actual_size;
  210|      0|    sh_free(ptr);
  211|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  212|       |#else
  213|       |    CRYPTO_free(ptr, file, line);
  214|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  215|      0|}
CRYPTO_secure_allocated:
  246|     79|{
  247|     79|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|     79|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 79, False: 0]
  ------------------
  249|     79|        return 0;
  250|       |    /*
  251|       |     * Only read accesses to the arena take place in sh_allocated() and this
  252|       |     * is only changed by the sh_init() and sh_done() calls which are not
  253|       |     * locked.  Hence, it is safe to make this check without a lock too.
  254|       |     */
  255|      0|    return sh_allocated(ptr);
  256|       |#else
  257|       |    return 0;
  258|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  259|     79|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  603|      2|#if !defined(_WIN32)
  604|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  |  Branch (604:40): [True: 0, False: 2]
  ------------------
  605|      0|        munmap(sh.map_result, sh.map_size);
  606|       |#else
  607|       |    if (sh.map_result != NULL && sh.map_size)
  608|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  609|       |#endif
  610|      2|    memset(&sh, 0, sizeof(sh));
  611|      2|}

CRYPTO_gcm128_init:
  603|     79|{
  604|     79|    DECLARE_IS_ENDIAN;
  ------------------
  |  |   25|     79|#  define DECLARE_IS_ENDIAN const int ossl_is_little_endian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
  ------------------
  605|       |
  606|     79|    memset(ctx, 0, sizeof(*ctx));
  607|     79|    ctx->block = block;
  608|     79|    ctx->key = key;
  609|       |
  610|     79|    (*block) (ctx->H.c, ctx->H.c, key);
  611|       |
  612|     79|    if (IS_LITTLE_ENDIAN) {
  ------------------
  |  |   26|     79|#  define IS_LITTLE_ENDIAN (ossl_is_little_endian)
  |  |  ------------------
  |  |  |  Branch (26:28): [Folded - Ignored]
  |  |  ------------------
  ------------------
  613|       |        /* H is stored in host byte order */
  614|       |#ifdef BSWAP8
  615|       |        ctx->H.u[0] = BSWAP8(ctx->H.u[0]);
  616|       |        ctx->H.u[1] = BSWAP8(ctx->H.u[1]);
  617|       |#else
  618|     79|        u8 *p = ctx->H.c;
  619|     79|        u64 hi, lo;
  620|     79|        hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
  ------------------
  |  |  103|     79|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
                      hi = (u64)GETU32(p) << 32 | GETU32(p + 4);
  ------------------
  |  |  103|     79|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  621|     79|        lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
  ------------------
  |  |  103|     79|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
                      lo = (u64)GETU32(p + 8) << 32 | GETU32(p + 12);
  ------------------
  |  |  103|     79|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  622|     79|        ctx->H.u[0] = hi;
  623|     79|        ctx->H.u[1] = lo;
  624|     79|#endif
  625|     79|    }
  626|       |
  627|     79|    gcm_get_funcs(&ctx->funcs);
  628|     79|    ctx->funcs.ginit(ctx->Htable, ctx->H.u);
  629|     79|}
gcm128.c:gcm_get_funcs:
  431|     79|{
  432|       |    /* set defaults -- overridden below as needed */
  433|     79|    ctx->ginit = gcm_init_4bit;
  434|       |#if !defined(GHASH_ASM)
  435|       |    ctx->gmult = gcm_gmult_4bit;
  436|       |#else
  437|     79|    ctx->gmult = NULL;
  438|     79|#endif
  439|       |#if !defined(GHASH_ASM) && !defined(OPENSSL_SMALL_FOOTPRINT)
  440|       |    ctx->ghash = gcm_ghash_4bit;
  441|       |#else
  442|     79|    ctx->ghash = NULL;
  443|     79|#endif
  444|       |
  445|     79|#if defined(GHASH_ASM_X86_OR_64)
  446|     79|# if !defined(GHASH_ASM_X86) || defined(OPENSSL_IA32_SSE2)
  447|       |    /* x86_64 */
  448|     79|    if (OPENSSL_ia32cap_P[1] & (1 << 1)) { /* check PCLMULQDQ bit */
  ------------------
  |  Branch (448:9): [True: 79, False: 0]
  ------------------
  449|     79|        if (((OPENSSL_ia32cap_P[1] >> 22) & 0x41) == 0x41) { /* AVX+MOVBE */
  ------------------
  |  Branch (449:13): [True: 79, False: 0]
  ------------------
  450|     79|            ctx->ginit = gcm_init_avx;
  451|     79|            ctx->gmult = gcm_gmult_avx;
  452|     79|            ctx->ghash = gcm_ghash_avx;
  453|     79|        } else {
  454|      0|            ctx->ginit = gcm_init_clmul;
  455|      0|            ctx->gmult = gcm_gmult_clmul;
  456|      0|            ctx->ghash = gcm_ghash_clmul;
  457|      0|        }
  458|     79|        return;
  459|     79|    }
  460|      0|# endif
  461|       |# if defined(GHASH_ASM_X86)
  462|       |    /* x86 only */
  463|       |#  if defined(OPENSSL_IA32_SSE2)
  464|       |    if (OPENSSL_ia32cap_P[0] & (1 << 25)) { /* check SSE bit */
  465|       |        ctx->gmult = gcm_gmult_4bit_mmx;
  466|       |        ctx->ghash = gcm_ghash_4bit_mmx;
  467|       |        return;
  468|       |    }
  469|       |#  else
  470|       |    if (OPENSSL_ia32cap_P[0] & (1 << 23)) { /* check MMX bit */
  471|       |        ctx->gmult = gcm_gmult_4bit_mmx;
  472|       |        ctx->ghash = gcm_ghash_4bit_mmx;
  473|       |        return;
  474|       |    }
  475|       |#  endif
  476|       |    ctx->gmult = gcm_gmult_4bit_x86;
  477|       |    ctx->ghash = gcm_ghash_4bit_x86;
  478|       |    return;
  479|       |# else
  480|       |    /* x86_64 fallback defaults */
  481|      0|    ctx->gmult = gcm_gmult_4bit;
  482|      0|    ctx->ghash = gcm_ghash_4bit;
  483|      0|    return;
  484|     79|# endif
  485|       |#elif defined(GHASH_ASM_ARM)
  486|       |    /* ARM defaults */
  487|       |    ctx->gmult = gcm_gmult_4bit;
  488|       |# if !defined(OPENSSL_SMALL_FOOTPRINT)
  489|       |    ctx->ghash = gcm_ghash_4bit;
  490|       |# else
  491|       |    ctx->ghash = NULL;
  492|       |# endif
  493|       |# ifdef PMULL_CAPABLE
  494|       |    if (PMULL_CAPABLE) {
  495|       |        ctx->ginit = (gcm_init_fn)gcm_init_v8;
  496|       |        ctx->gmult = gcm_gmult_v8;
  497|       |        ctx->ghash = gcm_ghash_v8;
  498|       |    }
  499|       |# elif defined(NEON_CAPABLE)
  500|       |    if (NEON_CAPABLE) {
  501|       |        ctx->ginit = gcm_init_neon;
  502|       |        ctx->gmult = gcm_gmult_neon;
  503|       |        ctx->ghash = gcm_ghash_neon;
  504|       |    }
  505|       |# endif
  506|       |    return;
  507|       |#elif defined(GHASH_ASM_SPARC)
  508|       |    /* SPARC defaults */
  509|       |    ctx->gmult = gcm_gmult_4bit;
  510|       |    ctx->ghash = gcm_ghash_4bit;
  511|       |    if (OPENSSL_sparcv9cap_P[0] & SPARCV9_VIS3) {
  512|       |        ctx->ginit = gcm_init_vis3;
  513|       |        ctx->gmult = gcm_gmult_vis3;
  514|       |        ctx->ghash = gcm_ghash_vis3;
  515|       |    }
  516|       |    return;
  517|       |#elif defined(GHASH_ASM_PPC)
  518|       |    /* PowerPC does not define GHASH_ASM; defaults set above */
  519|       |    if (OPENSSL_ppccap_P & PPC_CRYPTO207) {
  520|       |        ctx->ginit = gcm_init_p8;
  521|       |        ctx->gmult = gcm_gmult_p8;
  522|       |        ctx->ghash = gcm_ghash_p8;
  523|       |    }
  524|       |    return;
  525|       |#elif defined(GHASH_ASM_RV64I)
  526|       |    /* RISCV defaults */
  527|       |    ctx->gmult = gcm_gmult_4bit;
  528|       |    ctx->ghash = gcm_ghash_4bit;
  529|       |
  530|       |    if (RISCV_HAS_ZVKG() && riscv_vlen() >= 128) {
  531|       |        if (RISCV_HAS_ZVKB())
  532|       |            ctx->ginit = gcm_init_rv64i_zvkg_zvkb;
  533|       |        else
  534|       |            ctx->ginit = gcm_init_rv64i_zvkg;
  535|       |        ctx->gmult = gcm_gmult_rv64i_zvkg;
  536|       |        ctx->ghash = gcm_ghash_rv64i_zvkg;
  537|       |    } else if (RISCV_HAS_ZVKB() && RISCV_HAS_ZVBC() && riscv_vlen() >= 128) {
  538|       |        ctx->ginit = gcm_init_rv64i_zvkb_zvbc;
  539|       |        ctx->gmult = gcm_gmult_rv64i_zvkb_zvbc;
  540|       |        ctx->ghash = gcm_ghash_rv64i_zvkb_zvbc;
  541|       |    } else if (RISCV_HAS_ZBC()) {
  542|       |        if (RISCV_HAS_ZBKB()) {
  543|       |            ctx->ginit = gcm_init_rv64i_zbc__zbkb;
  544|       |            ctx->gmult = gcm_gmult_rv64i_zbc__zbkb;
  545|       |            ctx->ghash = gcm_ghash_rv64i_zbc__zbkb;
  546|       |        } else if (RISCV_HAS_ZBB()) {
  547|       |            ctx->ginit = gcm_init_rv64i_zbc__zbb;
  548|       |            ctx->gmult = gcm_gmult_rv64i_zbc;
  549|       |            ctx->ghash = gcm_ghash_rv64i_zbc;
  550|       |        } else {
  551|       |            ctx->ginit = gcm_init_rv64i_zbc;
  552|       |            ctx->gmult = gcm_gmult_rv64i_zbc;
  553|       |            ctx->ghash = gcm_ghash_rv64i_zbc;
  554|       |        }
  555|       |    }
  556|       |    return;
  557|       |#elif defined(GHASH_ASM)
  558|       |    /* all other architectures use the generic names */
  559|       |    ctx->gmult = gcm_gmult_4bit;
  560|       |    ctx->ghash = gcm_ghash_4bit;
  561|       |    return;
  562|       |#endif
  563|     79|}

openssl_fopen:
   39|      2|{
   40|      2|    FILE *file = NULL;
   41|       |# if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0;
   43|       |    DWORD flags;
   44|       |# endif
   45|       |
   46|      2|    if (filename == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      0|        return NULL;
   48|       |# if defined(_WIN32) && defined(CP_UTF8)
   49|       |    len_0 = (int)strlen(filename) + 1;
   50|       |
   51|       |    /*
   52|       |     * Basically there are three cases to cover: a) filename is
   53|       |     * pure ASCII string; b) actual UTF-8 encoded string and
   54|       |     * c) locale-ized string, i.e. one containing 8-bit
   55|       |     * characters that are meaningful in current system locale.
   56|       |     * If filename is pure ASCII or real UTF-8 encoded string,
   57|       |     * MultiByteToWideChar succeeds and _wfopen works. If
   58|       |     * filename is locale-ized string, chances are that
   59|       |     * MultiByteToWideChar fails reporting
   60|       |     * ERROR_NO_UNICODE_TRANSLATION, in which case we fall
   61|       |     * back to fopen...
   62|       |     */
   63|       |    if ((sz = MultiByteToWideChar(CP_UTF8, (flags = MB_ERR_INVALID_CHARS),
   64|       |                                  filename, len_0, NULL, 0)) > 0 ||
   65|       |        (GetLastError() == ERROR_INVALID_FLAGS &&
   66|       |         (sz = MultiByteToWideChar(CP_UTF8, (flags = 0),
   67|       |                                   filename, len_0, NULL, 0)) > 0)
   68|       |        ) {
   69|       |        WCHAR wmode[8];
   70|       |        WCHAR *wfilename = _alloca(sz * sizeof(WCHAR));
   71|       |
   72|       |        if (MultiByteToWideChar(CP_UTF8, flags,
   73|       |                                filename, len_0, wfilename, sz) &&
   74|       |            MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode) + 1,
   75|       |                                wmode, OSSL_NELEM(wmode)) &&
   76|       |            (file = _wfopen(wfilename, wmode)) == NULL &&
   77|       |            (errno == ENOENT || errno == EBADF)
   78|       |            ) {
   79|       |            /*
   80|       |             * UTF-8 decode succeeded, but no file, filename
   81|       |             * could still have been locale-ized...
   82|       |             */
   83|       |            file = fopen(filename, mode);
   84|       |        }
   85|       |    } else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
   86|       |        file = fopen(filename, mode);
   87|       |    }
   88|       |# elif defined(__DJGPP__)
   89|       |    {
   90|       |        char *newname = NULL;
   91|       |
   92|       |        if (pathconf(filename, _PC_NAME_MAX) <= 12) {  /* 8.3 file system? */
   93|       |            char *iterator;
   94|       |            char lastchar;
   95|       |
   96|       |            if ((newname = OPENSSL_malloc(strlen(filename) + 1)) == NULL)
   97|       |                return NULL;
   98|       |
   99|       |            for (iterator = newname, lastchar = '\0';
  100|       |                *filename; filename++, iterator++) {
  101|       |                if (lastchar == '/' && filename[0] == '.'
  102|       |                    && filename[1] != '.' && filename[1] != '/') {
  103|       |                    /* Leading dots are not permitted in plain DOS. */
  104|       |                    *iterator = '_';
  105|       |                } else {
  106|       |                    *iterator = *filename;
  107|       |                }
  108|       |                lastchar = *filename;
  109|       |            }
  110|       |            *iterator = '\0';
  111|       |            filename = newname;
  112|       |        }
  113|       |        file = fopen(filename, mode);
  114|       |
  115|       |        OPENSSL_free(newname);
  116|       |    }
  117|       |# else
  118|      2|    file = fopen(filename, mode);
  119|      2|# endif
  120|      2|    return file;
  121|      2|}

CRYPTO_strdup:
   23|  15.5k|{
   24|  15.5k|    char *ret;
   25|       |
   26|  15.5k|    if (str == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 15.5k]
  ------------------
   27|      0|        return NULL;
   28|  15.5k|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   29|  15.5k|    if (ret != NULL)
  ------------------
  |  Branch (29:9): [True: 15.5k, False: 0]
  ------------------
   30|  15.5k|        strcpy(ret, str);
   31|  15.5k|    return ret;
   32|  15.5k|}
CRYPTO_strndup:
   35|    269|{
   36|    269|    size_t maxlen;
   37|    269|    char *ret;
   38|       |
   39|    269|    if (str == NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 269]
  ------------------
   40|      0|        return NULL;
   41|       |
   42|    269|    maxlen = OPENSSL_strnlen(str, s);
   43|       |
   44|    269|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   45|    269|    if (ret) {
  ------------------
  |  Branch (45:9): [True: 269, False: 0]
  ------------------
   46|    269|        memcpy(ret, str, maxlen);
   47|    269|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|    269|#define CH_ZERO '\0'
  ------------------
   48|    269|    }
   49|    269|    return ret;
   50|    269|}
OPENSSL_strnlen:
   66|  4.07k|{
   67|  4.07k|    const char *p;
   68|       |
   69|  66.0k|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   20|  65.8k|#define CH_ZERO '\0'
  ------------------
  |  Branch (69:19): [True: 65.8k, False: 269]
  |  Branch (69:36): [True: 62.0k, False: 3.80k]
  ------------------
   70|       |
   71|  4.07k|    return p - str;
   72|  4.07k|}
OPENSSL_strlcpy:
   75|  1.38k|{
   76|  1.38k|    size_t l = 0;
   77|  5.27k|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (77:12): [True: 5.27k, False: 0]
  |  Branch (77:24): [True: 3.89k, False: 1.38k]
  ------------------
   78|  3.89k|        *dst++ = *src++;
   79|  3.89k|        l++;
   80|  3.89k|    }
   81|  1.38k|    if (size)
  ------------------
  |  Branch (81:9): [True: 1.38k, False: 0]
  ------------------
   82|  1.38k|        *dst = CH_ZERO;
  ------------------
  |  |   20|  1.38k|#define CH_ZERO '\0'
  ------------------
   83|  1.38k|    return l + strlen(src);
   84|  1.38k|}
OPENSSL_strcasecmp:
  407|  9.03k|{
  408|  9.03k|    int t;
  409|       |
  410|  34.3k|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (410:12): [True: 27.4k, False: 6.89k]
  ------------------
  411|  27.4k|        if (*s1++ == '\0')
  ------------------
  |  Branch (411:13): [True: 2.13k, False: 25.2k]
  ------------------
  412|  2.13k|            return 0;
  413|  6.89k|    return t;
  414|  9.03k|}
OPENSSL_strncasecmp:
  417|    790|{
  418|    790|    int t;
  419|    790|    size_t i;
  420|       |
  421|    790|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (421:17): [True: 790, False: 0]
  ------------------
  422|    790|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (422:13): [True: 790, False: 0]
  ------------------
  423|    790|            return t;
  424|      0|        else if (*s1++ == '\0')
  ------------------
  |  Branch (424:18): [True: 0, False: 0]
  ------------------
  425|      0|            return 0;
  426|      0|    return 0;
  427|    790|}

OBJ_NAME_init:
   64|  1.88k|{
   65|  1.88k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.88k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.88k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.88k|}
OBJ_NAME_get:
  152|    556|{
  153|    556|    OBJ_NAME on, *ret;
  154|    556|    int num = 0, alias;
  155|    556|    const char *value = NULL;
  156|       |
  157|    556|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 556]
  ------------------
  158|      0|        return NULL;
  159|    556|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 556]
  ------------------
  160|      0|        return NULL;
  161|    556|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 556]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    556|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    556|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    556|    on.name = name;
  168|    556|    on.type = type;
  169|       |
  170|    651|    for (;;) {
  171|    651|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    651|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 157, False: 494]
  ------------------
  173|    157|            break;
  174|    494|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 95, False: 399]
  |  Branch (174:29): [True: 95, False: 0]
  ------------------
  175|     95|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 95]
  ------------------
  176|      0|                break;
  177|     95|            on.name = ret->data;
  178|    399|        } else {
  179|    399|            value = ret->data;
  180|    399|            break;
  181|    399|        }
  182|    494|    }
  183|       |
  184|    556|    CRYPTO_THREAD_unlock(obj_lock);
  185|    556|    return value;
  186|    556|}
OBJ_NAME_add:
  189|    848|{
  190|    848|    OBJ_NAME *onp, *ret;
  191|    848|    int alias, ok = 0;
  192|       |
  193|    848|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (193:9): [True: 0, False: 848]
  ------------------
  194|      0|        return 0;
  195|       |
  196|    848|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    848|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  197|    848|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    848|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  198|       |
  199|    848|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  102|    848|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    848|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    848|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  200|    848|    if (onp == NULL)
  ------------------
  |  Branch (200:9): [True: 0, False: 848]
  ------------------
  201|      0|        return 0;
  202|       |
  203|    848|    onp->name = name;
  204|    848|    onp->alias = alias;
  205|    848|    onp->type = type;
  206|    848|    onp->data = data;
  207|       |
  208|    848|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 848]
  ------------------
  209|      0|        OPENSSL_free(onp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|      0|        return 0;
  211|      0|    }
  212|       |
  213|    848|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  214|    848|    if (ret != NULL) {
  ------------------
  |  Branch (214:9): [True: 364, False: 484]
  ------------------
  215|       |        /* free things */
  216|    364|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 364]
  ------------------
  217|    364|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (217:16): [True: 0, False: 0]
  ------------------
  218|       |            /*
  219|       |             * XXX: I'm not sure I understand why the free function should
  220|       |             * get three arguments... -- Richard Levitte
  221|       |             */
  222|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  223|      0|                                ret->type)->free_func(ret->name, ret->type,
  224|      0|                                                      ret->data);
  225|      0|        }
  226|    364|        OPENSSL_free(ret);
  ------------------
  |  |  115|    364|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    364|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    364|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|    484|    } else {
  228|    484|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (228:13): [True: 0, False: 484]
  ------------------
  229|       |            /* ERROR */
  230|      0|            OPENSSL_free(onp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|            goto unlock;
  232|      0|        }
  233|    484|    }
  234|       |
  235|    848|    ok = 1;
  236|       |
  237|    848|unlock:
  238|    848|    CRYPTO_THREAD_unlock(obj_lock);
  239|    848|    return ok;
  240|    848|}
OBJ_NAME_remove:
  243|    484|{
  244|    484|    OBJ_NAME on, *ret;
  245|    484|    int ok = 0;
  246|       |
  247|    484|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (247:9): [True: 0, False: 484]
  ------------------
  248|      0|        return 0;
  249|       |
  250|    484|    if (!CRYPTO_THREAD_write_lock(obj_lock))
  ------------------
  |  Branch (250:9): [True: 0, False: 484]
  ------------------
  251|      0|        return 0;
  252|       |
  253|    484|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    484|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  254|    484|    on.name = name;
  255|    484|    on.type = type;
  256|    484|    ret = lh_OBJ_NAME_delete(names_lh, &on);
  257|    484|    if (ret != NULL) {
  ------------------
  |  Branch (257:9): [True: 484, False: 0]
  ------------------
  258|       |        /* free things */
  259|    484|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (259:13): [True: 0, False: 484]
  ------------------
  260|    484|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (260:16): [True: 0, False: 0]
  ------------------
  261|       |            /*
  262|       |             * XXX: I'm not sure I understand why the free function should
  263|       |             * get three arguments... -- Richard Levitte
  264|       |             */
  265|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  266|      0|                                ret->type)->free_func(ret->name, ret->type,
  267|      0|                                                      ret->data);
  268|      0|        }
  269|    484|        OPENSSL_free(ret);
  ------------------
  |  |  115|    484|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    484|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    484|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  270|    484|        ok = 1;
  271|    484|    }
  272|       |
  273|    484|    CRYPTO_THREAD_unlock(obj_lock);
  274|    484|    return ok;
  275|    484|}
OBJ_NAME_do_all:
  293|      2|{
  294|      2|    OBJ_DOALL d;
  295|       |
  296|      2|    d.type = type;
  297|      2|    d.fn = fn;
  298|      2|    d.arg = arg;
  299|       |
  300|      2|    lh_OBJ_NAME_doall_OBJ_DOALL(names_lh, do_all_fn, &d);
  301|      2|}
OBJ_NAME_cleanup:
  368|      8|{
  369|      8|    unsigned long down_load;
  370|       |
  371|      8|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 8]
  ------------------
  372|      0|        return;
  373|       |
  374|      8|    free_type = type;
  375|      8|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      8|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      8|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      8|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 2, False: 6]
  ------------------
  380|      2|        lh_OBJ_NAME_free(names_lh);
  381|      2|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      2|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      2|        names_lh = NULL;
  384|      2|        name_funcs_stack = NULL;
  385|      2|        obj_lock = NULL;
  386|      2|    } else
  387|      6|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      8|}
o_names.c:o_names_init:
   51|      2|{
   52|      2|    names_lh = NULL;
   53|      2|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      2|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      2|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 2]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      2|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 2, False: 0]
  |  Branch (60:32): [True: 2, False: 0]
  ------------------
   61|      2|}
o_names.c:obj_name_hash:
  136|  1.98k|{
  137|  1.98k|    unsigned long ret;
  138|       |
  139|  1.98k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.98k]
  ------------------
  140|  1.98k|        && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (140:12): [True: 0, False: 0]
  ------------------
  141|      0|        ret =
  142|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  143|      0|                                a->type)->hash_func(a->name);
  144|  1.98k|    } else {
  145|  1.98k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.98k|    }
  147|  1.98k|    ret ^= a->type;
  148|  1.98k|    return ret;
  149|  1.98k|}
o_names.c:obj_name_cmp:
  120|  1.34k|{
  121|  1.34k|    int ret;
  122|       |
  123|  1.34k|    ret = a->type - b->type;
  124|  1.34k|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 1.34k, False: 0]
  ------------------
  125|  1.34k|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.34k]
  ------------------
  126|  1.34k|            && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (126:16): [True: 0, False: 0]
  ------------------
  127|      0|            ret = sk_NAME_FUNCS_value(name_funcs_stack,
  128|      0|                                      a->type)->cmp_func(a->name, b->name);
  129|      0|        } else
  130|  1.34k|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|  1.34k|    }
  132|  1.34k|    return ret;
  133|  1.34k|}
o_names.c:do_all_fn:
  284|    484|{
  285|    484|    if (name->type == d->type)
  ------------------
  |  Branch (285:9): [True: 242, False: 242]
  ------------------
  286|    242|        d->fn(name, d->arg);
  287|    484|}
o_names.c:names_lh_free_doall:
  354|  1.08k|{
  355|  1.08k|    if (onp == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 1.08k]
  ------------------
  356|      0|        return;
  357|       |
  358|  1.08k|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (358:9): [True: 0, False: 1.08k]
  |  Branch (358:26): [True: 484, False: 602]
  ------------------
  359|    484|        OBJ_NAME_remove(onp->name, onp->type);
  360|  1.08k|}

ossl_obj_cleanup_int:
  212|      2|{
  213|      2|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        lh_ADDED_OBJ_set_down_load(added, 0);
  215|      0|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  216|      0|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  217|      0|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  218|      0|        lh_ADDED_OBJ_free(added);
  219|      0|        added = NULL;
  220|      0|    }
  221|      2|    objs_free_locks();
  222|      2|}
OBJ_nid2obj:
  331|  8.79k|{
  332|  8.79k|    ADDED_OBJ ad, *adp = NULL;
  333|  8.79k|    ASN1_OBJECT ob;
  334|       |
  335|  8.79k|    if (n == NID_undef
  ------------------
  |  |   18|  17.5k|#define NID_undef                       0
  ------------------
  |  Branch (335:9): [True: 0, False: 8.79k]
  ------------------
  336|  8.79k|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1353|  17.5k|#define NUM_NID 1496
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|  8.79k|#define NID_undef                       0
  ------------------
  |  Branch (336:13): [True: 8.79k, False: 0]
  |  Branch (336:22): [True: 8.79k, False: 0]
  |  Branch (336:37): [True: 8.79k, False: 0]
  ------------------
  337|  8.79k|        return (ASN1_OBJECT *)&(nid_objs[n]);
  338|       |
  339|      0|    ad.type = ADDED_NID;
  ------------------
  |  |   33|      0|#define ADDED_NID       3
  ------------------
  340|      0|    ad.obj = &ob;
  341|      0|    ob.nid = n;
  342|      0|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (342:9): [True: 0, False: 0]
  ------------------
  343|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  344|      0|        return NULL;
  345|      0|    }
  346|      0|    if (added != NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 0]
  ------------------
  347|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  348|      0|    ossl_obj_unlock(1);
  349|      0|    if (adp != NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|        return adp->obj;
  351|       |
  352|      0|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|    return NULL;
  354|      0|}
OBJ_nid2sn:
  357|  5.71k|{
  358|  5.71k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  359|       |
  360|  5.71k|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (360:12): [True: 0, False: 5.71k]
  ------------------
  361|  5.71k|}
OBJ_nid2ln:
  364|    578|{
  365|    578|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  366|       |
  367|    578|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (367:12): [True: 0, False: 578]
  ------------------
  368|    578|}
OBJ_txt2obj:
  424|  1.89k|{
  425|  1.89k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.89k|#define NID_undef                       0
  ------------------
  426|  1.89k|    ASN1_OBJECT *op = NULL;
  427|  1.89k|    unsigned char *buf;
  428|  1.89k|    unsigned char *p;
  429|  1.89k|    const unsigned char *cp;
  430|  1.89k|    int i, j;
  431|       |
  432|  1.89k|    if (!no_name) {
  ------------------
  |  Branch (432:9): [True: 1.65k, False: 237]
  ------------------
  433|  1.65k|        if ((nid = OBJ_sn2nid(s)) != NID_undef
  ------------------
  |  |   18|  3.31k|#define NID_undef                       0
  ------------------
  |  Branch (433:13): [True: 0, False: 1.65k]
  ------------------
  434|  1.65k|            || (nid = OBJ_ln2nid(s)) != NID_undef) {
  ------------------
  |  |   18|  1.65k|#define NID_undef                       0
  ------------------
  |  Branch (434:16): [True: 1.65k, False: 0]
  ------------------
  435|  1.65k|            return OBJ_nid2obj(nid);
  436|  1.65k|        }
  437|      0|        if (!ossl_isdigit(*s)) {
  ------------------
  |  Branch (437:13): [True: 0, False: 0]
  ------------------
  438|      0|            ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_OBJECT_NAME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  439|      0|            return NULL;
  440|      0|        }
  441|      0|    }
  442|       |
  443|       |    /* Work out size of content octets */
  444|    237|    i = a2d_ASN1_OBJECT(NULL, 0, s, -1);
  445|    237|    if (i <= 0)
  ------------------
  |  Branch (445:9): [True: 0, False: 237]
  ------------------
  446|      0|        return NULL;
  447|       |
  448|       |    /* Work out total size */
  449|    237|    j = ASN1_object_size(0, i, V_ASN1_OBJECT);
  ------------------
  |  |   68|    237|# define V_ASN1_OBJECT                   6
  ------------------
  450|    237|    if (j < 0)
  ------------------
  |  Branch (450:9): [True: 0, False: 237]
  ------------------
  451|      0|        return NULL;
  452|       |
  453|    237|    if ((buf = OPENSSL_malloc(j)) == NULL)
  ------------------
  |  |  102|    237|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (453:9): [True: 0, False: 237]
  ------------------
  454|      0|        return NULL;
  455|       |
  456|    237|    p = buf;
  457|       |    /* Write out tag+length */
  458|    237|    ASN1_put_object(&p, 0, i, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
  ------------------
  |  |   68|    237|# define V_ASN1_OBJECT                   6
  ------------------
                  ASN1_put_object(&p, 0, i, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
  ------------------
  |  |   47|    237|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  459|       |    /* Write out contents */
  460|    237|    a2d_ASN1_OBJECT(p, i, s, -1);
  461|       |
  462|    237|    cp = buf;
  463|    237|    op = d2i_ASN1_OBJECT(NULL, &cp, j);
  464|    237|    OPENSSL_free(buf);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|    237|    return op;
  466|    237|}
OBJ_obj2txt:
  469|    210|{
  470|    210|    int i, n = 0, len, nid, first, use_bn;
  471|    210|    BIGNUM *bl;
  472|    210|    unsigned long l;
  473|    210|    const unsigned char *p;
  474|    210|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  475|    210|    const char *s;
  476|       |
  477|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  478|    210|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (478:9): [True: 210, False: 0]
  |  Branch (478:24): [True: 210, False: 0]
  ------------------
  479|    210|        buf[0] = '\0';
  480|       |
  481|    210|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (481:9): [True: 0, False: 210]
  |  Branch (481:22): [True: 1, False: 209]
  ------------------
  482|      1|        return 0;
  483|       |
  484|    209|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (484:9): [True: 0, False: 209]
  |  Branch (484:21): [True: 0, False: 0]
  ------------------
  485|      0|        s = OBJ_nid2ln(nid);
  486|      0|        if (s == NULL)
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|            s = OBJ_nid2sn(nid);
  488|      0|        if (s != NULL) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|            if (buf != NULL)
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                OPENSSL_strlcpy(buf, s, buf_len);
  491|      0|            return (int)strlen(s);
  492|      0|        }
  493|      0|    }
  494|       |
  495|    209|    len = a->length;
  496|    209|    p = a->data;
  497|       |
  498|    209|    first = 1;
  499|    209|    bl = NULL;
  500|       |
  501|       |    /*
  502|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  503|       |     *
  504|       |     * > 3.5. OBJECT IDENTIFIER values
  505|       |     * >
  506|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  507|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  508|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  509|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  510|       |     * > decimal).
  511|       |     *
  512|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  513|       |     * i.e. 586 bytes long.
  514|       |     *
  515|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  516|       |     */
  517|    209|    if (len > 586)
  ------------------
  |  Branch (517:9): [True: 0, False: 209]
  ------------------
  518|      0|        goto err;
  519|       |
  520|  1.59k|    while (len > 0) {
  ------------------
  |  Branch (520:12): [True: 1.38k, False: 209]
  ------------------
  521|  1.38k|        l = 0;
  522|  1.38k|        use_bn = 0;
  523|  1.70k|        for (;;) {
  524|  1.70k|            unsigned char c = *p++;
  525|       |
  526|  1.70k|            len--;
  527|  1.70k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (527:17): [True: 209, False: 1.49k]
  |  Branch (527:29): [True: 0, False: 209]
  ------------------
  528|      0|                goto err;
  529|  1.70k|            if (use_bn) {
  ------------------
  |  Branch (529:17): [True: 0, False: 1.70k]
  ------------------
  530|      0|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (530:21): [True: 0, False: 0]
  ------------------
  531|      0|                    goto err;
  532|  1.70k|            } else {
  533|  1.70k|                l |= c & 0x7f;
  534|  1.70k|            }
  535|  1.70k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (535:17): [True: 1.38k, False: 322]
  ------------------
  536|  1.38k|                break;
  537|    322|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (537:17): [True: 322, False: 0]
  |  Branch (537:28): [True: 0, False: 322]
  ------------------
  538|      0|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (538:21): [True: 0, False: 0]
  |  Branch (538:35): [True: 0, False: 0]
  ------------------
  539|      0|                    goto err;
  540|      0|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (540:21): [True: 0, False: 0]
  ------------------
  541|      0|                    goto err;
  542|      0|                use_bn = 1;
  543|      0|            }
  544|    322|            if (use_bn) {
  ------------------
  |  Branch (544:17): [True: 0, False: 322]
  ------------------
  545|      0|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (545:21): [True: 0, False: 0]
  ------------------
  546|      0|                    goto err;
  547|    322|            } else {
  548|    322|                l <<= 7L;
  549|    322|            }
  550|    322|        }
  551|       |
  552|  1.38k|        if (first) {
  ------------------
  |  Branch (552:13): [True: 209, False: 1.17k]
  ------------------
  553|    209|            first = 0;
  554|    209|            if (l >= 80) {
  ------------------
  |  Branch (554:17): [True: 81, False: 128]
  ------------------
  555|     81|                i = 2;
  556|     81|                if (use_bn) {
  ------------------
  |  Branch (556:21): [True: 0, False: 81]
  ------------------
  557|      0|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (557:25): [True: 0, False: 0]
  ------------------
  558|      0|                        goto err;
  559|     81|                } else {
  560|     81|                    l -= 80;
  561|     81|                }
  562|    128|            } else {
  563|    128|                i = (int)(l / 40);
  564|    128|                l -= (long)(i * 40);
  565|    128|            }
  566|    209|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (566:17): [True: 209, False: 0]
  |  Branch (566:32): [True: 209, False: 0]
  ------------------
  567|    209|                *buf++ = i + '0';
  568|    209|                *buf = '\0';
  569|    209|                buf_len--;
  570|    209|            }
  571|    209|            n++;
  572|    209|        }
  573|       |
  574|  1.38k|        if (use_bn) {
  ------------------
  |  Branch (574:13): [True: 0, False: 1.38k]
  ------------------
  575|      0|            char *bndec;
  576|      0|            bndec = BN_bn2dec(bl);
  577|      0|            if (!bndec)
  ------------------
  |  Branch (577:17): [True: 0, False: 0]
  ------------------
  578|      0|                goto err;
  579|      0|            i = strlen(bndec);
  580|      0|            if (buf != NULL) {
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  ------------------
  581|      0|                if (buf_len > 1) {
  ------------------
  |  Branch (581:21): [True: 0, False: 0]
  ------------------
  582|      0|                    *buf++ = '.';
  583|      0|                    *buf = '\0';
  584|      0|                    buf_len--;
  585|      0|                }
  586|      0|                OPENSSL_strlcpy(buf, bndec, buf_len);
  587|      0|                if (i > buf_len) {
  ------------------
  |  Branch (587:21): [True: 0, False: 0]
  ------------------
  588|      0|                    buf += buf_len;
  589|      0|                    buf_len = 0;
  590|      0|                } else {
  591|      0|                    buf += i;
  592|      0|                    buf_len -= i;
  593|      0|                }
  594|      0|            }
  595|      0|            n++;
  596|      0|            n += i;
  597|      0|            OPENSSL_free(bndec);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  598|  1.38k|        } else {
  599|  1.38k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  600|  1.38k|            i = strlen(tbuf);
  601|  1.38k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (601:17): [True: 1.38k, False: 0]
  |  Branch (601:24): [True: 1.38k, False: 0]
  ------------------
  602|  1.38k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  603|  1.38k|                if (i > buf_len) {
  ------------------
  |  Branch (603:21): [True: 0, False: 1.38k]
  ------------------
  604|      0|                    buf += buf_len;
  605|      0|                    buf_len = 0;
  606|  1.38k|                } else {
  607|  1.38k|                    buf += i;
  608|  1.38k|                    buf_len -= i;
  609|  1.38k|                }
  610|  1.38k|            }
  611|  1.38k|            n += i;
  612|  1.38k|            l = 0;
  613|  1.38k|        }
  614|  1.38k|    }
  615|       |
  616|    209|    BN_free(bl);
  617|    209|    return n;
  618|       |
  619|      0| err:
  620|      0|    BN_free(bl);
  621|      0|    return -1;
  622|    209|}
OBJ_txt2nid:
  625|  1.65k|{
  626|  1.65k|    ASN1_OBJECT *obj = OBJ_txt2obj(s, 0);
  627|  1.65k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.65k|#define NID_undef                       0
  ------------------
  628|       |
  629|  1.65k|    if (obj != NULL) {
  ------------------
  |  Branch (629:9): [True: 1.65k, False: 0]
  ------------------
  630|  1.65k|        nid = OBJ_obj2nid(obj);
  631|  1.65k|        ASN1_OBJECT_free(obj);
  632|  1.65k|    }
  633|  1.65k|    return nid;
  634|  1.65k|}
OBJ_ln2nid:
  637|  1.73k|{
  638|  1.73k|    ASN1_OBJECT o;
  639|  1.73k|    const ASN1_OBJECT *oo = &o;
  640|  1.73k|    ADDED_OBJ ad, *adp;
  641|  1.73k|    const unsigned int *op;
  642|  1.73k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.73k|#define NID_undef                       0
  ------------------
  643|       |
  644|  1.73k|    o.ln = s;
  645|  1.73k|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 4344|  1.73k|#define NUM_LN 1487
  ------------------
  646|  1.73k|    if (op != NULL)
  ------------------
  |  Branch (646:9): [True: 1.67k, False: 55]
  ------------------
  647|  1.67k|        return nid_objs[*op].nid;
  648|     55|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (648:9): [True: 0, False: 55]
  ------------------
  649|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  650|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  651|      0|    }
  652|     55|    if (added != NULL) {
  ------------------
  |  Branch (652:9): [True: 0, False: 55]
  ------------------
  653|      0|        ad.type = ADDED_LNAME;
  ------------------
  |  |   32|      0|#define ADDED_LNAME     2
  ------------------
  654|      0|        ad.obj = &o;
  655|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  656|      0|        if (adp != NULL)
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      0|            nid = adp->obj->nid;
  658|      0|    }
  659|     55|    ossl_obj_unlock(1);
  660|     55|    return nid;
  661|     55|}
OBJ_sn2nid:
  664|  1.97k|{
  665|  1.97k|    ASN1_OBJECT o;
  666|  1.97k|    const ASN1_OBJECT *oo = &o;
  667|  1.97k|    ADDED_OBJ ad, *adp;
  668|  1.97k|    const unsigned int *op;
  669|  1.97k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.97k|#define NID_undef                       0
  ------------------
  670|       |
  671|  1.97k|    o.sn = s;
  672|  1.97k|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2853|  1.97k|#define NUM_SN 1487
  ------------------
  673|  1.97k|    if (op != NULL)
  ------------------
  |  Branch (673:9): [True: 28, False: 1.94k]
  ------------------
  674|     28|        return nid_objs[*op].nid;
  675|  1.94k|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (675:9): [True: 0, False: 1.94k]
  ------------------
  676|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  678|      0|    }
  679|  1.94k|    if (added != NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 1.94k]
  ------------------
  680|      0|        ad.type = ADDED_SNAME;
  ------------------
  |  |   31|      0|#define ADDED_SNAME     1
  ------------------
  681|      0|        ad.obj = &o;
  682|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  683|      0|        if (adp != NULL)
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            nid = adp->obj->nid;
  685|      0|    }
  686|  1.94k|    ossl_obj_unlock(1);
  687|  1.94k|    return nid;
  688|  1.94k|}
OBJ_bsearch_:
  692|  4.88k|{
  693|  4.88k|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  694|  4.88k|}
OBJ_bsearch_ex_:
  700|  4.88k|{
  701|  4.88k|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  702|       |
  703|       |#ifdef CHARSET_EBCDIC
  704|       |    /*
  705|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  706|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  707|       |     * wasn't found in the binary search.
  708|       |     */
  709|       |    if (p == NULL) {
  710|       |        const char *base_ = base;
  711|       |        int l, h, i = 0, c = 0;
  712|       |        char *p1;
  713|       |
  714|       |        for (i = 0; i < num; ++i) {
  715|       |            p1 = &(base_[i * size]);
  716|       |            c = (*cmp) (key, p1);
  717|       |            if (c == 0
  718|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  719|       |                return p1;
  720|       |        }
  721|       |    }
  722|       |#endif
  723|  4.88k|    return p;
  724|  4.88k|}
OBJ_create:
  780|    237|{
  781|    237|    ASN1_OBJECT *tmpoid = NULL;
  782|    237|    int ok = 0;
  783|       |
  784|       |    /* With no arguments at all, nothing can be done */
  785|    237|    if (oid == NULL && sn == NULL && ln == NULL) {
  ------------------
  |  Branch (785:9): [True: 0, False: 237]
  |  Branch (785:24): [True: 0, False: 0]
  |  Branch (785:38): [True: 0, False: 0]
  ------------------
  786|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  787|      0|        return 0;
  788|      0|    }
  789|       |
  790|       |    /* Check to see if short or long name already present */
  791|    237|    if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef)
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (791:10): [True: 237, False: 0]
  |  Branch (791:24): [True: 0, False: 237]
  ------------------
  792|    237|            || (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (792:17): [True: 0, False: 237]
  |  Branch (792:31): [True: 0, False: 0]
  ------------------
  793|      0|        ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  794|      0|        return 0;
  795|      0|    }
  796|       |
  797|    237|    if (oid != NULL) {
  ------------------
  |  Branch (797:9): [True: 237, False: 0]
  ------------------
  798|       |        /* Convert numerical OID string to an ASN1_OBJECT structure */
  799|    237|        tmpoid = OBJ_txt2obj(oid, 1);
  800|    237|        if (tmpoid == NULL)
  ------------------
  |  Branch (800:13): [True: 0, False: 237]
  ------------------
  801|      0|            return 0;
  802|    237|    } else {
  803|       |        /* Create a no-OID ASN1_OBJECT */
  804|      0|        tmpoid = ASN1_OBJECT_new();
  805|      0|        if (tmpoid == NULL) {
  ------------------
  |  Branch (805:13): [True: 0, False: 0]
  ------------------
  806|      0|            ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  807|      0|            return 0;
  808|      0|        }
  809|      0|    }
  810|       |
  811|    237|    if (!ossl_obj_write_lock(1)) {
  ------------------
  |  Branch (811:9): [True: 0, False: 237]
  ------------------
  812|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  813|      0|        ASN1_OBJECT_free(tmpoid);
  814|      0|        return 0;
  815|      0|    }
  816|       |
  817|       |    /* If NID is not NID_undef then object already exists */
  818|    237|    if (oid != NULL
  ------------------
  |  Branch (818:9): [True: 237, False: 0]
  ------------------
  819|    237|        && ossl_obj_obj2nid(tmpoid, 0) != NID_undef) {
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (819:12): [True: 237, False: 0]
  ------------------
  820|    237|        ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
  ------------------
  |  |  401|    237|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    237|    (ERR_new(),                                                 \
  |  |  |  |  404|    237|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    237|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    237|     ERR_set_error)
  |  |  ------------------
  ------------------
  821|    237|        goto err;
  822|    237|    }
  823|       |
  824|      0|    tmpoid->nid = obj_new_nid_unlocked(1);
  825|       |
  826|      0|    if (tmpoid->nid == NID_undef)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (826:9): [True: 0, False: 0]
  ------------------
  827|      0|        goto err;
  828|       |
  829|      0|    tmpoid->sn = (char *)sn;
  830|      0|    tmpoid->ln = (char *)ln;
  831|       |
  832|      0|    ok = ossl_obj_add_object(tmpoid, 0);
  833|       |
  834|      0|    tmpoid->sn = NULL;
  835|      0|    tmpoid->ln = NULL;
  836|       |
  837|    237| err:
  838|    237|    ossl_obj_unlock(1);
  839|    237|    ASN1_OBJECT_free(tmpoid);
  840|    237|    return ok;
  841|      0|}
OBJ_get0_data:
  851|    159|{
  852|    159|    if (obj == NULL)
  ------------------
  |  Branch (852:9): [True: 0, False: 159]
  ------------------
  853|      0|        return NULL;
  854|    159|    return obj->data;
  855|    159|}
OBJ_obj2nid:
  863|  1.89k|{
  864|  1.89k|    return ossl_obj_obj2nid(a, 1);
  865|  1.89k|}
obj_dat.c:objs_free_locks:
   49|      2|{
   50|      2|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      2|    ossl_obj_lock = NULL;
   52|       |#ifdef TSAN_REQUIRES_LOCKING
   53|       |    CRYPTO_THREAD_lock_free(ossl_obj_nid_lock);
   54|       |    ossl_obj_nid_lock = NULL;
   55|       |#endif
   56|      2|}
obj_dat.c:ossl_obj_read_lock:
   93|  2.00k|{
   94|  2.00k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 2.00k]
  ------------------
   95|      0|        return 1;
   96|  2.00k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 2.00k]
  ------------------
   97|      0|        return 0;
   98|  2.00k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|  2.00k|}
obj_dat.c:ossl_init_added_lock:
   75|  2.23k|{
   76|  2.23k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|  2.23k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  2.23k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|  2.23k|#endif
   80|  2.23k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|  2.23k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.23k, False: 0]
  |  |  ------------------
  ------------------
   81|  2.23k|}
obj_dat.c:obj_lock_initialise:
   59|      1|{
   60|      1|    ossl_obj_lock = CRYPTO_THREAD_lock_new();
   61|      1|    if (ossl_obj_lock == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|       |
   64|       |#ifdef TSAN_REQUIRES_LOCKING
   65|       |    ossl_obj_nid_lock = CRYPTO_THREAD_lock_new();
   66|       |    if (ossl_obj_nid_lock == NULL) {
   67|       |        objs_free_locks();
   68|       |        return 0;
   69|       |    }
   70|       |#endif
   71|      1|    return 1;
   72|      1|}
obj_dat.c:ossl_obj_unlock:
  102|  2.23k|{
  103|  2.23k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 2.23k, False: 0]
  ------------------
  104|  2.23k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|  2.23k|}
obj_dat.c:ln_cmp:
  115|  16.8k|{
  116|  16.8k|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|  16.8k|}
obj_dat.c:sn_cmp:
  108|  21.6k|{
  109|  21.6k|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|  21.6k|}
obj_dat.c:ossl_obj_write_lock:
   84|    237|{
   85|    237|    if (!lock)
  ------------------
  |  Branch (85:9): [True: 0, False: 237]
  ------------------
   86|      0|        return 1;
   87|    237|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (87:9): [True: 0, False: 237]
  ------------------
   88|      0|        return 0;
   89|    237|    return CRYPTO_THREAD_write_lock(ossl_obj_lock);
   90|    237|}
obj_dat.c:ossl_obj_obj2nid:
  387|  2.13k|{
  388|  2.13k|    int nid = NID_undef;
  ------------------
  |  |   18|  2.13k|#define NID_undef                       0
  ------------------
  389|  2.13k|    const unsigned int *op;
  390|  2.13k|    ADDED_OBJ ad, *adp;
  391|       |
  392|  2.13k|    if (a == NULL)
  ------------------
  |  Branch (392:9): [True: 0, False: 2.13k]
  ------------------
  393|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  394|  2.13k|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  2.13k|#define NID_undef                       0
  ------------------
  |  Branch (394:9): [True: 1.89k, False: 237]
  ------------------
  395|  1.89k|        return a->nid;
  396|    237|    if (a->length == 0)
  ------------------
  |  Branch (396:9): [True: 0, False: 237]
  ------------------
  397|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  398|       |
  399|    237|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5835|    237|#define NUM_OBJ 1344
  ------------------
  400|    237|    if (op != NULL)
  ------------------
  |  Branch (400:9): [True: 237, False: 0]
  ------------------
  401|    237|        return nid_objs[*op].nid;
  402|      0|    if (!ossl_obj_read_lock(lock)) {
  ------------------
  |  Branch (402:9): [True: 0, False: 0]
  ------------------
  403|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  404|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  405|      0|    }
  406|      0|    if (added != NULL) {
  ------------------
  |  Branch (406:9): [True: 0, False: 0]
  ------------------
  407|      0|        ad.type = ADDED_DATA;
  ------------------
  |  |   30|      0|#define ADDED_DATA      0
  ------------------
  408|      0|        ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
  409|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  410|      0|        if (adp != NULL)
  ------------------
  |  Branch (410:13): [True: 0, False: 0]
  ------------------
  411|      0|            nid = adp->obj->nid;
  412|      0|    }
  413|      0|    ossl_obj_unlock(lock);
  414|      0|    return nid;
  415|      0|}
obj_dat.c:obj_cmp:
  371|  2.29k|{
  372|  2.29k|    int j;
  373|  2.29k|    const ASN1_OBJECT *a = *ap;
  374|  2.29k|    const ASN1_OBJECT *b = &nid_objs[*bp];
  375|       |
  376|  2.29k|    j = (a->length - b->length);
  377|  2.29k|    if (j)
  ------------------
  |  Branch (377:9): [True: 474, False: 1.81k]
  ------------------
  378|    474|        return j;
  379|  1.81k|    if (a->length == 0)
  ------------------
  |  Branch (379:9): [True: 0, False: 1.81k]
  ------------------
  380|      0|        return 0;
  381|  1.81k|    return memcmp(a->data, b->data, a->length);
  382|  1.81k|}

ossl_err_load_OBJ_strings:
   28|      2|{
   29|      2|#ifndef OPENSSL_NO_ERR
   30|      2|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        ERR_load_strings_const(OBJ_str_reasons);
   32|      2|#endif
   33|      2|    return 1;
   34|      2|}

OBJ_add_sigid:
  148|    237|{
  149|    237|    nid_triple *ntr;
  150|    237|    int dnid = NID_undef, pnid = NID_undef, ret = 0;
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
                  int dnid = NID_undef, pnid = NID_undef, ret = 0;
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  151|       |
  152|    237|    if (signid == NID_undef || pkey_id == NID_undef)
  ------------------
  |  |   18|    474|#define NID_undef                       0
  ------------------
                  if (signid == NID_undef || pkey_id == NID_undef)
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (152:9): [True: 0, False: 237]
  |  Branch (152:32): [True: 0, False: 237]
  ------------------
  153|      0|        return 0;
  154|       |
  155|    237|    if (!obj_sig_init())
  ------------------
  |  Branch (155:9): [True: 0, False: 237]
  ------------------
  156|      0|        return 0;
  157|       |
  158|    237|    if ((ntr = OPENSSL_malloc(sizeof(*ntr))) == NULL)
  ------------------
  |  |  102|    237|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (158:9): [True: 0, False: 237]
  ------------------
  159|      0|        return 0;
  160|    237|    ntr->sign_id = signid;
  161|    237|    ntr->hash_id = dig_id;
  162|    237|    ntr->pkey_id = pkey_id;
  163|       |
  164|    237|    if (!CRYPTO_THREAD_write_lock(sig_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 237]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        OPENSSL_free(ntr);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|      0|        return 0;
  168|      0|    }
  169|       |
  170|       |    /* Check that the entry doesn't exist or exists as desired */
  171|    237|    if (ossl_obj_find_sigid_algs(signid, &dnid, &pnid, 0)) {
  ------------------
  |  Branch (171:9): [True: 237, False: 0]
  ------------------
  172|    237|        ret = dnid == dig_id && pnid == pkey_id;
  ------------------
  |  Branch (172:15): [True: 237, False: 0]
  |  Branch (172:33): [True: 237, False: 0]
  ------------------
  173|    237|        goto err;
  174|    237|    }
  175|       |
  176|      0|    if (sig_app == NULL) {
  ------------------
  |  Branch (176:9): [True: 0, False: 0]
  ------------------
  177|      0|        sig_app = sk_nid_triple_new(sig_sk_cmp);
  178|      0|        if (sig_app == NULL)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            goto err;
  180|      0|    }
  181|      0|    if (sigx_app == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 0]
  ------------------
  182|      0|        sigx_app = sk_nid_triple_new(sigx_cmp);
  183|      0|        if (sigx_app == NULL)
  ------------------
  |  Branch (183:13): [True: 0, False: 0]
  ------------------
  184|      0|            goto err;
  185|      0|    }
  186|       |
  187|       |    /*
  188|       |     * Better might be to find where to insert the element and insert it there.
  189|       |     * This would avoid the sorting steps below.
  190|       |     */
  191|      0|    if (!sk_nid_triple_push(sig_app, ntr))
  ------------------
  |  Branch (191:9): [True: 0, False: 0]
  ------------------
  192|      0|        goto err;
  193|      0|    if (!sk_nid_triple_push(sigx_app, ntr)) {
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|      0|        ntr = NULL;             /* This is referenced by sig_app still */
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|      0|    sk_nid_triple_sort(sig_app);
  199|      0|    sk_nid_triple_sort(sigx_app);
  200|       |
  201|      0|    ntr = NULL;
  202|      0|    ret = 1;
  203|    237| err:
  204|    237|    OPENSSL_free(ntr);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|    237|    CRYPTO_THREAD_unlock(sig_lock);
  206|    237|    return ret;
  207|      0|}
OBJ_sigid_free:
  215|      2|{
  216|      2|    sk_nid_triple_pop_free(sig_app, sid_free);
  217|      2|    sk_nid_triple_free(sigx_app);
  218|      2|    CRYPTO_THREAD_lock_free(sig_lock);
  219|      2|    sig_app = NULL;
  220|      2|    sigx_app = NULL;
  221|      2|    sig_lock = NULL;
  222|      2|}
obj_xref.c:ossl_obj_find_sigid_algs:
   68|    237|{
   69|    237|    nid_triple tmp;
   70|    237|    const nid_triple *rv;
   71|    237|    int idx;
   72|       |
   73|    237|    if (signid == NID_undef)
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (73:9): [True: 0, False: 237]
  ------------------
   74|      0|        return 0;
   75|       |
   76|    237|    tmp.sign_id = signid;
   77|    237|    rv = OBJ_bsearch_sig(&tmp, sigoid_srt, OSSL_NELEM(sigoid_srt));
  ------------------
  |  |   14|    237|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   78|    237|    if (rv == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 237]
  ------------------
   79|      0|        if (!obj_sig_init())
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            return 0;
   81|      0|        if (lock && !CRYPTO_THREAD_read_lock(sig_lock)) {
  ------------------
  |  Branch (81:13): [True: 0, False: 0]
  |  Branch (81:21): [True: 0, False: 0]
  ------------------
   82|      0|            ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   83|      0|            return 0;
   84|      0|        }
   85|      0|        if (sig_app != NULL) {
  ------------------
  |  Branch (85:13): [True: 0, False: 0]
  ------------------
   86|      0|            idx = sk_nid_triple_find(sig_app, &tmp);
   87|      0|            if (idx >= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 0]
  ------------------
   88|      0|                rv = sk_nid_triple_value(sig_app, idx);
   89|      0|        }
   90|      0|        if (lock)
  ------------------
  |  Branch (90:13): [True: 0, False: 0]
  ------------------
   91|      0|            CRYPTO_THREAD_unlock(sig_lock);
   92|      0|        if (rv == NULL)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            return 0;
   94|      0|    }
   95|       |
   96|    237|    if (pdig_nid != NULL)
  ------------------
  |  Branch (96:9): [True: 237, False: 0]
  ------------------
   97|    237|        *pdig_nid = rv->hash_id;
   98|    237|    if (ppkey_nid != NULL)
  ------------------
  |  Branch (98:9): [True: 237, False: 0]
  ------------------
   99|    237|        *ppkey_nid = rv->pkey_id;
  100|    237|    return 1;
  101|    237|}
obj_xref.c:sig_cmp:
   20|  1.34k|{
   21|  1.34k|    return a->sign_id - b->sign_id;
   22|  1.34k|}
obj_xref.c:obj_sig_init:
   62|    237|{
   63|    237|    return RUN_ONCE(&sig_init, o_sig_init);
  ------------------
  |  |  130|    237|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 237, False: 0]
  |  |  ------------------
  ------------------
   64|    237|}
obj_xref.c:o_sig_init:
   56|      1|{
   57|      1|    sig_lock = CRYPTO_THREAD_lock_new();
   58|      1|    return sig_lock != NULL;
   59|      1|}

ossl_err_load_OCSP_strings:
   66|      2|{
   67|      2|# ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(OCSP_str_reasons);
   70|      2|# endif
   71|      2|    return 1;
   72|      2|}

OSSL_PARAM_locate:
   54|  65.0k|{
   55|  65.0k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 65.0k, False: 9]
  |  Branch (55:22): [True: 65.0k, False: 0]
  ------------------
   56|   315k|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 301k, False: 14.2k]
  ------------------
   57|   301k|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 50.8k, False: 250k]
  ------------------
   58|  50.8k|                return p;
   59|  14.2k|    return NULL;
   60|  65.0k|}
OSSL_PARAM_locate_const:
   63|  50.3k|{
   64|  50.3k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|  50.3k|}
OSSL_PARAM_get_int:
  267|  19.7k|{
  268|  19.7k|#ifndef OPENSSL_SMALL_FOOTPRINT
  269|  19.7k|    switch (sizeof(int)) {
  ------------------
  |  Branch (269:13): [Folded - Ignored]
  ------------------
  270|  19.7k|    case sizeof(int32_t):
  ------------------
  |  Branch (270:5): [True: 19.7k, False: 0]
  ------------------
  271|  19.7k|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  272|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (272:5): [True: 0, False: 19.7k]
  ------------------
  273|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  274|  19.7k|    }
  275|      0|#endif
  276|      0|    return general_get_int(p, val, sizeof(*val));
  277|  19.7k|}
OSSL_PARAM_set_int:
  280|    913|{
  281|    913|#ifndef OPENSSL_SMALL_FOOTPRINT
  282|    913|    switch (sizeof(int)) {
  ------------------
  |  Branch (282:13): [Folded - Ignored]
  ------------------
  283|    913|    case sizeof(int32_t):
  ------------------
  |  Branch (283:5): [True: 913, False: 0]
  ------------------
  284|    913|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  285|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (285:5): [True: 0, False: 913]
  ------------------
  286|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  287|    913|    }
  288|      0|#endif
  289|      0|    return general_set_int(p, &val, sizeof(val));
  290|    913|}
OSSL_PARAM_construct_int:
  293|  1.94k|{
  294|  1.94k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  1.94k|# define OSSL_PARAM_INTEGER              1
  ------------------
  295|  1.94k|}
OSSL_PARAM_get_uint:
  298|  14.4k|{
  299|  14.4k|#ifndef OPENSSL_SMALL_FOOTPRINT
  300|  14.4k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (300:13): [Folded - Ignored]
  ------------------
  301|  14.4k|    case sizeof(uint32_t):
  ------------------
  |  Branch (301:5): [True: 14.4k, False: 0]
  ------------------
  302|  14.4k|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  303|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (303:5): [True: 0, False: 14.4k]
  ------------------
  304|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  305|  14.4k|    }
  306|      0|#endif
  307|      0|    return general_get_uint(p, val, sizeof(*val));
  308|  14.4k|}
OSSL_PARAM_set_uint:
  311|    130|{
  312|    130|#ifndef OPENSSL_SMALL_FOOTPRINT
  313|    130|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (313:13): [Folded - Ignored]
  ------------------
  314|    130|    case sizeof(uint32_t):
  ------------------
  |  Branch (314:5): [True: 130, False: 0]
  ------------------
  315|    130|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  316|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (316:5): [True: 0, False: 130]
  ------------------
  317|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  318|    130|    }
  319|      0|#endif
  320|      0|    return general_set_uint(p, &val, sizeof(val));
  321|    130|}
OSSL_PARAM_construct_uint:
  324|    133|{
  325|    133|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|    133|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  326|    133|                                sizeof(unsigned int));
  327|    133|}
OSSL_PARAM_get_int32:
  393|  19.7k|{
  394|  19.7k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 19.7k]
  |  Branch (394:24): [True: 0, False: 19.7k]
  ------------------
  395|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  396|      0|        return 0;
  397|      0|    }
  398|       |
  399|  19.7k|    if (p->data == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 19.7k]
  ------------------
  400|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|      0|        return 0;
  402|      0|    }
  403|       |
  404|  19.7k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  19.7k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (404:9): [True: 19.5k, False: 158]
  ------------------
  405|  19.5k|#ifndef OPENSSL_SMALL_FOOTPRINT
  406|  19.5k|        int64_t i64;
  407|       |
  408|  19.5k|        switch (p->data_size) {
  ------------------
  |  Branch (408:17): [True: 0, False: 19.5k]
  ------------------
  409|  19.5k|        case sizeof(int32_t):
  ------------------
  |  Branch (409:9): [True: 19.5k, False: 0]
  ------------------
  410|  19.5k|            *val = *(const int32_t *)p->data;
  411|  19.5k|            return 1;
  412|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (412:9): [True: 0, False: 19.5k]
  ------------------
  413|      0|            i64 = *(const int64_t *)p->data;
  414|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (414:17): [True: 0, False: 0]
  |  Branch (414:37): [True: 0, False: 0]
  ------------------
  415|      0|                *val = (int32_t)i64;
  416|      0|                return 1;
  417|      0|            }
  418|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  419|      0|            return 0;
  420|  19.5k|        }
  421|      0|#endif
  422|      0|        return general_get_int(p, val, sizeof(*val));
  423|       |
  424|  19.5k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|    158|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (424:16): [True: 158, False: 0]
  ------------------
  425|    158|#ifndef OPENSSL_SMALL_FOOTPRINT
  426|    158|        uint32_t u32;
  427|    158|        uint64_t u64;
  428|       |
  429|    158|        switch (p->data_size) {
  ------------------
  |  Branch (429:17): [True: 0, False: 158]
  ------------------
  430|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (430:9): [True: 0, False: 158]
  ------------------
  431|      0|            u32 = *(const uint32_t *)p->data;
  432|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (432:17): [True: 0, False: 0]
  ------------------
  433|      0|                *val = (int32_t)u32;
  434|      0|                return 1;
  435|      0|            }
  436|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  437|      0|            return 0;
  438|    158|        case sizeof(uint64_t):
  ------------------
  |  Branch (438:9): [True: 158, False: 0]
  ------------------
  439|    158|            u64 = *(const uint64_t *)p->data;
  440|    158|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (440:17): [True: 158, False: 0]
  ------------------
  441|    158|                *val = (int32_t)u64;
  442|    158|                return 1;
  443|    158|            }
  444|      0|            err_out_of_range;
  ------------------
  |  |   25|    158|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  445|      0|            return 0;
  446|    158|        }
  447|      0|#endif
  448|      0|        return general_get_int(p, val, sizeof(*val));
  449|       |
  450|    158|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (450:16): [True: 0, False: 0]
  ------------------
  451|      0|#ifndef OPENSSL_SYS_UEFI
  452|      0|        double d;
  453|       |
  454|      0|        switch (p->data_size) {
  ------------------
  |  Branch (454:17): [True: 0, False: 0]
  ------------------
  455|      0|        case sizeof(double):
  ------------------
  |  Branch (455:9): [True: 0, False: 0]
  ------------------
  456|      0|            d = *(const double *)p->data;
  457|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (457:17): [True: 0, False: 0]
  |  Branch (457:35): [True: 0, False: 0]
  |  Branch (457:53): [True: 0, False: 0]
  ------------------
  458|      0|                *val = (int32_t)d;
  459|      0|                return 1;
  460|      0|            }
  461|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  462|      0|            return 0;
  463|      0|        }
  464|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|      0|        return 0;
  466|      0|#endif
  467|      0|    }
  468|      0|    err_bad_type;
  ------------------
  |  |   35|  19.7k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|      0|    return 0;
  470|  19.7k|}
OSSL_PARAM_set_int32:
  473|    913|{
  474|    913|    if (p == NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 913]
  ------------------
  475|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|      0|        return 0;
  477|      0|    }
  478|    913|    p->return_size = 0;
  479|    913|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|    913|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (479:9): [True: 913, False: 0]
  ------------------
  480|    913|#ifndef OPENSSL_SMALL_FOOTPRINT
  481|    913|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  482|    913|        if (p->data == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 913]
  ------------------
  483|      0|            return 1;
  484|    913|        switch (p->data_size) {
  ------------------
  |  Branch (484:17): [True: 0, False: 913]
  ------------------
  485|    913|        case sizeof(int32_t):
  ------------------
  |  Branch (485:9): [True: 913, False: 0]
  ------------------
  486|    913|            *(int32_t *)p->data = val;
  487|    913|            return 1;
  488|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (488:9): [True: 0, False: 913]
  ------------------
  489|      0|            p->return_size = sizeof(int64_t);
  490|      0|            *(int64_t *)p->data = (int64_t)val;
  491|      0|            return 1;
  492|    913|        }
  493|      0|#endif
  494|      0|        return general_set_int(p, &val, sizeof(val));
  495|    913|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (495:16): [True: 0, False: 0]
  |  Branch (495:63): [True: 0, False: 0]
  ------------------
  496|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  497|      0|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  498|      0|        if (p->data == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 1;
  500|      0|        switch (p->data_size) {
  ------------------
  |  Branch (500:17): [True: 0, False: 0]
  ------------------
  501|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|            *(uint32_t *)p->data = (uint32_t)val;
  503|      0|            return 1;
  504|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|      0|            p->return_size = sizeof(uint64_t);
  506|      0|            *(uint64_t *)p->data = (uint64_t)val;
  507|      0|            return 1;
  508|      0|        }
  509|      0|#endif
  510|      0|        return general_set_int(p, &val, sizeof(val));
  511|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (511:16): [True: 0, False: 0]
  ------------------
  512|      0|#ifndef OPENSSL_SYS_UEFI
  513|      0|        uint32_t u32;
  514|      0|        unsigned int shift;
  515|       |
  516|      0|        p->return_size = sizeof(double);
  517|      0|        if (p->data == NULL)
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            return 1;
  519|      0|        switch (p->data_size) {
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|        case sizeof(double):
  ------------------
  |  Branch (520:9): [True: 0, False: 0]
  ------------------
  521|      0|            shift = real_shift();
  522|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (522:17): [True: 0, False: 0]
  ------------------
  523|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (523:23): [True: 0, False: 0]
  ------------------
  524|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (524:21): [True: 0, False: 0]
  ------------------
  525|      0|                    err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  526|      0|                    return 0;
  527|      0|                }
  528|      0|            }
  529|      0|            *(double *)p->data = (double)val;
  530|      0|            return 1;
  531|      0|        }
  532|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|      0|        return 0;
  534|      0|#endif
  535|      0|    }
  536|      0|    err_bad_type;
  ------------------
  |  |   35|    913|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  537|      0|    return 0;
  538|    913|}
OSSL_PARAM_get_uint32:
  547|  14.4k|{
  548|  14.4k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (548:9): [True: 0, False: 14.4k]
  |  Branch (548:24): [True: 0, False: 14.4k]
  ------------------
  549|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|      0|        return 0;
  551|      0|    }
  552|       |
  553|  14.4k|    if (p->data == NULL) {
  ------------------
  |  Branch (553:9): [True: 0, False: 14.4k]
  ------------------
  554|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|      0|        return 0;
  556|      0|    }
  557|       |
  558|  14.4k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  14.4k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (558:9): [True: 9.79k, False: 4.66k]
  ------------------
  559|  9.79k|#ifndef OPENSSL_SMALL_FOOTPRINT
  560|  9.79k|        uint64_t u64;
  561|       |
  562|  9.79k|        switch (p->data_size) {
  ------------------
  |  Branch (562:17): [True: 0, False: 9.79k]
  ------------------
  563|  9.79k|        case sizeof(uint32_t):
  ------------------
  |  Branch (563:9): [True: 9.79k, False: 0]
  ------------------
  564|  9.79k|            *val = *(const uint32_t *)p->data;
  565|  9.79k|            return 1;
  566|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (566:9): [True: 0, False: 9.79k]
  ------------------
  567|      0|            u64 = *(const uint64_t *)p->data;
  568|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                *val = (uint32_t)u64;
  570|      0|                return 1;
  571|      0|            }
  572|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  573|      0|            return 0;
  574|  9.79k|        }
  575|      0|#endif
  576|      0|        return general_get_uint(p, val, sizeof(*val));
  577|  9.79k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  4.66k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (577:16): [True: 4.66k, False: 0]
  ------------------
  578|  4.66k|#ifndef OPENSSL_SMALL_FOOTPRINT
  579|  4.66k|        int32_t i32;
  580|  4.66k|        int64_t i64;
  581|       |
  582|  4.66k|        switch (p->data_size) {
  ------------------
  |  Branch (582:17): [True: 0, False: 4.66k]
  ------------------
  583|  4.66k|        case sizeof(int32_t):
  ------------------
  |  Branch (583:9): [True: 4.66k, False: 0]
  ------------------
  584|  4.66k|            i32 = *(const int32_t *)p->data;
  585|  4.66k|            if (i32 >= 0) {
  ------------------
  |  Branch (585:17): [True: 4.66k, False: 0]
  ------------------
  586|  4.66k|                *val = i32;
  587|  4.66k|                return 1;
  588|  4.66k|            }
  589|      0|            err_unsigned_negative;
  ------------------
  |  |   22|  4.66k|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  590|      0|            return 0;
  591|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (591:9): [True: 0, False: 4.66k]
  ------------------
  592|      0|            i64 = *(const int64_t *)p->data;
  593|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (593:17): [True: 0, False: 0]
  |  Branch (593:29): [True: 0, False: 0]
  ------------------
  594|      0|                *val = (uint32_t)i64;
  595|      0|                return 1;
  596|      0|            }
  597|      0|            if (i64 < 0)
  ------------------
  |  Branch (597:17): [True: 0, False: 0]
  ------------------
  598|      0|                err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  599|      0|            else
  600|      0|                err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  601|      0|            return 0;
  602|  4.66k|        }
  603|      0|#endif
  604|      0|        return general_get_uint(p, val, sizeof(*val));
  605|  4.66k|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|      0|#ifndef OPENSSL_SYS_UEFI
  607|      0|        double d;
  608|       |
  609|      0|        switch (p->data_size) {
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  ------------------
  610|      0|        case sizeof(double):
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|            d = *(const double *)p->data;
  612|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (612:17): [True: 0, False: 0]
  |  Branch (612:27): [True: 0, False: 0]
  |  Branch (612:46): [True: 0, False: 0]
  ------------------
  613|      0|                *val = (uint32_t)d;
  614|      0|                return 1;
  615|      0|            }
  616|      0|            err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  617|      0|            return 0;
  618|      0|        }
  619|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|      0|        return 0;
  621|      0|#endif
  622|      0|    }
  623|      0|    err_bad_type;
  ------------------
  |  |   35|  14.4k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  624|      0|    return 0;
  625|  14.4k|}
OSSL_PARAM_set_uint32:
  628|    130|{
  629|    130|    if (p == NULL) {
  ------------------
  |  Branch (629:9): [True: 0, False: 130]
  ------------------
  630|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|      0|        return 0;
  632|      0|    }
  633|    130|    p->return_size = 0;
  634|       |
  635|    130|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|    130|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (635:9): [True: 130, False: 0]
  ------------------
  636|    130|#ifndef OPENSSL_SMALL_FOOTPRINT
  637|    130|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  638|    130|        if (p->data == NULL)
  ------------------
  |  Branch (638:13): [True: 0, False: 130]
  ------------------
  639|      0|            return 1;
  640|    130|        switch (p->data_size) {
  ------------------
  |  Branch (640:17): [True: 0, False: 130]
  ------------------
  641|    130|        case sizeof(uint32_t):
  ------------------
  |  Branch (641:9): [True: 130, False: 0]
  ------------------
  642|    130|            *(uint32_t *)p->data = val;
  643|    130|            return 1;
  644|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (644:9): [True: 0, False: 130]
  ------------------
  645|      0|            p->return_size = sizeof(uint64_t);
  646|      0|            *(uint64_t *)p->data = val;
  647|      0|            return 1;
  648|    130|        }
  649|      0|#endif
  650|      0|        return general_set_uint(p, &val, sizeof(val));
  651|    130|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  653|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  654|      0|        if (p->data == NULL)
  ------------------
  |  Branch (654:13): [True: 0, False: 0]
  ------------------
  655|      0|            return 1;
  656|      0|        switch (p->data_size) {
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (657:9): [True: 0, False: 0]
  ------------------
  658|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|                *(int32_t *)p->data = (int32_t)val;
  660|      0|                return 1;
  661|      0|            }
  662|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  663|      0|            return 0;
  664|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (664:9): [True: 0, False: 0]
  ------------------
  665|      0|            p->return_size = sizeof(int64_t);
  666|      0|            *(int64_t *)p->data = (int64_t)val;
  667|      0|            return 1;
  668|      0|        }
  669|      0|#endif
  670|      0|        return general_set_uint(p, &val, sizeof(val));
  671|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (671:16): [True: 0, False: 0]
  ------------------
  672|      0|#ifndef OPENSSL_SYS_UEFI
  673|      0|        unsigned int shift;
  674|       |
  675|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (675:13): [True: 0, False: 0]
  ------------------
  676|      0|            p->return_size = sizeof(double);
  677|      0|            return 1;
  678|      0|        }
  679|      0|        switch (p->data_size) {
  ------------------
  |  Branch (679:17): [True: 0, False: 0]
  ------------------
  680|      0|        case sizeof(double):
  ------------------
  |  Branch (680:9): [True: 0, False: 0]
  ------------------
  681|      0|            shift = real_shift();
  682|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (682:17): [True: 0, False: 0]
  |  Branch (682:44): [True: 0, False: 0]
  ------------------
  683|      0|                err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  684|      0|                return 0;
  685|      0|            }
  686|      0|            *(double *)p->data = (double)val;
  687|      0|            p->return_size = sizeof(double);
  688|      0|            return 1;
  689|      0|        }
  690|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  691|      0|        return 0;
  692|      0|#endif
  693|      0|    }
  694|      0|    err_bad_type;
  ------------------
  |  |   35|    130|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|      0|    return 0;
  696|    130|}
OSSL_PARAM_set_uint64:
  938|  1.15k|{
  939|  1.15k|    if (p == NULL) {
  ------------------
  |  Branch (939:9): [True: 0, False: 1.15k]
  ------------------
  940|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|      0|        return 0;
  942|      0|    }
  943|  1.15k|    p->return_size = 0;
  944|       |
  945|  1.15k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  1.15k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (945:9): [True: 1.15k, False: 0]
  ------------------
  946|  1.15k|#ifndef OPENSSL_SMALL_FOOTPRINT
  947|  1.15k|        if (p->data == NULL) {
  ------------------
  |  Branch (947:13): [True: 0, False: 1.15k]
  ------------------
  948|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  949|      0|            return 1;
  950|      0|        }
  951|  1.15k|        switch (p->data_size) {
  ------------------
  |  Branch (951:17): [True: 0, False: 1.15k]
  ------------------
  952|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (952:9): [True: 0, False: 1.15k]
  ------------------
  953|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (953:17): [True: 0, False: 0]
  ------------------
  954|      0|                p->return_size = sizeof(uint32_t);
  955|      0|                *(uint32_t *)p->data = (uint32_t)val;
  956|      0|                return 1;
  957|      0|            }
  958|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  959|      0|            return 0;
  960|  1.15k|        case sizeof(uint64_t):
  ------------------
  |  Branch (960:9): [True: 1.15k, False: 0]
  ------------------
  961|  1.15k|            p->return_size = sizeof(uint64_t);
  962|  1.15k|            *(uint64_t *)p->data = val;
  963|  1.15k|            return 1;
  964|  1.15k|        }
  965|      0|#endif
  966|      0|        return general_set_uint(p, &val, sizeof(val));
  967|  1.15k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (967:16): [True: 0, False: 0]
  ------------------
  968|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  969|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (969:13): [True: 0, False: 0]
  ------------------
  970|      0|            p->return_size = sizeof(int64_t); /* Expected size */
  971|      0|            return 1;
  972|      0|        }
  973|      0|        switch (p->data_size) {
  ------------------
  |  Branch (973:17): [True: 0, False: 0]
  ------------------
  974|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  ------------------
  975|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (975:17): [True: 0, False: 0]
  ------------------
  976|      0|                p->return_size = sizeof(int32_t);
  977|      0|                *(int32_t *)p->data = (int32_t)val;
  978|      0|                return 1;
  979|      0|            }
  980|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  981|      0|            return 0;
  982|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (982:9): [True: 0, False: 0]
  ------------------
  983|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (983:17): [True: 0, False: 0]
  ------------------
  984|      0|                p->return_size = sizeof(int64_t);
  985|      0|                *(int64_t *)p->data = (int64_t)val;
  986|      0|                return 1;
  987|      0|            }
  988|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  989|      0|            return 0;
  990|      0|        }
  991|      0|#endif
  992|      0|        return general_set_uint(p, &val, sizeof(val));
  993|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (993:16): [True: 0, False: 0]
  ------------------
  994|      0|#ifndef OPENSSL_SYS_UEFI
  995|      0|        switch (p->data_size) {
  ------------------
  |  Branch (995:17): [True: 0, False: 0]
  ------------------
  996|      0|        case sizeof(double):
  ------------------
  |  Branch (996:9): [True: 0, False: 0]
  ------------------
  997|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (997:17): [True: 0, False: 0]
  ------------------
  998|      0|                p->return_size = sizeof(double);
  999|      0|                *(double *)p->data = (double)val;
 1000|      0|                return 1;
 1001|      0|            }
 1002|      0|            err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
 1003|      0|            return 0;
 1004|      0|        }
 1005|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1006|      0|        return 0;
 1007|      0|#endif
 1008|      0|    }
 1009|      0|    err_bad_type;
  ------------------
  |  |   35|  1.15k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|      0|    return 0;
 1011|  1.15k|}
OSSL_PARAM_set_size_t:
 1033|  1.15k|{
 1034|  1.15k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1035|  1.15k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1035:13): [Folded - Ignored]
  ------------------
 1036|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1036:5): [True: 0, False: 1.15k]
  ------------------
 1037|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1038|  1.15k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1038:5): [True: 1.15k, False: 0]
  ------------------
 1039|  1.15k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1040|  1.15k|    }
 1041|      0|#endif
 1042|      0|    return general_set_uint(p, &val, sizeof(val));
 1043|  1.15k|}
OSSL_PARAM_construct_size_t:
 1046|  1.15k|{
 1047|  1.15k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  1.15k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1048|  1.15k|                                sizeof(size_t));
 1049|  1.15k|}
OSSL_PARAM_construct_time_t:
 1078|      3|{
 1079|      3|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      3|# define OSSL_PARAM_INTEGER              1
  ------------------
 1080|      3|}
OSSL_PARAM_construct_utf8_string:
 1462|      3|{
 1463|      3|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1463:9): [True: 3, False: 0]
  |  Branch (1463:24): [True: 3, False: 0]
  ------------------
 1464|      3|        bsize = strlen(buf);
 1465|      3|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|      3|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1466|      3|}
OSSL_PARAM_construct_end:
 1661|  1.26k|{
 1662|  1.26k|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|  1.26k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1663|       |
 1664|  1.26k|    return end;
 1665|  1.26k|}
params.c:ossl_param_construct:
   69|  3.23k|{
   70|  3.23k|    OSSL_PARAM res;
   71|       |
   72|  3.23k|    res.key = key;
   73|  3.23k|    res.data_type = data_type;
   74|  3.23k|    res.data = data;
   75|  3.23k|    res.data_size = data_size;
   76|  3.23k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  3.23k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|  3.23k|    return res;
   78|  3.23k|}

ossl_err_load_PEM_strings:
   70|      2|{
   71|      2|#ifndef OPENSSL_NO_ERR
   72|      2|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (72:9): [True: 2, False: 0]
  ------------------
   73|      2|        ERR_load_strings_const(PEM_str_reasons);
   74|      2|#endif
   75|      2|    return 1;
   76|      2|}

ossl_err_load_PKCS12_strings:
   56|      2|{
   57|      2|#ifndef OPENSSL_NO_ERR
   58|      2|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (58:9): [True: 2, False: 0]
  ------------------
   59|      2|        ERR_load_strings_const(PKCS12_str_reasons);
   60|      2|#endif
   61|      2|    return 1;
   62|      2|}

ossl_err_load_PKCS7_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

ossl_property_defns_free:
   52|      2|{
   53|      2|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = vproperty_defns;
  ------------------
  |  |  149|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|      2|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|      2|                                    &property_defn_free);
   58|      2|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|      2|    }
   60|      2|}
ossl_property_defns_new:
   62|      4|void *ossl_property_defns_new(OSSL_LIB_CTX *ctx) {
   63|      4|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   64|      4|}
ossl_prop_defn_get:
   67|    269|{
   68|    269|    PROPERTY_DEFN_ELEM elem, *r;
   69|    269|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  149|    269|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   70|       |
   71|    269|    property_defns = ossl_lib_ctx_get_data(ctx,
   72|    269|                                           OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |  100|    269|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
   73|    269|    if (!ossl_assert(property_defns != NULL) || !ossl_lib_ctx_read_lock(ctx))
  ------------------
  |  |   52|    538|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    538|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (73:9): [True: 0, False: 269]
  |  Branch (73:49): [True: 0, False: 269]
  ------------------
   74|      0|        return NULL;
   75|       |
   76|    269|    elem.prop = prop;
   77|    269|    r = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem);
   78|    269|    ossl_lib_ctx_unlock(ctx);
   79|    269|    if (r == NULL || !ossl_assert(r->defn != NULL))
  ------------------
  |  |   52|    267|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    267|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (79:9): [True: 2, False: 267]
  |  Branch (79:22): [True: 0, False: 267]
  ------------------
   80|      2|        return NULL;
   81|    267|    return r->defn;
   82|    269|}
ossl_prop_defn_set:
   91|      2|{
   92|      2|    PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
   93|      2|    size_t len;
   94|      2|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  149|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   95|      2|    int res = 1;
   96|       |
   97|      2|    property_defns = ossl_lib_ctx_get_data(ctx,
   98|      2|                                           OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |  100|      2|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
   99|      2|    if (property_defns == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        return 0;
  101|       |
  102|      2|    if (prop == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        return 1;
  104|       |
  105|      2|    if (!ossl_lib_ctx_write_lock(ctx))
  ------------------
  |  Branch (105:9): [True: 0, False: 2]
  ------------------
  106|      0|        return 0;
  107|      2|    elem.prop = prop;
  108|      2|    if (pl == NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 2]
  ------------------
  109|      0|        lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem);
  110|      0|        goto end;
  111|      0|    }
  112|       |    /* check if property definition is in the cache already */
  113|      2|    if ((p = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem)) != NULL) {
  ------------------
  |  Branch (113:9): [True: 0, False: 2]
  ------------------
  114|      0|        ossl_property_free(*pl);
  115|      0|        *pl = p->defn;
  116|      0|        goto end;
  117|      0|    }
  118|      2|    len = strlen(prop);
  119|      2|    p = OPENSSL_malloc(sizeof(*p) + len);
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|      2|    if (p != NULL) {
  ------------------
  |  Branch (120:9): [True: 2, False: 0]
  ------------------
  121|      2|        p->prop = p->body;
  122|      2|        p->defn = *pl;
  123|      2|        memcpy(p->body, prop, len + 1);
  124|      2|        old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
  125|      2|        if (!ossl_assert(old == NULL))
  ------------------
  |  |   52|      2|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      2|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (125:13): [True: 0, False: 2]
  ------------------
  126|       |            /* This should not happen. An existing entry is handled above. */
  127|      0|            goto end;
  128|      2|        if (!lh_PROPERTY_DEFN_ELEM_error(property_defns))
  ------------------
  |  Branch (128:13): [True: 2, False: 0]
  ------------------
  129|      2|            goto end;
  130|      2|    }
  131|      0|    OPENSSL_free(p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|      0|    res = 0;
  133|      2| end:
  134|      2|    ossl_lib_ctx_unlock(ctx);
  135|      2|    return res;
  136|      0|}
defn_cache.c:property_defn_free:
   46|      2|{
   47|      2|    ossl_property_free(elem->defn);
   48|      2|    OPENSSL_free(elem);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|      2|}
defn_cache.c:property_defn_hash:
   35|    273|{
   36|    273|    return OPENSSL_LH_strhash(a->prop);
   37|    273|}
defn_cache.c:property_defn_cmp:
   41|    267|{
   42|    267|    return strcmp(a->prop, b->prop);
   43|    267|}

ossl_ctx_global_properties_free:
  115|      2|{
  116|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  117|       |
  118|      2|    if (globp != NULL) {
  ------------------
  |  Branch (118:9): [True: 2, False: 0]
  ------------------
  119|      2|        ossl_property_free(globp->list);
  120|      2|        OPENSSL_free(globp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      2|    }
  122|      2|}
ossl_ctx_global_properties_new:
  125|      4|{
  126|      4|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      4|}
ossl_ctx_global_properties:
  131|     44|{
  132|     44|    OSSL_GLOBAL_PROPERTIES *globp;
  133|       |
  134|     44|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  135|     44|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (135:9): [True: 0, False: 44]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      0|        return NULL;
  137|     44|#endif
  138|     44|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  114|     44|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  139|       |
  140|     44|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (140:12): [True: 44, False: 0]
  ------------------
  141|     44|}
ossl_method_store_new:
  244|     16|{
  245|     16|    OSSL_METHOD_STORE *res;
  246|       |
  247|     16|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|     16|    if (res != NULL) {
  ------------------
  |  Branch (248:9): [True: 16, False: 0]
  ------------------
  249|     16|        res->ctx = ctx;
  250|     16|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 16]
  ------------------
  251|     16|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (251:16): [True: 0, False: 16]
  ------------------
  252|     16|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (252:16): [True: 0, False: 16]
  ------------------
  253|      0|            ossl_method_store_free(res);
  254|      0|            return NULL;
  255|      0|        }
  256|     16|    }
  257|     16|    return res;
  258|     16|}
ossl_method_store_free:
  261|      8|{
  262|      8|    if (store != NULL) {
  ------------------
  |  Branch (262:9): [True: 8, False: 0]
  ------------------
  263|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (263:13): [True: 8, False: 0]
  ------------------
  264|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  265|      8|        ossl_sa_ALGORITHM_free(store->algs);
  266|      8|        CRYPTO_THREAD_lock_free(store->lock);
  267|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  268|      8|        OPENSSL_free(store);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  269|      8|    }
  270|      8|}
ossl_method_lock_store:
  273|  2.61k|{
  274|  2.61k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (274:12): [True: 2.61k, False: 0]
  ------------------
  275|  2.61k|}
ossl_method_unlock_store:
  278|  2.61k|{
  279|  2.61k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (279:12): [True: 2.61k, False: 0]
  ------------------
  280|  2.61k|}
ossl_method_store_add:
  321|    269|{
  322|    269|    ALGORITHM *alg = NULL;
  323|    269|    IMPLEMENTATION *impl;
  324|    269|    int ret = 0;
  325|    269|    int i;
  326|       |
  327|    269|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 269]
  |  Branch (327:21): [True: 0, False: 269]
  |  Branch (327:39): [True: 0, False: 269]
  ------------------
  328|      0|        return 0;
  329|       |
  330|    269|    if (properties == NULL)
  ------------------
  |  Branch (330:9): [True: 0, False: 269]
  ------------------
  331|      0|        properties = "";
  332|       |
  333|    269|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    269|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    269|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (333:9): [True: 0, False: 269]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* Create new entry */
  337|    269|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    269|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|    269|    if (impl == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 269]
  ------------------
  339|      0|        return 0;
  340|    269|    impl->method.method = method;
  341|    269|    impl->method.up_ref = method_up_ref;
  342|    269|    impl->method.free = method_destruct;
  343|    269|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 269]
  ------------------
  344|      0|        OPENSSL_free(impl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|      0|        return 0;
  346|      0|    }
  347|    269|    impl->provider = prov;
  348|       |
  349|       |    /* Insert into the hash table if required */
  350|    269|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (350:9): [True: 0, False: 269]
  ------------------
  351|      0|        impl_free(impl);
  352|      0|        return 0;
  353|      0|    }
  354|       |
  355|       |    /*
  356|       |     * Flush the alg cache of any implementation that already exists
  357|       |     * for this id.
  358|       |     * This is done to ensure that on the next lookup we go through the
  359|       |     * provider comparison in ossl_method_store_fetch.  If we don't do this
  360|       |     * then this new method won't be given a chance to get selected.
  361|       |     * NOTE: This doesn't actually remove the method from the backing store
  362|       |     * It just ensures that we query the backing store when (re)-adding a
  363|       |     * method to the algorithm cache, in case the one selected by the next
  364|       |     * query selects a different implementation
  365|       |     */
  366|    269|    ossl_method_cache_flush(store, nid);
  367|       |
  368|       |    /*
  369|       |     * Parse the properties associated with this method, and convert it to a
  370|       |     * property list stored against the implementation for later comparison
  371|       |     * during fetch operations
  372|       |     */
  373|    269|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (373:9): [True: 2, False: 267]
  ------------------
  374|      2|        impl->properties = ossl_parse_property(store->ctx, properties);
  375|      2|        if (impl->properties == NULL)
  ------------------
  |  Branch (375:13): [True: 0, False: 2]
  ------------------
  376|      0|            goto err;
  377|      2|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 2]
  ------------------
  378|      0|            ossl_property_free(impl->properties);
  379|      0|            impl->properties = NULL;
  380|      0|            goto err;
  381|      0|        }
  382|      2|    }
  383|       |
  384|       |    /*
  385|       |     * Check if we have an algorithm cache already for this nid.  If so use
  386|       |     * it, otherwise, create it, and insert it into the store
  387|       |     */
  388|    269|    alg = ossl_method_store_retrieve(store, nid);
  389|    269|    if (alg == NULL) {
  ------------------
  |  Branch (389:9): [True: 269, False: 0]
  ------------------
  390|    269|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|    269|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (390:13): [True: 0, False: 269]
  ------------------
  391|    269|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (391:20): [True: 0, False: 269]
  ------------------
  392|    269|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (392:20): [True: 0, False: 269]
  ------------------
  393|      0|            goto err;
  394|    269|        alg->nid = nid;
  395|    269|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (395:13): [True: 0, False: 269]
  ------------------
  396|      0|            goto err;
  397|    269|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    269|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    269|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  398|    269|    }
  399|       |
  400|       |    /* Push onto stack if there isn't one there already */
  401|    269|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (401:17): [True: 0, False: 269]
  ------------------
  402|      0|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  403|       |
  404|      0|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (404:13): [True: 0, False: 0]
  ------------------
  405|      0|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (405:16): [True: 0, False: 0]
  ------------------
  406|      0|            break;
  407|      0|    }
  408|       |
  409|    269|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (409:9): [True: 269, False: 0]
  ------------------
  410|    269|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (410:12): [True: 269, False: 0]
  ------------------
  411|    269|        ret = 1;
  412|    269|#ifndef FIPS_MODULE
  413|    269|        OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|    269|    do {                                        \
  |  |  221|    269|        BIO *trc_out = NULL;                    \
  |  |  222|    269|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  414|      0|            BIO_printf(trc_out, "Adding to method store "
  415|      0|                       "nid: %d\nproperties: %s\nprovider: %s\n",
  416|      0|                       nid, properties,
  417|      0|                       ossl_provider_name(prov) == NULL ? "none" :
  ------------------
  |  Branch (417:24): [True: 0, False: 0]
  ------------------
  418|      0|                       ossl_provider_name(prov));
  419|    269|        } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|    269|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|    269|#endif
  421|    269|    }
  422|    269|    ossl_property_unlock(store);
  423|    269|    if (ret == 0)
  ------------------
  |  Branch (423:9): [True: 0, False: 269]
  ------------------
  424|      0|        impl_free(impl);
  425|    269|    return ret;
  426|       |
  427|      0|err:
  428|      0|    ossl_property_unlock(store);
  429|      0|    alg_cleanup(0, alg, NULL);
  430|      0|    impl_free(impl);
  431|      0|    return 0;
  432|    269|}
ossl_method_store_fetch:
  624|    439|{
  625|    439|    OSSL_PROPERTY_LIST **plp;
  626|    439|    ALGORITHM *alg;
  627|    439|    IMPLEMENTATION *impl, *best_impl = NULL;
  628|    439|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  629|    439|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (629:33): [True: 439, False: 0]
  ------------------
  630|    439|    int ret = 0;
  631|    439|    int j, best = -1, score, optional;
  632|       |
  633|    439|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 439]
  |  Branch (633:21): [True: 0, False: 439]
  |  Branch (633:39): [True: 0, False: 439]
  ------------------
  634|      0|        return 0;
  635|       |
  636|    439|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  637|    439|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (637:9): [True: 439, False: 0]
  ------------------
  638|    439|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|    439|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (638:16): [True: 0, False: 439]
  ------------------
  639|      0|        return 0;
  640|    439|#endif
  641|       |
  642|       |    /* This only needs to be a read lock, because the query won't create anything */
  643|    439|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (643:9): [True: 0, False: 439]
  ------------------
  644|      0|        return 0;
  645|       |
  646|    439|    OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    439|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    439|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  647|    439|    alg = ossl_method_store_retrieve(store, nid);
  648|    439|    if (alg == NULL) {
  ------------------
  |  Branch (648:9): [True: 395, False: 44]
  ------------------
  649|    395|        ossl_property_unlock(store);
  650|    395|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    395|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    395|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  651|    395|        return 0;
  652|    395|    }
  653|     44|    OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|     44|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|     44|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  654|       |
  655|       |    /*
  656|       |     * If a property query string is provided, convert it to an
  657|       |     * OSSL_PROPERTY_LIST structure
  658|       |     */
  659|     44|    if (prop_query != NULL)
  ------------------
  |  Branch (659:9): [True: 44, False: 0]
  ------------------
  660|     44|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  661|       |
  662|       |    /*
  663|       |     * If the library context has default properties specified
  664|       |     * then merge those with the properties passed to this function
  665|       |     */
  666|     44|    plp = ossl_ctx_global_properties(store->ctx, 0);
  667|     44|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (667:9): [True: 44, False: 0]
  |  Branch (667:24): [True: 0, False: 44]
  ------------------
  668|      0|        if (pq == NULL) {
  ------------------
  |  Branch (668:13): [True: 0, False: 0]
  ------------------
  669|      0|            pq = *plp;
  670|      0|        } else {
  671|      0|            p2 = ossl_property_merge(pq, *plp);
  672|      0|            ossl_property_free(pq);
  673|      0|            if (p2 == NULL)
  ------------------
  |  Branch (673:17): [True: 0, False: 0]
  ------------------
  674|      0|                goto fin;
  675|      0|            pq = p2;
  676|      0|        }
  677|      0|    }
  678|       |
  679|       |    /*
  680|       |     * Search for a provider that provides this implementation.
  681|       |     * If the requested provider is NULL, then any provider will do,
  682|       |     * otherwise we should try to find the one that matches the requested
  683|       |     * provider.  Note that providers are given implicit preference via the
  684|       |     * ordering of the implementation stack
  685|       |     */
  686|     44|    if (pq == NULL) {
  ------------------
  |  Branch (686:9): [True: 0, False: 44]
  ------------------
  687|      0|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (687:21): [True: 0, False: 0]
  ------------------
  688|      0|            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (688:17): [True: 0, False: 0]
  ------------------
  689|      0|                && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (689:21): [True: 0, False: 0]
  |  Branch (689:37): [True: 0, False: 0]
  ------------------
  690|      0|                best_impl = impl;
  691|      0|                ret = 1;
  692|      0|                break;
  693|      0|            }
  694|      0|        }
  695|      0|        goto fin;
  696|      0|    }
  697|       |
  698|       |    /*
  699|       |     * If there are optional properties specified
  700|       |     * then run the search again, and select the provider that matches the
  701|       |     * most options
  702|       |     */
  703|     44|    optional = ossl_property_has_optional(pq);
  704|     44|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (704:17): [True: 44, False: 0]
  ------------------
  705|     44|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (705:13): [True: 44, False: 0]
  ------------------
  706|     44|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (706:17): [True: 44, False: 0]
  |  Branch (706:33): [True: 0, False: 0]
  ------------------
  707|     44|            score = ossl_property_match_count(pq, impl->properties);
  708|     44|            if (score > best) {
  ------------------
  |  Branch (708:17): [True: 44, False: 0]
  ------------------
  709|     44|                best_impl = impl;
  710|     44|                best = score;
  711|     44|                ret = 1;
  712|     44|                if (!optional)
  ------------------
  |  Branch (712:21): [True: 44, False: 0]
  ------------------
  713|     44|                    goto fin;
  714|     44|            }
  715|     44|        }
  716|     44|    }
  717|     44|fin:
  718|     44|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (718:9): [True: 44, False: 0]
  |  Branch (718:16): [True: 44, False: 0]
  ------------------
  719|     44|        *method = best_impl->method.method;
  720|     44|        if (prov_rw != NULL)
  ------------------
  |  Branch (720:13): [True: 44, False: 0]
  ------------------
  721|     44|            *prov_rw = best_impl->provider;
  722|     44|    } else {
  723|      0|        ret = 0;
  724|      0|    }
  725|       |
  726|     44|#ifndef FIPS_MODULE
  727|     44|    OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|     44|    do {                                        \
  |  |  221|     44|        BIO *trc_out = NULL;                    \
  |  |  222|     44|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  728|      0|        char buf[512];
  729|      0|        int size;
  730|       |
  731|      0|        size = ossl_property_list_to_string(NULL, pq, buf, 512);
  732|      0|        BIO_printf(trc_out, "method store query with properties %s "
  733|      0|                   "resolves to provider %s\n",
  734|      0|                   size == 0 ? "none" : buf,
  ------------------
  |  Branch (734:20): [True: 0, False: 0]
  ------------------
  735|      0|                   best_impl == NULL ? "none" :
  ------------------
  |  Branch (735:20): [True: 0, False: 0]
  ------------------
  736|      0|                   ossl_provider_name(best_impl->provider));
  737|     44|    } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|     44|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  738|     44|#endif
  739|       |
  740|     44|    ossl_property_unlock(store);
  741|     44|    ossl_property_free(p2);
  742|     44|    return ret;
  743|     44|}
ossl_method_store_cache_flush_all:
  761|      8|{
  762|      8|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (762:9): [True: 0, False: 8]
  ------------------
  763|      0|        return 0;
  764|      8|    ossl_sa_ALGORITHM_doall(store->algs, &impl_cache_flush_alg);
  765|      8|    store->cache_nelem = 0;
  766|      8|    ossl_property_unlock(store);
  767|      8|    return 1;
  768|      8|}
ossl_method_store_cache_get:
  846|  9.64k|{
  847|  9.64k|    ALGORITHM *alg;
  848|  9.64k|    QUERY elem, *r;
  849|  9.64k|    int res = 0;
  850|       |
  851|  9.64k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (851:9): [True: 0, False: 9.64k]
  |  Branch (851:21): [True: 0, False: 9.64k]
  |  Branch (851:38): [True: 0, False: 9.64k]
  ------------------
  852|      0|        return 0;
  853|       |
  854|  9.64k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (854:9): [True: 0, False: 9.64k]
  ------------------
  855|      0|        return 0;
  856|  9.64k|    alg = ossl_method_store_retrieve(store, nid);
  857|  9.64k|    if (alg == NULL)
  ------------------
  |  Branch (857:9): [True: 398, False: 9.24k]
  ------------------
  858|    398|        goto err;
  859|       |
  860|  9.24k|    elem.query = prop_query;
  861|  9.24k|    elem.provider = prov;
  862|  9.24k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  863|  9.24k|    if (r == NULL)
  ------------------
  |  Branch (863:9): [True: 39, False: 9.20k]
  ------------------
  864|     39|        goto err;
  865|  9.20k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (865:9): [True: 9.20k, False: 0]
  ------------------
  866|  9.20k|        *method = r->method.method;
  867|  9.20k|        res = 1;
  868|  9.20k|    }
  869|  9.64k|err:
  870|  9.64k|    ossl_property_unlock(store);
  871|  9.64k|    return res;
  872|  9.20k|}
ossl_method_store_cache_set:
  878|     44|{
  879|     44|    QUERY elem, *old, *p = NULL;
  880|     44|    ALGORITHM *alg;
  881|     44|    size_t len;
  882|     44|    int res = 1;
  883|       |
  884|     44|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (884:9): [True: 0, False: 44]
  |  Branch (884:21): [True: 0, False: 44]
  |  Branch (884:38): [True: 0, False: 44]
  ------------------
  885|      0|        return 0;
  886|       |
  887|     44|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|     44|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     44|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (887:9): [True: 0, False: 44]
  ------------------
  888|      0|        return 0;
  889|       |
  890|     44|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (890:9): [True: 0, False: 44]
  ------------------
  891|      0|        return 0;
  892|     44|    if (store->cache_need_flush)
  ------------------
  |  Branch (892:9): [True: 0, False: 44]
  ------------------
  893|      0|        ossl_method_cache_flush_some(store);
  894|     44|    alg = ossl_method_store_retrieve(store, nid);
  895|     44|    if (alg == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 44]
  ------------------
  896|      0|        goto err;
  897|       |
  898|     44|    if (method == NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 44]
  ------------------
  899|      0|        elem.query = prop_query;
  900|      0|        elem.provider = prov;
  901|      0|        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
  ------------------
  |  Branch (901:13): [True: 0, False: 0]
  ------------------
  902|      0|            impl_cache_free(old);
  903|      0|            store->cache_nelem--;
  904|      0|        }
  905|      0|        goto end;
  906|      0|    }
  907|     44|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  102|     44|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     44|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     44|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  908|     44|    if (p != NULL) {
  ------------------
  |  Branch (908:9): [True: 44, False: 0]
  ------------------
  909|     44|        p->query = p->body;
  910|     44|        p->provider = prov;
  911|     44|        p->method.method = method;
  912|     44|        p->method.up_ref = method_up_ref;
  913|     44|        p->method.free = method_destruct;
  914|     44|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (914:13): [True: 0, False: 44]
  ------------------
  915|      0|            goto err;
  916|     44|        memcpy((char *)p->query, prop_query, len + 1);
  917|     44|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (917:13): [True: 0, False: 44]
  ------------------
  918|      0|            impl_cache_free(old);
  919|      0|            goto end;
  920|      0|        }
  921|     44|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (921:13): [True: 44, False: 0]
  ------------------
  922|     44|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   34|     44|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (922:17): [True: 0, False: 44]
  ------------------
  923|      0|                store->cache_need_flush = 1;
  924|     44|            goto end;
  925|     44|        }
  926|      0|        ossl_method_free(&p->method);
  927|      0|    }
  928|      0|err:
  929|      0|    res = 0;
  930|      0|    OPENSSL_free(p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  931|     44|end:
  932|     44|    ossl_property_unlock(store);
  933|     44|    return res;
  934|      0|}
property.c:alg_cleanup:
  226|    269|{
  227|    269|    OSSL_METHOD_STORE *store = arg;
  228|       |
  229|    269|    if (a != NULL) {
  ------------------
  |  Branch (229:9): [True: 269, False: 0]
  ------------------
  230|    269|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  231|    269|        lh_QUERY_doall(a->cache, &impl_cache_free);
  232|    269|        lh_QUERY_free(a->cache);
  233|    269|        OPENSSL_free(a);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|    269|    }
  235|    269|    if (store != NULL)
  ------------------
  |  Branch (235:9): [True: 269, False: 0]
  ------------------
  236|    269|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  237|    269|}
property.c:ossl_method_up_ref:
  163|  9.56k|{
  164|  9.56k|    return (*method->up_ref)(method->method);
  165|  9.56k|}
property.c:ossl_property_write_lock:
  178|    321|{
  179|    321|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (179:12): [True: 321, False: 0]
  ------------------
  180|    321|}
property.c:impl_free:
  204|    269|{
  205|    269|    if (impl != NULL) {
  ------------------
  |  Branch (205:9): [True: 269, False: 0]
  ------------------
  206|    269|        ossl_method_free(&impl->method);
  207|    269|        OPENSSL_free(impl);
  ------------------
  |  |  115|    269|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    269|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    269|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|    269|    }
  209|    269|}
property.c:ossl_method_store_retrieve:
  283|  10.6k|{
  284|  10.6k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  285|  10.6k|}
property.c:query_hash:
  188|  9.28k|{
  189|  9.28k|    return OPENSSL_LH_strhash(a->query);
  190|  9.28k|}
property.c:query_cmp:
  193|  9.20k|{
  194|  9.20k|    int res = strcmp(a->query, b->query);
  195|       |
  196|  9.20k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (196:9): [True: 9.20k, False: 0]
  |  Branch (196:21): [True: 9.20k, False: 0]
  |  Branch (196:44): [True: 0, False: 9.20k]
  ------------------
  197|      0|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (197:15): [True: 0, False: 0]
  ------------------
  198|      0|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (198:15): [True: 0, False: 0]
  ------------------
  199|      0|            : 0;
  200|  9.20k|    return res;
  201|  9.20k|}
property.c:ossl_method_store_insert:
  288|    269|{
  289|    269|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  290|    269|}
property.c:ossl_property_unlock:
  183|  10.4k|{
  184|  10.4k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (184:12): [True: 10.4k, False: 0]
  ------------------
  185|  10.4k|}
property.c:ossl_property_read_lock:
  173|  10.0k|{
  174|  10.0k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (174:12): [True: 10.0k, False: 0]
  ------------------
  175|  10.0k|}
property.c:ossl_method_cache_flush:
  753|    269|{
  754|    269|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  755|       |
  756|    269|    if (alg != NULL)
  ------------------
  |  Branch (756:9): [True: 0, False: 269]
  ------------------
  757|      0|        ossl_method_cache_flush_alg(store, alg);
  758|    269|}
property.c:impl_cache_free:
  212|     44|{
  213|     44|    if (elem != NULL) {
  ------------------
  |  Branch (213:9): [True: 44, False: 0]
  ------------------
  214|     44|        ossl_method_free(&elem->method);
  215|     44|        OPENSSL_free(elem);
  ------------------
  |  |  115|     44|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     44|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     44|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|     44|    }
  217|     44|}
property.c:ossl_method_free:
  168|    313|{
  169|    313|    (*method->free)(method->method);
  170|    313|}

ossl_err_load_PROP_strings:
   40|      2|{
   41|      2|#ifndef OPENSSL_NO_ERR
   42|      2|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        ERR_load_strings_const(PROP_str_reasons);
   44|      2|#endif
   45|      2|    return 1;
   46|      2|}

ossl_parse_property:
  346|      2|{
  347|      2|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|      2|    OSSL_PROPERTY_LIST *res = NULL;
  349|      2|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|      2|    const char *s = defn;
  351|      2|    int done;
  352|       |
  353|      2|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 2]
  |  Branch (353:22): [True: 0, False: 2]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|      2|    s = skip_space(s);
  357|      2|    done = *s == '\0';
  358|      4|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 2, False: 2]
  ------------------
  359|      2|        const char *start = s;
  360|       |
  361|      2|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      2|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 2]
  ------------------
  363|      0|            goto err;
  364|      2|        memset(&prop->v, 0, sizeof(prop->v));
  365|      2|        prop->optional = 0;
  366|      2|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 2]
  ------------------
  367|      0|            goto err;
  368|      2|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|      2|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 2]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  371|      0|                           "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|      2|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 2, False: 0]
  ------------------
  375|      2|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 2]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|# define PROP_R_NO_VALUE                                  107
  ------------------
  377|      0|                               "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|      2|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  384|      0|        }
  385|       |
  386|      2|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 2]
  ------------------
  387|      0|            goto err;
  388|      2|        prop = NULL;
  389|      2|        done = !match_ch(&s, ',');
  390|      2|    }
  391|      2|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 2]
  ------------------
  392|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  393|      0|                       "HERE-->%s", s);
  394|      0|        goto err;
  395|      0|    }
  396|      2|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|      2|err:
  399|      2|    OPENSSL_free(prop);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|      2|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|      2|    return res;
  402|      2|}
ossl_parse_query:
  406|     44|{
  407|     44|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|     44|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|     44|    OSSL_PROPERTY_LIST *res = NULL;
  409|     44|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|     44|    int done;
  411|       |
  412|     44|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 44]
  |  Branch (412:22): [True: 0, False: 44]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|     44|    s = skip_space(s);
  416|     44|    done = *s == '\0';
  417|     44|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 0, False: 44]
  ------------------
  418|      0|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      0|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 0]
  ------------------
  420|      0|            goto err;
  421|      0|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|      0|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  425|      0|            prop->optional = 0;
  426|      0|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  ------------------
  427|      0|                goto err;
  428|      0|            goto skip_value;
  429|      0|        }
  430|      0|        prop->optional = match_ch(&s, '?');
  431|      0|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            goto err;
  433|       |
  434|      0|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 0, False: 0]
  ------------------
  435|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|      0|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   43|      0|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (43:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  437|      0|            prop->oper = OSSL_PROPERTY_OPER_NE;
  438|      0|        } else {
  439|       |            /* A name alone is a Boolean comparison for true */
  440|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  441|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  442|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  443|      0|            goto skip_value;
  444|      0|        }
  445|      0|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|      0|skip_value:
  449|      0|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  ------------------
  450|      0|            goto err;
  451|      0|        prop = NULL;
  452|      0|        done = !match_ch(&s, ',');
  453|      0|    }
  454|     44|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 44]
  ------------------
  455|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  456|      0|                       "HERE-->%s", s);
  457|      0|        goto err;
  458|      0|    }
  459|     44|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|     44|err:
  462|     44|    OPENSSL_free(prop);
  ------------------
  |  |  115|     44|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     44|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     44|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|     44|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|     44|    return res;
  465|     44|}
ossl_property_match_count:
  473|     44|{
  474|     44|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|     44|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|     44|    int i = 0, j = 0, matches = 0;
  477|     44|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|     44|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 0, False: 44]
  ------------------
  480|      0|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|            i++;
  482|      0|            continue;
  483|      0|        }
  484|      0|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            if (q[i].name_idx > d[j].name_idx) {  /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 0, False: 0]
  ------------------
  486|      0|                j++;
  487|      0|                continue;
  488|      0|            }
  489|      0|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (490:32): [True: 0, False: 0]
  ------------------
  491|      0|                               && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (491:35): [True: 0, False: 0]
  ------------------
  492|       |
  493|      0|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (493:22): [True: 0, False: 0]
  |  Branch (493:28): [True: 0, False: 0]
  ------------------
  494|      0|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (494:25): [True: 0, False: 0]
  |  Branch (494:32): [True: 0, False: 0]
  ------------------
  495|      0|                    matches++;
  496|      0|                else if (!q[i].optional)
  ------------------
  |  Branch (496:26): [True: 0, False: 0]
  ------------------
  497|      0|                    return -1;
  498|      0|                i++;
  499|      0|                j++;
  500|      0|                continue;
  501|      0|            }
  502|      0|        }
  503|       |
  504|       |        /*
  505|       |         * Handle the cases of a missing value and a query with no corresponding
  506|       |         * definition.  The former fails for any comparison except inequality,
  507|       |         * the latter is treated as a comparison against the Boolean false.
  508|       |         */
  509|      0|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                matches++;
  512|      0|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 0, False: 0]
  ------------------
  513|      0|                return -1;
  514|      0|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (514:20): [True: 0, False: 0]
  ------------------
  515|      0|                   || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (515:24): [True: 0, False: 0]
  ------------------
  516|      0|                       && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (516:27): [True: 0, False: 0]
  ------------------
  517|      0|                   || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (517:24): [True: 0, False: 0]
  ------------------
  518|      0|                       && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (518:27): [True: 0, False: 0]
  ------------------
  519|      0|            if (!q[i].optional)
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                return -1;
  521|      0|        } else {
  522|      0|            matches++;
  523|      0|        }
  524|      0|        i++;
  525|      0|    }
  526|     44|    return matches;
  527|     44|}
ossl_property_free:
  530|     48|{
  531|     48|    OPENSSL_free(p);
  ------------------
  |  |  115|     48|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     48|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     48|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|     48|}
ossl_property_parse_init:
  575|      4|{
  576|      4|    static const char *const predefined_names[] = {
  577|      4|        "provider",     /* Name of provider (default, legacy, fips) */
  578|      4|        "version",      /* Version number of this provider */
  579|      4|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  580|      4|        "output",       /* Output type for encoders */
  581|      4|        "input",        /* Input type for decoders */
  582|      4|        "structure",    /* Structure name for encoders and decoders */
  583|      4|    };
  584|      4|    size_t i;
  585|       |
  586|     28|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     28|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 24, False: 4]
  ------------------
  587|     24|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 24]
  ------------------
  588|      0|            goto err;
  589|       |
  590|       |    /*
  591|       |     * Pre-populate the two Boolean values. We must do them before any other
  592|       |     * values and in this order so that we get the same index as the global
  593|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  594|       |     */
  595|      4|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      4|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (595:9): [True: 0, False: 4]
  ------------------
  596|      4|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      4|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (596:12): [True: 0, False: 4]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      4|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      4|}
property_parse.c:skip_space:
   26|     52|{
   27|     52|    while (ossl_isspace(*s))
  ------------------
  |  |   82|     52|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     52|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 52]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|     52|    return s;
   30|     52|}
property_parse.c:parse_name:
   58|      2|{
   59|      2|    char name[100];
   60|      2|    int err = 0;
   61|      2|    size_t i = 0;
   62|      2|    const char *s = *t;
   63|      2|    int user_name = 0;
   64|       |
   65|      2|    for (;;) {
   66|      2|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|      2|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      2|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      2|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 2]
  ------------------
   67|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   30|      0|# define PROP_R_NOT_AN_IDENTIFIER                         103
  ------------------
   68|      0|                           "HERE-->%s", *t);
   69|      0|            return 0;
   70|      0|        }
   71|     16|        do {
   72|     16|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 16, False: 0]
  ------------------
   73|     16|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|     16|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|     16|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|     16|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|     16|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|     16|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|     16|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|     16|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 14, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 16]
  ------------------
   77|      2|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 2, False: 0]
  ------------------
   78|      2|            break;
   79|      0|        user_name = 1;
   80|      0|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|            name[i++] = *s;
   82|      0|        else
   83|      0|            err = 1;
   84|      0|        s++;
   85|      0|    }
   86|      2|    name[i] = '\0';
   87|      2|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 2]
  ------------------
   88|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   27|      0|# define PROP_R_NAME_TOO_LONG                             100
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|      2|    *t = skip_space(s);
   92|      2|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 2]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|      2|    return 1;
   94|      2|}
property_parse.c:match_ch:
   33|      4|{
   34|      4|    const char *s = *t;
   35|       |
   36|      4|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 2, False: 2]
  ------------------
   37|      2|        *t = skip_space(s + 1);
   38|      2|        return 1;
   39|      2|    }
   40|      2|    return 0;
   41|      4|}
property_parse.c:parse_value:
  258|      2|{
  259|      2|    const char *s = *t;
  260|      2|    int r = 0;
  261|       |
  262|      2|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 2]
  |  Branch (262:22): [True: 0, False: 2]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|      2|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 2]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|      2|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 2]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|      2|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 2]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|      2|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 2]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|      2|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 2]
  ------------------
  279|      0|        return parse_number(t, res);
  280|      2|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|      2|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      2|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      2|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  281|      2|        return parse_unquoted(ctx, t, res, create);
  282|      0|    if (r)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        *t = s;
  284|      0|    return r;
  285|      2|}
property_parse.c:parse_unquoted:
  226|      2|{
  227|      2|    char v[1000];
  228|      2|    const char *s = *t;
  229|      2|    size_t i = 0;
  230|      2|    int err = 0;
  231|       |
  232|      2|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 2]
  |  Branch (232:23): [True: 0, False: 2]
  ------------------
  233|      0|        return 0;
  234|     18|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|     36|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|     18|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 16, False: 2]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|     34|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     16|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 16, False: 0]
  |  Branch (234:53): [True: 16, False: 0]
  ------------------
  235|     16|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 16, False: 0]
  ------------------
  236|     16|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|     16|        s++;
  240|     16|    }
  241|      2|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|      4|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|      2|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 2, False: 0]
  |  Branch (241:30): [True: 0, False: 2]
  |  Branch (241:44): [True: 0, False: 0]
  ------------------
  242|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   28|      0|# define PROP_R_NOT_AN_ASCII_CHARACTER                    101
  ------------------
  243|      0|                       "HERE-->%s", s);
  244|      0|        return 0;
  245|      0|    }
  246|      2|    v[i] = 0;
  247|      2|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 2]
  ------------------
  248|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|      0|# define PROP_R_STRING_TOO_LONG                           109
  ------------------
  249|      2|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 2]
  ------------------
  250|      0|        err = 1;
  251|      2|    *t = skip_space(s);
  252|      2|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|      2|    return !err;
  254|      2|}
property_parse.c:stack_to_property_list:
  314|     46|{
  315|     46|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|     46|    OSSL_PROPERTY_LIST *r;
  317|     46|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|     46|    int i;
  319|       |
  320|     46|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|     92|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     46|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     46|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 44, False: 2]
  |  |  ------------------
  ------------------
  321|     46|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|     46|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 46, False: 0]
  ------------------
  323|     46|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|     46|        r->has_optional = 0;
  326|     48|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 2, False: 46]
  ------------------
  327|      2|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|      2|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|      2|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 0, False: 2]
  |  Branch (331:26): [True: 0, False: 0]
  ------------------
  332|      0|                OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  334|      0|                               "Duplicated name `%s'",
  335|      0|                               ossl_property_name_str(ctx, prev_name_idx));
  336|      0|                return NULL;
  337|      0|            }
  338|      2|            prev_name_idx = r->properties[i].name_idx;
  339|      2|        }
  340|     46|        r->num_properties = n;
  341|     46|    }
  342|     46|    return r;
  343|     46|}
property_parse.c:pd_free:
  301|      2|{
  302|      2|    OPENSSL_free(pd);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|      2|}

ossl_property_has_optional:
   63|     44|{
   64|     44|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (64:12): [True: 0, False: 44]
  ------------------
   65|     44|}

ossl_property_string_data_free:
   77|      2|{
   78|      2|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|      2|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 2]
  ------------------
   81|      0|        return;
   82|       |
   83|      2|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|      2|    property_table_free(&propdata->prop_names);
   85|      2|    property_table_free(&propdata->prop_values);
   86|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|      2|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|      2|#endif
   91|      2|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|      2|    OPENSSL_free(propdata);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|      2|}
ossl_property_string_data_new:
   96|      4|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      4|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|       |
   99|      4|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 4]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      4|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      4|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      4|                                                  &property_cmp);
  105|      4|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      4|                                                   &property_cmp);
  107|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      4|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      4|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      4|#endif
  111|      4|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 4]
  ------------------
  112|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      4|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 4]
  ------------------
  114|      4|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 4]
  ------------------
  115|      4|#endif
  116|      4|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 4]
  ------------------
  117|      4|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 4]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      4|    return propdata;
  122|      4|}
ossl_property_name:
  253|     26|{
  254|     26|    return ossl_property_string(ctx, 1, create, s);
  255|     26|}
ossl_property_value:
  264|     10|{
  265|     10|    return ossl_property_string(ctx, 0, create, s);
  266|     10|}
property_string.c:property_table_free:
   66|      4|{
   67|      4|    PROP_TABLE *t = *pt;
   68|       |
   69|      4|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 4, False: 0]
  ------------------
   70|      4|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      4|        lh_PROPERTY_STRING_free(t);
   72|      4|        *pt = NULL;
   73|      4|    }
   74|      4|}
property_string.c:property_free:
   61|     18|{
   62|     18|    OPENSSL_free(ps);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     18|}
property_string.c:property_hash:
   51|    104|{
   52|    104|    return OPENSSL_LH_strhash(a->s);
   53|    104|}
property_string.c:property_cmp:
   56|      2|{
   57|      2|    return strcmp(a->s, b->s);
   58|      2|}
property_string.c:ossl_property_string:
  144|     36|{
  145|     36|    PROPERTY_STRING p, *ps, *ps_new;
  146|     36|    PROP_TABLE *t;
  147|     36|    OSSL_PROPERTY_IDX *pidx;
  148|     36|    PROPERTY_STRING_DATA *propdata
  149|     36|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|     36|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|     36|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 36]
  ------------------
  152|      0|        return 0;
  153|       |
  154|     36|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 26, False: 10]
  ------------------
  155|     36|    p.s = s;
  156|     36|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 36]
  ------------------
  157|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|     36|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|     36|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 34, False: 2]
  |  Branch (161:23): [True: 34, False: 0]
  ------------------
  162|     34|        CRYPTO_THREAD_unlock(propdata->lock);
  163|     34|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 34]
  ------------------
  164|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|            return 0;
  166|      0|        }
  167|     34|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 24, False: 10]
  ------------------
  168|     34|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|     34|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 34, False: 0]
  |  Branch (169:27): [True: 34, False: 0]
  ------------------
  170|     34|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|     34|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|     34|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|     34|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 24, False: 10]
  ------------------
  174|     34|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  265|     34|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (174:17): [True: 0, False: 34]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|     34|#endif
  180|     34|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|     34|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 34]
  ------------------
  182|       |                /*-
  183|       |                 * Undo the previous push which means also decrementing the
  184|       |                 * index and freeing the allocated storage.
  185|       |                 */
  186|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  187|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  267|      0|#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
  ------------------
  188|      0|#endif
  189|      0|                property_free(ps_new);
  190|      0|                --*pidx;
  191|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  192|      0|                return 0;
  193|      0|            }
  194|     34|            ps = ps_new;
  195|     34|        }
  196|     34|    }
  197|     36|    CRYPTO_THREAD_unlock(propdata->lock);
  198|     36|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 36, False: 0]
  ------------------
  199|     36|}
property_string.c:new_property_string:
  126|     34|{
  127|     34|    const size_t l = strlen(s);
  128|     34|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|     34|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     34|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     34|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|     34|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 34, False: 0]
  ------------------
  131|     34|        memcpy(ps->body, s, l + 1);
  132|     34|        ps->s = ps->body;
  133|     34|        ps->idx = ++*pidx;
  134|     34|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 34]
  ------------------
  135|      0|            OPENSSL_free(ps);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|      0|            return NULL;
  137|      0|        }
  138|     34|    }
  139|     34|    return ps;
  140|     34|}

OSSL_PROVIDER_try_load_ex:
   20|      2|{
   21|      2|    OSSL_PROVIDER *prov = NULL, *actual;
   22|      2|    int isnew = 0;
   23|       |
   24|       |    /* Find it or create it */
   25|      2|    if ((prov = ossl_provider_find(libctx, name, 0)) == NULL) {
  ------------------
  |  Branch (25:9): [True: 2, False: 0]
  ------------------
   26|      2|        if ((prov = ossl_provider_new(libctx, name, NULL, params, 0)) == NULL)
  ------------------
  |  Branch (26:13): [True: 0, False: 2]
  ------------------
   27|      0|            return NULL;
   28|      2|        isnew = 1;
   29|      2|    }
   30|       |
   31|      2|    if (!ossl_provider_activate(prov, 1, 0)) {
  ------------------
  |  Branch (31:9): [True: 0, False: 2]
  ------------------
   32|      0|        ossl_provider_free(prov);
   33|      0|        return NULL;
   34|      0|    }
   35|       |
   36|      2|    actual = prov;
   37|      2|    if (isnew && !ossl_provider_add_to_store(prov, &actual, retain_fallbacks)) {
  ------------------
  |  Branch (37:9): [True: 2, False: 0]
  |  Branch (37:18): [True: 0, False: 2]
  ------------------
   38|      0|        ossl_provider_deactivate(prov, 1);
   39|      0|        ossl_provider_free(prov);
   40|      0|        return NULL;
   41|      0|    }
   42|      2|    if (actual != prov) {
  ------------------
  |  Branch (42:9): [True: 0, False: 2]
  ------------------
   43|      0|        if (!ossl_provider_activate(actual, 1, 0)) {
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            ossl_provider_free(actual);
   45|      0|            return NULL;
   46|      0|        }
   47|      0|    }
   48|       |
   49|      2|    return actual;
   50|      2|}
OSSL_PROVIDER_try_load:
   54|      2|{
   55|      2|    return OSSL_PROVIDER_try_load_ex(libctx, name, NULL, retain_fallbacks);
   56|      2|}
OSSL_PROVIDER_get_capabilities:
  122|    316|{
  123|    316|    return ossl_provider_get_capabilities(prov, capability, cb, arg);
  124|    316|}
OSSL_PROVIDER_add_builtin:
  128|      2|{
  129|      2|    OSSL_PROVIDER_INFO entry;
  130|       |
  131|      2|    if (name == NULL || init_fn == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  |  Branch (131:25): [True: 0, False: 2]
  ------------------
  132|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        return 0;
  134|      0|    }
  135|      2|    memset(&entry, 0, sizeof(entry));
  136|      2|    entry.name = OPENSSL_strdup(name);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|      2|    if (entry.name == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  ------------------
  138|      0|        return 0;
  139|      2|    entry.init = init_fn;
  140|      2|    if (!ossl_provider_info_add_to_store(libctx, &entry)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|        ossl_provider_info_clear(&entry);
  142|      0|        return 0;
  143|      0|    }
  144|      2|    return 1;
  145|      2|}
OSSL_PROVIDER_do_all:
  156|    158|{
  157|    158|    return ossl_provider_doall_activated(ctx, cb, cbdata);
  158|    158|}

ossl_child_prov_ctx_new:
   38|      4|{
   39|      4|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      4|}
ossl_child_prov_ctx_free:
   43|      2|{
   44|      2|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      2|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      2|    OPENSSL_free(gbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      2|}

ossl_prov_conf_ctx_new:
   31|      4|{
   32|      4|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|      4|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 4]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      4|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      4|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 4]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|      4|    return pcgbl;
   44|      4|}
ossl_prov_conf_ctx_free:
   47|      2|{
   48|      2|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      2|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      2|                              ossl_provider_free);
   52|       |
   53|      2|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      2|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      2|    OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

ossl_provider_info_clear:
  281|      2|{
  282|      2|    OPENSSL_free(info->name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  283|      2|    OPENSSL_free(info->path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  284|      2|    sk_INFOPAIR_pop_free(info->parameters, infopair_free);
  285|      2|}
ossl_provider_store_free:
  288|      2|{
  289|      2|    struct provider_store_st *store = vstore;
  290|      2|    size_t i;
  291|       |
  292|      2|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 2]
  ------------------
  293|      0|        return;
  294|      2|    store->freeing = 1;
  295|      2|    OPENSSL_free(store->default_path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      2|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|      2|#ifndef FIPS_MODULE
  298|      2|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|      2|                                       ossl_provider_child_cb_free);
  300|      2|#endif
  301|      2|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|      2|    CRYPTO_THREAD_lock_free(store->lock);
  303|      4|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 2, False: 2]
  ------------------
  304|      2|        ossl_provider_info_clear(&store->provinfo[i]);
  305|      2|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|      2|    OPENSSL_free(store);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|      2|}
ossl_provider_store_new:
  310|      4|{
  311|      4|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|       |
  313|      4|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 4]
  ------------------
  314|      4|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 4]
  ------------------
  315|      4|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 4]
  ------------------
  316|      4|#ifndef FIPS_MODULE
  317|      4|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 4]
  ------------------
  318|      4|#endif
  319|      4|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 4]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|      4|    store->libctx = ctx;
  324|      4|    store->use_fallbacks = 1;
  325|       |
  326|      4|    return store;
  327|      4|}
ossl_provider_info_add_to_store:
  357|      2|{
  358|      2|    struct provider_store_st *store = get_provider_store(libctx);
  359|      2|    int ret = 0;
  360|       |
  361|      2|    if (entry->name == NULL) {
  ------------------
  |  Branch (361:9): [True: 0, False: 2]
  ------------------
  362|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|        return 0;
  364|      0|    }
  365|       |
  366|      2|    if (store == NULL) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        return 0;
  369|      0|    }
  370|       |
  371|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        return 0;
  373|      2|    if (store->provinfosz == 0) {
  ------------------
  |  Branch (373:9): [True: 2, False: 0]
  ------------------
  374|      2|        store->provinfo = OPENSSL_zalloc(sizeof(*store->provinfo)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  375|      2|                                         * BUILTINS_BLOCK_SIZE);
  376|      2|        if (store->provinfo == NULL)
  ------------------
  |  Branch (376:13): [True: 0, False: 2]
  ------------------
  377|      0|            goto err;
  378|      2|        store->provinfosz = BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  353|      2|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  379|      2|    } else if (store->numprovinfo == store->provinfosz) {
  ------------------
  |  Branch (379:16): [True: 0, False: 0]
  ------------------
  380|      0|        OSSL_PROVIDER_INFO *tmpbuiltins;
  381|      0|        size_t newsz = store->provinfosz + BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  353|      0|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  382|       |
  383|      0|        tmpbuiltins = OPENSSL_realloc(store->provinfo,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  384|      0|                                      sizeof(*store->provinfo) * newsz);
  385|      0|        if (tmpbuiltins == NULL)
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      0|            goto err;
  387|      0|        store->provinfo = tmpbuiltins;
  388|      0|        store->provinfosz = newsz;
  389|      0|    }
  390|      2|    store->provinfo[store->numprovinfo] = *entry;
  391|      2|    store->numprovinfo++;
  392|       |
  393|      2|    ret = 1;
  394|      2| err:
  395|      2|    CRYPTO_THREAD_unlock(store->lock);
  396|      2|    return ret;
  397|      2|}
ossl_provider_find:
  401|      2|{
  402|      2|    struct provider_store_st *store = NULL;
  403|      2|    OSSL_PROVIDER *prov = NULL;
  404|       |
  405|      2|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (405:9): [True: 2, False: 0]
  ------------------
  406|      2|        OSSL_PROVIDER tmpl = { 0, };
  407|      2|        int i;
  408|       |
  409|      2|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  410|       |        /*
  411|       |         * Make sure any providers are loaded from config before we try to find
  412|       |         * them.
  413|       |         */
  414|      2|        if (!noconfig) {
  ------------------
  |  Branch (414:13): [True: 2, False: 0]
  ------------------
  415|      2|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (415:17): [True: 2, False: 0]
  ------------------
  416|      2|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  417|      2|        }
  418|      2|#endif
  419|       |
  420|      2|        tmpl.name = (char *)name;
  421|      2|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (421:13): [True: 0, False: 2]
  ------------------
  422|      0|            return NULL;
  423|      2|        sk_OSSL_PROVIDER_sort(store->providers);
  424|      2|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (424:13): [True: 0, False: 2]
  ------------------
  425|      0|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  426|      2|        CRYPTO_THREAD_unlock(store->lock);
  427|      2|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (427:13): [True: 0, False: 2]
  |  Branch (427:29): [True: 0, False: 0]
  ------------------
  428|      0|            prov = NULL;
  429|      2|    }
  430|       |
  431|      2|    return prov;
  432|      2|}
ossl_provider_up_ref:
  477|    271|{
  478|    271|    int ref = 0;
  479|       |
  480|    271|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 271]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    271|#ifndef FIPS_MODULE
  484|    271|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 271]
  ------------------
  485|      0|        if (!ossl_provider_up_ref_parent(prov, 0)) {
  ------------------
  |  Branch (485:13): [True: 0, False: 0]
  ------------------
  486|      0|            ossl_provider_free(prov);
  487|      0|            return 0;
  488|      0|        }
  489|      0|    }
  490|    271|#endif
  491|       |
  492|    271|    return ref;
  493|    271|}
ossl_provider_new:
  522|      2|{
  523|      2|    struct provider_store_st *store = NULL;
  524|      2|    OSSL_PROVIDER_INFO template;
  525|      2|    OSSL_PROVIDER *prov = NULL;
  526|       |
  527|      2|    if ((store = get_provider_store(libctx)) == NULL)
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  ------------------
  528|      0|        return NULL;
  529|       |
  530|      2|    memset(&template, 0, sizeof(template));
  531|      2|    if (init_function == NULL) {
  ------------------
  |  Branch (531:9): [True: 2, False: 0]
  ------------------
  532|      2|        const OSSL_PROVIDER_INFO *p;
  533|      2|        size_t i;
  534|      2|        int chosen = 0;
  535|       |
  536|       |        /* Check if this is a predefined builtin provider */
  537|      8|        for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (537:45): [True: 6, False: 2]
  ------------------
  538|      6|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (538:17): [True: 6, False: 0]
  ------------------
  539|      6|                continue;
  540|       |            /* These compile-time templates always have NULL parameters */
  541|      0|            template = *p;
  542|      0|            chosen = 1;
  543|      0|            break;
  544|      6|        }
  545|      2|        if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (545:13): [True: 0, False: 2]
  ------------------
  546|      0|            return NULL;
  547|      2|        for (i = 0, p = store->provinfo; i < store->numprovinfo; p++, i++) {
  ------------------
  |  Branch (547:42): [True: 2, False: 0]
  ------------------
  548|      2|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (548:17): [True: 0, False: 2]
  ------------------
  549|      0|                continue;
  550|       |            /* For built-in providers, copy just implicit parameters. */
  551|      2|            if (!chosen)
  ------------------
  |  Branch (551:17): [True: 2, False: 0]
  ------------------
  552|      2|                template = *p;
  553|       |            /*
  554|       |             * Explicit parameters override config-file defaults.  If an empty
  555|       |             * parameter set is desired, a non-NULL empty set must be provided.
  556|       |             */
  557|      2|            if (params != NULL || p->parameters == NULL) {
  ------------------
  |  Branch (557:17): [True: 0, False: 2]
  |  Branch (557:35): [True: 2, False: 0]
  ------------------
  558|      2|                template.parameters = NULL;
  559|      2|                break;
  560|      2|            }
  561|       |            /* Always copy to avoid sharing/mutation. */
  562|      0|            template.parameters = sk_INFOPAIR_deep_copy(p->parameters,
  563|      0|                                                        infopair_copy,
  564|      0|                                                        infopair_free);
  565|      0|            if (template.parameters == NULL)
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                return NULL;
  567|      0|            break;
  568|      0|        }
  569|      2|        CRYPTO_THREAD_unlock(store->lock);
  570|      2|    } else {
  571|      0|        template.init = init_function;
  572|      0|    }
  573|       |
  574|      2|    if (params != NULL) {
  ------------------
  |  Branch (574:9): [True: 0, False: 2]
  ------------------
  575|      0|        int i;
  576|       |
  577|       |        /* Don't leak if already non-NULL */
  578|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (578:13): [True: 0, False: 0]
  ------------------
  579|      0|            template.parameters = sk_INFOPAIR_new_null();
  580|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (580:13): [True: 0, False: 0]
  ------------------
  581|      0|            return NULL;
  582|       |
  583|      0|        for (i = 0; params[i].key != NULL; i++) {
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|      0|            if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (584:17): [True: 0, False: 0]
  ------------------
  585|      0|                continue;
  586|      0|            if (ossl_provider_info_add_parameter(&template, params[i].key,
  ------------------
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|                                                 (char *)params[i].data) <= 0) {
  588|      0|                sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  589|      0|                return NULL;
  590|      0|            }
  591|      0|        }
  592|      0|    }
  593|       |
  594|       |    /* provider_new() generates an error, so no need here */
  595|      2|    prov = provider_new(name, template.init, template.parameters);
  596|       |
  597|       |    /* If we copied the parameters, free them */
  598|      2|    if (template.parameters != NULL)
  ------------------
  |  Branch (598:9): [True: 0, False: 2]
  ------------------
  599|      0|        sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  600|       |
  601|      2|    if (prov == NULL)
  ------------------
  |  Branch (601:9): [True: 0, False: 2]
  ------------------
  602|      0|        return NULL;
  603|       |
  604|      2|    if (!ossl_provider_set_module_path(prov, template.path)) {
  ------------------
  |  Branch (604:9): [True: 0, False: 2]
  ------------------
  605|      0|        ossl_provider_free(prov);
  606|      0|        return NULL;
  607|      0|    }
  608|       |
  609|      2|    prov->libctx = libctx;
  610|      2|#ifndef FIPS_MODULE
  611|      2|    prov->error_lib = ERR_get_next_error_library();
  612|      2|#endif
  613|       |
  614|       |    /*
  615|       |     * At this point, the provider is only partially "loaded".  To be
  616|       |     * fully "loaded", ossl_provider_activate() must also be called and it must
  617|       |     * then be added to the provider store.
  618|       |     */
  619|       |
  620|      2|    return prov;
  621|      2|}
ossl_provider_add_to_store:
  648|      2|{
  649|      2|    struct provider_store_st *store;
  650|      2|    int idx;
  651|      2|    OSSL_PROVIDER tmpl = { 0, };
  652|      2|    OSSL_PROVIDER *actualtmp = NULL;
  653|       |
  654|      2|    if (actualprov != NULL)
  ------------------
  |  Branch (654:9): [True: 2, False: 0]
  ------------------
  655|      2|        *actualprov = NULL;
  656|       |
  657|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (657:9): [True: 0, False: 2]
  ------------------
  658|      0|        return 0;
  659|       |
  660|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (660:9): [True: 0, False: 2]
  ------------------
  661|      0|        return 0;
  662|       |
  663|      2|    tmpl.name = (char *)prov->name;
  664|      2|    idx = sk_OSSL_PROVIDER_find(store->providers, &tmpl);
  665|      2|    if (idx == -1)
  ------------------
  |  Branch (665:9): [True: 2, False: 0]
  ------------------
  666|      2|        actualtmp = prov;
  667|      0|    else
  668|      0|        actualtmp = sk_OSSL_PROVIDER_value(store->providers, idx);
  669|       |
  670|      2|    if (idx == -1) {
  ------------------
  |  Branch (670:9): [True: 2, False: 0]
  ------------------
  671|      2|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0)
  ------------------
  |  Branch (671:13): [True: 0, False: 2]
  ------------------
  672|      0|            goto err;
  673|      2|        prov->store = store;
  674|      2|        if (!create_provider_children(prov)) {
  ------------------
  |  Branch (674:13): [True: 0, False: 2]
  ------------------
  675|      0|            sk_OSSL_PROVIDER_delete_ptr(store->providers, prov);
  676|      0|            goto err;
  677|      0|        }
  678|      2|        if (!retain_fallbacks)
  ------------------
  |  Branch (678:13): [True: 0, False: 2]
  ------------------
  679|      0|            store->use_fallbacks = 0;
  680|      2|    }
  681|       |
  682|      2|    CRYPTO_THREAD_unlock(store->lock);
  683|       |
  684|      2|    if (actualprov != NULL) {
  ------------------
  |  Branch (684:9): [True: 2, False: 0]
  ------------------
  685|      2|        if (!ossl_provider_up_ref(actualtmp)) {
  ------------------
  |  Branch (685:13): [True: 0, False: 2]
  ------------------
  686|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  687|      0|            actualtmp = NULL;
  688|      0|            return 0;
  689|      0|        }
  690|      2|        *actualprov = actualtmp;
  691|      2|    }
  692|       |
  693|      2|    if (idx >= 0) {
  ------------------
  |  Branch (693:9): [True: 0, False: 2]
  ------------------
  694|       |        /*
  695|       |         * The provider is already in the store. Probably two threads
  696|       |         * independently initialised their own provider objects with the same
  697|       |         * name and raced to put them in the store. This thread lost. We
  698|       |         * deactivate the one we just created and use the one that already
  699|       |         * exists instead.
  700|       |         * If we get here then we know we did not create provider children
  701|       |         * above, so we inform ossl_provider_deactivate not to attempt to remove
  702|       |         * any.
  703|       |         */
  704|      0|        ossl_provider_deactivate(prov, 0);
  705|      0|        ossl_provider_free(prov);
  706|      0|    }
  707|      2|#ifndef FIPS_MODULE
  708|      2|    else {
  709|       |        /*
  710|       |         * This can be done outside the lock. We tolerate other threads getting
  711|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
  712|       |         */
  713|      2|        ossl_decoder_cache_flush(prov->libctx);
  714|      2|    }
  715|      2|#endif
  716|       |
  717|      2|    return 1;
  718|       |
  719|      0| err:
  720|      0|    CRYPTO_THREAD_unlock(store->lock);
  721|      0|    return 0;
  722|      2|}
ossl_provider_free:
  725|    272|{
  726|    272|    if (prov != NULL) {
  ------------------
  |  Branch (726:9): [True: 272, False: 0]
  ------------------
  727|    272|        int ref = 0;
  728|       |
  729|    272|        CRYPTO_DOWN_REF(&prov->refcnt, &ref);
  730|       |
  731|       |        /*
  732|       |         * When the refcount drops to zero, we clean up the provider.
  733|       |         * Note that this also does teardown, which may seem late,
  734|       |         * considering that init happens on first activation.  However,
  735|       |         * there may be other structures hanging on to the provider after
  736|       |         * the last deactivation and may therefore need full access to the
  737|       |         * provider's services.  Therefore, we deinit late.
  738|       |         */
  739|    272|        if (ref == 0) {
  ------------------
  |  Branch (739:13): [True: 1, False: 271]
  ------------------
  740|      1|            if (prov->flag_initialized) {
  ------------------
  |  Branch (740:17): [True: 1, False: 0]
  ------------------
  741|      1|                ossl_provider_teardown(prov);
  742|      1|#ifndef OPENSSL_NO_ERR
  743|      1|# ifndef FIPS_MODULE
  744|      1|                if (prov->error_strings != NULL) {
  ------------------
  |  Branch (744:21): [True: 0, False: 1]
  ------------------
  745|      0|                    ERR_unload_strings(prov->error_lib, prov->error_strings);
  746|      0|                    OPENSSL_free(prov->error_strings);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  747|      0|                    prov->error_strings = NULL;
  748|      0|                }
  749|      1|# endif
  750|      1|#endif
  751|      1|                OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  752|      1|                prov->operation_bits = NULL;
  753|      1|                prov->operation_bits_sz = 0;
  754|      1|                prov->flag_initialized = 0;
  755|      1|            }
  756|       |
  757|      1|#ifndef FIPS_MODULE
  758|       |            /*
  759|       |             * We deregister thread handling whether or not the provider was
  760|       |             * initialized. If init was attempted but was not successful then
  761|       |             * the provider may still have registered a thread handler.
  762|       |             */
  763|      1|            ossl_init_thread_deregister(prov);
  764|      1|            DSO_free(prov->module);
  765|      1|#endif
  766|      1|            OPENSSL_free(prov->name);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  767|      1|            OPENSSL_free(prov->path);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  768|      1|            sk_INFOPAIR_pop_free(prov->parameters, infopair_free);
  769|      1|            CRYPTO_THREAD_lock_free(prov->opbits_lock);
  770|      1|            CRYPTO_THREAD_lock_free(prov->flag_lock);
  771|      1|            CRYPTO_THREAD_lock_free(prov->activatecnt_lock);
  772|      1|            CRYPTO_FREE_REF(&prov->refcnt);
  773|      1|            OPENSSL_free(prov);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  774|      1|        }
  775|    271|#ifndef FIPS_MODULE
  776|    271|        else if (prov->ischild) {
  ------------------
  |  Branch (776:18): [True: 0, False: 271]
  ------------------
  777|      0|            ossl_provider_free_parent(prov, 0);
  778|      0|        }
  779|    272|#endif
  780|    272|    }
  781|    272|}
ossl_provider_set_module_path:
  785|      2|{
  786|      2|    OPENSSL_free(prov->path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  787|      2|    prov->path = NULL;
  788|      2|    if (module_path == NULL)
  ------------------
  |  Branch (788:9): [True: 2, False: 0]
  ------------------
  789|      2|        return 1;
  790|      0|    if ((prov->path = OPENSSL_strdup(module_path)) != NULL)
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (790:9): [True: 0, False: 0]
  ------------------
  791|      0|        return 1;
  792|      0|    return 0;
  793|      0|}
ossl_provider_activate:
 1397|      2|{
 1398|      2|    int count;
 1399|       |
 1400|      2|    if (prov == NULL)
  ------------------
  |  Branch (1400:9): [True: 0, False: 2]
  ------------------
 1401|      0|        return 0;
 1402|      2|#ifndef FIPS_MODULE
 1403|       |    /*
 1404|       |     * If aschild is true, then we only actually do the activation if the
 1405|       |     * provider is a child. If its not, this is still success.
 1406|       |     */
 1407|      2|    if (aschild && !prov->ischild)
  ------------------
  |  Branch (1407:9): [True: 0, False: 2]
  |  Branch (1407:20): [True: 0, False: 0]
  ------------------
 1408|      0|        return 1;
 1409|      2|#endif
 1410|      2|    if ((count = provider_activate(prov, 1, upcalls)) > 0)
  ------------------
  |  Branch (1410:9): [True: 2, False: 0]
  ------------------
 1411|      2|        return count == 1 ? provider_flush_store_cache(prov) : 1;
  ------------------
  |  Branch (1411:16): [True: 2, False: 0]
  ------------------
 1412|       |
 1413|      0|    return 0;
 1414|      2|}
ossl_provider_deactivate:
 1417|      3|{
 1418|      3|    int count;
 1419|       |
 1420|      3|    if (prov == NULL
  ------------------
  |  Branch (1420:9): [True: 0, False: 3]
  ------------------
 1421|      3|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1421:16): [True: 0, False: 3]
  ------------------
 1422|      0|        return 0;
 1423|      3|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1423:12): [True: 3, False: 0]
  ------------------
 1424|      3|}
ossl_provider_ctx:
 1427|    292|{
 1428|    292|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1428:12): [True: 292, False: 0]
  ------------------
 1429|    292|}
ossl_provider_doall_activated:
 1528|  1.46k|{
 1529|  1.46k|    int ret = 0, curr, max, ref = 0;
 1530|  1.46k|    struct provider_store_st *store = get_provider_store(ctx);
 1531|  1.46k|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|  1.46k|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1532|       |
 1533|  1.46k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
 1534|       |    /*
 1535|       |     * Make sure any providers are loaded from config before we try to use
 1536|       |     * them.
 1537|       |     */
 1538|  1.46k|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1538:9): [True: 1.46k, False: 0]
  ------------------
 1539|  1.46k|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  1.46k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1540|  1.46k|#endif
 1541|       |
 1542|  1.46k|    if (store == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 1.46k]
  ------------------
 1543|      0|        return 1;
 1544|  1.46k|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1544:9): [True: 0, False: 1.46k]
  ------------------
 1545|      0|        return 0;
 1546|       |
 1547|       |    /*
 1548|       |     * Under lock, grab a copy of the provider list and up_ref each
 1549|       |     * provider so that they don't disappear underneath us.
 1550|       |     */
 1551|  1.46k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1551:9): [True: 0, False: 1.46k]
  ------------------
 1552|      0|        return 0;
 1553|  1.46k|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1554|  1.46k|    if (provs == NULL) {
  ------------------
  |  Branch (1554:9): [True: 0, False: 1.46k]
  ------------------
 1555|      0|        CRYPTO_THREAD_unlock(store->lock);
 1556|      0|        return 0;
 1557|      0|    }
 1558|  1.46k|    max = sk_OSSL_PROVIDER_num(provs);
 1559|       |    /*
 1560|       |     * We work backwards through the stack so that we can safely delete items
 1561|       |     * as we go.
 1562|       |     */
 1563|  4.39k|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1563:26): [True: 2.93k, False: 1.46k]
  ------------------
 1564|  2.93k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1565|       |
 1566|  2.93k|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1566:13): [True: 0, False: 2.93k]
  ------------------
 1567|      0|            goto err_unlock;
 1568|  2.93k|        if (prov->flag_activated) {
  ------------------
  |  Branch (1568:13): [True: 2.93k, False: 0]
  ------------------
 1569|       |            /*
 1570|       |             * We call CRYPTO_UP_REF directly rather than ossl_provider_up_ref
 1571|       |             * to avoid upping the ref count on the parent provider, which we
 1572|       |             * must not do while holding locks.
 1573|       |             */
 1574|  2.93k|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1574:17): [True: 0, False: 2.93k]
  ------------------
 1575|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1576|      0|                goto err_unlock;
 1577|      0|            }
 1578|       |            /*
 1579|       |             * It's already activated, but we up the activated count to ensure
 1580|       |             * it remains activated until after we've called the user callback.
 1581|       |             * In theory this could mean the parent provider goes inactive,
 1582|       |             * whilst still activated in the child for a short period. That's ok.
 1583|       |             */
 1584|  2.93k|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1584:17): [True: 0, False: 2.93k]
  ------------------
 1585|  2.93k|                                   prov->activatecnt_lock)) {
 1586|      0|                CRYPTO_DOWN_REF(&prov->refcnt, &ref);
 1587|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1588|      0|                goto err_unlock;
 1589|      0|            }
 1590|  2.93k|        } else {
 1591|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1592|      0|            max--;
 1593|      0|        }
 1594|  2.93k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1595|  2.93k|    }
 1596|  1.46k|    CRYPTO_THREAD_unlock(store->lock);
 1597|       |
 1598|       |    /*
 1599|       |     * Now, we sweep through all providers not under lock
 1600|       |     */
 1601|  4.39k|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1601:20): [True: 2.93k, False: 1.46k]
  ------------------
 1602|  2.93k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1603|       |
 1604|  2.93k|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 2.93k]
  ------------------
 1605|      0|            curr = -1;
 1606|      0|            goto finish;
 1607|      0|        }
 1608|  2.93k|    }
 1609|  1.46k|    curr = -1;
 1610|       |
 1611|  1.46k|    ret = 1;
 1612|  1.46k|    goto finish;
 1613|       |
 1614|      0| err_unlock:
 1615|      0|    CRYPTO_THREAD_unlock(store->lock);
 1616|  1.46k| finish:
 1617|       |    /*
 1618|       |     * The pop_free call doesn't do what we want on an error condition. We
 1619|       |     * either start from the first item in the stack, or part way through if
 1620|       |     * we only processed some of the items.
 1621|       |     */
 1622|  4.39k|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1622:18): [True: 2.93k, False: 1.46k]
  ------------------
 1623|  2.93k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1624|       |
 1625|  2.93k|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1625:13): [True: 0, False: 2.93k]
  ------------------
 1626|  2.93k|                               prov->activatecnt_lock)) {
 1627|      0|            ret = 0;
 1628|      0|            continue;
 1629|      0|        }
 1630|  2.93k|        if (ref < 1) {
  ------------------
  |  Branch (1630:13): [True: 0, False: 2.93k]
  ------------------
 1631|       |            /*
 1632|       |             * Looks like we need to deactivate properly. We could just have
 1633|       |             * done this originally, but it involves taking a write lock so
 1634|       |             * we avoid it. We up the count again and do a full deactivation
 1635|       |             */
 1636|      0|            if (CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1636:17): [True: 0, False: 0]
  ------------------
 1637|      0|                                  prov->activatecnt_lock))
 1638|      0|                provider_deactivate(prov, 0, 1);
 1639|      0|            else
 1640|      0|                ret = 0;
 1641|      0|        }
 1642|       |        /*
 1643|       |         * As above where we did the up-ref, we don't call ossl_provider_free
 1644|       |         * to avoid making upcalls. There should always be at least one ref
 1645|       |         * to the provider in the store, so this should never drop to 0.
 1646|       |         */
 1647|  2.93k|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 2.93k]
  ------------------
 1648|      0|            ret = 0;
 1649|      0|            continue;
 1650|      0|        }
 1651|       |        /*
 1652|       |         * Not much we can do if this assert ever fails. So we don't use
 1653|       |         * ossl_assert here.
 1654|       |         */
 1655|  2.93k|        assert(ref > 0);
 1656|  2.93k|    }
 1657|  1.46k|    sk_OSSL_PROVIDER_free(provs);
 1658|  1.46k|    return ret;
 1659|  1.46k|}
ossl_provider_name:
 1683|      3|{
 1684|      3|    return prov->name;
 1685|      3|}
ossl_provider_libctx:
 1720|    466|{
 1721|    466|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1721:12): [True: 466, False: 0]
  ------------------
 1722|    466|}
ossl_provider_teardown:
 1737|      1|{
 1738|      1|    if (prov->teardown != NULL
  ------------------
  |  Branch (1738:9): [True: 1, False: 0]
  ------------------
 1739|      1|#ifndef FIPS_MODULE
 1740|      1|            && !prov->ischild
  ------------------
  |  Branch (1740:16): [True: 1, False: 0]
  ------------------
 1741|      1|#endif
 1742|      1|        ) {
 1743|      1|#ifndef FIPS_MODULE
 1744|      1|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      1|    do {                                        \
  |  |  221|      1|        BIO *trc_out = NULL;                    \
  |  |  222|      1|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1745|      0|            BIO_printf(trc_out, "(provider %s) calling teardown\n",
 1746|      0|                       ossl_provider_name(prov));
 1747|      1|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      1|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1748|      1|#endif
 1749|      1|        prov->teardown(prov->provctx);
 1750|      1|    }
 1751|      1|}
ossl_provider_get_capabilities:
 1900|    316|{
 1901|    316|    if (prov->get_capabilities != NULL) {
  ------------------
  |  Branch (1901:9): [True: 158, False: 158]
  ------------------
 1902|    158|#ifndef FIPS_MODULE
 1903|    158|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|    158|    do {                                        \
  |  |  221|    158|        BIO *trc_out = NULL;                    \
  |  |  222|    158|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1904|      0|            BIO_printf(trc_out,
 1905|      0|                       "(provider %s) Calling get_capabilities "
 1906|      0|                       "with capabilities %s\n", prov->name,
 1907|      0|                       capability == NULL ? "none" : capability);
  ------------------
  |  Branch (1907:24): [True: 0, False: 0]
  ------------------
 1908|    158|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|    158|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1909|    158|#endif
 1910|    158|        return prov->get_capabilities(prov->provctx, capability, cb, arg);
 1911|    158|    }
 1912|    158|    return 1;
 1913|    316|}
ossl_provider_query_operation:
 1936|  2.61k|{
 1937|  2.61k|    const OSSL_ALGORITHM *res;
 1938|       |
 1939|  2.61k|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 2.61k]
  ------------------
 1940|      0|#ifndef FIPS_MODULE
 1941|      0|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1942|      0|            BIO_printf(trc_out, "provider %s lacks query operation!\n",
 1943|      0|                       prov->name);
 1944|      0|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1945|      0|#endif
 1946|      0|        return NULL;
 1947|      0|    }
 1948|       |
 1949|  2.61k|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1950|  2.61k|#ifndef FIPS_MODULE
 1951|  2.61k|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|  2.61k|    do {                                        \
  |  |  221|  2.61k|        BIO *trc_out = NULL;                    \
  |  |  222|  2.61k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1952|      0|        const OSSL_ALGORITHM *idx;
 1953|      0|        if (res != NULL) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 0]
  ------------------
 1954|      0|            BIO_printf(trc_out,
 1955|      0|                       "(provider %s) Calling query, available algs are:\n", prov->name);
 1956|       |
 1957|      0|            for (idx = res; idx->algorithm_names != NULL; idx++) {
  ------------------
  |  Branch (1957:29): [True: 0, False: 0]
  ------------------
 1958|      0|                BIO_printf(trc_out,
 1959|      0|                           "(provider %s) names %s, prop_def %s, desc %s\n",
 1960|      0|                           prov->name,
 1961|      0|                           idx->algorithm_names == NULL ? "none" :
  ------------------
  |  Branch (1961:28): [True: 0, False: 0]
  ------------------
 1962|      0|                           idx->algorithm_names,
 1963|      0|                           idx->property_definition == NULL ? "none" :
  ------------------
  |  Branch (1963:28): [True: 0, False: 0]
  ------------------
 1964|      0|                           idx->property_definition,
 1965|      0|                           idx->algorithm_description == NULL ? "none" :
  ------------------
  |  Branch (1965:28): [True: 0, False: 0]
  ------------------
 1966|      0|                           idx->algorithm_description);
 1967|      0|            }
 1968|      0|        } else {
 1969|      0|            BIO_printf(trc_out, "(provider %s) query_operation failed\n", prov->name);
 1970|      0|        }
 1971|  2.61k|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|  2.61k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1972|  2.61k|#endif
 1973|       |
 1974|       |#if defined(OPENSSL_NO_CACHED_FETCH)
 1975|       |    /* Forcing the non-caching of queries */
 1976|       |    if (no_cache != NULL)
 1977|       |        *no_cache = 1;
 1978|       |#endif
 1979|  2.61k|    return res;
 1980|  2.61k|}
ossl_provider_unquery_operation:
 1999|  2.61k|{
 2000|  2.61k|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2000:9): [True: 0, False: 2.61k]
  ------------------
 2001|      0|#ifndef FIPS_MODULE
 2002|      0|        OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      0|    do {                                        \
  |  |  221|      0|        BIO *trc_out = NULL;                    \
  |  |  222|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2003|      0|            BIO_printf(trc_out,
 2004|      0|                       "(provider %s) Calling unquery"
 2005|      0|                       " with operation %d\n",
 2006|      0|                       prov->name,
 2007|      0|                       operation_id);
 2008|      0|        } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2009|      0|#endif
 2010|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 2011|      0|    }
 2012|  2.61k|}
ossl_provider_set_operation_bit:
 2015|     12|{
 2016|     12|    size_t byte = bitnum / 8;
 2017|     12|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2018|       |
 2019|     12|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2019:9): [True: 0, False: 12]
  ------------------
 2020|      0|        return 0;
 2021|     12|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2021:9): [True: 4, False: 8]
  ------------------
 2022|      4|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      4|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2023|      4|                                             byte + 1);
 2024|       |
 2025|      4|        if (tmp == NULL) {
  ------------------
  |  Branch (2025:13): [True: 0, False: 4]
  ------------------
 2026|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2027|      0|            return 0;
 2028|      0|        }
 2029|      4|        provider->operation_bits = tmp;
 2030|      4|        memset(provider->operation_bits + provider->operation_bits_sz,
 2031|      4|               '\0', byte + 1 - provider->operation_bits_sz);
 2032|      4|        provider->operation_bits_sz = byte + 1;
 2033|      4|    }
 2034|     12|    provider->operation_bits[byte] |= bit;
 2035|     12|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2036|     12|    return 1;
 2037|     12|}
ossl_provider_test_operation_bit:
 2041|  2.61k|{
 2042|  2.61k|    size_t byte = bitnum / 8;
 2043|  2.61k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2044|       |
 2045|  2.61k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  2.61k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.61k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2045:9): [True: 0, False: 2.61k]
  ------------------
 2046|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 2047|      0|        return 0;
 2048|      0|    }
 2049|       |
 2050|  2.61k|    *result = 0;
 2051|  2.61k|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2051:9): [True: 0, False: 2.61k]
  ------------------
 2052|      0|        return 0;
 2053|  2.61k|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2053:9): [True: 2.61k, False: 4]
  ------------------
 2054|  2.61k|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2055|  2.61k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|  2.61k|    return 1;
 2057|  2.61k|}
provider_core.c:provider_deactivate_free:
  237|      3|{
  238|      3|    if (prov->flag_activated)
  ------------------
  |  Branch (238:9): [True: 3, False: 0]
  ------------------
  239|      3|        ossl_provider_deactivate(prov, 1);
  240|      3|    ossl_provider_free(prov);
  241|      3|}
provider_core.c:get_provider_store:
  330|  1.48k|{
  331|  1.48k|    struct provider_store_st *store = NULL;
  332|       |
  333|  1.48k|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|  1.48k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  334|  1.48k|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 1.48k]
  ------------------
  335|  1.48k|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|  1.48k|    return store;
  337|  1.48k|}
provider_core.c:provider_new:
  442|      3|{
  443|      3|    OSSL_PROVIDER *prov = NULL;
  444|       |
  445|      3|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  104|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (445:9): [True: 0, False: 3]
  ------------------
  446|      0|        return NULL;
  447|      3|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (447:9): [True: 0, False: 3]
  ------------------
  448|      0|        OPENSSL_free(prov);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|      0|        return NULL;
  450|      0|    }
  451|      3|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (451:9): [True: 0, False: 3]
  ------------------
  452|      0|        ossl_provider_free(prov);
  453|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  454|      0|        return NULL;
  455|      0|    }
  456|       |
  457|      3|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:9): [True: 0, False: 3]
  ------------------
  458|      3|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (458:12): [True: 0, False: 3]
  ------------------
  459|      3|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (459:12): [True: 0, False: 3]
  ------------------
  460|      3|                                                     infopair_copy,
  461|      3|                                                     infopair_free)) == NULL) {
  462|      0|        ossl_provider_free(prov);
  463|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return NULL;
  465|      0|    }
  466|      3|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      3|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (466:9): [True: 0, False: 3]
  ------------------
  467|      0|        ossl_provider_free(prov);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|      3|    prov->init_function = init_function;
  472|       |
  473|      3|    return prov;
  474|      3|}
provider_core.c:create_provider_children:
  625|      2|{
  626|      2|    int ret = 1;
  627|      2|#ifndef FIPS_MODULE
  628|      2|    struct provider_store_st *store = prov->store;
  629|      2|    OSSL_PROVIDER_CHILD_CB *child_cb;
  630|      2|    int i, max;
  631|       |
  632|      2|    max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
  633|      2|    for (i = 0; i < max; i++) {
  ------------------
  |  Branch (633:17): [True: 0, False: 2]
  ------------------
  634|       |        /*
  635|       |         * This is newly activated (activatecnt == 1), so we need to
  636|       |         * create child providers as necessary.
  637|       |         */
  638|      0|        child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
  639|      0|        ret &= child_cb->create_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
  640|      0|    }
  641|      2|#endif
  642|       |
  643|      2|    return ret;
  644|      2|}
provider_core.c:provider_activate:
 1257|      3|{
 1258|      3|    int count = -1;
 1259|      3|    struct provider_store_st *store;
 1260|      3|    int ret = 1;
 1261|       |
 1262|      3|    store = prov->store;
 1263|       |    /*
 1264|       |    * If the provider hasn't been added to the store, then we don't need
 1265|       |    * any locks because we've not shared it with other threads.
 1266|       |    */
 1267|      3|    if (store == NULL) {
  ------------------
  |  Branch (1267:9): [True: 3, False: 0]
  ------------------
 1268|      3|        lock = 0;
 1269|      3|        if (!provider_init(prov))
  ------------------
  |  Branch (1269:13): [True: 0, False: 3]
  ------------------
 1270|      0|            return -1;
 1271|      3|    }
 1272|       |
 1273|      3|#ifndef FIPS_MODULE
 1274|      3|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1274:9): [True: 0, False: 3]
  ------------------
 1275|      3|            && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1275:16): [True: 0, False: 0]
  ------------------
 1276|      0|        return -1;
 1277|       |
 1278|      3|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1278:9): [True: 0, False: 3]
  |  Branch (1278:26): [True: 0, False: 0]
  |  Branch (1278:37): [True: 0, False: 0]
  ------------------
 1279|      0|        return -1;
 1280|      3|#endif
 1281|       |
 1282|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1282:9): [True: 0, False: 3]
  |  Branch (1282:17): [True: 0, False: 0]
  ------------------
 1283|      0|#ifndef FIPS_MODULE
 1284|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1284:13): [True: 0, False: 0]
  |  Branch (1284:30): [True: 0, False: 0]
  ------------------
 1285|      0|            ossl_provider_free_parent(prov, 1);
 1286|      0|#endif
 1287|      0|        return -1;
 1288|      0|    }
 1289|       |
 1290|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1290:9): [True: 0, False: 3]
  |  Branch (1290:17): [True: 0, False: 0]
  ------------------
 1291|      0|        CRYPTO_THREAD_unlock(store->lock);
 1292|      0|#ifndef FIPS_MODULE
 1293|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1293:13): [True: 0, False: 0]
  |  Branch (1293:30): [True: 0, False: 0]
  ------------------
 1294|      0|            ossl_provider_free_parent(prov, 1);
 1295|      0|#endif
 1296|      0|        return -1;
 1297|      0|    }
 1298|      3|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1298:9): [True: 3, False: 0]
  ------------------
 1299|      3|        prov->flag_activated = 1;
 1300|       |
 1301|      3|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1301:13): [True: 3, False: 0]
  |  Branch (1301:27): [True: 0, False: 3]
  ------------------
 1302|      0|            ret = create_provider_children(prov);
 1303|      0|        }
 1304|      3|    }
 1305|      3|    if (lock) {
  ------------------
  |  Branch (1305:9): [True: 0, False: 3]
  ------------------
 1306|      0|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1307|      0|        CRYPTO_THREAD_unlock(store->lock);
 1308|       |        /*
 1309|       |         * This can be done outside the lock. We tolerate other threads getting
 1310|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1311|       |         */
 1312|      0|#ifndef FIPS_MODULE
 1313|      0|        if (count == 1)
  ------------------
  |  Branch (1313:13): [True: 0, False: 0]
  ------------------
 1314|      0|            ossl_decoder_cache_flush(prov->libctx);
 1315|      0|#endif
 1316|      0|    }
 1317|       |
 1318|      3|    if (!ret)
  ------------------
  |  Branch (1318:9): [True: 0, False: 3]
  ------------------
 1319|      0|        return -1;
 1320|       |
 1321|      3|    return count;
 1322|      3|}
provider_core.c:provider_init:
  940|      3|{
  941|      3|    const OSSL_DISPATCH *provider_dispatch = NULL;
  942|      3|    void *tmp_provctx = NULL;    /* safety measure */
  943|      3|#ifndef OPENSSL_NO_ERR
  944|      3|# ifndef FIPS_MODULE
  945|      3|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  946|      3|# endif
  947|      3|#endif
  948|      3|    int ok = 0;
  949|       |
  950|      3|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (950:9): [True: 0, False: 3]
  ------------------
  951|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  952|      0|        goto end;
  953|      0|    }
  954|       |
  955|       |    /*
  956|       |     * If the init function isn't set, it indicates that this provider is
  957|       |     * a loadable module.
  958|       |     */
  959|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (959:9): [True: 0, False: 3]
  ------------------
  960|       |#ifdef FIPS_MODULE
  961|       |        goto end;
  962|       |#else
  963|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (963:13): [True: 0, False: 0]
  ------------------
  964|      0|            char *allocated_path = NULL;
  965|      0|            const char *module_path = NULL;
  966|      0|            char *merged_path = NULL;
  967|      0|            const char *load_dir = NULL;
  968|      0|            char *allocated_load_dir = NULL;
  969|      0|            struct provider_store_st *store;
  970|       |
  971|      0|            if ((prov->module = DSO_new()) == NULL) {
  ------------------
  |  Branch (971:17): [True: 0, False: 0]
  ------------------
  972|       |                /* DSO_new() generates an error already */
  973|      0|                goto end;
  974|      0|            }
  975|       |
  976|      0|            if ((store = get_provider_store(prov->libctx)) == NULL
  ------------------
  |  Branch (976:17): [True: 0, False: 0]
  ------------------
  977|      0|                    || !CRYPTO_THREAD_read_lock(store->default_path_lock))
  ------------------
  |  Branch (977:24): [True: 0, False: 0]
  ------------------
  978|      0|                goto end;
  979|       |
  980|      0|            if (store->default_path != NULL) {
  ------------------
  |  Branch (980:17): [True: 0, False: 0]
  ------------------
  981|      0|                allocated_load_dir = OPENSSL_strdup(store->default_path);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  982|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  983|      0|                if (allocated_load_dir == NULL)
  ------------------
  |  Branch (983:21): [True: 0, False: 0]
  ------------------
  984|      0|                    goto end;
  985|      0|                load_dir = allocated_load_dir;
  986|      0|            } else {
  987|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  988|      0|            }
  989|       |
  990|      0|            if (load_dir == NULL) {
  ------------------
  |  Branch (990:17): [True: 0, False: 0]
  ------------------
  991|      0|                load_dir = ossl_safe_getenv("OPENSSL_MODULES");
  992|      0|                if (load_dir == NULL)
  ------------------
  |  Branch (992:21): [True: 0, False: 0]
  ------------------
  993|      0|                    load_dir = ossl_get_modulesdir();
  994|      0|            }
  995|       |
  996|      0|            DSO_ctrl(prov->module, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|      0|# define DSO_CTRL_SET_FLAGS      2
  ------------------
  997|      0|                     DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|      0|# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY      0x02
  ------------------
  998|       |
  999|      0|            module_path = prov->path;
 1000|      0|            if (module_path == NULL)
  ------------------
  |  Branch (1000:17): [True: 0, False: 0]
  ------------------
 1001|      0|                module_path = allocated_path =
 1002|      0|                    DSO_convert_filename(prov->module, prov->name);
 1003|      0|            if (module_path != NULL)
  ------------------
  |  Branch (1003:17): [True: 0, False: 0]
  ------------------
 1004|      0|                merged_path = DSO_merge(prov->module, module_path, load_dir);
 1005|       |
 1006|      0|            if (merged_path == NULL
  ------------------
  |  Branch (1006:17): [True: 0, False: 0]
  ------------------
 1007|      0|                || (DSO_load(prov->module, merged_path, NULL, 0)) == NULL) {
  ------------------
  |  Branch (1007:20): [True: 0, False: 0]
  ------------------
 1008|      0|                DSO_free(prov->module);
 1009|      0|                prov->module = NULL;
 1010|      0|            }
 1011|       |
 1012|      0|            OPENSSL_free(merged_path);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1013|      0|            OPENSSL_free(allocated_path);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1014|      0|            OPENSSL_free(allocated_load_dir);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1015|      0|        }
 1016|       |
 1017|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 0]
  ------------------
 1018|       |            /* DSO has already recorded errors, this is just a tracepoint */
 1019|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  335|      0|# define ERR_R_DSO_LIB          (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   98|      0|# define ERR_LIB_DSO             37
  |  |  ------------------
  |  |               # define ERR_R_DSO_LIB          (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1020|      0|                           "name=%s", prov->name);
 1021|      0|            goto end;
 1022|      0|        }
 1023|       |
 1024|      0|        prov->init_function = (OSSL_provider_init_fn *)
 1025|      0|            DSO_bind_func(prov->module, "OSSL_provider_init");
 1026|      0|#endif
 1027|      0|    }
 1028|       |
 1029|       |    /* Check for and call the initialise function for the provider. */
 1030|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 3]
  ------------------
 1031|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  363|      0|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1032|      0|                       "name=%s, provider has no provider init function",
 1033|      0|                       prov->name);
 1034|      0|        goto end;
 1035|      0|    }
 1036|      3|#ifndef FIPS_MODULE
 1037|      3|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      3|    do {                                        \
  |  |  221|      3|        BIO *trc_out = NULL;                    \
  |  |  222|      3|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1038|      0|        BIO_printf(trc_out,
 1039|      0|                   "(provider %s) initalizing\n", prov->name);
 1040|      3|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      3|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1041|      3|#endif
 1042|       |
 1043|      3|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1043:9): [True: 0, False: 3]
  ------------------
 1044|      3|                             &provider_dispatch, &tmp_provctx)) {
 1045|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  356|      0|# define ERR_R_INIT_FAIL                         (261|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|      0|                       "name=%s", prov->name);
 1047|      0|        goto end;
 1048|      0|    }
 1049|      3|    prov->provctx = tmp_provctx;
 1050|      3|    prov->dispatch = provider_dispatch;
 1051|       |
 1052|      3|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1052:9): [True: 3, False: 0]
  ------------------
 1053|     12|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1053:16): [True: 9, False: 3]
  ------------------
 1054|      9|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1054:21): [True: 0, False: 9]
  ------------------
 1055|      3|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  257|      3|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (1055:13): [True: 3, False: 6]
  ------------------
 1056|      3|                prov->teardown =
 1057|      3|                    OSSL_FUNC_provider_teardown(provider_dispatch);
 1058|      3|                break;
 1059|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  259|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (1059:13): [True: 1, False: 8]
  ------------------
 1060|      1|                prov->gettable_params =
 1061|      1|                    OSSL_FUNC_provider_gettable_params(provider_dispatch);
 1062|      1|                break;
 1063|      1|            case OSSL_FUNC_PROVIDER_GET_PARAMS:
  ------------------
  |  |  262|      1|# define OSSL_FUNC_PROVIDER_GET_PARAMS         1026
  ------------------
  |  Branch (1063:13): [True: 1, False: 8]
  ------------------
 1064|      1|                prov->get_params =
 1065|      1|                    OSSL_FUNC_provider_get_params(provider_dispatch);
 1066|      1|                break;
 1067|      0|            case OSSL_FUNC_PROVIDER_SELF_TEST:
  ------------------
  |  |  277|      0|# define OSSL_FUNC_PROVIDER_SELF_TEST          1031
  ------------------
  |  Branch (1067:13): [True: 0, False: 9]
  ------------------
 1068|      0|                prov->self_test =
 1069|      0|                    OSSL_FUNC_provider_self_test(provider_dispatch);
 1070|      0|                break;
 1071|      0|            case OSSL_FUNC_PROVIDER_RANDOM_BYTES:
  ------------------
  |  |  279|      0|# define OSSL_FUNC_PROVIDER_RANDOM_BYTES       1032
  ------------------
  |  Branch (1071:13): [True: 0, False: 9]
  ------------------
 1072|      0|                prov->random_bytes =
 1073|      0|                    OSSL_FUNC_provider_random_bytes(provider_dispatch);
 1074|      0|                break;
 1075|      1|            case OSSL_FUNC_PROVIDER_GET_CAPABILITIES:
  ------------------
  |  |  274|      1|# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES   1030
  ------------------
  |  Branch (1075:13): [True: 1, False: 8]
  ------------------
 1076|      1|                prov->get_capabilities =
 1077|      1|                    OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1078|      1|                break;
 1079|      3|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  265|      3|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (1079:13): [True: 3, False: 6]
  ------------------
 1080|      3|                prov->query_operation =
 1081|      3|                    OSSL_FUNC_provider_query_operation(provider_dispatch);
 1082|      3|                break;
 1083|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  268|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (1083:13): [True: 0, False: 9]
  ------------------
 1084|      0|                prov->unquery_operation =
 1085|      0|                    OSSL_FUNC_provider_unquery_operation(provider_dispatch);
 1086|      0|                break;
 1087|      0|#ifndef OPENSSL_NO_ERR
 1088|      0|# ifndef FIPS_MODULE
 1089|      0|            case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS:
  ------------------
  |  |  271|      0|# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
  ------------------
  |  Branch (1089:13): [True: 0, False: 9]
  ------------------
 1090|      0|                p_get_reason_strings =
 1091|      0|                    OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1092|      0|                break;
 1093|      9|# endif
 1094|      9|#endif
 1095|      9|            }
 1096|      9|        }
 1097|      3|    }
 1098|       |
 1099|      3|#ifndef OPENSSL_NO_ERR
 1100|      3|# ifndef FIPS_MODULE
 1101|      3|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 3]
  ------------------
 1102|      0|        const OSSL_ITEM *reasonstrings = p_get_reason_strings(prov->provctx);
 1103|      0|        size_t cnt, cnt2;
 1104|       |
 1105|       |        /*
 1106|       |         * ERR_load_strings() handles ERR_STRING_DATA rather than OSSL_ITEM,
 1107|       |         * although they are essentially the same type.
 1108|       |         * Furthermore, ERR_load_strings() patches the array's error number
 1109|       |         * with the error library number, so we need to make a copy of that
 1110|       |         * array either way.
 1111|       |         */
 1112|      0|        cnt = 0;
 1113|      0|        while (reasonstrings[cnt].id != 0) {
  ------------------
  |  Branch (1113:16): [True: 0, False: 0]
  ------------------
 1114|      0|            if (ERR_GET_LIB(reasonstrings[cnt].id) != 0)
  ------------------
  |  Branch (1114:17): [True: 0, False: 0]
  ------------------
 1115|      0|                goto end;
 1116|      0|            cnt++;
 1117|      0|        }
 1118|      0|        cnt++;                   /* One for the terminating item */
 1119|       |
 1120|       |        /* Allocate one extra item for the "library" name */
 1121|      0|        prov->error_strings =
 1122|      0|            OPENSSL_zalloc(sizeof(ERR_STRING_DATA) * (cnt + 1));
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1123|      0|        if (prov->error_strings == NULL)
  ------------------
  |  Branch (1123:13): [True: 0, False: 0]
  ------------------
 1124|      0|            goto end;
 1125|       |
 1126|       |        /*
 1127|       |         * Set the "library" name.
 1128|       |         */
 1129|      0|        prov->error_strings[0].error = ERR_PACK(prov->error_lib, 0, 0);
  ------------------
  |  |  279|      0|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|      0|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|      0|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|      0|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|      0|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
 1130|      0|        prov->error_strings[0].string = prov->name;
 1131|       |        /*
 1132|       |         * Copy reasonstrings item 0..cnt-1 to prov->error_trings positions
 1133|       |         * 1..cnt.
 1134|       |         */
 1135|      0|        for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
  ------------------
  |  Branch (1135:24): [True: 0, False: 0]
  ------------------
 1136|      0|            prov->error_strings[cnt2].error = (int)reasonstrings[cnt2-1].id;
 1137|      0|            prov->error_strings[cnt2].string = reasonstrings[cnt2-1].ptr;
 1138|      0|        }
 1139|       |
 1140|      0|        ERR_load_strings(prov->error_lib, prov->error_strings);
 1141|      0|    }
 1142|      3|# endif
 1143|      3|#endif
 1144|       |
 1145|       |    /* With this flag set, this provider has become fully "loaded". */
 1146|      3|    prov->flag_initialized = 1;
 1147|      3|    ok = 1;
 1148|       |
 1149|      3| end:
 1150|      3|    return ok;
 1151|      3|}
provider_core.c:core_get_libctx:
 2332|      1|{
 2333|       |    /*
 2334|       |     * We created this object originally and we know it is actually an
 2335|       |     * OSSL_PROVIDER *, so the cast is safe
 2336|       |     */
 2337|      1|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2338|       |
 2339|       |    /*
 2340|       |     * Using ossl_provider_libctx would be wrong as that returns
 2341|       |     * NULL for |prov| == NULL and NULL libctx has a special meaning
 2342|       |     * that does not apply here. Here |prov| == NULL can happen only in
 2343|       |     * case of a coding error.
 2344|       |     */
 2345|      1|    assert(prov != NULL);
 2346|      1|    return (OPENSSL_CORE_CTX *)prov->libctx;
 2347|      1|}
provider_core.c:provider_flush_store_cache:
 1325|      2|{
 1326|      2|    struct provider_store_st *store;
 1327|      2|    int freeing;
 1328|       |
 1329|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1329:9): [True: 0, False: 2]
  ------------------
 1330|      0|        return 0;
 1331|       |
 1332|      2|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1332:9): [True: 0, False: 2]
  ------------------
 1333|      0|        return 0;
 1334|      2|    freeing = store->freeing;
 1335|      2|    CRYPTO_THREAD_unlock(store->lock);
 1336|       |
 1337|      2|    if (!freeing) {
  ------------------
  |  Branch (1337:9): [True: 2, False: 0]
  ------------------
 1338|      2|        int acc
 1339|      2|            = evp_method_store_cache_flush(prov->libctx)
 1340|      2|#ifndef FIPS_MODULE
 1341|      2|            + ossl_encoder_store_cache_flush(prov->libctx)
 1342|      2|            + ossl_decoder_store_cache_flush(prov->libctx)
 1343|      2|            + ossl_store_loader_store_cache_flush(prov->libctx)
 1344|      2|#endif
 1345|      2|            ;
 1346|       |
 1347|      2|#ifndef FIPS_MODULE
 1348|      2|        return acc == 4;
 1349|       |#else
 1350|       |        return acc == 1;
 1351|       |#endif
 1352|      2|    }
 1353|      0|    return 1;
 1354|      2|}
provider_core.c:provider_deactivate:
 1161|      3|{
 1162|      3|    int count;
 1163|      3|    struct provider_store_st *store;
 1164|      3|#ifndef FIPS_MODULE
 1165|      3|    int freeparent = 0;
 1166|      3|#endif
 1167|      3|    int lock = 1;
 1168|       |
 1169|      3|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1169:9): [True: 0, False: 3]
  ------------------
 1170|      0|        return -1;
 1171|       |
 1172|      3|#ifndef FIPS_MODULE
 1173|      3|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1173:9): [True: 0, False: 3]
  ------------------
 1174|      3|            && !ossl_rand_check_random_provider_on_unload(prov->libctx, prov))
  ------------------
  |  Branch (1174:16): [True: 0, False: 0]
  ------------------
 1175|      0|        return -1;
 1176|      3|#endif
 1177|       |
 1178|       |    /*
 1179|       |     * No need to lock if we've got no store because we've not been shared with
 1180|       |     * other threads.
 1181|       |     */
 1182|      3|    store = get_provider_store(prov->libctx);
 1183|      3|    if (store == NULL)
  ------------------
  |  Branch (1183:9): [True: 0, False: 3]
  ------------------
 1184|      0|        lock = 0;
 1185|       |
 1186|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1186:9): [True: 3, False: 0]
  |  Branch (1186:17): [True: 0, False: 3]
  ------------------
 1187|      0|        return -1;
 1188|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1188:9): [True: 3, False: 0]
  |  Branch (1188:17): [True: 0, False: 3]
  ------------------
 1189|      0|        CRYPTO_THREAD_unlock(store->lock);
 1190|      0|        return -1;
 1191|      0|    }
 1192|       |
 1193|      3|    if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 3]
  ------------------
 1194|      0|        if (lock) {
  ------------------
  |  Branch (1194:13): [True: 0, False: 0]
  ------------------
 1195|      0|            CRYPTO_THREAD_unlock(prov->flag_lock);
 1196|      0|            CRYPTO_THREAD_unlock(store->lock);
 1197|      0|        }
 1198|      0|        return -1;
 1199|      0|    }
 1200|       |
 1201|      3|#ifndef FIPS_MODULE
 1202|      3|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 3]
  |  Branch (1202:23): [True: 0, False: 0]
  |  Branch (1202:40): [True: 0, False: 0]
  ------------------
 1203|       |        /*
 1204|       |         * We have had a direct activation in this child libctx so we need to
 1205|       |         * now down the ref count in the parent provider. We do the actual down
 1206|       |         * ref outside of the flag_lock, since it could involve getting other
 1207|       |         * locks.
 1208|       |         */
 1209|      0|        freeparent = 1;
 1210|      0|    }
 1211|      3|#endif
 1212|       |
 1213|      3|    if (count < 1)
  ------------------
  |  Branch (1213:9): [True: 3, False: 0]
  ------------------
 1214|      3|        prov->flag_activated = 0;
 1215|      0|#ifndef FIPS_MODULE
 1216|      0|    else
 1217|      0|        removechildren = 0;
 1218|      3|#endif
 1219|       |
 1220|      3|#ifndef FIPS_MODULE
 1221|      3|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1221:9): [True: 3, False: 0]
  |  Branch (1221:27): [True: 3, False: 0]
  ------------------
 1222|      3|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1223|      3|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1224|       |
 1225|      3|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1225:21): [True: 0, False: 3]
  ------------------
 1226|      0|            child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
 1227|      0|            child_cb->remove_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
 1228|      0|        }
 1229|      3|    }
 1230|      3|#endif
 1231|      3|    if (lock) {
  ------------------
  |  Branch (1231:9): [True: 3, False: 0]
  ------------------
 1232|      3|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1233|      3|        CRYPTO_THREAD_unlock(store->lock);
 1234|       |        /*
 1235|       |         * This can be done outside the lock. We tolerate other threads getting
 1236|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1237|       |         */
 1238|      3|#ifndef FIPS_MODULE
 1239|      3|        if (count < 1)
  ------------------
  |  Branch (1239:13): [True: 3, False: 0]
  ------------------
 1240|      3|            ossl_decoder_cache_flush(prov->libctx);
 1241|      3|#endif
 1242|      3|    }
 1243|      3|#ifndef FIPS_MODULE
 1244|      3|    if (freeparent)
  ------------------
  |  Branch (1244:9): [True: 0, False: 3]
  ------------------
 1245|      0|        ossl_provider_free_parent(prov, 1);
 1246|      3|#endif
 1247|       |
 1248|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1249|      3|    return count;
 1250|      3|}
provider_core.c:provider_remove_store_methods:
 1357|      3|{
 1358|      3|    struct provider_store_st *store;
 1359|      3|    int freeing;
 1360|       |
 1361|      3|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1361:9): [True: 0, False: 3]
  ------------------
 1362|      0|        return 0;
 1363|       |
 1364|      3|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1364:9): [True: 0, False: 3]
  ------------------
 1365|      0|        return 0;
 1366|      3|    freeing = store->freeing;
 1367|      3|    CRYPTO_THREAD_unlock(store->lock);
 1368|       |
 1369|      3|    if (!freeing) {
  ------------------
  |  Branch (1369:9): [True: 0, False: 3]
  ------------------
 1370|      0|        int acc;
 1371|       |
 1372|      0|        if (!CRYPTO_THREAD_write_lock(prov->opbits_lock))
  ------------------
  |  Branch (1372:13): [True: 0, False: 0]
  ------------------
 1373|      0|            return 0;
 1374|      0|        OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1375|      0|        prov->operation_bits = NULL;
 1376|      0|        prov->operation_bits_sz = 0;
 1377|      0|        CRYPTO_THREAD_unlock(prov->opbits_lock);
 1378|       |
 1379|      0|        acc = evp_method_store_remove_all_provided(prov)
 1380|      0|#ifndef FIPS_MODULE
 1381|      0|            + ossl_encoder_store_remove_all_provided(prov)
 1382|      0|            + ossl_decoder_store_remove_all_provided(prov)
 1383|      0|            + ossl_store_loader_store_remove_all_provided(prov)
 1384|      0|#endif
 1385|      0|            ;
 1386|       |
 1387|      0|#ifndef FIPS_MODULE
 1388|      0|        return acc == 4;
 1389|       |#else
 1390|       |        return acc == 1;
 1391|       |#endif
 1392|      0|    }
 1393|      3|    return 1;
 1394|      3|}
provider_core.c:provider_activate_fallbacks:
 1437|  1.46k|{
 1438|  1.46k|    int use_fallbacks;
 1439|  1.46k|    int activated_fallback_count = 0;
 1440|  1.46k|    int ret = 0;
 1441|  1.46k|    const OSSL_PROVIDER_INFO *p;
 1442|       |
 1443|  1.46k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1443:9): [True: 0, False: 1.46k]
  ------------------
 1444|      0|        return 0;
 1445|  1.46k|    use_fallbacks = store->use_fallbacks;
 1446|  1.46k|    CRYPTO_THREAD_unlock(store->lock);
 1447|  1.46k|    if (!use_fallbacks)
  ------------------
  |  Branch (1447:9): [True: 1.46k, False: 1]
  ------------------
 1448|  1.46k|        return 1;
 1449|       |
 1450|      1|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (1450:9): [True: 0, False: 1]
  ------------------
 1451|      0|        return 0;
 1452|       |    /* Check again, just in case another thread changed it */
 1453|      1|    use_fallbacks = store->use_fallbacks;
 1454|      1|    if (!use_fallbacks) {
  ------------------
  |  Branch (1454:9): [True: 0, False: 1]
  ------------------
 1455|      0|        CRYPTO_THREAD_unlock(store->lock);
 1456|      0|        return 1;
 1457|      0|    }
 1458|       |
 1459|      4|    for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (1459:41): [True: 3, False: 1]
  ------------------
 1460|      3|        OSSL_PROVIDER *prov = NULL;
 1461|      3|        OSSL_PROVIDER_INFO *info = store->provinfo;
 1462|      3|        STACK_OF(INFOPAIR) *params = NULL;
  ------------------
  |  |   31|      3|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1463|      3|        size_t i;
 1464|       |
 1465|      3|        if (!p->is_fallback)
  ------------------
  |  Branch (1465:13): [True: 2, False: 1]
  ------------------
 1466|      2|            continue;
 1467|       |
 1468|      2|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1468:21): [True: 1, False: 1]
  ------------------
 1469|      1|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1469:17): [True: 1, False: 0]
  ------------------
 1470|      1|                continue;
 1471|      0|            params = info->parameters;
 1472|      0|            break;
 1473|      1|        }
 1474|       |
 1475|       |        /*
 1476|       |         * We use the internal constructor directly here,
 1477|       |         * otherwise we get a call loop
 1478|       |         */
 1479|      1|        prov = provider_new(p->name, p->init, params);
 1480|      1|        if (prov == NULL)
  ------------------
  |  Branch (1480:13): [True: 0, False: 1]
  ------------------
 1481|      0|            goto err;
 1482|      1|        prov->libctx = store->libctx;
 1483|      1|#ifndef FIPS_MODULE
 1484|      1|        prov->error_lib = ERR_get_next_error_library();
 1485|      1|#endif
 1486|       |
 1487|       |        /*
 1488|       |         * We are calling provider_activate while holding the store lock. This
 1489|       |         * means the init function will be called while holding a lock. Normally
 1490|       |         * we try to avoid calling a user callback while holding a lock.
 1491|       |         * However, fallbacks are never third party providers so we accept this.
 1492|       |         */
 1493|      1|        if (provider_activate(prov, 0, 0) < 0) {
  ------------------
  |  Branch (1493:13): [True: 0, False: 1]
  ------------------
 1494|      0|            ossl_provider_free(prov);
 1495|      0|            goto err;
 1496|      0|        }
 1497|      1|        prov->store = store;
 1498|      1|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
  ------------------
  |  Branch (1498:13): [True: 0, False: 1]
  ------------------
 1499|      0|            ossl_provider_free(prov);
 1500|      0|            goto err;
 1501|      0|        }
 1502|      1|        activated_fallback_count++;
 1503|      1|    }
 1504|       |
 1505|      1|    if (activated_fallback_count > 0) {
  ------------------
  |  Branch (1505:9): [True: 1, False: 0]
  ------------------
 1506|      1|        store->use_fallbacks = 0;
 1507|      1|        ret = 1;
 1508|      1|    }
 1509|      1| err:
 1510|      1|    CRYPTO_THREAD_unlock(store->lock);
 1511|      1|    return ret;
 1512|      1|}

ossl_err_load_RAND_strings:
  105|      2|{
  106|      2|#ifndef OPENSSL_NO_ERR
  107|      2|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 2, False: 0]
  ------------------
  108|      2|        ERR_load_strings_const(RAND_str_reasons);
  109|      2|#endif
  110|      2|    return 1;
  111|      2|}

ossl_rand_cleanup_int:
  180|      2|{
  181|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
  182|      2|    const RAND_METHOD *meth = default_RAND_meth;
  183|       |
  184|      2|    if (!rand_inited)
  ------------------
  |  Branch (184:9): [True: 1, False: 1]
  ------------------
  185|      1|        return;
  186|       |
  187|      1|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (187:9): [True: 1, False: 0]
  |  Branch (187:25): [True: 0, False: 1]
  ------------------
  188|      0|        meth->cleanup();
  189|      1|    RAND_set_rand_method(NULL);
  190|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  191|      1|    ossl_rand_pool_cleanup();
  192|      1|# ifndef OPENSSL_NO_ENGINE
  193|      1|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  194|      1|    rand_engine_lock = NULL;
  195|      1|# endif     /* !OPENSSL_NO_ENGINE */
  196|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  197|      1|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  198|      1|    rand_meth_lock = NULL;
  199|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  200|      1|    ossl_release_default_drbg_ctx();
  201|      1|    rand_inited = 0;
  202|      1|}
RAND_set_rand_method:
  281|      1|{
  282|      1|    return rand_set_rand_method_internal(meth, NULL);
  283|      1|}
RAND_get_rand_method:
  286|    553|{
  287|    553|    const RAND_METHOD *tmp_meth = NULL;
  288|       |
  289|    553|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|    553|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 553, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 0, False: 553]
  ------------------
  290|      0|        return NULL;
  291|       |
  292|    553|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 553]
  ------------------
  293|      0|        return NULL;
  294|       |
  295|    553|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (295:9): [True: 0, False: 553]
  ------------------
  296|      0|        return NULL;
  297|    553|    tmp_meth = default_RAND_meth;
  298|    553|    CRYPTO_THREAD_unlock(rand_meth_lock);
  299|    553|    if (tmp_meth != NULL)
  ------------------
  |  Branch (299:9): [True: 552, False: 1]
  ------------------
  300|    552|        return tmp_meth;
  301|       |
  302|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (302:9): [True: 0, False: 1]
  ------------------
  303|      0|        return NULL;
  304|      1|    if (default_RAND_meth == NULL) {
  ------------------
  |  Branch (304:9): [True: 1, False: 0]
  ------------------
  305|      1|#  ifndef OPENSSL_NO_ENGINE
  306|      1|        ENGINE *e;
  307|       |
  308|       |        /* If we have an engine that can do RAND, use it. */
  309|      1|        if ((e = ENGINE_get_default_RAND()) != NULL
  ------------------
  |  Branch (309:13): [True: 0, False: 1]
  ------------------
  310|      1|                && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
  ------------------
  |  Branch (310:20): [True: 0, False: 0]
  ------------------
  311|      0|            funct_ref = e;
  312|      0|            default_RAND_meth = tmp_meth;
  313|      1|        } else {
  314|      1|            ENGINE_finish(e);
  315|      1|            default_RAND_meth = &ossl_rand_meth;
  316|      1|        }
  317|       |#  else
  318|       |        default_RAND_meth = &ossl_rand_meth;
  319|       |#  endif
  320|      1|    }
  321|      1|    tmp_meth = default_RAND_meth;
  322|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  323|      1|    return tmp_meth;
  324|      1|}
RAND_priv_bytes_ex:
  438|    395|{
  439|    395|    RAND_GLOBAL *dgbl;
  440|    395|    EVP_RAND_CTX *rand;
  441|    395|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  442|    395|    const RAND_METHOD *meth = RAND_get_rand_method();
  443|       |
  444|    395|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (444:9): [True: 395, False: 0]
  |  Branch (444:25): [True: 0, False: 395]
  ------------------
  445|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            return meth->bytes(buf, num);
  447|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  448|      0|        return -1;
  449|      0|    }
  450|    395|#endif
  451|       |
  452|    395|    dgbl = rand_get_global(ctx);
  453|    395|    if (dgbl == NULL)
  ------------------
  |  Branch (453:9): [True: 0, False: 395]
  ------------------
  454|      0|        return 0;
  455|    395|#ifndef FIPS_MODULE
  456|    395|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 395]
  ------------------
  457|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  458|      0|                                          OSSL_PROV_RANDOM_PRIVATE,
  ------------------
  |  |  125|      0|# define OSSL_PROV_RANDOM_PRIVATE    1
  ------------------
  459|      0|                                          buf, num, strength);
  460|    395|#endif      /* !FIPS_MODULE */
  461|    395|    rand = rand_get0_private(ctx, dgbl);
  462|    395|    if (rand != NULL)
  ------------------
  |  Branch (462:9): [True: 395, False: 0]
  ------------------
  463|    395|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  464|       |
  465|      0|    return 0;
  466|    395|}
RAND_bytes_ex:
  477|    158|{
  478|    158|    RAND_GLOBAL *dgbl;
  479|    158|    EVP_RAND_CTX *rand;
  480|    158|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  481|    158|    const RAND_METHOD *meth = RAND_get_rand_method();
  482|       |
  483|    158|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (483:9): [True: 158, False: 0]
  |  Branch (483:25): [True: 0, False: 158]
  ------------------
  484|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            return meth->bytes(buf, num);
  486|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  487|      0|        return -1;
  488|      0|    }
  489|    158|#endif
  490|       |
  491|    158|    dgbl = rand_get_global(ctx);
  492|    158|    if (dgbl == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 158]
  ------------------
  493|      0|        return 0;
  494|    158|#ifndef FIPS_MODULE
  495|    158|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (495:9): [True: 0, False: 158]
  ------------------
  496|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  497|      0|                                          OSSL_PROV_RANDOM_PUBLIC,
  ------------------
  |  |  124|      0|# define OSSL_PROV_RANDOM_PUBLIC     0
  ------------------
  498|      0|                                          buf, num, strength);
  499|    158|#endif      /* !FIPS_MODULE */
  500|       |
  501|    158|    rand = rand_get0_public(ctx, dgbl);
  502|    158|    if (rand != NULL)
  ------------------
  |  Branch (502:9): [True: 158, False: 0]
  ------------------
  503|    158|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  504|       |
  505|      0|    return 0;
  506|    158|}
ossl_rand_ctx_new:
  520|      4|{
  521|      4|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|       |
  523|      4|    if (dgbl == NULL)
  ------------------
  |  Branch (523:9): [True: 0, False: 4]
  ------------------
  524|      0|        return NULL;
  525|       |
  526|      4|#ifndef FIPS_MODULE
  527|       |    /*
  528|       |     * We need to ensure that base libcrypto thread handling has been
  529|       |     * initialised.
  530|       |     */
  531|      4|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      4|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  532|       |
  533|       |    /* Prepopulate the random provider name */
  534|      4|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  119|      4|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      4|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 4]
  ------------------
  536|      0|        goto err0;
  537|      4|#endif
  538|       |
  539|      4|    dgbl->lock = CRYPTO_THREAD_lock_new();
  540|      4|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 4]
  ------------------
  541|      0|        goto err1;
  542|       |
  543|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (543:9): [True: 0, False: 4]
  ------------------
  544|      0|        goto err1;
  545|       |
  546|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (546:9): [True: 0, False: 4]
  ------------------
  547|      0|        goto err2;
  548|       |
  549|      4|    return dgbl;
  550|       |
  551|      0| err2:
  552|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  553|      0| err1:
  554|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  555|      0|#ifndef FIPS_MODULE
  556|      0| err0:
  557|      0|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|#endif
  559|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  560|      0|    return NULL;
  561|      0|}
ossl_rand_ctx_free:
  564|      2|{
  565|      2|    RAND_GLOBAL *dgbl = vdgbl;
  566|       |
  567|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 2]
  ------------------
  568|      0|        return;
  569|       |
  570|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  571|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  572|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  573|      2|    EVP_RAND_CTX_free(dgbl->primary);
  574|      2|    EVP_RAND_CTX_free(dgbl->seed);
  575|      2|#ifndef FIPS_MODULE
  576|      2|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      2|#endif      /* !FIPS_MODULE */
  578|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  579|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  580|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  581|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  582|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  583|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  584|       |
  585|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  586|      2|}
RAND_set_DRBG_type:
 1067|      2|{
 1068|      2|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
 1069|       |
 1070|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (1070:9): [True: 0, False: 2]
  ------------------
 1071|      0|        return 0;
 1072|      2|    if (dgbl->primary != NULL) {
  ------------------
  |  Branch (1072:9): [True: 0, False: 2]
  ------------------
 1073|      0|        ERR_raise(ERR_LIB_CRYPTO, RAND_R_ALREADY_INSTANTIATED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1074|      0|        return 0;
 1075|      0|    }
 1076|      2|    return random_set_string(&dgbl->rng_name, drbg)
  ------------------
  |  Branch (1076:12): [True: 2, False: 0]
  ------------------
 1077|      2|        && random_set_string(&dgbl->rng_propq, propq)
  ------------------
  |  Branch (1077:12): [True: 2, False: 0]
  ------------------
 1078|      2|        && random_set_string(&dgbl->rng_cipher, cipher)
  ------------------
  |  Branch (1078:12): [True: 2, False: 0]
  ------------------
 1079|      2|        && random_set_string(&dgbl->rng_digest, digest);
  ------------------
  |  Branch (1079:12): [True: 2, False: 0]
  ------------------
 1080|      2|}
rand_lib.c:do_rand_init:
  148|      1|{
  149|      1|# ifndef OPENSSL_NO_ENGINE
  150|      1|    rand_engine_lock = CRYPTO_THREAD_lock_new();
  151|      1|    if (rand_engine_lock == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 1]
  ------------------
  152|      0|        return 0;
  153|      1|# endif     /* !OPENSSL_NO_ENGINE */
  154|       |
  155|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  156|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
  157|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 1]
  ------------------
  158|      0|        goto err;
  159|      1|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  160|       |
  161|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|        goto err;
  163|       |
  164|      1|    rand_inited = 1;
  165|      1|    return 1;
  166|       |
  167|      0| err:
  168|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
  169|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  170|      0|    rand_meth_lock = NULL;
  171|      0|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  172|      0|# ifndef OPENSSL_NO_ENGINE
  173|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  174|      0|    rand_engine_lock = NULL;
  175|      0|# endif     /* !OPENSSL_NO_ENGINE */
  176|      0|    return 0;
  177|      1|}
rand_lib.c:rand_set_rand_method_internal:
  265|      1|{
  266|      1|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (266:9): [True: 0, False: 1]
  ------------------
  267|      0|        return 0;
  268|       |
  269|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (269:9): [True: 0, False: 1]
  ------------------
  270|      0|        return 0;
  271|      1|#  ifndef OPENSSL_NO_ENGINE
  272|      1|    ENGINE_finish(funct_ref);
  273|      1|    funct_ref = e;
  274|      1|#  endif
  275|      1|    default_RAND_meth = meth;
  276|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  277|      1|    return 1;
  278|      1|}
rand_lib.c:rand_get_global:
  100|    560|{
  101|    560|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|    560|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  102|    560|}
rand_lib.c:rand_get0_primary:
  760|      2|{
  761|      2|    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
  762|       |
  763|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (763:9): [True: 0, False: 2]
  ------------------
  764|      0|        return NULL;
  765|       |
  766|      2|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (766:9): [True: 0, False: 2]
  ------------------
  767|      0|        return NULL;
  768|       |
  769|      2|    ret = dgbl->primary;
  770|      2|    seed = dgbl->seed;
  771|      2|    CRYPTO_THREAD_unlock(dgbl->lock);
  772|       |
  773|      2|    if (ret != NULL)
  ------------------
  |  Branch (773:9): [True: 1, False: 1]
  ------------------
  774|      1|        return ret;
  775|       |
  776|      1|#if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
  777|       |    /* Create a seed source for libcrypto or jitter enabled FIPS provider */
  778|      1|    if (seed == NULL) {
  ------------------
  |  Branch (778:9): [True: 1, False: 0]
  ------------------
  779|      1|        ERR_set_mark();
  780|      1|        seed = newseed = rand_new_seed(ctx);
  781|      1|        ERR_pop_to_mark();
  782|      1|    }
  783|      1|#endif  /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */
  784|       |
  785|       |#if defined(FIPS_MODULE)
  786|       |    /* The FIPS provider has entropy health tests instead of the primary */
  787|       |    ret = rand_new_crngt(ctx, seed);
  788|       |#else   /* FIPS_MODULE */
  789|      1|    ret = rand_new_drbg(ctx, seed, PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|# define PRIMARY_RESEED_INTERVAL                 (1 << 8)
  ------------------
  790|      1|                        PRIMARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   25|      1|# define PRIMARY_RESEED_TIME_INTERVAL            (60 * 60) /* 1 hour */
  ------------------
  791|      1|#endif  /* FIPS_MODULE */
  792|       |
  793|       |    /*
  794|       |     * The primary DRBG may be shared between multiple threads so we must
  795|       |     * enable locking.
  796|       |     */
  797|      1|    if (ret == NULL || !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (797:9): [True: 0, False: 1]
  |  Branch (797:24): [True: 0, False: 1]
  ------------------
  798|      0|        if (ret != NULL) {
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  ------------------
  799|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  800|      0|            EVP_RAND_CTX_free(ret);
  801|      0|        }
  802|      0|        if (newseed == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            return NULL;
  804|       |        /* else carry on and store seed */
  805|      0|        ret = NULL;
  806|      0|    }
  807|       |
  808|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (808:9): [True: 0, False: 1]
  ------------------
  809|      0|        return NULL;
  810|       |
  811|      1|    primary = dgbl->primary;
  812|      1|    if (primary != NULL) {
  ------------------
  |  Branch (812:9): [True: 0, False: 1]
  ------------------
  813|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  814|      0|        EVP_RAND_CTX_free(ret);
  815|      0|        EVP_RAND_CTX_free(newseed);
  816|      0|        return primary;
  817|      0|    }
  818|      1|    if (newseed != NULL)
  ------------------
  |  Branch (818:9): [True: 1, False: 0]
  ------------------
  819|      1|        dgbl->seed = newseed;
  820|      1|    dgbl->primary = ret;
  821|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  822|       |
  823|      1|    return ret;
  824|      1|}
rand_lib.c:rand_new_seed:
  608|      1|{
  609|      1|    EVP_RAND *rand;
  610|      1|    const char *propq;
  611|      1|    char *name;
  612|      1|    EVP_RAND_CTX *ctx = NULL;
  613|      1|# ifdef OPENSSL_NO_FIPS_JITTER
  614|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  615|       |
  616|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (616:9): [True: 0, False: 1]
  ------------------
  617|      0|        return NULL;
  618|      1|    propq = dgbl->seed_propq;
  619|      1|    name = dgbl->seed_name != NULL ? dgbl->seed_name
  ------------------
  |  Branch (619:12): [True: 0, False: 1]
  ------------------
  620|      1|                                   : OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC);
  ------------------
  |  |   20|      1|# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
  |  |  ------------------
  |  |  |  |   19|      1|# define OPENSSL_MSTR_HELPER(x) #x
  |  |  ------------------
  ------------------
  621|       |# else /* !OPENSSL_NO_FIPS_JITTER */
  622|       |    name = "JITTER";
  623|       |    propq = "";
  624|       |# endif /* OPENSSL_NO_FIPS_JITTER */
  625|       |
  626|      1|    rand = EVP_RAND_fetch(libctx, name, propq);
  627|      1|    if (rand == NULL) {
  ------------------
  |  Branch (627:9): [True: 0, False: 1]
  ------------------
  628|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  629|      0|        goto err;
  630|      0|    }
  631|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  632|      1|    EVP_RAND_free(rand);
  633|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (633:9): [True: 0, False: 1]
  ------------------
  634|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  635|      0|        goto err;
  636|      0|    }
  637|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (637:9): [True: 0, False: 1]
  ------------------
  638|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|        goto err;
  640|      0|    }
  641|      1|    return ctx;
  642|      0| err:
  643|      0|    EVP_RAND_CTX_free(ctx);
  644|      0|    return NULL;
  645|      1|}
rand_lib.c:rand_new_drbg:
  668|      3|{
  669|      3|    EVP_RAND *rand;
  670|      3|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  671|      3|    EVP_RAND_CTX *ctx;
  672|      3|    OSSL_PARAM params[9], *p = params;
  673|      3|    const OSSL_PARAM *settables;
  674|      3|    const char *prov_name;
  675|      3|    char *name, *cipher;
  676|      3|    int use_df = 1;
  677|       |
  678|      3|    if (dgbl == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3]
  ------------------
  679|      0|        return NULL;
  680|      3|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (680:12): [True: 3, False: 0]
  ------------------
  681|      3|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  682|      3|    if (rand == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 3]
  ------------------
  683|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  684|      0|        return NULL;
  685|      0|    }
  686|      3|    prov_name = ossl_provider_name(EVP_RAND_get0_provider(rand));
  687|      3|    ctx = EVP_RAND_CTX_new(rand, parent);
  688|      3|    EVP_RAND_free(rand);
  689|      3|    if (ctx == NULL) {
  ------------------
  |  Branch (689:9): [True: 0, False: 3]
  ------------------
  690|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  691|      0|        return NULL;
  692|      0|    }
  693|       |
  694|      3|    settables = EVP_RAND_CTX_settable_params(ctx);
  695|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 0, False: 3]
  ------------------
  696|      0|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (696:18): [True: 0, False: 0]
  ------------------
  697|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  227|      0|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      0|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  698|      0|                                                cipher, 0);
  699|      0|    }
  700|      3|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (700:9): [True: 0, False: 3]
  ------------------
  701|      3|            && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (701:16): [True: 0, False: 0]
  ------------------
  702|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  703|      0|                                                dgbl->rng_digest, 0);
  704|      3|    if (prov_name != NULL)
  ------------------
  |  Branch (704:9): [True: 3, False: 0]
  ------------------
  705|      3|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_CORE_PROV_NAME,
  ------------------
  |  |  494|      3|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  706|      3|                                                (char *)prov_name, 0);
  707|      3|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 3]
  ------------------
  708|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  242|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  709|      0|                                                dgbl->rng_propq, 0);
  710|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  125|      3|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (710:9): [True: 0, False: 3]
  ------------------
  711|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  125|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  712|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  249|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (712:9): [True: 0, False: 3]
  ------------------
  713|      0|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  249|      0|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  714|      3|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  245|      3|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  715|      3|                                     &reseed_interval);
  716|      3|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  247|      3|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  717|      3|                                       &reseed_time_interval);
  718|      3|    *p = OSSL_PARAM_construct_end();
  719|      3|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (719:9): [True: 0, False: 3]
  ------------------
  720|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  721|      0|        EVP_RAND_CTX_free(ctx);
  722|      0|        return NULL;
  723|      0|    }
  724|      3|    return ctx;
  725|      3|}
rand_lib.c:rand_get0_public:
  839|    158|{
  840|    158|    EVP_RAND_CTX *rand, *primary;
  841|       |
  842|    158|    if (dgbl == NULL)
  ------------------
  |  Branch (842:9): [True: 0, False: 158]
  ------------------
  843|      0|        return NULL;
  844|       |
  845|    158|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  846|    158|    if (rand == NULL) {
  ------------------
  |  Branch (846:9): [True: 1, False: 157]
  ------------------
  847|      1|        primary = rand_get0_primary(ctx, dgbl);
  848|      1|        if (primary == NULL)
  ------------------
  |  Branch (848:13): [True: 0, False: 1]
  ------------------
  849|      0|            return NULL;
  850|       |
  851|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  852|       |
  853|      1|        if (ctx == NULL)
  ------------------
  |  Branch (853:13): [True: 0, False: 1]
  ------------------
  854|      0|            return NULL;
  855|       |        /*
  856|       |         * If the private is also NULL then this is the first time we've
  857|       |         * used this thread.
  858|       |         */
  859|      1|        if (CRYPTO_THREAD_get_local(&dgbl->private) == NULL
  ------------------
  |  Branch (859:13): [True: 1, False: 0]
  ------------------
  860|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (860:20): [True: 0, False: 1]
  ------------------
  861|      0|            return NULL;
  862|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  863|      1|                             SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  864|      1|        CRYPTO_THREAD_set_local(&dgbl->public, rand);
  865|      1|    }
  866|    158|    return rand;
  867|    158|}
rand_lib.c:rand_delete_thread_state:
  589|      1|{
  590|      1|    OSSL_LIB_CTX *ctx = arg;
  591|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  592|      1|    EVP_RAND_CTX *rand;
  593|       |
  594|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (594:9): [True: 0, False: 1]
  ------------------
  595|      0|        return;
  596|       |
  597|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  598|      1|    CRYPTO_THREAD_set_local(&dgbl->public, NULL);
  599|      1|    EVP_RAND_CTX_free(rand);
  600|       |
  601|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  602|      1|    CRYPTO_THREAD_set_local(&dgbl->private, NULL);
  603|      1|    EVP_RAND_CTX_free(rand);
  604|      1|}
rand_lib.c:rand_get0_private:
  881|    395|{
  882|    395|    EVP_RAND_CTX *rand, *primary;
  883|       |
  884|    395|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  885|    395|    if (rand == NULL) {
  ------------------
  |  Branch (885:9): [True: 1, False: 394]
  ------------------
  886|      1|        primary = rand_get0_primary(ctx, dgbl);
  887|      1|        if (primary == NULL)
  ------------------
  |  Branch (887:13): [True: 0, False: 1]
  ------------------
  888|      0|            return NULL;
  889|       |
  890|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  891|       |
  892|      1|        if (ctx == NULL)
  ------------------
  |  Branch (892:13): [True: 0, False: 1]
  ------------------
  893|      0|            return NULL;
  894|       |        /*
  895|       |         * If the public is also NULL then this is the first time we've
  896|       |         * used this thread.
  897|       |         */
  898|      1|        if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL
  ------------------
  |  Branch (898:13): [True: 0, False: 1]
  ------------------
  899|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (899:20): [True: 0, False: 0]
  ------------------
  900|      0|            return NULL;
  901|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  902|      1|                             SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  903|      1|        CRYPTO_THREAD_set_local(&dgbl->private, rand);
  904|      1|    }
  905|    395|    return rand;
  906|    395|}
rand_lib.c:random_set_string:
  961|      8|{
  962|      8|    char *d = NULL;
  963|       |
  964|      8|    if (s != NULL) {
  ------------------
  |  Branch (964:9): [True: 2, False: 6]
  ------------------
  965|      2|        d = OPENSSL_strdup(s);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  966|      2|        if (d == NULL)
  ------------------
  |  Branch (966:13): [True: 0, False: 2]
  ------------------
  967|      0|            return 0;
  968|      2|    }
  969|      8|    OPENSSL_free(*p);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  970|      8|    *p = d;
  971|      8|    return 1;
  972|      8|}

RAND_OpenSSL:
   63|    553|{
   64|    553|    return &ossl_rand_meth;
   65|    553|}

ossl_err_load_RSA_strings:
  160|      2|{
  161|      2|#ifndef OPENSSL_NO_ERR
  162|      2|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (162:9): [True: 2, False: 0]
  ------------------
  163|      2|        ERR_load_strings_const(RSA_str_reasons);
  164|      2|#endif
  165|      2|    return 1;
  166|      2|}

ossl_self_test_set_callback_new:
   35|      4|{
   36|      4|    SELF_TEST_CB *stcb;
   37|       |
   38|      4|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      4|    return stcb;
   40|      4|}
ossl_self_test_set_callback_free:
   43|      2|{
   44|      2|    OPENSSL_free(stcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      2|}

EVP_sm3:
   29|      2|{
   30|      2|    return &sm3_md;
   31|      2|}

ossl_sa_new:
   59|     16|{
   60|     16|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|     16|    return res;
   63|     16|}
ossl_sa_free:
  111|      8|{
  112|      8|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 8, False: 0]
  ------------------
  113|      8|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      8|        OPENSSL_free(sa);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall:
  135|      8|{
  136|      8|    struct trampoline_st tramp;
  137|       |
  138|      8|    tramp.func = leaf;
  139|      8|    if (sa != NULL)
  ------------------
  |  Branch (139:9): [True: 8, False: 0]
  ------------------
  140|      8|        sa_doall(sa, NULL, &trampoline, &tramp);
  141|      8|}
ossl_sa_doall_arg:
  146|      8|{
  147|      8|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 8, False: 0]
  ------------------
  148|      8|        sa_doall(sa, NULL, leaf, arg);
  149|      8|}
ossl_sa_get:
  157|  10.6k|{
  158|  10.6k|    int level;
  159|  10.6k|    void **p, *r = NULL;
  160|       |
  161|  10.6k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 10.6k]
  |  Branch (161:23): [True: 3, False: 10.6k]
  ------------------
  162|      3|        return NULL;
  163|       |
  164|  10.6k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 10.3k, False: 272]
  ------------------
  165|  10.3k|        p = sa->nodes;
  166|  40.5k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 39.5k, False: 994]
  |  Branch (166:51): [True: 30.1k, False: 9.39k]
  ------------------
  167|  30.1k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  30.1k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  30.1k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  30.1k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  30.1k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  30.1k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  10.3k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  9.39k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  9.39k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  9.39k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 994, False: 9.39k]
  ------------------
  170|  10.3k|    }
  171|  10.6k|    return r;
  172|  10.6k|}
ossl_sa_set:
  180|    538|{
  181|    538|    int i, level = 1;
  182|    538|    ossl_uintmax_t n = posn;
  183|    538|    void **p;
  184|       |
  185|    538|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 538]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  2.12k|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  2.12k|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  2.12k|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  2.12k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|  2.12k|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  2.12k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 2.12k, False: 0]
  ------------------
  189|  2.12k|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  2.12k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 538, False: 1.58k]
  ------------------
  190|    538|            break;
  191|       |
  192|    542|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 4, False: 538]
  ------------------
  193|      4|        p = alloc_node();
  194|      4|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 4]
  ------------------
  195|      0|            return 0;
  196|      4|        p[0] = sa->nodes;
  197|      4|        sa->nodes = p;
  198|      4|    }
  199|    538|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 137, False: 401]
  ------------------
  200|    137|        sa->top = posn;
  201|       |
  202|    538|    p = sa->nodes;
  203|  2.15k|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 1.61k, False: 538]
  ------------------
  204|  1.61k|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|  1.61k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|  1.61k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.61k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.61k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  1.61k|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 491, False: 1.12k]
  |  Branch (205:29): [True: 0, False: 491]
  ------------------
  206|      0|            return 0;
  207|  1.61k|        p = p[i];
  208|  1.61k|    }
  209|    538|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    538|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    538|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    538|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    538|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 269, False: 269]
  |  Branch (210:24): [True: 269, False: 0]
  ------------------
  211|    269|        sa->nelem--;
  212|    269|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 269, False: 0]
  |  Branch (212:29): [True: 269, False: 0]
  ------------------
  213|    269|        sa->nelem++;
  214|    538|    *p = val;
  215|    538|    return 1;
  216|    538|}
sparse_array.c:sa_doall:
   67|     24|{
   68|     24|    int i[SA_BLOCK_MAX_LEVELS];
   69|     24|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|     24|    ossl_uintmax_t idx = 0;
   71|     24|    int l = 0;
   72|       |
   73|     24|    i[0] = 0;
   74|     24|    nodes[0] = sa->nodes;
   75|  17.2k|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 17.2k, False: 24]
  ------------------
   76|  17.2k|        const int n = i[l];
   77|  17.2k|        void ** const p = nodes[l];
   78|       |
   79|  17.2k|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  17.2k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  17.2k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 1.01k, False: 16.1k]
  ------------------
   80|  1.01k|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 990, False: 22]
  |  Branch (80:30): [True: 495, False: 495]
  ------------------
   81|    495|                (*node)(p);
   82|  1.01k|            l--;
   83|  1.01k|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  1.01k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  16.1k|        } else {
   85|  16.1k|            i[l] = n + 1;
   86|  16.1k|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 15.8k, False: 352]
  |  Branch (86:30): [True: 1.25k, False: 14.5k]
  ------------------
   87|  1.25k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|  1.25k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.25k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.25k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  1.25k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 988, False: 269]
  ------------------
   89|    988|                    i[++l] = 0;
   90|    988|                    nodes[l] = p[n];
   91|    988|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|    988|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|    988|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 269, False: 0]
  ------------------
   93|    269|                    (*leaf)(idx, p[n], arg);
   94|    269|                }
   95|  1.25k|            }
   96|  16.1k|        }
   97|  17.2k|    }
   98|     24|}
sparse_array.c:sa_free_node:
  101|    495|{
  102|    495|    OPENSSL_free(p);
  ------------------
  |  |  115|    495|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    495|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    495|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    495|}
sparse_array.c:alloc_node:
  175|    495|{
  176|    495|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    495|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    495|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    495|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    495|}

ossl_err_load_SSL_strings:
  629|      2|{
  630|      2|#ifndef OPENSSL_NO_ERR
  631|      2|    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (631:9): [True: 2, False: 0]
  ------------------
  632|      2|        ERR_load_strings_const(SSL_str_reasons);
  633|      2|#endif
  634|      2|    return 1;
  635|      2|}

OPENSSL_sk_set_cmp_func:
   38|     79|{
   39|     79|    OPENSSL_sk_compfunc old = sk->comp;
   40|       |
   41|     79|    if (sk->comp != c)
  ------------------
  |  Branch (41:9): [True: 79, False: 0]
  ------------------
   42|     79|        sk->sorted = 0;
   43|     79|    sk->comp = c;
   44|       |
   45|     79|    return old;
   46|     79|}
OPENSSL_sk_dup:
   49|  1.74k|{
   50|  1.74k|    OPENSSL_STACK *ret;
   51|       |
   52|  1.74k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  1.74k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 1.74k]
  ------------------
   53|      0|        goto err;
   54|       |
   55|  1.74k|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 1.74k]
  ------------------
   56|      2|        ret->num = 0;
   57|      2|        ret->sorted = 0;
   58|      2|        ret->comp = NULL;
   59|  1.74k|    } else {
   60|       |        /* direct structure assignment */
   61|  1.74k|        *ret = *sk;
   62|  1.74k|    }
   63|       |
   64|  1.74k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 2, False: 1.74k]
  |  Branch (64:23): [True: 0, False: 1.74k]
  ------------------
   65|       |        /* postpone |ret->data| allocation */
   66|      2|        ret->data = NULL;
   67|      2|        ret->num_alloc = 0;
   68|      2|        return ret;
   69|      2|    }
   70|       |
   71|       |    /* duplicate |sk->data| content */
   72|  1.74k|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|  1.74k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|  1.74k|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 1.74k]
  ------------------
   74|      0|        goto err;
   75|  1.74k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|  1.74k|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|  1.74k|}
OPENSSL_sk_deep_copy:
   86|      3|{
   87|      3|    OPENSSL_STACK *ret;
   88|      3|    int i;
   89|       |
   90|      3|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (90:9): [True: 0, False: 3]
  ------------------
   91|      0|        goto err;
   92|       |
   93|      3|    if (sk == NULL) {
  ------------------
  |  Branch (93:9): [True: 3, False: 0]
  ------------------
   94|      3|        ret->num = 0;
   95|      3|        ret->sorted = 0;
   96|      3|        ret->comp = NULL;
   97|      3|    } else {
   98|       |        /* direct structure assignment */
   99|      0|        *ret = *sk;
  100|      0|    }
  101|       |
  102|      3|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (102:9): [True: 3, False: 0]
  |  Branch (102:23): [True: 0, False: 0]
  ------------------
  103|       |        /* postpone |ret| data allocation */
  104|      3|        ret->data = NULL;
  105|      3|        ret->num_alloc = 0;
  106|      3|        return ret;
  107|      3|    }
  108|       |
  109|      0|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (109:22): [True: 0, False: 0]
  ------------------
  110|      0|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    if (ret->data == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 0]
  ------------------
  112|      0|        goto err;
  113|       |
  114|      0|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|            continue;
  117|      0|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|            while (--i >= 0)
  ------------------
  |  Branch (118:20): [True: 0, False: 0]
  ------------------
  119|      0|                if (ret->data[i] != NULL)
  ------------------
  |  Branch (119:21): [True: 0, False: 0]
  ------------------
  120|      0|                    free_func((void *)ret->data[i]);
  121|      0|            goto err;
  122|      0|        }
  123|      0|    }
  124|      0|    return ret;
  125|       |
  126|      0| err:
  127|      0|    OPENSSL_sk_free(ret);
  128|      0|    return NULL;
  129|      0|}
OPENSSL_sk_new_null:
  132|  1.09k|{
  133|  1.09k|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|  1.09k|}
OPENSSL_sk_new:
  137|    133|{
  138|    133|    return OPENSSL_sk_new_reserve(c, 0);
  139|    133|}
OPENSSL_sk_new_reserve:
  228|  1.23k|{
  229|  1.23k|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|  1.23k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.23k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.23k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|  1.23k|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 1.23k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|  1.23k|    st->comp = c;
  235|       |
  236|  1.23k|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 1.23k, False: 0]
  ------------------
  237|  1.23k|        return st;
  238|       |
  239|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|        OPENSSL_sk_free(st);
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|      0|    return st;
  245|      0|}
OPENSSL_sk_set_thunks:
  260|    578|{
  261|    578|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 455, False: 123]
  ------------------
  262|    455|        st->free_thunk = f_thunk;
  263|       |
  264|    578|    return st;
  265|    578|}
OPENSSL_sk_insert:
  268|  1.63k|{
  269|  1.63k|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 1.63k]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return 0;
  272|      0|    }
  273|  1.63k|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 1.63k]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return 0;
  276|      0|    }
  277|       |
  278|  1.63k|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 1.63k]
  ------------------
  279|      0|        return 0;
  280|       |
  281|  1.63k|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 1.63k, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|  1.63k|        st->data[st->num] = data;
  283|  1.63k|    } else {
  284|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  285|      0|                sizeof(st->data[0]) * (st->num - loc));
  286|      0|        st->data[loc] = data;
  287|      0|    }
  288|  1.63k|    st->num++;
  289|  1.63k|    st->sorted = 0;
  290|  1.63k|    return st->num;
  291|  1.63k|}
OPENSSL_sk_delete:
  319|      2|{
  320|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (320:9): [True: 0, False: 2]
  |  Branch (320:23): [True: 0, False: 2]
  |  Branch (320:34): [True: 0, False: 2]
  ------------------
  321|      0|        return NULL;
  322|       |
  323|      2|    return internal_delete(st, loc);
  324|      2|}
OPENSSL_sk_find:
  392|      4|{
  393|      4|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  153|      4|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  394|      4|}
OPENSSL_sk_push:
  407|  1.63k|{
  408|  1.63k|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 1.63k]
  ------------------
  409|      0|        return 0;
  410|  1.63k|    return OPENSSL_sk_insert(st, data, st->num);
  411|  1.63k|}
OPENSSL_sk_pop_free:
  441|  2.52k|{
  442|  2.52k|    int i;
  443|       |
  444|  2.52k|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 1.54k, False: 978]
  ------------------
  445|  1.54k|        return;
  446|       |
  447|  2.10k|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 1.12k, False: 978]
  ------------------
  448|  1.12k|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 1.12k, False: 2]
  ------------------
  449|  1.12k|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 531, False: 590]
  ------------------
  450|    531|                st->free_thunk(func, (void *)st->data[i]);
  451|    590|            else
  452|    590|                func((void *)st->data[i]);
  453|  1.12k|        }
  454|  1.12k|    }
  455|    978|    OPENSSL_sk_free(st);
  456|    978|}
OPENSSL_sk_free:
  459|  3.76k|{
  460|  3.76k|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 800, False: 2.96k]
  ------------------
  461|    800|        return;
  462|  2.96k|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  2.96k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|  2.96k|    OPENSSL_free(st);
  ------------------
  |  |  115|  2.96k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  2.96k|}
OPENSSL_sk_num:
  467|  4.48k|{
  468|  4.48k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 950, False: 3.53k]
  ------------------
  469|  4.48k|}
OPENSSL_sk_value:
  472|  10.0k|{
  473|  10.0k|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 10.0k]
  |  Branch (473:23): [True: 0, False: 10.0k]
  |  Branch (473:32): [True: 0, False: 10.0k]
  ------------------
  474|      0|        return NULL;
  475|  10.0k|    return (void *)st->data[i];
  476|  10.0k|}
OPENSSL_sk_set:
  479|      2|{
  480|      2|    if (st == NULL) {
  ------------------
  |  Branch (480:9): [True: 0, False: 2]
  ------------------
  481|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|      0|        return NULL;
  483|      0|    }
  484|      2|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (484:9): [True: 0, False: 2]
  |  Branch (484:18): [True: 0, False: 2]
  ------------------
  485|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|      0|                       "i=%d", i);
  487|      0|        return NULL;
  488|      0|    }
  489|      2|    st->data[i] = data;
  490|      2|    st->sorted = 0;
  491|      2|    return (void *)st->data[i];
  492|      2|}
OPENSSL_sk_sort:
  495|    129|{
  496|    129|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (496:9): [True: 129, False: 0]
  |  Branch (496:23): [True: 129, False: 0]
  |  Branch (496:38): [True: 129, False: 0]
  ------------------
  497|    129|        if (st->num > 1)
  ------------------
  |  Branch (497:13): [True: 79, False: 50]
  ------------------
  498|     79|            qsort(st->data, st->num, sizeof(void *), st->comp);
  499|    129|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  500|    129|    }
  501|    129|}
stack.c:sk_reserve:
  179|  1.63k|{
  180|  1.63k|    const void **tmpdata;
  181|  1.63k|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|  1.63k|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 1.63k]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /* Figure out the new size */
  190|  1.63k|    num_alloc = st->num + n;
  191|  1.63k|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 1.30k, False: 324]
  ------------------
  192|  1.30k|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|  1.63k|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 699, False: 934]
  ------------------
  196|       |        /*
  197|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  198|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  199|       |         */
  200|    699|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|    699|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    699|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    699|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 699]
  ------------------
  201|      0|            return 0;
  202|    699|        st->num_alloc = num_alloc;
  203|    699|        return 1;
  204|    699|    }
  205|       |
  206|    934|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 934, False: 0]
  ------------------
  207|    934|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 914, False: 20]
  ------------------
  208|    914|            return 1;
  209|     20|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|     20|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 20]
  ------------------
  211|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|            return 0;
  213|      0|        }
  214|     20|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|     20|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|     20|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     20|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     20|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     20|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 20]
  ------------------
  220|      0|        return 0;
  221|       |
  222|     20|    st->data = tmpdata;
  223|     20|    st->num_alloc = num_alloc;
  224|     20|    return 1;
  225|     20|}
stack.c:compute_growth:
  161|     20|{
  162|     20|    int err = 0;
  163|       |
  164|     40|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 20, False: 20]
  ------------------
  165|     20|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 20]
  ------------------
  166|      0|            return 0;
  167|       |
  168|     20|        current = safe_muldiv_int(current, 8, 5, &err);
  169|     20|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 20]
  ------------------
  170|      0|            return 0;
  171|     20|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 20]
  ------------------
  172|      0|            current = max_nodes;
  173|     20|    }
  174|     20|    return current;
  175|     20|}
stack.c:internal_delete:
  294|      2|{
  295|      2|    const void *ret = st->data[loc];
  296|       |
  297|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (297:9): [True: 0, False: 2]
  ------------------
  298|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  299|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  300|      2|    st->num--;
  301|       |
  302|      2|    return (void *)ret;
  303|      2|}
stack.c:internal_find:
  328|      4|{
  329|      4|    const void *r;
  330|      4|    int i, count = 0;
  331|      4|    int *pnum = pnum_matched;
  332|       |
  333|      4|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (333:9): [True: 0, False: 4]
  |  Branch (333:23): [True: 4, False: 0]
  ------------------
  334|      4|        return -1;
  335|       |
  336|      0|    if (pnum == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  ------------------
  337|      0|        pnum = &count;
  338|       |
  339|      0|    if (st->comp == NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (340:21): [True: 0, False: 0]
  ------------------
  341|      0|            if (st->data[i] == data) {
  ------------------
  |  Branch (341:17): [True: 0, False: 0]
  ------------------
  342|      0|                *pnum = 1;
  343|      0|                return i;
  344|      0|            }
  345|      0|        *pnum = 0;
  346|      0|        return -1;
  347|      0|    }
  348|       |
  349|      0|    if (data == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|        return -1;
  351|       |
  352|      0|    if (!st->sorted) {
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        int res = -1;
  354|       |
  355|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|            if (st->comp(&data, st->data + i) == 0) {
  ------------------
  |  Branch (356:17): [True: 0, False: 0]
  ------------------
  357|      0|                if (res == -1)
  ------------------
  |  Branch (357:21): [True: 0, False: 0]
  ------------------
  358|      0|                    res = i;
  359|      0|                ++*pnum;
  360|       |                /* Check if only one result is wanted and exit if so */
  361|      0|                if (pnum_matched == NULL)
  ------------------
  |  Branch (361:21): [True: 0, False: 0]
  ------------------
  362|      0|                    return i;
  363|      0|            }
  364|      0|        if (res == -1)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            *pnum = 0;
  366|      0|        return res;
  367|      0|    }
  368|       |
  369|      0|    if (pnum_matched != NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 0]
  ------------------
  370|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  153|      0|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  371|      0|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  372|      0|                     ret_val_options);
  373|       |
  374|      0|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 0]
  ------------------
  375|      0|        *pnum = 0;
  376|      0|        if (r != NULL) {
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            const void **p = (const void **)r;
  378|       |
  379|      0|            while (p < st->data + st->num) {
  ------------------
  |  Branch (379:20): [True: 0, False: 0]
  ------------------
  380|      0|                if (st->comp(&data, p) != 0)
  ------------------
  |  Branch (380:21): [True: 0, False: 0]
  ------------------
  381|      0|                    break;
  382|      0|                ++*pnum;
  383|      0|                ++p;
  384|      0|            }
  385|      0|        }
  386|      0|    }
  387|       |
  388|      0|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (388:12): [True: 0, False: 0]
  ------------------
  389|      0|}

ossl_err_load_OSSL_STORE_strings:
   69|      2|{
   70|      2|#ifndef OPENSSL_NO_ERR
   71|      2|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (71:9): [True: 2, False: 0]
  ------------------
   72|      2|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   73|      2|#endif
   74|      2|    return 1;
   75|      2|}

ossl_store_cleanup_int:
   14|      2|{
   15|      2|    ossl_store_destroy_loaders_int();
   16|      2|}

ossl_store_loader_store_cache_flush:
  389|      2|{
  390|      2|    OSSL_METHOD_STORE *store = get_loader_store(libctx);
  391|       |
  392|      2|    if (store != NULL)
  ------------------
  |  Branch (392:9): [True: 2, False: 0]
  ------------------
  393|      2|        return ossl_method_store_cache_flush_all(store);
  394|      0|    return 1;
  395|      2|}
store_meth.c:get_loader_store:
  109|      2|{
  110|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX);
  ------------------
  |  |  115|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  111|      2|}

ossl_store_destroy_loaders_int:
  281|      2|{
  282|      2|    lh_OSSL_STORE_LOADER_free(loader_register);
  283|      2|    loader_register = NULL;
  284|      2|    CRYPTO_THREAD_lock_free(registry_lock);
  285|      2|    registry_lock = NULL;
  286|      2|}

ossl_crypto_mutex_new:
   97|     83|{
   98|     83|    pthread_mutex_t *mutex;
   99|       |
  100|     83|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  104|     83|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     83|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     83|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 83]
  ------------------
  101|      0|        return NULL;
  102|     83|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 83]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|     83|    return (CRYPTO_MUTEX *)mutex;
  107|     83|}
ossl_crypto_mutex_lock:
  122|    158|{
  123|    158|    int rc;
  124|    158|    pthread_mutex_t *mutex_p;
  125|       |
  126|    158|    mutex_p = (pthread_mutex_t *)mutex;
  127|    158|    rc = pthread_mutex_lock(mutex_p);
  128|    158|    OPENSSL_assert(rc == 0);
  ------------------
  |  |  438|    158|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 158, False: 0]
  |  |  ------------------
  ------------------
  129|    158|}
ossl_crypto_mutex_unlock:
  132|    158|{
  133|    158|    int rc;
  134|    158|    pthread_mutex_t *mutex_p;
  135|       |
  136|    158|    mutex_p = (pthread_mutex_t *)mutex;
  137|    158|    rc = pthread_mutex_unlock(mutex_p);
  138|    158|    OPENSSL_assert(rc == 0);
  ------------------
  |  |  438|    158|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 158, False: 0]
  |  |  ------------------
  ------------------
  139|    158|}
ossl_crypto_mutex_free:
  142|     81|{
  143|     81|    pthread_mutex_t **mutex_p;
  144|       |
  145|     81|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 81]
  ------------------
  146|      0|        return;
  147|       |
  148|     81|    mutex_p = (pthread_mutex_t **)mutex;
  149|     81|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 81, False: 0]
  ------------------
  150|     81|        pthread_mutex_destroy(*mutex_p);
  151|     81|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  115|     81|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     81|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     81|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|     81|    *mutex = NULL;
  153|     81|}
ossl_crypto_condvar_new:
  156|      4|{
  157|      4|    pthread_cond_t *cv_p;
  158|       |
  159|      4|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      0|        return NULL;
  161|      4|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 4]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      4|    return (CRYPTO_CONDVAR *) cv_p;
  166|      4|}
ossl_crypto_condvar_free:
  220|      2|{
  221|      2|    pthread_cond_t **cv_p;
  222|       |
  223|      2|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        return;
  225|       |
  226|      2|    cv_p = (pthread_cond_t **)cv;
  227|      2|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 2, False: 0]
  ------------------
  228|      2|        pthread_cond_destroy(*cv_p);
  229|      2|    OPENSSL_free(*cv_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      2|    *cv_p = NULL;
  231|      2|}

ossl_threads_ctx_new:
  128|      4|{
  129|      4|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      4|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      4|    t->lock = ossl_crypto_mutex_new();
  135|      4|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      4|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 4]
  |  Branch (137:28): [True: 0, False: 4]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      4|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      4|}
ossl_threads_ctx_free:
  148|      2|{
  149|      2|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      2|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 2]
  ------------------
  152|      0|        return;
  153|       |
  154|      2|    ossl_crypto_mutex_free(&t->lock);
  155|      2|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      2|    OPENSSL_free(t);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

ossl_rcu_write_lock:
  441|      6|{
  442|      6|    pthread_mutex_lock(&lock->write_lock);
  443|      6|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  444|      6|}
ossl_rcu_write_unlock:
  447|      6|{
  448|      6|    TSAN_FAKE_LOCK(&lock->write_lock);
  449|      6|    pthread_mutex_unlock(&lock->write_lock);
  450|      6|}
ossl_synchronize_rcu:
  453|     10|{
  454|     10|    struct rcu_qp *qp;
  455|     10|    uint64_t count;
  456|     10|    uint32_t curr_id;
  457|     10|    struct rcu_cb_item *cb_items, *tmpcb;
  458|       |
  459|     10|    pthread_mutex_lock(&lock->write_lock);
  460|     10|    cb_items = lock->cb_items;
  461|     10|    lock->cb_items = NULL;
  462|     10|    pthread_mutex_unlock(&lock->write_lock);
  463|       |
  464|     10|    qp = update_qp(lock, &curr_id);
  465|       |
  466|       |    /* retire in order */
  467|     10|    pthread_mutex_lock(&lock->prior_lock);
  468|     10|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (468:12): [True: 0, False: 10]
  ------------------
  469|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  470|       |
  471|       |    /*
  472|       |     * wait for the reader count to reach zero
  473|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  474|       |     * prior __ATOMIC_RELEASE write operation in ossl_rcu_read_unlock
  475|       |     * is visible prior to our read
  476|       |     * however this is likely just necessary to silence a tsan warning
  477|       |     * because the read side should not do any write operation
  478|       |     * outside the atomic itself
  479|       |     */
  480|     10|    do {
  481|     10|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|     10|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  482|     10|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (482:14): [True: 0, False: 10]
  ------------------
  483|       |
  484|     10|    lock->next_to_retire++;
  485|     10|    pthread_cond_broadcast(&lock->prior_signal);
  486|     10|    pthread_mutex_unlock(&lock->prior_lock);
  487|       |
  488|     10|    retire_qp(lock, qp);
  489|       |
  490|       |    /* handle any callbacks that we have */
  491|     12|    while (cb_items != NULL) {
  ------------------
  |  Branch (491:12): [True: 2, False: 10]
  ------------------
  492|      2|        tmpcb = cb_items;
  493|      2|        cb_items = cb_items->next;
  494|      2|        tmpcb->fn(tmpcb->data);
  495|      2|        OPENSSL_free(tmpcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  496|      2|    }
  497|     10|}
ossl_rcu_call:
  504|      2|{
  505|      2|    struct rcu_cb_item *new =
  506|      2|        OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|       |
  508|      2|    if (new == NULL)
  ------------------
  |  Branch (508:9): [True: 0, False: 2]
  ------------------
  509|      0|        return 0;
  510|       |
  511|      2|    new->data = data;
  512|      2|    new->fn = cb;
  513|       |
  514|      2|    new->next = lock->cb_items;
  515|      2|    lock->cb_items = new;
  516|       |
  517|      2|    return 1;
  518|      2|}
ossl_rcu_uptr_deref:
  521|  28.5k|{
  522|  28.5k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|  28.5k|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|  28.5k|}
ossl_rcu_assign_uptr:
  526|    596|{
  527|    596|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|    596|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|    596|}
ossl_rcu_lock_new:
  531|      6|{
  532|      6|    struct rcu_lock_st *new;
  533|       |
  534|       |    /*
  535|       |     * We need a minimum of 2 qp's
  536|       |     */
  537|      6|    if (num_writers < 2)
  ------------------
  |  Branch (537:9): [True: 6, False: 0]
  ------------------
  538|      6|        num_writers = 2;
  539|       |
  540|      6|    ctx = ossl_lib_ctx_get_concrete(ctx);
  541|      6|    if (ctx == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 6]
  ------------------
  542|      0|        return 0;
  543|       |
  544|      6|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  545|      6|    if (new == NULL)
  ------------------
  |  Branch (545:9): [True: 0, False: 6]
  ------------------
  546|      0|        return NULL;
  547|       |
  548|      6|    new->ctx = ctx;
  549|      6|    pthread_mutex_init(&new->write_lock, NULL);
  550|      6|    pthread_mutex_init(&new->prior_lock, NULL);
  551|      6|    pthread_mutex_init(&new->alloc_lock, NULL);
  552|      6|    pthread_cond_init(&new->prior_signal, NULL);
  553|      6|    pthread_cond_init(&new->alloc_signal, NULL);
  554|       |
  555|      6|    new->qp_group = allocate_new_qp_group(new, num_writers);
  556|      6|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 6]
  ------------------
  557|      0|        OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|        new = NULL;
  559|      0|    }
  560|       |
  561|      6|    return new;
  562|      6|}
ossl_rcu_lock_free:
  565|      4|{
  566|      4|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  567|       |
  568|      4|    if (lock == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 4]
  ------------------
  569|      0|        return;
  570|       |
  571|       |    /* make sure we're synchronized */
  572|      4|    ossl_synchronize_rcu(rlock);
  573|       |
  574|      4|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  575|       |    /* There should only be a single qp left now */
  576|      4|    OPENSSL_free(rlock);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      4|}
CRYPTO_THREAD_lock_new:
  580|    576|{
  581|    576|# ifdef USE_RWLOCK
  582|    576|    CRYPTO_RWLOCK *lock;
  583|       |
  584|    576|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|    576|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    576|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    576|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 576]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|    576|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 576]
  ------------------
  589|      0|        OPENSSL_free(lock);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  590|      0|        return NULL;
  591|      0|    }
  592|       |# else
  593|       |    pthread_mutexattr_t attr;
  594|       |    CRYPTO_RWLOCK *lock;
  595|       |
  596|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  597|       |        /* Don't set error, to avoid recursion blowup. */
  598|       |        return NULL;
  599|       |
  600|       |    /*
  601|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  602|       |     */
  603|       |    pthread_mutexattr_init(&attr);
  604|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
  605|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  606|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  607|       |#   endif
  608|       |#  else
  609|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  610|       |#  endif
  611|       |
  612|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  613|       |        pthread_mutexattr_destroy(&attr);
  614|       |        OPENSSL_free(lock);
  615|       |        return NULL;
  616|       |    }
  617|       |
  618|       |    pthread_mutexattr_destroy(&attr);
  619|       |# endif
  620|       |
  621|    576|    return lock;
  622|    576|}
CRYPTO_THREAD_read_lock:
  625|  23.8k|{
  626|  23.8k|# ifdef USE_RWLOCK
  627|  23.8k|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  23.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  23.8k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 23.8k]
  ------------------
  628|      0|        return 0;
  629|       |# else
  630|       |    if (pthread_mutex_lock(lock) != 0) {
  631|       |        assert(errno != EDEADLK && errno != EBUSY);
  632|       |        return 0;
  633|       |    }
  634|       |# endif
  635|       |
  636|  23.8k|    return 1;
  637|  23.8k|}
CRYPTO_THREAD_write_lock:
  640|  6.18k|{
  641|  6.18k|# ifdef USE_RWLOCK
  642|  6.18k|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  6.18k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.18k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 6.18k]
  ------------------
  643|      0|        return 0;
  644|       |# else
  645|       |    if (pthread_mutex_lock(lock) != 0) {
  646|       |        assert(errno != EDEADLK && errno != EBUSY);
  647|       |        return 0;
  648|       |    }
  649|       |# endif
  650|       |
  651|  6.18k|    return 1;
  652|  6.18k|}
CRYPTO_THREAD_unlock:
  655|  30.0k|{
  656|  30.0k|# ifdef USE_RWLOCK
  657|  30.0k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 30.0k]
  ------------------
  658|      0|        return 0;
  659|       |# else
  660|       |    if (pthread_mutex_unlock(lock) != 0) {
  661|       |        assert(errno != EPERM);
  662|       |        return 0;
  663|       |    }
  664|       |# endif
  665|       |
  666|  30.0k|    return 1;
  667|  30.0k|}
CRYPTO_THREAD_lock_free:
  670|    543|{
  671|    543|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 11, False: 532]
  ------------------
  672|     11|        return;
  673|       |
  674|    532|# ifdef USE_RWLOCK
  675|    532|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|    532|    OPENSSL_free(lock);
  ------------------
  |  |  115|    532|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    532|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    532|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  680|       |
  681|    532|    return;
  682|    543|}
CRYPTO_THREAD_run_once:
  685|  82.4k|{
  686|  82.4k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 82.4k]
  ------------------
  687|      0|        return 0;
  688|       |
  689|  82.4k|    return 1;
  690|  82.4k|}
CRYPTO_THREAD_init_local:
  693|     24|{
  694|     24|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 24]
  ------------------
  695|      0|        return 0;
  696|       |
  697|     24|    return 1;
  698|     24|}
CRYPTO_THREAD_get_local:
  701|  55.3k|{
  702|  55.3k|    return pthread_getspecific(*key);
  703|  55.3k|}
CRYPTO_THREAD_set_local:
  706|     20|{
  707|     20|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 20]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     20|    return 1;
  711|     20|}
CRYPTO_THREAD_cleanup_local:
  714|     18|{
  715|     18|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (715:9): [True: 0, False: 18]
  ------------------
  716|      0|        return 0;
  717|       |
  718|     18|    return 1;
  719|     18|}
CRYPTO_atomic_add:
  732|  5.87k|{
  733|  5.87k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  734|  5.87k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (734:9): [Folded - Ignored]
  ------------------
  735|  5.87k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  736|  5.87k|        return 1;
  737|  5.87k|    }
  738|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  739|       |    /* This will work for all future Solaris versions. */
  740|       |    if (ret != NULL) {
  741|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
  742|       |        return 1;
  743|       |    }
  744|       |# endif
  745|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (745:9): [True: 0, False: 0]
  |  Branch (745:25): [True: 0, False: 0]
  ------------------
  746|      0|        return 0;
  747|       |
  748|      0|    *val += amount;
  749|      0|    *ret  = *val;
  750|       |
  751|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (751:9): [True: 0, False: 0]
  ------------------
  752|      0|        return 0;
  753|       |
  754|      0|    return 1;
  755|      0|}
CRYPTO_atomic_or:
  811|      8|{
  812|      8|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  813|      8|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (813:9): [Folded - Ignored]
  ------------------
  814|      8|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  815|      8|        return 1;
  816|      8|    }
  817|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  818|       |    /* This will work for all future Solaris versions. */
  819|       |    if (ret != NULL) {
  820|       |        *ret = atomic_or_64_nv(val, op);
  821|       |        return 1;
  822|       |    }
  823|       |# endif
  824|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  |  Branch (824:25): [True: 0, False: 0]
  ------------------
  825|      0|        return 0;
  826|      0|    *val |= op;
  827|      0|    *ret  = *val;
  828|       |
  829|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  ------------------
  830|      0|        return 0;
  831|       |
  832|      0|    return 1;
  833|      0|}
CRYPTO_atomic_load:
  836|  43.8k|{
  837|  43.8k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|  43.8k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|  43.8k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|  43.8k|        return 1;
  841|  43.8k|    }
  842|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  843|       |    /* This will work for all future Solaris versions. */
  844|       |    if (ret != NULL) {
  845|       |        *ret = atomic_or_64_nv(val, 0);
  846|       |        return 1;
  847|       |    }
  848|       |# endif
  849|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (849:9): [True: 0, False: 0]
  |  Branch (849:25): [True: 0, False: 0]
  ------------------
  850|      0|        return 0;
  851|      0|    *ret  = *val;
  852|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (852:9): [True: 0, False: 0]
  ------------------
  853|      0|        return 0;
  854|       |
  855|      0|    return 1;
  856|      0|}
CRYPTO_atomic_store:
  859|    590|{
  860|    590|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  861|    590|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (861:9): [Folded - Ignored]
  ------------------
  862|    590|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
  863|    590|        return 1;
  864|    590|    }
  865|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  866|       |    /* This will work for all future Solaris versions. */
  867|       |    if (dst != NULL) {
  868|       |        atomic_swap_64(dst, val);
  869|       |        return 1;
  870|       |    }
  871|       |# endif
  872|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (872:9): [True: 0, False: 0]
  |  Branch (872:25): [True: 0, False: 0]
  ------------------
  873|      0|        return 0;
  874|      0|    *dst  = val;
  875|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (875:9): [True: 0, False: 0]
  ------------------
  876|      0|        return 0;
  877|       |
  878|      0|    return 1;
  879|      0|}
threads_pthread.c:update_qp:
  380|     10|{
  381|     10|    uint32_t current_idx;
  382|       |
  383|     10|    pthread_mutex_lock(&lock->alloc_lock);
  384|       |
  385|       |    /*
  386|       |     * we need at least one qp to be available with one
  387|       |     * left over, so that readers can start working on
  388|       |     * one that isn't yet being waited on
  389|       |     */
  390|     10|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (390:12): [True: 0, False: 10]
  ------------------
  391|       |        /* we have to wait for one to be free */
  392|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  393|       |
  394|     10|    current_idx = lock->current_alloc_idx;
  395|       |
  396|       |    /* Allocate the qp */
  397|     10|    lock->writers_alloced++;
  398|       |
  399|       |    /* increment the allocation index */
  400|     10|    lock->current_alloc_idx =
  401|     10|        (lock->current_alloc_idx + 1) % lock->group_count;
  402|       |
  403|     10|    *curr_id = lock->id_ctr;
  404|     10|    lock->id_ctr++;
  405|       |
  406|     10|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |   97|     10|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  407|     10|                   __ATOMIC_RELAXED);
  408|       |
  409|       |    /*
  410|       |     * this should make sure that the new value of reader_idx is visible in
  411|       |     * get_hold_current_qp, directly after incrementing the users count
  412|       |     */
  413|     10|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |   99|     10|#  define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  414|     10|                     __ATOMIC_RELEASE);
  415|       |
  416|       |    /* wake up any waiters */
  417|     10|    pthread_cond_signal(&lock->alloc_signal);
  418|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  419|     10|    return &lock->qp_group[current_idx];
  420|     10|}
threads_pthread.c:retire_qp:
  423|     10|{
  424|     10|    pthread_mutex_lock(&lock->alloc_lock);
  425|     10|    lock->writers_alloced--;
  426|     10|    pthread_cond_signal(&lock->alloc_signal);
  427|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  428|     10|}
threads_pthread.c:allocate_new_qp_group:
  432|      6|{
  433|      6|    struct rcu_qp *new =
  434|      6|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  435|       |
  436|      6|    lock->group_count = count;
  437|      6|    return new;
  438|      6|}

ossl_trace_cleanup:
  340|      2|{
  341|       |#ifndef OPENSSL_NO_TRACE
  342|       |    int category;
  343|       |    BIO *channel = NULL;
  344|       |    const char *prefix = NULL;
  345|       |    const char *suffix = NULL;
  346|       |
  347|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  348|       |        /* We force the TRACE category to be treated last */
  349|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  350|       |            continue;
  351|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  352|       |                       trace_attach_cb, trace_detach_cb);
  353|       |    }
  354|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  355|       |                   &prefix, &suffix,
  356|       |                   trace_attach_cb, trace_detach_cb);
  357|       |    CRYPTO_THREAD_lock_free(trace_lock);
  358|       |#endif
  359|      2|}
OSSL_trace_set_channel:
  362|      2|{
  363|       |#ifndef OPENSSL_NO_TRACE
  364|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  365|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  366|       |                              trace_attach_cb, trace_detach_cb);
  367|       |#endif
  368|      2|    return 0;
  369|      2|}

ossl_err_load_TS_strings:
   82|      2|{
   83|      2|# ifndef OPENSSL_NO_ERR
   84|      2|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 2, False: 0]
  ------------------
   85|      2|        ERR_load_strings_const(TS_str_reasons);
   86|      2|# endif
   87|      2|    return 1;
   88|      2|}

ossl_err_load_UI_strings:
   41|      2|{
   42|      2|#ifndef OPENSSL_NO_ERR
   43|      2|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 2, False: 0]
  ------------------
   44|      2|        ERR_load_strings_const(UI_str_reasons);
   45|      2|#endif
   46|      2|    return 1;
   47|      2|}

OSSL_STACK_OF_X509_free:
   21|  1.02k|{
   22|  1.02k|    sk_X509_pop_free(certs, X509_free);
  ------------------
  |  |   93|  1.02k|#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk), ossl_check_X509_freefunc_type(freefunc))
  ------------------
   23|  1.02k|}

ossl_err_load_X509V3_strings:
  146|      2|{
  147|      2|#ifndef OPENSSL_NO_ERR
  148|      2|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (148:9): [True: 2, False: 0]
  ------------------
  149|      2|        ERR_load_strings_const(X509V3_str_reasons);
  150|      2|#endif
  151|      2|    return 1;
  152|      2|}

X509_get_default_cert_area:
   79|      2|{
   80|       |#if defined (_WIN32)
   81|       |    RUN_ONCE(&openssldir_setup_init, do_openssldir_setup);
   82|       |    return x509_cert_areaptr;
   83|       |#else
   84|      2|    return X509_CERT_AREA;
  ------------------
  |  |   84|      2|#  define X509_CERT_AREA          OPENSSLDIR
  ------------------
   85|      2|#endif
   86|      2|}

ossl_err_load_X509_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(X509_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

X509_STORE_new:
  183|     79|{
  184|     79|    X509_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|       |
  186|     79|    if (ret == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 79]
  ------------------
  187|      0|        return NULL;
  188|     79|    if ((ret->objs = sk_X509_OBJECT_new(x509_object_cmp)) == NULL) {
  ------------------
  |  |   97|     79|#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
  ------------------
  |  Branch (188:9): [True: 0, False: 79]
  ------------------
  189|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  190|      0|        goto err;
  191|      0|    }
  192|     79|    ret->cache = 1;
  193|     79|    if ((ret->get_cert_methods = sk_X509_LOOKUP_new_null()) == NULL) {
  ------------------
  |  |   72|     79|#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (193:9): [True: 0, False: 79]
  ------------------
  194|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|     79|    if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
  ------------------
  |  Branch (198:9): [True: 0, False: 79]
  ------------------
  199|      0|        ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  200|      0|        goto err;
  201|      0|    }
  202|     79|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data)) {
  ------------------
  |  |  233|     79|# define CRYPTO_EX_INDEX_X509_STORE       4
  ------------------
  |  Branch (202:9): [True: 0, False: 79]
  ------------------
  203|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|        goto err;
  205|      0|    }
  206|       |
  207|     79|    ret->lock = CRYPTO_THREAD_lock_new();
  208|     79|    if (ret->lock == NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 79]
  ------------------
  209|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|        goto err;
  211|      0|    }
  212|       |
  213|     79|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (213:9): [True: 0, False: 79]
  ------------------
  214|      0|        goto err;
  215|     79|    return ret;
  216|       |
  217|      0|err:
  218|      0|    X509_VERIFY_PARAM_free(ret->param);
  219|      0|    sk_X509_OBJECT_free(ret->objs);
  ------------------
  |  |  101|      0|#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
  ------------------
  220|      0|    sk_X509_LOOKUP_free(ret->get_cert_methods);
  ------------------
  |  |   75|      0|#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  ------------------
  221|      0|    CRYPTO_THREAD_lock_free(ret->lock);
  222|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|      0|    return NULL;
  224|     79|}
X509_STORE_free:
  227|    237|{
  228|    237|    int i;
  229|    237|    STACK_OF(X509_LOOKUP) *sk;
  ------------------
  |  |   31|    237|# define STACK_OF(type) struct stack_st_##type
  ------------------
  230|    237|    X509_LOOKUP *lu;
  231|       |
  232|    237|    if (xs == NULL)
  ------------------
  |  Branch (232:9): [True: 158, False: 79]
  ------------------
  233|    158|        return;
  234|     79|    CRYPTO_DOWN_REF(&xs->references, &i);
  235|     79|    REF_PRINT_COUNT("X509_STORE", i, xs);
  ------------------
  |  |  301|     79|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     79|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     79|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     79|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|     79|    if (i > 0)
  ------------------
  |  Branch (236:9): [True: 0, False: 79]
  ------------------
  237|      0|        return;
  238|     79|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
  239|       |
  240|     79|    sk = xs->get_cert_methods;
  241|     79|    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
  ------------------
  |  |   69|     79|#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
  ------------------
  |  Branch (241:17): [True: 0, False: 79]
  ------------------
  242|      0|        lu = sk_X509_LOOKUP_value(sk, i);
  ------------------
  |  |   70|      0|#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
  ------------------
  243|      0|        X509_LOOKUP_shutdown(lu);
  244|      0|        X509_LOOKUP_free(lu);
  245|      0|    }
  246|     79|    sk_X509_LOOKUP_free(sk);
  ------------------
  |  |   75|     79|#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  ------------------
  247|     79|    sk_X509_OBJECT_pop_free(xs->objs, X509_OBJECT_free);
  ------------------
  |  |  109|     79|#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_freefunc_type(freefunc))
  ------------------
  248|       |
  249|     79|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, xs, &xs->ex_data);
  ------------------
  |  |  233|     79|# define CRYPTO_EX_INDEX_X509_STORE       4
  ------------------
  250|     79|    X509_VERIFY_PARAM_free(xs->param);
  251|     79|    CRYPTO_THREAD_lock_free(xs->lock);
  252|     79|    CRYPTO_FREE_REF(&xs->references);
  253|     79|    OPENSSL_free(xs);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|     79|}

X509_VERIFY_PARAM_new:
   83|    158|{
   84|    158|    X509_VERIFY_PARAM *param;
   85|       |
   86|    158|    param = OPENSSL_zalloc(sizeof(*param));
  ------------------
  |  |  104|    158|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   87|    158|    if (param == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 158]
  ------------------
   88|      0|        return NULL;
   89|    158|    param->trust = X509_TRUST_DEFAULT;
  ------------------
  |  |  186|    158|# define X509_TRUST_DEFAULT      0 /* Only valid in purpose settings */
  ------------------
   90|       |    /* param->inh_flags = X509_VP_FLAG_DEFAULT; */
   91|    158|    param->depth = -1;
   92|    158|    param->auth_level = -1; /* -1 means unset, 0 is explicit */
   93|    158|    return param;
   94|    158|}
X509_VERIFY_PARAM_free:
   97|    158|{
   98|    158|    if (param == NULL)
  ------------------
  |  Branch (98:9): [True: 0, False: 158]
  ------------------
   99|      0|        return;
  100|    158|    sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
  ------------------
  |  |  650|    158|#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
  ------------------
  101|    158|    sk_OPENSSL_STRING_pop_free(param->hosts, str_free);
  ------------------
  |  |  243|    158|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  102|    158|    OPENSSL_free(param->peername);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    158|    OPENSSL_free(param->email);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|    158|    OPENSSL_free(param->ip);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  105|    158|    OPENSSL_free(param);
  ------------------
  |  |  115|    158|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    158|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    158|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|    158|}

LLVMFuzzerInitialize:
   22|      2|{
   23|      2|    return FuzzerInitialize(argc, argv);
   24|      2|}
LLVMFuzzerTestOneInput:
   27|     79|{
   28|     79|    return FuzzerTestOneInput(buf, len);
   29|     79|}

FuzzerSetRand:
  158|      2|{
  159|      2|    if (!OSSL_PROVIDER_add_builtin(NULL, "fuzz-rand", fuzz_rand_provider_init)
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      2|        || !RAND_set_DRBG_type(NULL, "fuzz", NULL, NULL, NULL)
  ------------------
  |  Branch (160:12): [True: 0, False: 2]
  ------------------
  161|      2|        || (r_prov = OSSL_PROVIDER_try_load(NULL, "fuzz-rand", 1)) == NULL)
  ------------------
  |  Branch (161:12): [True: 0, False: 2]
  ------------------
  162|      0|        exit(1);
  163|      2|}
fuzz_rand.c:fuzz_rand_provider_init:
  147|      2|{
  148|      2|    *provctx = OSSL_LIB_CTX_new();
  149|      2|    if (*provctx == NULL)
  ------------------
  |  Branch (149:9): [True: 0, False: 2]
  ------------------
  150|      0|        return 0;
  151|      2|    *out = fuzz_rand_method;
  152|      2|    return 1;
  153|      2|}
fuzz_rand.c:fuzz_rand_query:
  128|  1.30k|{
  129|  1.30k|    *no_cache = 0;
  130|  1.30k|    switch (operation_id) {
  ------------------
  |  Branch (130:13): [True: 1.30k, False: 2]
  ------------------
  131|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (131:5): [True: 2, False: 1.30k]
  ------------------
  132|      2|        return fuzz_rand_rand;
  133|  1.30k|    }
  134|  1.30k|    return NULL;
  135|  1.30k|}
fuzz_rand.c:fuzz_rand_newctx:
   27|      3|{
   28|      3|    int *st = OPENSSL_malloc(sizeof(*st));
  ------------------
  |  |  102|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|       |
   30|      3|    if (st != NULL)
  ------------------
  |  Branch (30:9): [True: 3, False: 0]
  ------------------
   31|      3|        *st = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      3|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   32|      3|    return st;
   33|      3|}
fuzz_rand.c:fuzz_rand_freectx:
   36|      3|{
   37|      3|    OPENSSL_free(vrng);
  ------------------
  |  |  115|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      3|}
fuzz_rand.c:fuzz_rand_instantiate:
   46|      3|{
   47|      3|    *(int *)vrng = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      3|# define EVP_RAND_STATE_READY            1
  ------------------
   48|      3|    return 1;
   49|      3|}
fuzz_rand.c:fuzz_rand_generate:
   63|    553|{
   64|    553|    unsigned char val = 1;
   65|    553|    size_t i;
   66|       |
   67|  14.4k|    for (i = 0; i < outlen; i++)
  ------------------
  |  Branch (67:17): [True: 13.9k, False: 553]
  ------------------
   68|  13.9k|        out[i] = val++;
   69|    553|    return 1;
   70|    553|}
fuzz_rand.c:fuzz_rand_enable_locking:
   73|      1|{
   74|      1|    return 1;
   75|      1|}
fuzz_rand.c:fuzz_rand_get_ctx_params:
   78|    553|{
   79|    553|    OSSL_PARAM *p;
   80|       |
   81|    553|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|    553|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
   82|    553|    if (p != NULL && !OSSL_PARAM_set_int(p, *(int *)vrng))
  ------------------
  |  Branch (82:9): [True: 0, False: 553]
  |  Branch (82:22): [True: 0, False: 0]
  ------------------
   83|      0|        return 0;
   84|       |
   85|    553|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|    553|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   86|    553|    if (p != NULL && !OSSL_PARAM_set_int(p, 500))
  ------------------
  |  Branch (86:9): [True: 0, False: 553]
  |  Branch (86:22): [True: 0, False: 0]
  ------------------
   87|      0|        return 0;
   88|       |
   89|    553|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|    553|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
   90|    553|    if (p != NULL && !OSSL_PARAM_set_size_t(p, INT_MAX))
  ------------------
  |  Branch (90:9): [True: 553, False: 0]
  |  Branch (90:22): [True: 0, False: 553]
  ------------------
   91|      0|        return 0;
   92|    553|    return 1;
   93|    553|}

FuzzerInitialize:
   30|      2|{
   31|      2|    STACK_OF(SSL_COMP) *comp_methods;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
   32|       |
   33|      2|    FuzzerSetRand();
   34|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_ASYNC, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
                  OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_ASYNC, NULL);
  ------------------
  |  |  474|      2|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
   35|      2|    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
  ------------------
  |  | 2807|      2|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
   36|      2|    ERR_clear_error();
   37|      2|    CRYPTO_free_ex_index(0, -1);
   38|      2|    idx = SSL_get_ex_data_X509_STORE_CTX_idx();
   39|      2|    comp_methods = SSL_COMP_get_compression_methods();
   40|      2|    if (comp_methods != NULL)
  ------------------
  |  Branch (40:9): [True: 2, False: 0]
  ------------------
   41|      2|        sk_SSL_COMP_sort(comp_methods);
  ------------------
  |  |   87|      2|#define sk_SSL_COMP_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_COMP_sk_type(sk))
  ------------------
   42|       |
   43|      2|    return 1;
   44|      2|}
FuzzerTestOneInput:
   65|     79|{
   66|     79|    SSL *server = NULL, *stream = NULL;
   67|     79|    SSL *allstreams[] = {NULL, NULL, NULL, NULL};
   68|     79|    size_t i, thisstream = 0, numstreams = 1;
   69|     79|    BIO *in;
   70|     79|    BIO *out;
   71|     79|    SSL_CTX *ctx;
   72|     79|    struct timeval tv;
   73|     79|    int state = HANDSHAKING;
  ------------------
  |  |   46|     79|#define HANDSHAKING      0
  ------------------
   74|     79|    uint8_t tmp[1024];
   75|     79|    int writelen = 0;
   76|       |
   77|     79|    if (len == 0)
  ------------------
  |  Branch (77:9): [True: 0, False: 79]
  ------------------
   78|      0|        return 0;
   79|       |
   80|     79|    ctx = SSL_CTX_new(OSSL_QUIC_server_method());
   81|     79|    if (ctx == NULL)
  ------------------
  |  Branch (81:9): [True: 0, False: 79]
  ------------------
   82|      0|        goto end;
   83|       |
   84|     79|    SSL_CTX_set_alpn_select_cb(ctx, select_alpn, NULL);
   85|       |
   86|     79|    server = SSL_new_listener(ctx, 0);
   87|     79|    allstreams[0] = stream = server;
   88|     79|    if (server == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 79]
  ------------------
   89|      0|        goto end;
   90|       |
   91|     79|    fake_now = ossl_ms2time(1);
  ------------------
  |  |   44|     79|#define ossl_ms2time(ms) ossl_ticks2time((ms) * OSSL_TIME_MS)
  |  |  ------------------
  |  |  |  |   34|     79|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|     79|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|     79|    if (!ossl_quic_set_override_now_cb(server, fake_now_cb, NULL))
  ------------------
  |  Branch (92:9): [True: 0, False: 79]
  ------------------
   93|      0|        goto end;
   94|       |
   95|     79|    in = BIO_new(BIO_s_dgram_mem());
   96|     79|    if (in == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 79]
  ------------------
   97|      0|        goto end;
   98|     79|    out = BIO_new(BIO_s_dgram_mem());
   99|     79|    if (out == NULL) {
  ------------------
  |  Branch (99:9): [True: 0, False: 79]
  ------------------
  100|      0|        BIO_free(in);
  101|      0|        goto end;
  102|      0|    }
  103|     79|    if (!BIO_dgram_set_caps(out, BIO_DGRAM_CAP_HANDLES_DST_ADDR)) {
  ------------------
  |  |  688|     79|         (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_CAPS, (long)(caps), NULL)
  |  |  ------------------
  |  |  |  |  184|     79|# define BIO_CTRL_DGRAM_SET_CAPS                87
  |  |  ------------------
  ------------------
  |  Branch (103:9): [True: 0, False: 79]
  ------------------
  104|      0|        BIO_free(in);
  105|      0|        BIO_free(out);
  106|      0|        goto end;
  107|      0|    }
  108|     79|    SSL_set_bio(server, in, out);
  109|     79|    SSL_set_accept_state(server);
  110|       |
  111|     79|    for (;;) {
  112|     79|        size_t size;
  113|     79|        uint64_t nxtpktms = 0;
  114|     79|        OSSL_TIME nxtpkt = ossl_time_zero(), nxttimeout;
  115|     79|        int isinf, ret = 0;
  116|       |
  117|     79|        if (len >= 2) {
  ------------------
  |  Branch (117:13): [True: 77, False: 2]
  ------------------
  118|     77|            if (len >= 5 && buf[0] == 0xff && buf[1] == 0xff) {
  ------------------
  |  Branch (118:17): [True: 75, False: 2]
  |  Branch (118:29): [True: 26, False: 49]
  |  Branch (118:47): [True: 4, False: 22]
  ------------------
  119|      4|                switch (buf[2]) {
  120|      1|                case 0x00:
  ------------------
  |  Branch (120:17): [True: 1, False: 3]
  ------------------
  121|      1|                    if (state == READING)
  ------------------
  |  |   47|      1|#define READING          1
  ------------------
  |  Branch (121:25): [True: 0, False: 1]
  ------------------
  122|      0|                        state = ACCEPTING_STREAM;
  ------------------
  |  |   49|      0|#define ACCEPTING_STREAM 3
  ------------------
  123|      1|                    break;
  124|      1|                case 0x01:
  ------------------
  |  Branch (124:17): [True: 1, False: 3]
  ------------------
  125|      1|                    if (state == READING)
  ------------------
  |  |   47|      1|#define READING          1
  ------------------
  |  Branch (125:25): [True: 0, False: 1]
  ------------------
  126|      0|                        state = CREATING_STREAM;
  ------------------
  |  |   50|      0|#define CREATING_STREAM  4
  ------------------
  127|      1|                    break;
  128|      1|                case 0x02:
  ------------------
  |  Branch (128:17): [True: 1, False: 3]
  ------------------
  129|      1|                    if (state == READING)
  ------------------
  |  |   47|      1|#define READING          1
  ------------------
  |  Branch (129:25): [True: 0, False: 1]
  ------------------
  130|      0|                        state = SWAPPING_STREAM;
  ------------------
  |  |   51|      0|#define SWAPPING_STREAM  5
  ------------------
  131|      1|                    break;
  132|      1|                default:
  ------------------
  |  Branch (132:17): [True: 1, False: 3]
  ------------------
  133|       |                    /* ignore */
  134|      1|                    break;
  135|      4|                }
  136|      4|                len -= 3;
  137|      4|                buf += 3;
  138|      4|            }
  139|     77|            nxtpktms = buf[0] + (buf[1] << 8);
  140|     77|            nxtpkt = ossl_time_add(fake_now, ossl_ms2time(nxtpktms));
  ------------------
  |  |   44|     77|#define ossl_ms2time(ms) ossl_ticks2time((ms) * OSSL_TIME_MS)
  |  |  ------------------
  |  |  |  |   34|     77|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|     77|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|     77|            len -= 2;
  142|     77|            buf += 2;
  143|     77|        }
  144|       |
  145|     79|        for (;;) {
  146|     79|            switch (state) {
  ------------------
  |  Branch (146:21): [True: 0, False: 79]
  ------------------
  147|     79|            case HANDSHAKING:
  ------------------
  |  |   46|     79|#define HANDSHAKING      0
  ------------------
  |  Branch (147:13): [True: 79, False: 0]
  ------------------
  148|     79|                ret = SSL_accept_connection(stream, 0) != NULL;
  149|     79|                if (ret == 1)
  ------------------
  |  Branch (149:21): [True: 0, False: 79]
  ------------------
  150|      0|                    state = READING;
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  151|     79|                break;
  152|       |
  153|      0|            case READING:
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  |  Branch (153:13): [True: 0, False: 79]
  ------------------
  154|      0|                ret = SSL_read(stream, tmp, sizeof(tmp));
  155|      0|                if (ret > 0) {
  ------------------
  |  Branch (155:21): [True: 0, False: 0]
  ------------------
  156|      0|                    state = WRITING;
  ------------------
  |  |   48|      0|#define WRITING          2
  ------------------
  157|      0|                    writelen = ret;
  158|      0|                    assert(writelen <= (int)sizeof(tmp));
  159|      0|                }
  160|      0|                break;
  161|       |
  162|      0|            case WRITING:
  ------------------
  |  |   48|      0|#define WRITING          2
  ------------------
  |  Branch (162:13): [True: 0, False: 79]
  ------------------
  163|      0|                ret = SSL_write(stream, tmp, writelen);
  164|      0|                if (ret > 0)
  ------------------
  |  Branch (164:21): [True: 0, False: 0]
  ------------------
  165|      0|                    state = READING;
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  166|      0|                break;
  167|       |
  168|      0|            case ACCEPTING_STREAM:
  ------------------
  |  |   49|      0|#define ACCEPTING_STREAM 3
  ------------------
  |  Branch (168:13): [True: 0, False: 79]
  ------------------
  169|      0|                state = READING;
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  170|      0|                ret = 1;
  171|      0|                if (numstreams == OSSL_NELEM(allstreams)
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (171:21): [True: 0, False: 0]
  ------------------
  172|      0|                        || SSL_get_accept_stream_queue_len(server) == 0)
  ------------------
  |  Branch (172:28): [True: 0, False: 0]
  ------------------
  173|      0|                    break;
  174|      0|                thisstream = numstreams;
  175|      0|                stream = allstreams[numstreams++] = SSL_accept_stream(server, 0);
  176|      0|                if (stream == NULL)
  ------------------
  |  Branch (176:21): [True: 0, False: 0]
  ------------------
  177|      0|                    goto end;
  178|      0|                break;
  179|       |
  180|      0|            case CREATING_STREAM:
  ------------------
  |  |   50|      0|#define CREATING_STREAM  4
  ------------------
  |  Branch (180:13): [True: 0, False: 79]
  ------------------
  181|      0|                state = READING;
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  182|      0|                ret = 1;
  183|      0|                if (numstreams == OSSL_NELEM(allstreams))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (183:21): [True: 0, False: 0]
  ------------------
  184|      0|                    break;
  185|      0|                stream = SSL_new_stream(server, 0);
  186|      0|                if (stream == NULL) {
  ------------------
  |  Branch (186:21): [True: 0, False: 0]
  ------------------
  187|       |                    /* Ignore, and go back to the previous stream */
  188|      0|                    stream = allstreams[thisstream];
  189|      0|                    break;
  190|      0|                }
  191|      0|                thisstream = numstreams;
  192|      0|                allstreams[numstreams++] = stream;
  193|      0|                break;
  194|       |
  195|      0|            case SWAPPING_STREAM:
  ------------------
  |  |   51|      0|#define SWAPPING_STREAM  5
  ------------------
  |  Branch (195:13): [True: 0, False: 79]
  ------------------
  196|      0|                state = READING;
  ------------------
  |  |   47|      0|#define READING          1
  ------------------
  197|      0|                ret = 1;
  198|      0|                if (numstreams == 1)
  ------------------
  |  Branch (198:21): [True: 0, False: 0]
  ------------------
  199|      0|                    break;
  200|      0|                if (++thisstream == numstreams)
  ------------------
  |  Branch (200:21): [True: 0, False: 0]
  ------------------
  201|      0|                    thisstream = 0;
  202|      0|                stream = allstreams[thisstream];
  203|      0|                break;
  204|     79|            }
  205|     79|            assert(stream != NULL);
  206|     79|            assert(thisstream < numstreams);
  207|     79|            if (ret <= 0) {
  ------------------
  |  Branch (207:17): [True: 79, False: 0]
  ------------------
  208|     79|                switch (SSL_get_error(stream, ret)) {
  209|      0|                case SSL_ERROR_WANT_READ:
  ------------------
  |  | 1253|      0|# define SSL_ERROR_WANT_READ             2
  ------------------
  |  Branch (209:17): [True: 0, False: 79]
  ------------------
  210|      0|                case SSL_ERROR_WANT_WRITE:
  ------------------
  |  | 1254|      0|# define SSL_ERROR_WANT_WRITE            3
  ------------------
  |  Branch (210:17): [True: 0, False: 79]
  ------------------
  211|      0|                    break;
  212|     79|                default:
  ------------------
  |  Branch (212:17): [True: 79, False: 0]
  ------------------
  213|     79|                    goto end;
  214|     79|                }
  215|     79|            }
  216|       |
  217|      0|            if (!SSL_get_event_timeout(server, &tv, &isinf))
  ------------------
  |  Branch (217:17): [True: 0, False: 0]
  ------------------
  218|      0|                goto end;
  219|       |
  220|      0|            if (isinf) {
  ------------------
  |  Branch (220:17): [True: 0, False: 0]
  ------------------
  221|      0|                fake_now = nxtpkt;
  222|      0|                break;
  223|      0|            } else {
  224|      0|                nxttimeout = ossl_time_add(fake_now,
  225|      0|                                           ossl_time_from_timeval(tv));
  226|      0|                if (len > 3 && ossl_time_compare(nxttimeout, nxtpkt) >= 0) {
  ------------------
  |  Branch (226:21): [True: 0, False: 0]
  |  Branch (226:32): [True: 0, False: 0]
  ------------------
  227|      0|                    fake_now = nxtpkt;
  228|      0|                    break;
  229|      0|                }
  230|      0|                fake_now = nxttimeout;
  231|      0|            }
  232|      0|        }
  233|       |
  234|      0|        if (len <= 3)
  ------------------
  |  Branch (234:13): [True: 0, False: 0]
  ------------------
  235|      0|            break;
  236|       |
  237|      0|        size = buf[0] + (buf[1] << 8);
  238|      0|        if (size > len - 2)
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|            break;
  240|       |
  241|      0|        if (size > 0)
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|            BIO_write(in, buf + 2, size);
  243|      0|        len -= size + 2;
  244|      0|        buf += size + 2;
  245|      0|    }
  246|     79| end:
  247|    158|    for (i = 0; i < numstreams; i++)
  ------------------
  |  Branch (247:17): [True: 79, False: 79]
  ------------------
  248|     79|        SSL_free(allstreams[i]);
  249|     79|    ERR_clear_error();
  250|     79|    SSL_CTX_free(ctx);
  251|       |
  252|     79|    return 0;
  253|     79|}

EVP_aria_128_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb1:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb8:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cfb64:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cbc:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cfb128:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ofb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ecb:
  462|      2|const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

property.c:ossl_sa_ALGORITHM_new:
   27|     16|    { \
   28|     16|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|     16|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|      8|    { \
   57|      8|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|      8|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|      8|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    538|    { \
   69|    538|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    538|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      8|    { \
   33|      8|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      8|    } \
property.c:ossl_sa_ALGORITHM_get:
   62|  10.6k|    { \
   63|  10.6k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  10.6k|    } \
property.c:ossl_sa_ALGORITHM_doall:
   48|      8|    { \
   49|      8|        ossl_sa_doall((OPENSSL_SA *)sa, \
   50|      8|                      (void (*)(ossl_uintmax_t, void *))leaf); \
   51|      8|    } \

ssl_cert.c:ossl_assert_int:
   45|     79|{
   46|     79|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 79]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     79|    return expr;
   50|     79|}
ssl_ciph.c:ossl_assert_int:
   45|    553|{
   46|    553|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 553]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    553|    return expr;
   50|    553|}
quic_obj.c:ossl_assert_int:
   45|    237|{
   46|    237|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 237]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    237|    return expr;
   50|    237|}
bio_print.c:ossl_assert_int:
   45|   215k|{
   46|   215k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 215k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   215k|    return expr;
   50|   215k|}
bss_dgram_pair.c:ossl_assert_int:
   45|  1.34k|{
   46|  1.34k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.34k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.34k|    return expr;
   50|  1.34k|}
evp_enc.c:ossl_assert_int:
   45|    237|{
   46|    237|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 237]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    237|    return expr;
   50|    237|}
evp_fetch.c:ossl_assert_int:
   45|  31.2k|{
   46|  31.2k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 31.2k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  31.2k|    return expr;
   50|  31.2k|}
p_lib.c:ossl_assert_int:
   45|  4.10k|{
   46|  4.10k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.10k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.10k|    return expr;
   50|  4.10k|}
pmeth_lib.c:ossl_assert_int:
   45|  2.05k|{
   46|  2.05k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.05k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.05k|    return expr;
   50|  2.05k|}
core_fetch.c:ossl_assert_int:
   45|  2.62k|{
   46|  2.62k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.62k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.62k|    return expr;
   50|  2.62k|}
core_namemap.c:ossl_assert_int:
   45|  1.19k|{
   46|  1.19k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.19k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.19k|    return expr;
   50|  1.19k|}
provider_core.c:ossl_assert_int:
   45|  2.62k|{
   46|  2.62k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.62k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.62k|    return expr;
   50|  2.62k|}
threads_pthread.c:ossl_assert_int:
   45|  30.0k|{
   46|  30.0k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 30.0k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  30.0k|    return expr;
   50|  30.0k|}
defn_cache.c:ossl_assert_int:
   45|    538|{
   46|    538|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 538]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    538|    return expr;
   50|    538|}
property.c:ossl_assert_int:
   45|    313|{
   46|    313|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 313]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    313|    return expr;
   50|    313|}

core_namemap.c:ossl_ht_strcase:
  255|  14.1k|{
  256|  14.1k|    int i;
  257|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  258|       |    const long int case_adjust = ~0x40;
  259|       |#else
  260|  14.1k|    const long int case_adjust = ~0x20;
  261|  14.1k|#endif
  262|       |
  263|  14.1k|    if (src == NULL)
  ------------------
  |  Branch (263:9): [True: 0, False: 14.1k]
  ------------------
  264|      0|        return;
  265|       |
  266|   136k|    for (i = 0; src[i] != '\0' && i < len; i++)
  ------------------
  |  Branch (266:17): [True: 122k, False: 13.9k]
  |  Branch (266:35): [True: 122k, False: 186]
  ------------------
  267|   122k|        tgt[i] = case_adjust & src[i];
  268|  14.1k|}

quic_port.c:ossl_list_port_insert_tail:
  155|     79|    {                                                                       \
  156|     79|        assert(elem->ossl_list_ ## name.list == NULL);                      \
  157|     79|        OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list)                 \
  ------------------
  |  |   20|     79|#  define OSSL_LIST_DBG(x) x;
  ------------------
  158|     79|        if (list->omega != NULL)                                            \
  ------------------
  |  Branch (158:13): [True: 0, False: 79]
  ------------------
  159|     79|            list->omega->ossl_list_ ## name.next = elem;                    \
  160|     79|        elem->ossl_list_ ## name.prev = list->omega;                        \
  161|     79|        elem->ossl_list_ ## name.next = NULL;                               \
  162|     79|        list->omega = elem;                                                 \
  163|     79|        if (list->alpha == NULL)                                            \
  ------------------
  |  Branch (163:13): [True: 79, False: 0]
  ------------------
  164|     79|            list->alpha = elem;                                             \
  165|     79|        list->num_elems++;                                                  \
  166|     79|    }                                                                       \
quic_port.c:ossl_list_ch_num:
   87|     79|    {                                                                       \
   88|     79|        return list->num_elems;                                             \
   89|     79|    }                                                                       \
quic_port.c:ossl_list_port_remove:
  122|     79|    {                                                                       \
  123|     79|        assert(elem->ossl_list_ ## name.list == list);                      \
  124|     79|        OSSL_LIST_DBG(elem->ossl_list_ ## name.list = NULL)                 \
  ------------------
  |  |   20|     79|#  define OSSL_LIST_DBG(x) x;
  ------------------
  125|     79|        if (list->alpha == elem)                                            \
  ------------------
  |  Branch (125:13): [True: 79, False: 0]
  ------------------
  126|     79|            list->alpha = elem->ossl_list_ ## name.next;                    \
  127|     79|        if (list->omega == elem)                                            \
  ------------------
  |  Branch (127:13): [True: 79, False: 0]
  ------------------
  128|     79|            list->omega = elem->ossl_list_ ## name.prev;                    \
  129|     79|        if (elem->ossl_list_ ## name.prev != NULL)                          \
  ------------------
  |  Branch (129:13): [True: 0, False: 79]
  ------------------
  130|     79|            elem->ossl_list_ ## name.prev->ossl_list_ ## name.next =        \
  131|      0|                    elem->ossl_list_ ## name.next;                          \
  132|     79|        if (elem->ossl_list_ ## name.next != NULL)                          \
  ------------------
  |  Branch (132:13): [True: 0, False: 79]
  ------------------
  133|     79|            elem->ossl_list_ ## name.next->ossl_list_ ## name.prev =        \
  134|      0|                    elem->ossl_list_ ## name.prev;                          \
  135|     79|        list->num_elems--;                                                  \
  136|     79|        memset(&elem->ossl_list_ ## name, 0,                                \
  137|     79|               sizeof(elem->ossl_list_ ## name));                           \
  138|     79|    }                                                                       \
quic_port.c:ossl_list_ch_head:
   92|    237|    {                                                                       \
   93|    237|        assert(list->alpha == NULL                                          \
   94|    237|               || list->alpha->ossl_list_ ## name.list == list);            \
   95|    237|        return list->alpha;                                                 \
   96|    237|    }                                                                       \
quic_port.c:ossl_list_incoming_ch_head:
   92|    316|    {                                                                       \
   93|    316|        assert(list->alpha == NULL                                          \
   94|    316|               || list->alpha->ossl_list_ ## name.list == list);            \
   95|    316|        return list->alpha;                                                 \
   96|    316|    }                                                                       \
quic_demux.c:ossl_list_urxe_head:
   92|    632|    {                                                                       \
   93|    632|        assert(list->alpha == NULL                                          \
   94|    632|               || list->alpha->ossl_list_ ## name.list == list);            \
   95|    632|        return list->alpha;                                                 \
   96|    632|    }                                                                       \
quic_demux.c:ossl_list_urxe_num:
   87|  2.68k|    {                                                                       \
   88|  2.68k|        return list->num_elems;                                             \
   89|  2.68k|    }                                                                       \
quic_demux.c:ossl_list_urxe_init_elem:
   76|  2.52k|    {                                                                       \
   77|  2.52k|        memset(&elem->ossl_list_ ## name, 0,                                \
   78|  2.52k|               sizeof(elem->ossl_list_ ## name));                           \
   79|  2.52k|    }                                                                       \
quic_demux.c:ossl_list_urxe_remove:
  122|  2.52k|    {                                                                       \
  123|  2.52k|        assert(elem->ossl_list_ ## name.list == list);                      \
  124|  2.52k|        OSSL_LIST_DBG(elem->ossl_list_ ## name.list = NULL)                 \
  ------------------
  |  |   20|  2.52k|#  define OSSL_LIST_DBG(x) x;
  ------------------
  125|  2.52k|        if (list->alpha == elem)                                            \
  ------------------
  |  Branch (125:13): [True: 2.52k, False: 0]
  ------------------
  126|  2.52k|            list->alpha = elem->ossl_list_ ## name.next;                    \
  127|  2.52k|        if (list->omega == elem)                                            \
  ------------------
  |  Branch (127:13): [True: 79, False: 2.44k]
  ------------------
  128|  2.52k|            list->omega = elem->ossl_list_ ## name.prev;                    \
  129|  2.52k|        if (elem->ossl_list_ ## name.prev != NULL)                          \
  ------------------
  |  Branch (129:13): [True: 0, False: 2.52k]
  ------------------
  130|  2.52k|            elem->ossl_list_ ## name.prev->ossl_list_ ## name.next =        \
  131|      0|                    elem->ossl_list_ ## name.next;                          \
  132|  2.52k|        if (elem->ossl_list_ ## name.next != NULL)                          \
  ------------------
  |  Branch (132:13): [True: 2.44k, False: 79]
  ------------------
  133|  2.52k|            elem->ossl_list_ ## name.next->ossl_list_ ## name.prev =        \
  134|  2.44k|                    elem->ossl_list_ ## name.prev;                          \
  135|  2.52k|        list->num_elems--;                                                  \
  136|  2.52k|        memset(&elem->ossl_list_ ## name, 0,                                \
  137|  2.52k|               sizeof(elem->ossl_list_ ## name));                           \
  138|  2.52k|    }                                                                       \
quic_demux.c:ossl_list_urxe_insert_tail:
  155|  2.52k|    {                                                                       \
  156|  2.52k|        assert(elem->ossl_list_ ## name.list == NULL);                      \
  157|  2.52k|        OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list)                 \
  ------------------
  |  |   20|  2.52k|#  define OSSL_LIST_DBG(x) x;
  ------------------
  158|  2.52k|        if (list->omega != NULL)                                            \
  ------------------
  |  Branch (158:13): [True: 2.44k, False: 79]
  ------------------
  159|  2.52k|            list->omega->ossl_list_ ## name.next = elem;                    \
  160|  2.52k|        elem->ossl_list_ ## name.prev = list->omega;                        \
  161|  2.52k|        elem->ossl_list_ ## name.next = NULL;                               \
  162|  2.52k|        list->omega = elem;                                                 \
  163|  2.52k|        if (list->alpha == NULL)                                            \
  ------------------
  |  Branch (163:13): [True: 79, False: 2.44k]
  ------------------
  164|  2.52k|            list->alpha = elem;                                             \
  165|  2.52k|        list->num_elems++;                                                  \
  166|  2.52k|    }                                                                       \
quic_demux.c:ossl_list_urxe_next:
  106|  7.58k|    {                                                                       \
  107|  7.58k|        assert(elem->ossl_list_ ## name.next == NULL                        \
  108|  7.58k|               || elem->ossl_list_ ## name.next                             \
  109|  7.58k|                      ->ossl_list_ ## name.prev == elem);                   \
  110|  7.58k|        return elem->ossl_list_ ## name.next;                               \
  111|  7.58k|    }                                                                       \
quic_engine.c:ossl_list_port_head:
   92|    237|    {                                                                       \
   93|    237|        assert(list->alpha == NULL                                          \
   94|    237|               || list->alpha->ossl_list_ ## name.list == list);            \
   95|    237|        return list->alpha;                                                 \
   96|    237|    }                                                                       \
quic_engine.c:ossl_list_port_next:
  106|    237|    {                                                                       \
  107|    237|        assert(elem->ossl_list_ ## name.next == NULL                        \
  108|    237|               || elem->ossl_list_ ## name.next                             \
  109|    237|                      ->ossl_list_ ## name.prev == elem);                   \
  110|    237|        return elem->ossl_list_ ## name.next;                               \
  111|    237|    }                                                                       \
quic_engine.c:ossl_list_port_num:
   87|    158|    {                                                                       \
   88|    158|        return list->num_elems;                                             \
   89|    158|    }                                                                       \

quic_demux.c:ossl_quic_urxe_data:
  144|  5.05k|{
  145|  5.05k|    return (unsigned char *)&e[1];
  146|  5.05k|}

quic_engine.c:ossl_quic_tick_result_merge_into:
   83|    158|{
   84|    158|    r->net_read_desired     = r->net_read_desired  || src->net_read_desired;
  ------------------
  |  Branch (84:31): [True: 0, False: 158]
  |  Branch (84:55): [True: 158, False: 0]
  ------------------
   85|    158|    r->net_write_desired    = r->net_write_desired || src->net_write_desired;
  ------------------
  |  Branch (85:31): [True: 0, False: 158]
  |  Branch (85:55): [True: 0, False: 158]
  ------------------
   86|    158|    r->notify_other_threads = r->notify_other_threads || src->notify_other_threads;
  ------------------
  |  Branch (86:31): [True: 0, False: 158]
  |  Branch (86:58): [True: 0, False: 158]
  ------------------
   87|    158|    r->tick_deadline        = ossl_time_min(r->tick_deadline, src->tick_deadline);
   88|    158|}

ssl_cert.c:CRYPTO_NEW_REF:
  280|     79|{
  281|     79|    refcnt->val = n;
  282|     79|    return 1;
  283|     79|}
ssl_cert.c:CRYPTO_DOWN_REF:
   56|     79|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     79|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     79|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 79, False: 0]
  ------------------
   66|     79|        atomic_thread_fence(memory_order_acquire);
   67|     79|#   endif
   68|     79|    return 1;
   69|     79|}
ssl_cert.c:CRYPTO_FREE_REF:
  285|     79|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     79|{
  287|     79|}
ssl_lib.c:CRYPTO_NEW_REF:
  280|    158|{
  281|    158|    refcnt->val = n;
  282|    158|    return 1;
  283|    158|}
ssl_lib.c:CRYPTO_FREE_REF:
  285|    158|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    158|{
  287|    158|}
ssl_lib.c:CRYPTO_UP_REF:
   40|     79|{
   41|     79|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     79|    return 1;
   43|     79|}
ssl_lib.c:CRYPTO_DOWN_REF:
   56|    237|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    237|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    237|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 158, False: 79]
  ------------------
   66|    158|        atomic_thread_fence(memory_order_acquire);
   67|    237|#   endif
   68|    237|    return 1;
   69|    237|}
bio_lib.c:CRYPTO_NEW_REF:
  280|    158|{
  281|    158|    refcnt->val = n;
  282|    158|    return 1;
  283|    158|}
bio_lib.c:CRYPTO_FREE_REF:
  285|    160|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    160|{
  287|    160|}
bio_lib.c:CRYPTO_DOWN_REF:
   56|    158|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    158|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    158|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 158, False: 0]
  ------------------
   66|    158|        atomic_thread_fence(memory_order_acquire);
   67|    158|#   endif
   68|    158|    return 1;
   69|    158|}
bio_lib.c:CRYPTO_GET_REF:
   72|    158|{
   73|    158|    *ret = atomic_load_explicit(&refcnt->val, memory_order_acquire);
   74|    158|    return 1;
   75|    158|}
digest.c:CRYPTO_NEW_REF:
  280|     27|{
  281|     27|    refcnt->val = n;
  282|     27|    return 1;
  283|     27|}
digest.c:CRYPTO_UP_REF:
   40|    745|{
   41|    745|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    745|    return 1;
   43|    745|}
digest.c:CRYPTO_DOWN_REF:
   56|    772|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    772|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    772|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 27, False: 745]
  ------------------
   66|     27|        atomic_thread_fence(memory_order_acquire);
   67|    772|#   endif
   68|    772|    return 1;
   69|    772|}
evp_enc.c:CRYPTO_NEW_REF:
  280|    130|{
  281|    130|    refcnt->val = n;
  282|    130|    return 1;
  283|    130|}
evp_enc.c:CRYPTO_UP_REF:
   40|  1.56k|{
   41|  1.56k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.56k|    return 1;
   43|  1.56k|}
evp_enc.c:CRYPTO_FREE_REF:
  285|    130|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    130|{
  287|    130|}
evp_enc.c:CRYPTO_DOWN_REF:
   56|  1.69k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  1.69k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.69k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 130, False: 1.56k]
  ------------------
   66|    130|        atomic_thread_fence(memory_order_acquire);
   67|  1.69k|#   endif
   68|  1.69k|    return 1;
   69|  1.69k|}
evp_lib.c:CRYPTO_FREE_REF:
  285|     27|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     27|{
  287|     27|}
exchange.c:CRYPTO_DOWN_REF:
   56|    174|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    174|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    174|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 7, False: 167]
  ------------------
   66|      7|        atomic_thread_fence(memory_order_acquire);
   67|    174|#   endif
   68|    174|    return 1;
   69|    174|}
exchange.c:CRYPTO_FREE_REF:
  285|      7|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      7|{
  287|      7|}
exchange.c:CRYPTO_UP_REF:
   40|    167|{
   41|    167|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    167|    return 1;
   43|    167|}
exchange.c:CRYPTO_NEW_REF:
  280|      7|{
  281|      7|    refcnt->val = n;
  282|      7|    return 1;
  283|      7|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  280|     40|{
  281|     40|    refcnt->val = n;
  282|     40|    return 1;
  283|     40|}
keymgmt_meth.c:CRYPTO_UP_REF:
   40|  7.01k|{
   41|  7.01k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  7.01k|    return 1;
   43|  7.01k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|  7.05k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  7.05k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  7.05k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 40, False: 7.01k]
  ------------------
   66|     40|        atomic_thread_fence(memory_order_acquire);
   67|  7.05k|#   endif
   68|  7.05k|    return 1;
   69|  7.05k|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  285|     40|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     40|{
  287|     40|}
p_lib.c:CRYPTO_NEW_REF:
  280|     79|{
  281|     79|    refcnt->val = n;
  282|     79|    return 1;
  283|     79|}
p_lib.c:CRYPTO_FREE_REF:
  285|     79|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     79|{
  287|     79|}
p_lib.c:CRYPTO_UP_REF:
   40|  2.05k|{
   41|  2.05k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.05k|    return 1;
   43|  2.05k|}
p_lib.c:CRYPTO_DOWN_REF:
   56|  2.13k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  2.13k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.13k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 79, False: 2.05k]
  ------------------
   66|     79|        atomic_thread_fence(memory_order_acquire);
   67|  2.13k|#   endif
   68|  2.13k|    return 1;
   69|  2.13k|}
signature.c:CRYPTO_DOWN_REF:
   56|    278|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|    278|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    278|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 59, False: 219]
  ------------------
   66|     59|        atomic_thread_fence(memory_order_acquire);
   67|    278|#   endif
   68|    278|    return 1;
   69|    278|}
signature.c:CRYPTO_FREE_REF:
  285|     59|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     59|{
  287|     59|}
signature.c:CRYPTO_UP_REF:
   40|    219|{
   41|    219|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    219|    return 1;
   43|    219|}
signature.c:CRYPTO_NEW_REF:
  280|     59|{
  281|     59|    refcnt->val = n;
  282|     59|    return 1;
  283|     59|}
provider_core.c:CRYPTO_UP_REF:
   40|  3.20k|{
   41|  3.20k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  3.20k|    return 1;
   43|  3.20k|}
provider_core.c:CRYPTO_NEW_REF:
  280|      3|{
  281|      3|    refcnt->val = n;
  282|      3|    return 1;
  283|      3|}
provider_core.c:CRYPTO_DOWN_REF:
   56|  3.20k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  3.20k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.20k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 3.20k]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|  3.20k|#   endif
   68|  3.20k|    return 1;
   69|  3.20k|}
provider_core.c:CRYPTO_FREE_REF:
  285|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      1|{
  287|      1|}
x509_lu.c:CRYPTO_NEW_REF:
  280|     79|{
  281|     79|    refcnt->val = n;
  282|     79|    return 1;
  283|     79|}
x509_lu.c:CRYPTO_DOWN_REF:
   56|     79|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     79|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     79|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 79, False: 0]
  ------------------
   66|     79|        atomic_thread_fence(memory_order_acquire);
   67|     79|#   endif
   68|     79|    return 1;
   69|     79|}
x509_lu.c:CRYPTO_FREE_REF:
  285|     79|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     79|{
  287|     79|}
evp_rand.c:CRYPTO_UP_REF:
   40|     19|{
   41|     19|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     19|    return 1;
   43|     19|}
evp_rand.c:CRYPTO_NEW_REF:
  280|     10|{
  281|     10|    refcnt->val = n;
  282|     10|    return 1;
  283|     10|}
evp_rand.c:CRYPTO_FREE_REF:
  285|     10|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     10|{
  287|     10|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|     29|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|     29|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     29|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 10, False: 19]
  ------------------
   66|     10|        atomic_thread_fence(memory_order_acquire);
   67|     29|#   endif
   68|     29|    return 1;
   69|     29|}

quic-server.c:safe_add_time:
   51|     77|    {                                                                        \
   52|     77|        type r;                                                              \
   53|     77|                                                                             \
   54|     77|        if (!__builtin_add_overflow(a, b, &r))                               \
  ------------------
  |  Branch (54:13): [True: 77, False: 0]
  ------------------
   55|     77|            return r;                                                        \
   56|     77|        *err |= 1;                                                           \
   57|      0|        return a + b;                                                            \
   58|     77|    }
stack.c:safe_muldiv_int:
  324|     20|    {                                                                        \
  325|     20|        int e2 = 0;                                                          \
  326|     20|        type q, r, x, y;                                                     \
  327|     20|                                                                             \
  328|     20|        if (c == 0) {                                                        \
  ------------------
  |  Branch (328:13): [True: 0, False: 20]
  ------------------
  329|      0|            *err |= 1;                                                       \
  330|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (330:20): [True: 0, False: 0]
  |  Branch (330:30): [True: 0, False: 0]
  ------------------
  331|      0|        }                                                                    \
  332|     20|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  333|     20|        if (!e2)                                                             \
  ------------------
  |  Branch (333:13): [True: 20, False: 0]
  ------------------
  334|     20|            return safe_div_ ## type_name(x, c, err);                        \
  335|     20|        if (b > a) {                                                         \
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            x = b;                                                           \
  337|      0|            b = a;                                                           \
  338|      0|            a = x;                                                           \
  339|      0|        }                                                                    \
  340|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  341|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  342|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  343|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  344|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  345|      0|        return safe_add_ ## type_name(y, q, err);                            \
  346|     20|    }
stack.c:safe_mul_int:
  138|     20|    {                                                                        \
  139|     20|        type r;                                                              \
  140|     20|                                                                             \
  141|     20|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (141:13): [True: 20, False: 0]
  ------------------
  142|     20|            return r;                                                        \
  143|     20|        *err |= 1;                                                           \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|     20|    }
stack.c:safe_div_int:
  201|     20|    {                                                                        \
  202|     20|        if (b == 0) {                                                        \
  ------------------
  |  Branch (202:13): [True: 0, False: 20]
  ------------------
  203|      0|            *err |= 1;                                                       \
  204|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                                    \
  206|     20|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (206:13): [True: 0, False: 20]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                                       \
  208|      0|            return max;                                                      \
  209|      0|        }                                                                    \
  210|     20|        return a / b;                                                        \
  211|     20|    }

ssl_cert.c:ssl_x509_store_ctx_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
ssl_init.c:ossl_init_ssl_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
do_engine_lock_init_ossl_:
   41|      1|    {                                           \
   42|      1|        init##_ossl_ret_ = init();              \
   43|      1|    }                                           \
err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_ssl_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_add_all_ciphers_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_add_all_digests_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_config_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_async_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
initthread.c:create_global_tevent_register_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
o_names.c:o_names_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
obj_dat.c:obj_lock_initialise_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
obj_xref.c:o_sig_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \

quic-server.c:ossl_ticks2time:
   59|    235|{
   60|    235|    OSSL_TIME r;
   61|       |
   62|    235|    r.t = ticks;
   63|    235|    return r;
   64|    235|}
quic-server.c:ossl_time_zero:
   79|     79|{
   80|     79|    return ossl_ticks2time(0);
   81|     79|}
quic-server.c:ossl_time_add:
  173|     77|{
  174|     77|    OSSL_TIME r;
  175|     77|    int err = 0;
  176|       |
  177|     77|    r.t = safe_add_time(a.t, b.t, &err);
  178|     77|    return err ? ossl_time_infinite() : r;
  ------------------
  |  Branch (178:12): [True: 0, False: 77]
  ------------------
  179|     77|}
ssl_sess.c:ossl_time_from_time_t:
  138|     79|{
  139|     79|    OSSL_TIME ot;
  140|       |
  141|     79|    ot.t = t;
  142|     79|    ot.t *= OSSL_TIME_SECOND;
  ------------------
  |  |   31|     79|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  143|     79|    return ot;
  144|     79|}
t1_lib.c:ossl_ticks2time:
   59|     79|{
   60|     79|    OSSL_TIME r;
   61|       |
   62|     79|    r.t = ticks;
   63|     79|    return r;
   64|     79|}
quic_port.c:ossl_ticks2time:
   59|    158|{
   60|    158|    OSSL_TIME r;
   61|       |
   62|    158|    r.t = ticks;
   63|    158|    return r;
   64|    158|}
quic_port.c:ossl_time_infinite:
   85|    158|{
   86|    158|    return ossl_ticks2time(~(uint64_t)0);
   87|    158|}
quic_engine.c:ossl_time_infinite:
   85|    158|{
   86|    158|    return ossl_ticks2time(~(uint64_t)0);
   87|    158|}
quic_engine.c:ossl_ticks2time:
   59|    237|{
   60|    237|    OSSL_TIME r;
   61|       |
   62|    237|    r.t = ticks;
   63|    237|    return r;
   64|    237|}
quic_engine.c:ossl_time_min:
  239|    158|{
  240|    158|    return a.t < b.t ? a : b;
  ------------------
  |  Branch (240:12): [True: 0, False: 158]
  ------------------
  241|    158|}
quic_engine.c:ossl_time_zero:
   79|     79|{
   80|     79|    return ossl_ticks2time(0);
   81|     79|}

X509_it:
  247|    948|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    948|        { \
  |  |   96|    948|                static const ASN1_ITEM local_it = {
  ------------------
  248|    948|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    948|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|    948|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    948|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|    948|                tname##_seq_tt,\
  251|    948|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|    948|                &tname##_aux,\
  253|    948|                sizeof(stname),\
  254|    948|                #tname \
  255|    948|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    948|                }; \
  |  |  103|    948|        return &local_it; \
  |  |  104|    948|        }
  ------------------
X509_free:
  816|    948|        { \
  817|    948|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  427|    948|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    948|        }

digest.c:OSSL_FUNC_digest_newctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_init:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_update:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_final:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_squeeze:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
digest.c:OSSL_FUNC_digest_freectx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_dupctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_get_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_copyctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   59|    118|    {                                                                   \
   60|    118|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    118|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   59|    129|    {                                                                   \
   60|    129|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    129|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
exchange.c:OSSL_FUNC_keyexch_newctx:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_init:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_set_peer:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
exchange.c:OSSL_FUNC_keyexch_derive:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_freectx:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_dupctx:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_get_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_gettable_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
exchange.c:OSSL_FUNC_keyexch_set_ctx_params:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
exchange.c:OSSL_FUNC_keyexch_settable_ctx_params:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   59|     33|    {                                                                   \
   60|     33|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     33|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
signature.c:OSSL_FUNC_signature_newctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_sign_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_sign:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_sign_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_sign_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_sign_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_verify:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_verify_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_verify_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_recover_init:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_verify_recover:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_digest_sign_init:
   59|     25|    {                                                                   \
   60|     25|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     25|    }
signature.c:OSSL_FUNC_signature_digest_sign_update:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign_final:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_digest_verify_init:
   59|     21|    {                                                                   \
   60|     21|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     21|    }
signature.c:OSSL_FUNC_signature_digest_verify_update:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify_final:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_freectx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_dupctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_set_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_settable_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_set_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_settable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_query_key_types:
   59|     36|    {                                                                   \
   60|     36|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     36|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
defltprov.c:OSSL_FUNC_core_gettable_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_params:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_entropy:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }

bio_lib.c:ERR_GET_REASON:
  256|    158|{
  257|    158|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|    158|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|    158|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|    158|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|    158|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|    158|}
bio_lib.c:ERR_GET_LIB:
  242|    158|{
  243|    158|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|    158|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|    158|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|    158|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|    158|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|    158|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|    158|}
conf_mod.c:ERR_GET_REASON:
  256|      2|{
  257|      2|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|      2|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|      2|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|      2|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|      2|}
err.c:ERR_GET_LIB:
  242|  9.71k|{
  243|  9.71k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  9.71k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  9.71k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 9.71k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  9.71k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  9.71k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  9.71k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  9.71k|}
err.c:ERR_GET_REASON:
  256|     70|{
  257|     70|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|     70|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     70|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 70]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|     70|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|     70|}
conf_def.c:ERR_GET_REASON:
  256|      2|{
  257|      2|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|      2|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|      2|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|      2|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|      2|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|      2|}

ssl_lib.c:lh_SSL_SESSION_new:
  317|     79|    { \
  318|     79|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|     79|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|     79|                                lh_##type##_doall_thunk, \
  321|     79|                                lh_##type##_doall_arg_thunk); \
  322|     79|    } \
ssl_lib.c:lh_SSL_SESSION_free:
  254|     79|    { \
  255|     79|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|     79|    } \
ssl_sess.c:lh_SSL_SESSION_get_down_load:
  289|     79|    { \
  290|     79|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|     79|    } \
ssl_sess.c:lh_SSL_SESSION_set_down_load:
  294|    158|    { \
  295|    158|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|    158|    } \
quic_srtm.c:lh_SRTM_ITEM_new:
  317|    158|    { \
  318|    158|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    158|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    158|                                lh_##type##_doall_thunk, \
  321|    158|                                lh_##type##_doall_arg_thunk); \
  322|    158|    } \
quic_srtm.c:lh_SRTM_ITEM_free:
  254|    158|    { \
  255|    158|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    158|    } \
quic_srtm.c:lh_SRTM_ITEM_doall:
  311|     79|    { \
  312|     79|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|     79|    } \
quic_lcidm.c:lh_QUIC_LCID_new:
  317|     79|    { \
  318|     79|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|     79|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|     79|                                lh_##type##_doall_thunk, \
  321|     79|                                lh_##type##_doall_arg_thunk); \
  322|     79|    } \
quic_lcidm.c:lh_QUIC_LCIDM_CONN_new:
  317|     79|    { \
  318|     79|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|     79|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|     79|                                lh_##type##_doall_thunk, \
  321|     79|                                lh_##type##_doall_arg_thunk); \
  322|     79|    } \
quic_lcidm.c:lh_QUIC_LCID_free:
  254|     79|    { \
  255|     79|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|     79|    } \
quic_lcidm.c:lh_QUIC_LCIDM_CONN_free:
  254|     79|    { \
  255|     79|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|     79|    } \
quic_lcidm.c:lh_QUIC_LCIDM_CONN_set_down_load:
  294|     79|    { \
  295|     79|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|     79|    } \
quic_lcidm.c:lh_QUIC_LCIDM_CONN_doall_arg:
  326|     79|    { \
  327|     79|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
  328|     79|                             (OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
  329|     79|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_flush:
  259|      2|    { \
  260|      2|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  9.64k|    { \
  197|  9.64k|        return (OPENSSL_LHASH *)lh; \
  198|  9.64k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      2|    { \
  207|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      2|    { \
  202|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      2|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  9.64k|    { \
  161|  9.64k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  9.64k|        return hfn_conv((const type *)data); \
  163|  9.64k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  6.16k|    { \
  166|  6.16k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  6.16k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  6.16k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  9.50k|    { \
  182|  9.50k|        return ptr; \
  183|  9.50k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|    140|    { \
  187|    140|        return ptr; \
  188|    140|    } \
o_names.c:lh_OBJ_NAME_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.98k|    { \
  244|  1.98k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.98k|        return hfn_conv((const type *)data); \
  246|  1.98k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|  1.34k|    { \
  249|  1.34k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.34k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.34k|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|  1.08k|    { \
  300|  1.08k|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|  1.08k|        doall_conv((type *)node); \
  302|  1.08k|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    651|    { \
  275|    651|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    651|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    848|    { \
  265|    848|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    848|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    484|    { \
  280|    484|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    484|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    484|    { \
  270|    484|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    484|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      8|    { \
  290|      8|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      8|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|     14|    { \
  295|     14|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|     14|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      8|    { \
  312|      8|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      8|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    273|    { \
  244|    273|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    273|        return hfn_conv((const type *)data); \
  246|    273|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    267|    { \
  249|    267|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    267|        return cfn_conv((const type *)da, (const type *)db); \
  251|    267|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|      2|    { \
  300|      2|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      2|        doall_conv((type *)node); \
  302|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    271|    { \
  275|    271|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    271|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|      2|    { \
  265|      2|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|      2|    { \
  280|      2|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      2|    } \
property.c:lh_QUERY_doall:
  311|    269|    { \
  312|    269|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    269|    } \
property.c:lh_QUERY_free:
  254|    269|    { \
  255|    269|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    269|    } \
property.c:lh_QUERY_new:
  317|    269|    { \
  318|    269|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    269|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    269|                                lh_##type##_doall_thunk, \
  321|    269|                                lh_##type##_doall_arg_thunk); \
  322|    269|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  9.28k|    { \
  244|  9.28k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  9.28k|        return hfn_conv((const type *)data); \
  246|  9.28k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  9.20k|    { \
  249|  9.20k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  9.20k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  9.20k|    } \
property.c:lh_QUERY_doall_thunk:
  299|     44|    { \
  300|     44|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     44|        doall_conv((type *)node); \
  302|     44|    } \
property.c:lh_QUERY_retrieve:
  274|  9.24k|    { \
  275|  9.24k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  9.24k|    } \
property.c:lh_QUERY_insert:
  264|     44|    { \
  265|     44|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     44|    } \
property.c:lh_QUERY_error:
  279|     44|    { \
  280|     44|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     44|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      4|    { \
  255|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  317|      8|    { \
  318|      8|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      8|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      8|                                lh_##type##_doall_thunk, \
  321|      8|                                lh_##type##_doall_arg_thunk); \
  322|      8|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|    104|    { \
  244|    104|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    104|        return hfn_conv((const type *)data); \
  246|    104|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|      2|    { \
  249|      2|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|      2|        return cfn_conv((const type *)da, (const type *)db); \
  251|      2|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     18|    { \
  300|     18|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     18|        doall_conv((type *)node); \
  302|     18|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|     70|    { \
  275|     70|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|     70|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     34|    { \
  265|     34|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     34|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     34|    { \
  280|     34|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     34|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \

ameth_lib.c:OBJ_bsearch_ameth:
  129|    704|      { \
  130|    704|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|    704|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|    704|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  2.25k|      { \
  124|  2.25k|      type1 const *a = a_; \
  125|  2.25k|      type2 const *b = b_; \
  126|  2.25k|      return nm##_cmp(a,b); \
  127|  2.25k|      } \
obj_dat.c:OBJ_bsearch_ln:
  129|  1.73k|      { \
  130|  1.73k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.73k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.73k|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|  16.8k|      { \
  124|  16.8k|      type1 const *a = a_; \
  125|  16.8k|      type2 const *b = b_; \
  126|  16.8k|      return nm##_cmp(a,b); \
  127|  16.8k|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|  1.97k|      { \
  130|  1.97k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.97k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.97k|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|  21.6k|      { \
  124|  21.6k|      type1 const *a = a_; \
  125|  21.6k|      type2 const *b = b_; \
  126|  21.6k|      return nm##_cmp(a,b); \
  127|  21.6k|      } \
obj_dat.c:OBJ_bsearch_obj:
  129|    237|      { \
  130|    237|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|    237|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|    237|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  2.29k|      { \
  124|  2.29k|      type1 const *a = a_; \
  125|  2.29k|      type2 const *b = b_; \
  126|  2.29k|      return nm##_cmp(a,b); \
  127|  2.29k|      } \
obj_xref.c:OBJ_bsearch_sig:
  129|    237|      { \
  130|    237|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|    237|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|    237|      } \
obj_xref.c:sig_cmp_BSEARCH_CMP_FN:
  123|  1.34k|      { \
  124|  1.34k|      type1 const *a = a_; \
  125|  1.34k|      type2 const *b = b_; \
  126|  1.34k|      return nm##_cmp(a,b); \
  127|  1.34k|      } \

quic-server.c:ossl_check_SSL_COMP_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
ssl_ciph.c:ossl_check_const_SSL_CIPHER_sk_type:
   49|    711|    { \
   50|    711|        return (const OPENSSL_STACK *)sk; \
   51|    711|    } \
ssl_ciph.c:ossl_check_SSL_CIPHER_sk_type:
   53|    869|    { \
   54|    869|        return (OPENSSL_STACK *)sk; \
   55|    869|    } \
ssl_ciph.c:ossl_check_SSL_CIPHER_type:
   45|    474|    { \
   46|    474|        return ptr; \
   47|    474|    } \
ssl_ciph.c:ossl_check_SSL_CIPHER_compfunc_type:
   57|     79|    { \
   58|     79|        return (OPENSSL_sk_compfunc)cmp; \
   59|     79|    } \
ssl_lib.c:ossl_check_const_SSL_CIPHER_sk_type:
   49|     79|    { \
   50|     79|        return (const OPENSSL_STACK *)sk; \
   51|     79|    } \
ssl_lib.c:ossl_check_SSL_CIPHER_sk_type:
   53|    237|    { \
   54|    237|        return (OPENSSL_STACK *)sk; \
   55|    237|    } \
ssl_lib.c:ossl_check_X509_NAME_sk_type:
   53|    158|    { \
   54|    158|        return (OPENSSL_STACK *)sk; \
   55|    158|    } \
ssl_lib.c:ossl_check_X509_NAME_freefunc_type:
   65|    158|    { \
   66|    158|        return (OPENSSL_sk_freefunc)fr; \
   67|    158|    }
ssl_lib.c:ossl_check_SRTP_PROTECTION_PROFILE_sk_type:
   53|     79|    { \
   54|     79|        return (OPENSSL_STACK *)sk; \
   55|     79|    } \
ssl_sess.c:sk_SSL_SESSION_new_null:
   96|     79|    { \
   97|     79|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|     79|    } \
ssl_sess.c:sk_SSL_SESSION_pop_free:
  145|     79|    { \
  146|     79|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     79|        \
  148|     79|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     79|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     79|        \
  151|     79|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     79|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      4|    { \
  113|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      2|    { \
  183|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      4|    { \
   81|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      6|    { \
  113|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
ct_log.c:ossl_check_CTLOG_sk_type:
   53|     79|    { \
   54|     79|        return (OPENSSL_STACK *)sk; \
   55|     79|    } \
ct_log.c:ossl_check_CTLOG_freefunc_type:
   65|     79|    { \
   66|     79|        return (OPENSSL_sk_freefunc)fr; \
   67|     79|    }
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  145|     79|    { \
  146|     79|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     79|        \
  148|     79|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     79|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     79|        \
  151|     79|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     79|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   53|     79|    { \
   54|     79|        return (OPENSSL_STACK *)sk; \
   55|     79|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   65|     79|    { \
   66|     79|        return (OPENSSL_sk_freefunc)fr; \
   67|     79|    }
core_namemap.c:sk_NAMES_value:
   84|    532|    { \
   85|    532|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|    532|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|  1.23k|    { \
   50|  1.23k|        return (const OPENSSL_STACK *)sk; \
   51|  1.23k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|  1.04k|    { \
   54|  1.04k|        return (OPENSSL_STACK *)sk; \
   55|  1.04k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    590|    { \
   46|    590|        return ptr; \
   47|    590|    } \
core_namemap.c:sk_NAMES_push:
  129|    255|    { \
  130|    255|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    255|    } \
core_namemap.c:sk_NAMES_num:
   80|    255|    { \
   81|    255|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    255|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    255|    { \
   66|    255|        return (OPENSSL_sk_freefunc)fr; \
   67|    255|    }
core_namemap.c:sk_NAMES_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
core_namemap.c:sk_NAMES_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
core_namemap.c:sk_NAMES_freefunc_thunk:
   75|    255|    { \
   76|    255|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    255|        freefunc((t3 *)ptr);\
   78|    255|    } \
ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     36|    { \
  146|     36|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     36|        \
  148|     36|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     36|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     36|        \
  151|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     36|    } \
ex_data.c:sk_EX_CALLBACK_freefunc_thunk:
   75|      2|    { \
   76|      2|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      2|        freefunc((t3 *)ptr);\
   78|      2|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|    950|    { \
   81|    950|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    950|    } \
ex_data.c:sk_EX_CALLBACK_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
ex_data.c:sk_EX_CALLBACK_push:
  129|      4|    { \
  130|      4|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      4|    } \
ex_data.c:sk_EX_CALLBACK_set:
  158|      2|    { \
  159|      2|        return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
  160|      2|    } \
ex_data.c:ossl_check_void_sk_type:
   53|    474|    { \
   54|    474|        return (OPENSSL_STACK *)sk; \
   55|    474|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      2|    { \
  130|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      2|    { \
   85|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      2|    { \
  121|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      2|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_INFOPAIR_pop_free:
  145|      3|    { \
  146|      3|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      3|        \
  148|      3|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      3|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      3|        \
  151|      3|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   75|      3|    { \
   76|      3|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      3|        freefunc((t3 *)ptr);\
   78|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      4|    { \
   89|      4|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      4|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      4|        \
   92|      4|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      4|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      4|    { \
   97|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  174|      2|    { \
  175|      2|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  162|      4|    { \
  163|      4|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  164|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   84|  8.79k|    { \
   85|  8.79k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  8.79k|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  188|      3|    { \
  189|      3|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|      3|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|      3|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  129|      3|    { \
  130|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  182|  1.46k|    { \
  183|  1.46k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|  1.46k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|  1.46k|    { \
   81|  1.46k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.46k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|  1.46k|    { \
  113|  1.46k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|  1.46k|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   80|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
o_names.c:sk_NAME_FUNCS_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  145|    269|    { \
  146|    269|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    269|        \
  148|    269|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    269|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    269|        \
  151|    269|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    269|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    269|    { \
   76|    269|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    269|        freefunc((t3 *)ptr);\
   78|    269|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    269|    { \
   97|    269|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    269|    } \
property.c:sk_IMPLEMENTATION_num:
   80|    582|    { \
   81|    582|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    582|    } \
property.c:sk_IMPLEMENTATION_value:
   84|     44|    { \
   85|     44|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     44|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    269|    { \
  130|    269|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    269|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|     46|    { \
   89|     46|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|     46|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|     46|        \
   92|     46|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|     46|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|     46|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   75|      2|    { \
   76|      2|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      2|        freefunc((t3 *)ptr);\
   78|      2|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  129|      2|    { \
  130|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      2|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   80|     46|    { \
   81|     46|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     46|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|     46|    { \
  175|     46|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|     46|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   84|      2|    { \
   85|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      2|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  145|     46|    { \
  146|     46|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     46|        \
  148|     46|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     46|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     46|        \
  151|     46|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     46|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     38|    { \
   54|     38|        return (OPENSSL_STACK *)sk; \
   55|     38|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|     34|    { \
   46|     34|        return ptr; \
   47|     34|    } \
t_x509.c:ossl_check_X509_sk_type:
   53|  1.02k|    { \
   54|  1.02k|        return (OPENSSL_STACK *)sk; \
   55|  1.02k|    } \
t_x509.c:ossl_check_X509_freefunc_type:
   65|  1.02k|    { \
   66|  1.02k|        return (OPENSSL_sk_freefunc)fr; \
   67|  1.02k|    }
x509_lu.c:ossl_check_X509_OBJECT_compfunc_type:
   57|     79|    { \
   58|     79|        return (OPENSSL_sk_compfunc)cmp; \
   59|     79|    } \
x509_lu.c:ossl_check_X509_OBJECT_sk_type:
   53|     79|    { \
   54|     79|        return (OPENSSL_STACK *)sk; \
   55|     79|    } \
x509_lu.c:ossl_check_X509_LOOKUP_sk_type:
   53|     79|    { \
   54|     79|        return (OPENSSL_STACK *)sk; \
   55|     79|    } \
x509_lu.c:ossl_check_const_X509_LOOKUP_sk_type:
   49|     79|    { \
   50|     79|        return (const OPENSSL_STACK *)sk; \
   51|     79|    } \
x509_lu.c:ossl_check_X509_OBJECT_freefunc_type:
   65|     79|    { \
   66|     79|        return (OPENSSL_sk_freefunc)fr; \
   67|     79|    }
x509_vpm.c:ossl_check_ASN1_OBJECT_sk_type:
   53|    158|    { \
   54|    158|        return (OPENSSL_STACK *)sk; \
   55|    158|    } \
x509_vpm.c:ossl_check_ASN1_OBJECT_freefunc_type:
   65|    158|    { \
   66|    158|        return (OPENSSL_sk_freefunc)fr; \
   67|    158|    }
x509_vpm.c:ossl_check_OPENSSL_STRING_sk_type:
   53|    158|    { \
   54|    158|        return (OPENSSL_STACK *)sk; \
   55|    158|    } \
x509_vpm.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    158|    { \
   66|    158|        return (OPENSSL_sk_freefunc)fr; \
   67|    158|    }
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      4|    { \
   58|      4|        return (OPENSSL_sk_compfunc)cmp; \
   59|      4|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      2|    { \
   66|      2|        return (OPENSSL_sk_freefunc)fr; \
   67|      2|    }

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 52, False: 1]
  ------------------
   29|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 42, False: 10]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  156|      1|#define OSSL_FUNC_BIO_NEW_FILE                40
  ------------------
  |  Branch (30:9): [True: 1, False: 51]
  ------------------
   31|      1|            if (c_bio_new_file == NULL)
  ------------------
  |  Branch (31:17): [True: 1, False: 0]
  ------------------
   32|      1|                c_bio_new_file = OSSL_FUNC_BIO_new_file(fns);
   33|      1|            break;
   34|      1|        case OSSL_FUNC_BIO_NEW_MEMBUF:
  ------------------
  |  |  157|      1|#define OSSL_FUNC_BIO_NEW_MEMBUF              41
  ------------------
  |  Branch (34:9): [True: 1, False: 51]
  ------------------
   35|      1|            if (c_bio_new_membuf == NULL)
  ------------------
  |  Branch (35:17): [True: 1, False: 0]
  ------------------
   36|      1|                c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns);
   37|      1|            break;
   38|      1|        case OSSL_FUNC_BIO_READ_EX:
  ------------------
  |  |  158|      1|#define OSSL_FUNC_BIO_READ_EX                 42
  ------------------
  |  Branch (38:9): [True: 1, False: 51]
  ------------------
   39|      1|            if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (39:17): [True: 1, False: 0]
  ------------------
   40|      1|                c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns);
   41|      1|            break;
   42|      1|        case OSSL_FUNC_BIO_WRITE_EX:
  ------------------
  |  |  159|      1|#define OSSL_FUNC_BIO_WRITE_EX                43
  ------------------
  |  Branch (42:9): [True: 1, False: 51]
  ------------------
   43|      1|            if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (43:17): [True: 1, False: 0]
  ------------------
   44|      1|                c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns);
   45|      1|            break;
   46|      1|        case OSSL_FUNC_BIO_GETS:
  ------------------
  |  |  165|      1|#define OSSL_FUNC_BIO_GETS                    49
  ------------------
  |  Branch (46:9): [True: 1, False: 51]
  ------------------
   47|      1|            if (c_bio_gets == NULL)
  ------------------
  |  Branch (47:17): [True: 1, False: 0]
  ------------------
   48|      1|                c_bio_gets = OSSL_FUNC_BIO_gets(fns);
   49|      1|            break;
   50|      1|        case OSSL_FUNC_BIO_PUTS:
  ------------------
  |  |  164|      1|#define OSSL_FUNC_BIO_PUTS                    48
  ------------------
  |  Branch (50:9): [True: 1, False: 51]
  ------------------
   51|      1|            if (c_bio_puts == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 0]
  ------------------
   52|      1|                c_bio_puts = OSSL_FUNC_BIO_puts(fns);
   53|      1|            break;
   54|      1|        case OSSL_FUNC_BIO_CTRL:
  ------------------
  |  |  166|      1|#define OSSL_FUNC_BIO_CTRL                    50
  ------------------
  |  Branch (54:9): [True: 1, False: 51]
  ------------------
   55|      1|            if (c_bio_ctrl == NULL)
  ------------------
  |  Branch (55:17): [True: 1, False: 0]
  ------------------
   56|      1|                c_bio_ctrl = OSSL_FUNC_BIO_ctrl(fns);
   57|      1|            break;
   58|      1|        case OSSL_FUNC_BIO_UP_REF:
  ------------------
  |  |  160|      1|#define OSSL_FUNC_BIO_UP_REF                  44
  ------------------
  |  Branch (58:9): [True: 1, False: 51]
  ------------------
   59|      1|            if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (59:17): [True: 1, False: 0]
  ------------------
   60|      1|                c_bio_up_ref = OSSL_FUNC_BIO_up_ref(fns);
   61|      1|            break;
   62|      1|        case OSSL_FUNC_BIO_FREE:
  ------------------
  |  |  161|      1|#define OSSL_FUNC_BIO_FREE                    45
  ------------------
  |  Branch (62:9): [True: 1, False: 51]
  ------------------
   63|      1|            if (c_bio_free == NULL)
  ------------------
  |  Branch (63:17): [True: 1, False: 0]
  ------------------
   64|      1|                c_bio_free = OSSL_FUNC_BIO_free(fns);
   65|      1|            break;
   66|      1|        case OSSL_FUNC_BIO_VPRINTF:
  ------------------
  |  |  162|      1|#define OSSL_FUNC_BIO_VPRINTF                 46
  ------------------
  |  Branch (66:9): [True: 1, False: 51]
  ------------------
   67|      1|            if (c_bio_vprintf == NULL)
  ------------------
  |  Branch (67:17): [True: 1, False: 0]
  ------------------
   68|      1|                c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns);
   69|      1|            break;
   70|     52|        }
   71|     52|    }
   72|       |
   73|      1|    return 1;
   74|      1|}
ossl_bio_prov_init_bio_method:
  207|      1|{
  208|      1|    BIO_METHOD *corebiometh = NULL;
  209|       |
  210|      1|    corebiometh = BIO_meth_new(BIO_TYPE_CORE_TO_PROV, "BIO to Core filter");
  ------------------
  |  |   69|      1|# define BIO_TYPE_CORE_TO_PROV   (25|BIO_TYPE_SOURCE_SINK)
  |  |  ------------------
  |  |  |  |   41|      1|# define BIO_TYPE_SOURCE_SINK    0x0400
  |  |  ------------------
  ------------------
  211|      1|    if (corebiometh == NULL
  ------------------
  |  Branch (211:9): [True: 0, False: 1]
  ------------------
  212|      1|            || !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex)
  ------------------
  |  Branch (212:16): [True: 0, False: 1]
  ------------------
  213|      1|            || !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex)
  ------------------
  |  Branch (213:16): [True: 0, False: 1]
  ------------------
  214|      1|            || !BIO_meth_set_puts(corebiometh, bio_core_puts)
  ------------------
  |  Branch (214:16): [True: 0, False: 1]
  ------------------
  215|      1|            || !BIO_meth_set_gets(corebiometh, bio_core_gets)
  ------------------
  |  Branch (215:16): [True: 0, False: 1]
  ------------------
  216|      1|            || !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl)
  ------------------
  |  Branch (216:16): [True: 0, False: 1]
  ------------------
  217|      1|            || !BIO_meth_set_create(corebiometh, bio_core_new)
  ------------------
  |  Branch (217:16): [True: 0, False: 1]
  ------------------
  218|      1|            || !BIO_meth_set_destroy(corebiometh, bio_core_free)) {
  ------------------
  |  Branch (218:16): [True: 0, False: 1]
  ------------------
  219|      0|        BIO_meth_free(corebiometh);
  220|      0|        return NULL;
  221|      0|    }
  222|       |
  223|      1|    return corebiometh;
  224|      1|}

ossl_prov_get_capabilities:
  337|    158|{
  338|    158|    if (OPENSSL_strcasecmp(capability, "TLS-GROUP") == 0)
  ------------------
  |  Branch (338:9): [True: 79, False: 79]
  ------------------
  339|     79|        return tls_group_capability(cb, arg);
  340|     79|    if (OPENSSL_strcasecmp(capability, "TLS-SIGALG") == 0)
  ------------------
  |  Branch (340:9): [True: 79, False: 0]
  ------------------
  341|     79|        return tls_sigalg_capability(cb, arg);
  342|       |
  343|       |    /* We don't support this capability */
  344|      0|    return 0;
  345|     79|}
capabilities.c:tls_group_capability:
  262|     79|{
  263|     79|#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ML_KEM)
  264|     79|    size_t i;
  265|       |
  266|  4.74k|    for (i = 0; i < OSSL_NELEM(param_group_list); i++)
  ------------------
  |  |   14|  4.74k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (266:17): [True: 4.66k, False: 79]
  ------------------
  267|  4.66k|        if (!cb(param_group_list[i], arg))
  ------------------
  |  Branch (267:13): [True: 0, False: 4.66k]
  ------------------
  268|      0|            return 0;
  269|     79|#endif
  270|       |
  271|     79|    return 1;
  272|     79|}
capabilities.c:tls_sigalg_capability:
  324|     79|{
  325|     79|#if !defined(OPENSSL_NO_ML_DSA)
  326|     79|    size_t i;
  327|       |
  328|    316|    for (i = 0; i < OSSL_NELEM(param_sigalg_list); i++)
  ------------------
  |  |   14|    316|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (328:17): [True: 237, False: 79]
  ------------------
  329|    237|        if (!cb(param_sigalg_list[i], arg))
  ------------------
  |  Branch (329:13): [True: 0, False: 237]
  ------------------
  330|      0|            return 0;
  331|     79|#endif
  332|     79|    return 1;
  333|     79|}

ciphercommon.c:ossl_param_is_empty:
   30|     79|{
   31|     79|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 79, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|     79|}
ciphercommon_gcm.c:ossl_param_is_empty:
   30|    158|{
   31|    158|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 158, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|    158|}

ossl_prov_ctx_new:
   16|      1|{
   17|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|      1|}
ossl_prov_ctx_free:
   21|      1|{
   22|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   23|      1|}
ossl_prov_ctx_set0_libctx:
   26|      1|{
   27|      1|    if (ctx != NULL)
  ------------------
  |  Branch (27:9): [True: 1, False: 0]
  ------------------
   28|      1|        ctx->libctx = libctx;
   29|      1|}
ossl_prov_ctx_set0_handle:
   32|      1|{
   33|      1|    if (ctx != NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ctx->handle = handle;
   35|      1|}
ossl_prov_ctx_set0_core_bio_method:
   38|      1|{
   39|      1|    if (ctx != NULL)
  ------------------
  |  Branch (39:9): [True: 1, False: 0]
  ------------------
   40|      1|        ctx->corebiometh = corebiometh;
   41|      1|}
ossl_prov_ctx_set0_core_get_params:
   46|      1|{
   47|      1|    if (ctx != NULL)
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        ctx->core_get_params = c_get_params;
   49|      1|}
ossl_prov_ctx_get0_libctx:
   52|    158|{
   53|    158|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 158]
  ------------------
   54|      0|        return NULL;
   55|    158|    return ctx->libctx;
   56|    158|}
ossl_prov_ctx_get0_core_bio_method:
   66|      1|{
   67|      1|    if (ctx == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|        return NULL;
   69|      1|    return ctx->corebiometh;
   70|      1|}

ossl_err_load_PROV_strings:
  259|      2|{
  260|      2|#ifndef OPENSSL_NO_ERR
  261|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (261:9): [True: 2, False: 0]
  ------------------
  262|      2|        ERR_load_strings_const(PROV_str_reasons);
  263|      2|#endif
  264|      2|    return 1;
  265|      2|}

ossl_prov_seeding_from_dispatch:
   42|      1|{
   43|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (43:12): [True: 52, False: 1]
  ------------------
   44|       |        /*
   45|       |         * We do not support the scenario of an application linked against
   46|       |         * multiple versions of libcrypto (e.g. one static and one dynamic), but
   47|       |         * sharing a single fips.so. We do a simple sanity check here.
   48|       |         */
   49|     52|#define set_func(c, f) \
   50|     52|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
   51|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (51:17): [True: 44, False: 8]
  ------------------
   52|      1|        case OSSL_FUNC_GET_ENTROPY:
  ------------------
  |  |  201|      1|#define OSSL_FUNC_GET_ENTROPY                101
  ------------------
  |  Branch (52:9): [True: 1, False: 51]
  ------------------
   53|      1|            set_func(c_get_entropy, OSSL_FUNC_get_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   54|      1|            break;
   55|      1|        case OSSL_FUNC_GET_USER_ENTROPY:
  ------------------
  |  |  190|      1|#define OSSL_FUNC_GET_USER_ENTROPY            98
  ------------------
  |  Branch (55:9): [True: 1, False: 51]
  ------------------
   56|      1|            set_func(c_get_user_entropy, OSSL_FUNC_get_user_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   57|      1|            break;
   58|      1|        case OSSL_FUNC_CLEANUP_ENTROPY:
  ------------------
  |  |  202|      1|#define OSSL_FUNC_CLEANUP_ENTROPY            102
  ------------------
  |  Branch (58:9): [True: 1, False: 51]
  ------------------
   59|      1|            set_func(c_cleanup_entropy, OSSL_FUNC_cleanup_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   60|      1|            break;
   61|      1|        case OSSL_FUNC_CLEANUP_USER_ENTROPY:
  ------------------
  |  |  188|      1|#define OSSL_FUNC_CLEANUP_USER_ENTROPY        96
  ------------------
  |  Branch (61:9): [True: 1, False: 51]
  ------------------
   62|      1|            set_func(c_cleanup_user_entropy, OSSL_FUNC_cleanup_user_entropy(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   63|      1|            break;
   64|      1|        case OSSL_FUNC_GET_NONCE:
  ------------------
  |  |  203|      1|#define OSSL_FUNC_GET_NONCE                  103
  ------------------
  |  Branch (64:9): [True: 1, False: 51]
  ------------------
   65|      1|            set_func(c_get_nonce, OSSL_FUNC_get_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   66|      1|            break;
   67|      1|        case OSSL_FUNC_GET_USER_NONCE:
  ------------------
  |  |  191|      1|#define OSSL_FUNC_GET_USER_NONCE              99
  ------------------
  |  Branch (67:9): [True: 1, False: 51]
  ------------------
   68|      1|            set_func(c_get_user_nonce, OSSL_FUNC_get_user_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|      1|            break;
   70|      1|        case OSSL_FUNC_CLEANUP_NONCE:
  ------------------
  |  |  204|      1|#define OSSL_FUNC_CLEANUP_NONCE              104
  ------------------
  |  Branch (70:9): [True: 1, False: 51]
  ------------------
   71|      1|            set_func(c_cleanup_nonce, OSSL_FUNC_cleanup_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   72|      1|            break;
   73|      1|        case OSSL_FUNC_CLEANUP_USER_NONCE:
  ------------------
  |  |  189|      1|#define OSSL_FUNC_CLEANUP_USER_NONCE          97
  ------------------
  |  Branch (73:9): [True: 1, False: 51]
  ------------------
   74|      1|            set_func(c_cleanup_user_nonce, OSSL_FUNC_cleanup_user_nonce(fns));
  ------------------
  |  |   50|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [True: 1, False: 0]
  |  |  |  Branch (50:41): [True: 0, False: 0]
  |  |  |  Branch (50:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   75|      1|            break;
   76|     52|        }
   77|     52|#undef set_func
   78|     52|    }
   79|      1|    return 1;
   80|      1|}

ossl_prov_cache_exported_algorithms:
  349|      1|{
  350|      1|    int i, j;
  351|       |
  352|      1|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (352:9): [True: 1, False: 0]
  ------------------
  353|    140|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (353:25): [True: 139, False: 1]
  ------------------
  354|    139|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (354:17): [True: 126, False: 13]
  |  Branch (354:42): [True: 4, False: 9]
  ------------------
  355|    130|                out[j++] = in[i].alg;
  356|    139|        }
  357|      1|        out[j++] = in[i].alg;
  358|      1|    }
  359|      1|}

ossl_default_provider_init:
  745|      1|{
  746|      1|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  747|      1|    BIO_METHOD *corebiometh;
  748|       |
  749|      1|    if (!ossl_prov_bio_from_dispatch(in)
  ------------------
  |  Branch (749:9): [True: 0, False: 1]
  ------------------
  750|      1|            || !ossl_prov_seeding_from_dispatch(in))
  ------------------
  |  Branch (750:16): [True: 0, False: 1]
  ------------------
  751|      0|        return 0;
  752|     53|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (752:12): [True: 52, False: 1]
  ------------------
  753|     52|        switch (in->function_id) {
  754|      1|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   71|      1|# define OSSL_FUNC_CORE_GETTABLE_PARAMS        1
  ------------------
  |  Branch (754:9): [True: 1, False: 51]
  ------------------
  755|      1|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  756|      1|            break;
  757|      1|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   74|      1|# define OSSL_FUNC_CORE_GET_PARAMS             2
  ------------------
  |  Branch (757:9): [True: 1, False: 51]
  ------------------
  758|      1|            c_get_params = OSSL_FUNC_core_get_params(in);
  759|      1|            break;
  760|      1|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   81|      1|# define OSSL_FUNC_CORE_GET_LIBCTX             4
  ------------------
  |  Branch (760:9): [True: 1, False: 51]
  ------------------
  761|      1|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  762|      1|            break;
  763|     49|        default:
  ------------------
  |  Branch (763:9): [True: 49, False: 3]
  ------------------
  764|       |            /* Just ignore anything we don't understand */
  765|     49|            break;
  766|     52|        }
  767|     52|    }
  768|       |
  769|      1|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (769:9): [True: 0, False: 1]
  ------------------
  770|      0|        return 0;
  771|       |
  772|       |    /*
  773|       |     * We want to make sure that all calls from this provider that requires
  774|       |     * a library context use the same context as the one used to call our
  775|       |     * functions.  We do that by passing it along in the provider context.
  776|       |     *
  777|       |     * This only works for built-in providers.  Most providers should
  778|       |     * create their own library context.
  779|       |     */
  780|      1|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (780:9): [True: 0, False: 1]
  ------------------
  781|      1|            || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (781:16): [True: 0, False: 1]
  ------------------
  782|      0|        ossl_prov_ctx_free(*provctx);
  783|      0|        *provctx = NULL;
  784|      0|        return 0;
  785|      0|    }
  786|      1|    ossl_prov_ctx_set0_libctx(*provctx,
  787|      1|                                       (OSSL_LIB_CTX *)c_get_libctx(handle));
  788|      1|    ossl_prov_ctx_set0_handle(*provctx, handle);
  789|      1|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  790|      1|    ossl_prov_ctx_set0_core_get_params(*provctx, c_get_params);
  791|       |
  792|      1|    *out = deflt_dispatch_table;
  793|      1|    ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
  794|       |
  795|      1|    return 1;
  796|      1|}
defltprov.c:deflt_teardown:
  723|      1|{
  724|      1|    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
  725|      1|    ossl_prov_ctx_free(provctx);
  726|      1|}
defltprov.c:deflt_query:
  686|  1.30k|{
  687|  1.30k|    *no_cache = 0;
  688|  1.30k|    switch (operation_id) {
  ------------------
  |  Branch (688:13): [True: 0, False: 1.30k]
  ------------------
  689|    560|    case OSSL_OP_DIGEST:
  ------------------
  |  |  310|    560|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (689:5): [True: 560, False: 748]
  ------------------
  690|    560|        return deflt_digests;
  691|    724|    case OSSL_OP_CIPHER:
  ------------------
  |  |  311|    724|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (691:5): [True: 724, False: 584]
  ------------------
  692|    724|        return exported_ciphers;
  693|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  312|      0|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (693:5): [True: 0, False: 1.30k]
  ------------------
  694|      0|        return deflt_macs;
  695|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  313|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (695:5): [True: 0, False: 1.30k]
  ------------------
  696|      0|        return deflt_kdfs;
  697|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (697:5): [True: 2, False: 1.30k]
  ------------------
  698|      2|        return deflt_rands;
  699|     18|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  315|     18|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (699:5): [True: 18, False: 1.29k]
  ------------------
  700|     18|        return deflt_keymgmt;
  701|      2|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  316|      2|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (701:5): [True: 2, False: 1.30k]
  ------------------
  702|      2|        return deflt_keyexch;
  703|      2|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  317|      2|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (703:5): [True: 2, False: 1.30k]
  ------------------
  704|      2|        return deflt_signature;
  705|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  318|      0|# define OSSL_OP_ASYM_CIPHER                        13
  ------------------
  |  Branch (705:5): [True: 0, False: 1.30k]
  ------------------
  706|      0|        return deflt_asym_cipher;
  707|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  319|      0|# define OSSL_OP_KEM                                14
  ------------------
  |  Branch (707:5): [True: 0, False: 1.30k]
  ------------------
  708|      0|        return deflt_asym_kem;
  709|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  322|      0|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (709:5): [True: 0, False: 1.30k]
  ------------------
  710|      0|        return deflt_encoder;
  711|      0|    case OSSL_OP_DECODER:
  ------------------
  |  |  323|      0|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (711:5): [True: 0, False: 1.30k]
  ------------------
  712|      0|        return deflt_decoder;
  713|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  324|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (713:5): [True: 0, False: 1.30k]
  ------------------
  714|      0|        return deflt_store;
  715|      0|    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  320|      0|# define OSSL_OP_SKEYMGMT                           15
  ------------------
  |  Branch (715:5): [True: 0, False: 1.30k]
  ------------------
  716|      0|        return deflt_skeymgmt;
  717|  1.30k|    }
  718|      0|    return NULL;
  719|  1.30k|}

cipher_aes.c:aes_freectx:
   27|     79|{
   28|     79|    PROV_AES_CTX *ctx = (PROV_AES_CTX *)vctx;
   29|       |
   30|     79|    ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
   31|     79|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|     79|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|     79|}

cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha1_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_gettable_ctx_params:
  303|      4|{
  304|      4|    return cipher_aes_known_gettable_ctx_params;
  305|      4|}
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha1_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha256_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha256_get_params:
  402|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  403|      1|{                                                                              \
  404|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  323|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  405|      1|                                          flags, kbits, blkbits, ivbits);      \
  406|      1|}                                                                              \

ossl_cipher_capable_aes_cbc_hmac_sha1_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha1:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE;
  ------------------
  |  |  177|      2|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  ------------------
   43|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha256_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha256:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE
  ------------------
  |  |  177|      4|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (177:38): [True: 2, False: 0]
  |  |  ------------------
  ------------------
   43|      2|           && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL);
  ------------------
  |  Branch (43:15): [True: 2, False: 0]
  ------------------
   44|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha512_etm:
   20|      3|{
   21|      3|    return 0;
   22|      3|}

cipher_aes_gcm.c:aes_gcm_newctx:
   24|     79|{
   25|     79|    PROV_AES_GCM_CTX *ctx;
   26|       |
   27|     79|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (27:9): [True: 0, False: 79]
  ------------------
   28|      0|        return NULL;
   29|       |
   30|     79|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   31|     79|    if (ctx != NULL)
  ------------------
  |  Branch (31:9): [True: 79, False: 0]
  ------------------
   32|     79|        ossl_gcm_initctx(provctx, &ctx->base, keybits,
   33|     79|                         ossl_prov_aes_hw_gcm(keybits));
   34|     79|    return ctx;
   35|     79|}
cipher_aes_gcm.c:aes_gcm_freectx:
   57|     79|{
   58|     79|    PROV_AES_GCM_CTX *ctx = (PROV_AES_GCM_CTX *)vctx;
   59|       |
   60|     79|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|     79|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|     79|}

ossl_prov_aes_hw_gcm:
   37|     79|{
   38|     79|#ifdef VAES_GCM_ENABLED
   39|     79|    if (ossl_vaes_vpclmulqdq_capable())
  ------------------
  |  Branch (39:9): [True: 0, False: 79]
  ------------------
   40|      0|        return &vaes_gcm;
   41|     79|    else
   42|     79|#endif
   43|     79|    if (AESNI_CAPABLE)
  ------------------
  |  |  195|     79|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (195:27): [True: 79, False: 0]
  |  |  ------------------
  ------------------
   44|     79|        return &aesni_gcm;
   45|      0|    else
   46|      0|        return &aes_gcm;
   47|     79|}
cipher_aes_gcm_hw.c:aesni_gcm_initkey:
   17|     79|{
   18|     79|    PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx;
   19|     79|    AES_KEY *ks = &actx->ks.ks;
   20|     79|    GCM_HW_SET_KEY_CTR_FN(ks, aesni_set_encrypt_key, aesni_encrypt,
  ------------------
  |  |  128|     79|    fn_set_enc_key(key, keylen * 8, ks);                                       \
  |  |  129|     79|    CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);                   \
  |  |  130|     79|    ctx->ctr = (ctr128_f)fn_ctr;                                               \
  |  |  131|     79|    ctx->key_set = 1;
  ------------------
   21|     79|                          aesni_ctr32_encrypt_blocks);
   22|     79|    return 1;
   23|     79|}

cipher_aes_gcm_siv.c:ossl_aes_128_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_gcm_siv_gettable_ctx_params:
  211|      3|{
  212|      3|    return aes_gcm_siv_known_gettable_ctx_params;
  213|      3|}
cipher_aes_gcm_siv.c:ossl_aes_192_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_256_gcm_siv_get_params:
  287|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  288|      1|{                                                                                                       \
  289|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  290|      1|                                          flags, kbits, blkbits, ivbits);                               \
  291|      1|}                                                                                                       \

ossl_prov_cipher_hw_aes_ecb:
  133|     79|const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_##mode(size_t keybits)           \
  134|     79|{                                                                              \
  135|     79|    PROV_CIPHER_HW_select(mode)                                                \
  ------------------
  |  |   82|     79|#define PROV_CIPHER_HW_select(mode)                                            \
  |  |   83|     79|if (AESNI_CAPABLE)                                                             \
  |  |  ------------------
  |  |  |  |  195|     79|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:27): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   84|     79|    return &aesni_##mode;
  ------------------
  136|     79|    return &aes_##mode;                                                        \
  137|     79|}

cipher_aes_hw.c:cipher_hw_aesni_initkey:
   23|     79|{
   24|     79|    int ret;
   25|     79|    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
   26|     79|    AES_KEY *ks = &adat->ks.ks;
   27|       |
   28|     79|    dat->ks = ks;
   29|       |
   30|     79|    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  322|    158|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
                  if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  323|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (30:10): [True: 79, False: 0]
  |  Branch (30:44): [True: 0, False: 0]
  ------------------
   31|     79|        && !dat->enc) {
  ------------------
  |  Branch (31:12): [True: 0, False: 79]
  ------------------
   32|      0|        ret = aesni_set_decrypt_key(key, keylen * 8, ks);
   33|      0|        dat->block = (block128_f) aesni_decrypt;
   34|      0|        dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
  ------------------
  |  |  323|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (34:27): [True: 0, False: 0]
  ------------------
   35|      0|            (cbc128_f) aesni_cbc_encrypt : NULL;
   36|     79|    } else {
   37|     79|        ret = aesni_set_encrypt_key(key, keylen * 8, ks);
   38|     79|        dat->block = (block128_f) aesni_encrypt;
   39|     79|        if (dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  323|     79|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (39:13): [True: 0, False: 79]
  ------------------
   40|      0|            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
   41|     79|        else if (dat->mode == EVP_CIPH_CTR_MODE)
  ------------------
  |  |  326|     79|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (41:18): [True: 0, False: 79]
  ------------------
   42|      0|            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
   43|     79|        else
   44|     79|            dat->stream.cbc = NULL;
   45|     79|    }
   46|       |
   47|     79|    if (ret < 0) {
  ------------------
  |  Branch (47:9): [True: 0, False: 79]
  ------------------
   48|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   49|      0|        return 0;
   50|      0|    }
   51|       |
   52|     79|    return 1;
   53|     79|}

cipher_aes_ocb.c:aes_256_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  488|      3|{
  489|      3|    return cipher_ocb_known_gettable_ctx_params;
  490|      3|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  528|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  529|      1|{                                                                              \
  530|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  531|      1|                                          flags, kbits, blkbits, ivbits);      \
  532|      1|}                                                                              \

cipher_aes_siv.c:aes_128_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \
cipher_aes_siv.c:aes_siv_gettable_ctx_params:
  186|      3|{
  187|      3|    return aes_siv_known_gettable_ctx_params;
  188|      3|}
cipher_aes_siv.c:aes_192_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \
cipher_aes_siv.c:aes_256_siv_get_params:
  260|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  261|      1|{                                                                              \
  262|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  263|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  264|      1|}                                                                              \

cipher_aes_wrp.c:aes_256_wrap_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrap_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrap_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrappad_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrappad_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrappad_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrapinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrapinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrapinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrappadinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrappadinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrappadinv_get_params:
  289|      1|    {                                                                          \
  290|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  291|      1|                                              flags, kbits, blkbits, ivbits);  \
  292|      1|    }                                                                          \

cipher_aes_xts.c:aes_256_xts_get_params:
  281|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  282|      1|{                                                                              \
  283|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  284|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  286|      1|}                                                                              \
cipher_aes_xts.c:aes_128_xts_get_params:
  281|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  282|      1|{                                                                              \
  283|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  284|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  286|      1|}                                                                              \

cipher_chacha20.c:chacha20_get_params:
   96|      1|{
   97|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_FLAGS,
  ------------------
  |  |   21|      1|#define CHACHA20_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   98|      1|                                          CHACHA20_KEYLEN * 8,
  ------------------
  |  |   18|      1|#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
  |  |  ------------------
  |  |  |  |   45|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
   99|      1|                                          CHACHA20_BLKLEN * 8,
  ------------------
  |  |   19|      1|#define CHACHA20_BLKLEN (1)
  ------------------
  100|      1|                                          CHACHA20_IVLEN * 8);
  ------------------
  |  |   20|      1|#define CHACHA20_IVLEN (CHACHA_CTR_SIZE)
  |  |  ------------------
  |  |  |  |   46|      1|#define CHACHA_CTR_SIZE         16
  |  |  ------------------
  ------------------
  101|      1|}
cipher_chacha20.c:chacha20_gettable_ctx_params:
  141|      1|{
  142|      1|    return chacha20_known_gettable_ctx_params;
  143|      1|}

cipher_chacha20_poly1305.c:chacha20_poly1305_get_params:
   97|     80|{
   98|     80|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   24|     80|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD                         \
  |  |  ------------------
  |  |  |  |   39|     80|# define PROV_CIPHER_FLAG_AEAD             0x0001
  |  |  ------------------
  |  |   25|     80|                                 | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|     80|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   99|     80|                                          CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   20|     80|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   45|     80|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
  100|     80|                                          CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   21|     80|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
  101|     80|                                          CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   16|     80|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
  102|     80|}
cipher_chacha20_poly1305.c:chacha20_poly1305_gettable_ctx_params:
  218|      1|{
  219|      1|    return chacha20_poly1305_known_gettable_ctx_params;
  220|      1|}

cipher_aes.c:aes_cts_256_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_aes.c:aes_cts_192_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_aes.c:aes_cts_128_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_256_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_192_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_128_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \

cipher_null.c:null_get_params:
  104|      1|{
  105|      1|    return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
  106|      1|}
cipher_null.c:null_gettable_ctx_params:
  118|      1|{
  119|      1|    return null_known_gettable_ctx_params;
  120|      1|}

cipher_sm4_xts.c:sm4_128_xts_get_params:
  245|      1|static int sm4_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  246|      1|{                                                                              \
  247|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  248|      1|                                          flags, 2 * kbits, SM4_XTS_BLOCK_BITS,\
  ------------------
  |  |   20|      1|#define SM4_XTS_BLOCK_BITS 8
  ------------------
  249|      1|                                          SM4_XTS_IV_BITS);                    \
  ------------------
  |  |   19|      1|#define SM4_XTS_IV_BITS 128
  ------------------
  250|      1|}                                                                              \

cipher_tdes.c:tdes_ede3_ecb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes.c:tdes_ede3_cbc_get_params:
   43|     80|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|     80|{                                                                              \
   45|     80|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|     80|                                flags, kbits, blkbits, ivbits);                \
   47|     80|}                                                                              \
cipher_tdes_default.c:tdes_ede3_ofb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb1_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb8_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ecb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cbc_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ofb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cfb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
   46|      1|                                flags, kbits, blkbits, ivbits);                \
   47|      1|}                                                                              \

ossl_tdes_get_params:
  190|     89|{
  191|       |#ifdef FIPS_MODULE
  192|       |    const int decrypt_only = 1;
  193|       |#else
  194|     89|    const int decrypt_only = 0;
  195|     89|#endif
  196|     89|    OSSL_PARAM *p;
  197|       |
  198|     89|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_DECRYPT_ONLY);
  ------------------
  |  |  187|     89|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
  199|     89|    if (p != NULL && !OSSL_PARAM_set_int(p, decrypt_only)) {
  ------------------
  |  Branch (199:9): [True: 79, False: 10]
  |  Branch (199:22): [True: 0, False: 79]
  ------------------
  200|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return 0;
  202|      0|    }
  203|       |
  204|     89|    return ossl_cipher_generic_get_params(params, md, flags,
  205|     89|                                          kbits, blkbits, ivbits);
  206|     89|}

cipher_tdes_wrap.c:tdes_wrap_get_params:
  179|      1|static int tdes_wrap_get_params(OSSL_PARAM params[])                           \
  180|      1|{                                                                              \
  181|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags,   \
  ------------------
  |  |  330|      1|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  182|      1|                                          kbits, blkbits, ivbits);             \
  183|      1|}                                                                              \

ossl_cipher_generic_get_params:
   50|  1.23k|{
   51|  1.23k|    OSSL_PARAM *p;
   52|       |
   53|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_MODE);
  ------------------
  |  |  195|  1.23k|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
   54|  1.23k|    if (p != NULL && !OSSL_PARAM_set_uint(p, md)) {
  ------------------
  |  Branch (54:9): [True: 130, False: 1.10k]
  |  Branch (54:22): [True: 0, False: 130]
  ------------------
   55|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD);
  ------------------
  |  |  169|  1.23k|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
   59|  1.23k|    if (p != NULL
  ------------------
  |  Branch (59:9): [True: 130, False: 1.10k]
  ------------------
   60|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
  ------------------
  |  |   39|    130|# define PROV_CIPHER_FLAG_AEAD             0x0001
  ------------------
  |  Branch (60:12): [True: 0, False: 130]
  ------------------
   61|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|      0|        return 0;
   63|      0|    }
   64|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CUSTOM_IV);
  ------------------
  |  |  186|  1.23k|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
   65|  1.23k|    if (p != NULL
  ------------------
  |  Branch (65:9): [True: 130, False: 1.10k]
  ------------------
   66|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
  ------------------
  |  |   40|    130|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  ------------------
  |  Branch (66:12): [True: 0, False: 130]
  ------------------
   67|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   68|      0|        return 0;
   69|      0|    }
   70|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS);
  ------------------
  |  |  184|  1.23k|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
   71|  1.23k|    if (p != NULL
  ------------------
  |  Branch (71:9): [True: 130, False: 1.10k]
  ------------------
   72|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
  ------------------
  |  |   41|    130|# define PROV_CIPHER_FLAG_CTS              0x0004
  ------------------
  |  Branch (72:12): [True: 0, False: 130]
  ------------------
   73|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   74|      0|        return 0;
   75|      0|    }
   76|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK);
  ------------------
  |  |  203|  1.23k|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
   77|  1.23k|    if (p != NULL
  ------------------
  |  Branch (77:9): [True: 130, False: 1.10k]
  ------------------
   78|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
  ------------------
  |  |   42|    130|# define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK  0x0008
  ------------------
  |  Branch (78:12): [True: 0, False: 130]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return 0;
   81|      0|    }
   82|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_HAS_RAND_KEY);
  ------------------
  |  |  191|  1.23k|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
   83|  1.23k|    if (p != NULL
  ------------------
  |  Branch (83:9): [True: 130, False: 1.10k]
  ------------------
   84|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
  ------------------
  |  |   43|    130|# define PROV_CIPHER_FLAG_RAND_KEY         0x0010
  ------------------
  |  Branch (84:12): [True: 0, False: 130]
  ------------------
   85|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|      0|        return 0;
   87|      0|    }
   88|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC);
  ------------------
  |  |  188|  1.23k|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
   89|  1.23k|    if (p != NULL
  ------------------
  |  Branch (89:9): [True: 130, False: 1.10k]
  ------------------
   90|  1.23k|        && !OSSL_PARAM_set_int(p, (flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0)) {
  ------------------
  |  |  379|    130|# define         EVP_CIPH_FLAG_ENC_THEN_MAC      0x10000000
  ------------------
  |  Branch (90:12): [True: 0, False: 130]
  ------------------
   91|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|        return 0;
   93|      0|    }
   94|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|  1.23k|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
   95|  1.23k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, kbits / 8)) {
  ------------------
  |  Branch (95:9): [True: 130, False: 1.10k]
  |  Branch (95:22): [True: 0, False: 130]
  ------------------
   96|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   97|      0|        return 0;
   98|      0|    }
   99|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_BLOCK_SIZE);
  ------------------
  |  |  183|  1.23k|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  100|  1.23k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blkbits / 8)) {
  ------------------
  |  Branch (100:9): [True: 130, False: 1.10k]
  |  Branch (100:22): [True: 0, False: 130]
  ------------------
  101|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        return 0;
  103|      0|    }
  104|  1.23k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|  1.23k|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  105|  1.23k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ivbits / 8)) {
  ------------------
  |  Branch (105:9): [True: 130, False: 1.10k]
  |  Branch (105:22): [True: 0, False: 130]
  ------------------
  106|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|        return 0;
  108|      0|    }
  109|  1.23k|    return 1;
  110|  1.23k|}
ossl_cipher_aead_get_ctx_params_find_pidx:
  174|     79|{
  175|     79|    switch(s[0]) {
  176|      0|    default:
  ------------------
  |  Branch (176:5): [True: 0, False: 79]
  ------------------
  177|      0|        break;
  178|      0|    case 'i':
  ------------------
  |  Branch (178:5): [True: 0, False: 79]
  ------------------
  179|      0|        switch(s[1]) {
  180|      0|        default:
  ------------------
  |  Branch (180:9): [True: 0, False: 0]
  ------------------
  181|      0|            break;
  182|      0|        case 'v':
  ------------------
  |  Branch (182:9): [True: 0, False: 0]
  ------------------
  183|      0|            switch(s[2]) {
  184|      0|            default:
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  ------------------
  185|      0|                break;
  186|      0|            case '-':
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|                if (strcmp("generated", s + 3) == 0)
  ------------------
  |  Branch (187:21): [True: 0, False: 0]
  ------------------
  188|      0|                    return PIDX_CIPHER_PARAM_AEAD_IV_GENERATED;
  ------------------
  |  |   67|      0|#define PIDX_CIPHER_PARAM_AEAD_IV_GENERATED 36
  ------------------
  189|      0|                break;
  190|      0|            case 'l':
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      0|                if (strcmp("en", s + 3) == 0)
  ------------------
  |  Branch (191:21): [True: 0, False: 0]
  ------------------
  192|      0|                    return PIDX_CIPHER_PARAM_IVLEN;
  ------------------
  |  |   89|      0|#define PIDX_CIPHER_PARAM_IVLEN 55
  ------------------
  193|      0|                break;
  194|      0|            case '\0':
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|                return PIDX_CIPHER_PARAM_IV;
  ------------------
  |  |   88|      0|#define PIDX_CIPHER_PARAM_IV 54
  ------------------
  196|      0|            }
  197|      0|        }
  198|      0|        break;
  199|     79|    case 'k':
  ------------------
  |  Branch (199:5): [True: 79, False: 0]
  ------------------
  200|     79|        if (strcmp("eylen", s + 1) == 0)
  ------------------
  |  Branch (200:13): [True: 79, False: 0]
  ------------------
  201|     79|            return PIDX_CIPHER_PARAM_KEYLEN;
  ------------------
  |  |   90|     79|#define PIDX_CIPHER_PARAM_KEYLEN 56
  ------------------
  202|      0|        break;
  203|      0|    case 't':
  ------------------
  |  Branch (203:5): [True: 0, False: 79]
  ------------------
  204|      0|        switch(s[1]) {
  205|      0|        default:
  ------------------
  |  Branch (205:9): [True: 0, False: 0]
  ------------------
  206|      0|            break;
  207|      0|        case 'a':
  ------------------
  |  Branch (207:9): [True: 0, False: 0]
  ------------------
  208|      0|            switch(s[2]) {
  209|      0|            default:
  ------------------
  |  Branch (209:13): [True: 0, False: 0]
  ------------------
  210|      0|                break;
  211|      0|            case 'g':
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|                switch(s[3]) {
  213|      0|                default:
  ------------------
  |  Branch (213:17): [True: 0, False: 0]
  ------------------
  214|      0|                    break;
  215|      0|                case 'l':
  ------------------
  |  Branch (215:17): [True: 0, False: 0]
  ------------------
  216|      0|                    if (strcmp("en", s + 4) == 0)
  ------------------
  |  Branch (216:25): [True: 0, False: 0]
  ------------------
  217|      0|                        return PIDX_CIPHER_PARAM_AEAD_TAGLEN;
  ------------------
  |  |   70|      0|#define PIDX_CIPHER_PARAM_AEAD_TAGLEN 39
  ------------------
  218|      0|                    break;
  219|      0|                case '\0':
  ------------------
  |  Branch (219:17): [True: 0, False: 0]
  ------------------
  220|      0|                    return PIDX_CIPHER_PARAM_AEAD_TAG;
  ------------------
  |  |   69|      0|#define PIDX_CIPHER_PARAM_AEAD_TAG 38
  ------------------
  221|      0|                }
  222|      0|            }
  223|      0|            break;
  224|      0|        case 'l':
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|      0|            switch(s[2]) {
  226|      0|            default:
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|                break;
  228|      0|            case 's':
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|                switch(s[3]) {
  230|      0|                default:
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                    break;
  232|      0|                case 'a':
  ------------------
  |  Branch (232:17): [True: 0, False: 0]
  ------------------
  233|      0|                    if (strcmp("adpad", s + 4) == 0)
  ------------------
  |  Branch (233:25): [True: 0, False: 0]
  ------------------
  234|      0|                        return PIDX_CIPHER_PARAM_AEAD_TLS1_AAD_PAD;
  ------------------
  |  |   72|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_AAD_PAD 41
  ------------------
  235|      0|                    break;
  236|      0|                case 'i':
  ------------------
  |  Branch (236:17): [True: 0, False: 0]
  ------------------
  237|      0|                    if (strcmp("vgen", s + 4) == 0)
  ------------------
  |  Branch (237:25): [True: 0, False: 0]
  ------------------
  238|      0|                        return PIDX_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN;
  ------------------
  |  |   73|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN 42
  ------------------
  239|      0|                }
  240|      0|            }
  241|      0|        }
  242|      0|        break;
  243|      0|    case 'u':
  ------------------
  |  Branch (243:5): [True: 0, False: 79]
  ------------------
  244|      0|        if (strcmp("pdated-iv", s + 1) == 0)
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            return PIDX_CIPHER_PARAM_UPDATED_IV;
  ------------------
  |  |  111|      0|#define PIDX_CIPHER_PARAM_UPDATED_IV 77
  ------------------
  246|     79|    }
  247|      0|    return -1;
  248|     79|}
ossl_cipher_aead_gettable_ctx_params:
  255|     14|{
  256|     14|    return cipher_aead_known_gettable_ctx_params;
  257|     14|}
ossl_cipher_generic_reset_ctx:
  332|     79|{
  333|     79|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (333:9): [True: 79, False: 0]
  |  Branch (333:24): [True: 0, False: 79]
  ------------------
  334|      0|        OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  335|      0|        ctx->alloced = 0;
  336|      0|        ctx->tlsmac = NULL;
  337|      0|    }
  338|     79|}
ossl_cipher_generic_einit:
  383|     79|{
  384|     79|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  385|     79|                                        iv, ivlen, params, 1);
  386|     79|}
ossl_cipher_generic_get_ctx_params:
  749|     79|{
  750|     79|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  751|     79|    OSSL_PARAM *p;
  752|       |
  753|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|     79|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  754|     79|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (754:9): [True: 0, False: 79]
  |  Branch (754:22): [True: 0, False: 0]
  ------------------
  755|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  756|      0|        return 0;
  757|      0|    }
  758|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|     79|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  759|     79|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (759:9): [True: 0, False: 79]
  |  Branch (759:22): [True: 0, False: 0]
  ------------------
  760|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  761|      0|        return 0;
  762|      0|    }
  763|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  192|     79|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  764|     79|    if (p != NULL
  ------------------
  |  Branch (764:9): [True: 0, False: 79]
  ------------------
  765|     79|        && !OSSL_PARAM_set_octet_string_or_ptr(p, ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (765:12): [True: 0, False: 0]
  ------------------
  766|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  767|      0|        return 0;
  768|      0|    }
  769|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  215|     79|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  770|     79|    if (p != NULL
  ------------------
  |  Branch (770:9): [True: 0, False: 79]
  ------------------
  771|     79|        && !OSSL_PARAM_set_octet_string_or_ptr(p, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (771:12): [True: 0, False: 0]
  ------------------
  772|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  773|      0|        return 0;
  774|      0|    }
  775|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|     79|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  776|     79|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 79]
  |  Branch (776:22): [True: 0, False: 0]
  ------------------
  777|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  778|      0|        return 0;
  779|      0|    }
  780|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|     79|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  781|     79|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (781:9): [True: 79, False: 0]
  |  Branch (781:22): [True: 0, False: 79]
  ------------------
  782|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  783|      0|        return 0;
  784|      0|    }
  785|     79|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  212|     79|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  786|     79|    if (p != NULL
  ------------------
  |  Branch (786:9): [True: 0, False: 79]
  ------------------
  787|     79|        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (787:12): [True: 0, False: 0]
  ------------------
  788|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  789|      0|        return 0;
  790|      0|    }
  791|     79|    return 1;
  792|     79|}
ossl_cipher_generic_set_ctx_params:
  795|     79|{
  796|     79|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  797|     79|    const OSSL_PARAM *p;
  798|       |
  799|     79|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (799:9): [True: 79, False: 0]
  ------------------
  800|     79|        return 1;
  801|       |
  802|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|      0|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  803|      0|    if (p != NULL) {
  ------------------
  |  Branch (803:9): [True: 0, False: 0]
  ------------------
  804|      0|        unsigned int pad;
  805|       |
  806|      0|        if (!OSSL_PARAM_get_uint(p, &pad)) {
  ------------------
  |  Branch (806:13): [True: 0, False: 0]
  ------------------
  807|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  808|      0|            return 0;
  809|      0|        }
  810|      0|        ctx->pad = pad ? 1 : 0;
  ------------------
  |  Branch (810:20): [True: 0, False: 0]
  ------------------
  811|      0|    }
  812|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
  ------------------
  |  |  216|      0|# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
  ------------------
  813|      0|    if (p != NULL) {
  ------------------
  |  Branch (813:9): [True: 0, False: 0]
  ------------------
  814|      0|        unsigned int bits;
  815|       |
  816|      0|        if (!OSSL_PARAM_get_uint(p, &bits)) {
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  818|      0|            return 0;
  819|      0|        }
  820|      0|        ctx->use_bits = bits ? 1 : 0;
  ------------------
  |  Branch (820:25): [True: 0, False: 0]
  ------------------
  821|      0|    }
  822|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
  ------------------
  |  |  214|      0|# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
  ------------------
  823|      0|    if (p != NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 0]
  ------------------
  824|      0|        if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {
  ------------------
  |  Branch (824:13): [True: 0, False: 0]
  ------------------
  825|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  826|      0|            return 0;
  827|      0|        }
  828|      0|    }
  829|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
  ------------------
  |  |  213|      0|# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
  ------------------
  830|      0|    if (p != NULL) {
  ------------------
  |  Branch (830:9): [True: 0, False: 0]
  ------------------
  831|      0|        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  833|      0|            return 0;
  834|      0|        }
  835|      0|    }
  836|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|      0|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  837|      0|    if (p != NULL) {
  ------------------
  |  Branch (837:9): [True: 0, False: 0]
  ------------------
  838|      0|        unsigned int num;
  839|       |
  840|      0|        if (!OSSL_PARAM_get_uint(p, &num)) {
  ------------------
  |  Branch (840:13): [True: 0, False: 0]
  ------------------
  841|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  842|      0|            return 0;
  843|      0|        }
  844|      0|        ctx->num = num;
  845|      0|    }
  846|      0|    return 1;
  847|      0|}
ossl_cipher_generic_initkey:
  867|     79|{
  868|     79|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  869|       |
  870|     79|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|     79|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (870:9): [True: 0, False: 79]
  ------------------
  871|      0|        ctx->inverse_cipher = 1;
  872|     79|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|     79|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (872:9): [True: 0, False: 79]
  ------------------
  873|      0|        ctx->variable_keylength = 1;
  874|       |
  875|     79|    ctx->pad = 1;
  876|     79|    ctx->keylen = ((kbits) / 8);
  877|     79|    ctx->ivlen = ((ivbits) / 8);
  878|     79|    ctx->hw = hw;
  879|     79|    ctx->mode = mode;
  880|     79|    ctx->blocksize = blkbits / 8;
  881|     79|    if (provctx != NULL)
  ------------------
  |  Branch (881:9): [True: 79, False: 0]
  ------------------
  882|     79|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|     79|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  883|     79|}
ciphercommon.c:cipher_generic_init_internal:
  344|     79|{
  345|     79|    ctx->num = 0;
  346|     79|    ctx->bufsz = 0;
  347|     79|    ctx->updated = 0;
  348|     79|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (348:16): [True: 79, False: 0]
  ------------------
  349|       |
  350|     79|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (350:9): [True: 0, False: 79]
  ------------------
  351|      0|        return 0;
  352|       |
  353|     79|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  322|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (353:9): [True: 0, False: 79]
  |  Branch (353:23): [True: 0, False: 0]
  ------------------
  354|      0|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (354:13): [True: 0, False: 0]
  ------------------
  355|      0|            return 0;
  356|      0|    }
  357|     79|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (357:9): [True: 79, False: 0]
  |  Branch (357:23): [True: 0, False: 79]
  ------------------
  358|     79|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  323|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (358:13): [True: 0, False: 0]
  ------------------
  359|      0|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  324|      0|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (359:16): [True: 0, False: 0]
  ------------------
  360|      0|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  325|      0|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (360:16): [True: 0, False: 0]
  ------------------
  361|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  362|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  363|       |
  364|     79|    if (key != NULL) {
  ------------------
  |  Branch (364:9): [True: 79, False: 0]
  ------------------
  365|     79|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (365:13): [True: 79, False: 0]
  ------------------
  366|     79|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (366:17): [True: 0, False: 79]
  ------------------
  367|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|                return 0;
  369|      0|            }
  370|     79|        } else {
  371|      0|            ctx->keylen = keylen;
  372|      0|        }
  373|     79|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (373:13): [True: 0, False: 79]
  ------------------
  374|      0|            return 0;
  375|     79|        ctx->key_set = 1;
  376|     79|    }
  377|     79|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  378|     79|}

ossl_gcm_initctx:
   35|     79|{
   36|     79|    ctx->pad = 1;
   37|     79|    ctx->mode = EVP_CIPH_GCM_MODE;
  ------------------
  |  |  327|     79|# define         EVP_CIPH_GCM_MODE               0x6
  ------------------
   38|     79|    ctx->taglen = UNINITIALISED_SIZET;
  ------------------
  |  |   14|     79|# define UNINITIALISED_SIZET ((size_t)-1)
  ------------------
   39|     79|    ctx->tls_aad_len = UNINITIALISED_SIZET;
  ------------------
  |  |   14|     79|# define UNINITIALISED_SIZET ((size_t)-1)
  ------------------
   40|     79|    ctx->ivlen = (EVP_GCM_TLS_FIXED_IV_LEN + EVP_GCM_TLS_EXPLICIT_IV_LEN);
  ------------------
  |  |  483|     79|# define EVP_GCM_TLS_FIXED_IV_LEN                        4
  ------------------
                  ctx->ivlen = (EVP_GCM_TLS_FIXED_IV_LEN + EVP_GCM_TLS_EXPLICIT_IV_LEN);
  ------------------
  |  |  485|     79|# define EVP_GCM_TLS_EXPLICIT_IV_LEN                     8
  ------------------
   41|     79|    ctx->keylen = keybits / 8;
   42|     79|    ctx->hw = hw;
   43|     79|    ctx->libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|     79|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   44|     79|}
ossl_gcm_einit:
   85|    158|{
   86|    158|    return gcm_init(vctx, key, keylen, iv, ivlen, params, 1);
   87|    158|}
ossl_gcm_get_ctx_params:
  145|     79|{
  146|     79|    PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
  147|     79|    OSSL_PARAM *p;
  148|     79|    size_t sz;
  149|       |
  150|    158|    for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (150:22): [True: 79, False: 79]
  ------------------
  151|     79|        switch (ossl_cipher_aead_get_ctx_params_find_pidx(p->key)) {
  152|      0|        default:
  ------------------
  |  Branch (152:9): [True: 0, False: 79]
  ------------------
  153|      0|            break;
  154|       |
  155|      0|        case PIDX_CIPHER_PARAM_IVLEN:
  ------------------
  |  |   89|      0|#define PIDX_CIPHER_PARAM_IVLEN 55
  ------------------
  |  Branch (155:9): [True: 0, False: 79]
  ------------------
  156|      0|            if (!OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (156:17): [True: 0, False: 0]
  ------------------
  157|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|                return 0;
  159|      0|            }
  160|      0|            break;
  161|       |
  162|     79|        case PIDX_CIPHER_PARAM_KEYLEN:
  ------------------
  |  |   90|     79|#define PIDX_CIPHER_PARAM_KEYLEN 56
  ------------------
  |  Branch (162:9): [True: 79, False: 0]
  ------------------
  163|     79|            if (!OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (163:17): [True: 0, False: 79]
  ------------------
  164|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|                return 0;
  166|      0|            }
  167|     79|            break;
  168|       |
  169|     79|        case PIDX_CIPHER_PARAM_AEAD_TAGLEN:
  ------------------
  |  |   70|      0|#define PIDX_CIPHER_PARAM_AEAD_TAGLEN 39
  ------------------
  |  Branch (169:9): [True: 0, False: 79]
  ------------------
  170|      0|            {
  171|      0|                size_t taglen = (ctx->taglen != UNINITIALISED_SIZET) ? ctx->taglen :
  ------------------
  |  |   14|      0|# define UNINITIALISED_SIZET ((size_t)-1)
  ------------------
  |  Branch (171:33): [True: 0, False: 0]
  ------------------
  172|      0|                                 GCM_TAG_MAX_SIZE;
  ------------------
  |  |   22|      0|# define GCM_TAG_MAX_SIZE    16
  ------------------
  173|       |
  174|      0|                if (!OSSL_PARAM_set_size_t(p, taglen)) {
  ------------------
  |  Branch (174:21): [True: 0, False: 0]
  ------------------
  175|      0|                    ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|                    return 0;
  177|      0|                }
  178|      0|            }
  179|      0|            break;
  180|       |
  181|      0|        case PIDX_CIPHER_PARAM_IV:
  ------------------
  |  |   88|      0|#define PIDX_CIPHER_PARAM_IV 54
  ------------------
  |  Branch (181:9): [True: 0, False: 79]
  ------------------
  182|      0|            if (ctx->iv_state == IV_STATE_UNINITIALISED)
  ------------------
  |  |   25|      0|# define IV_STATE_UNINITIALISED 0  /* initial state is not initialized */
  ------------------
  |  Branch (182:17): [True: 0, False: 0]
  ------------------
  183|      0|                return 0;
  184|      0|            if (ctx->ivlen > p->data_size) {
  ------------------
  |  Branch (184:17): [True: 0, False: 0]
  ------------------
  185|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|                return 0;
  187|      0|            }
  188|      0|            if (!OSSL_PARAM_set_octet_string_or_ptr(p, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (188:17): [True: 0, False: 0]
  ------------------
  189|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  190|      0|                return 0;
  191|      0|            }
  192|      0|            break;
  193|       |
  194|      0|        case PIDX_CIPHER_PARAM_UPDATED_IV:
  ------------------
  |  |  111|      0|#define PIDX_CIPHER_PARAM_UPDATED_IV 77
  ------------------
  |  Branch (194:9): [True: 0, False: 79]
  ------------------
  195|      0|            if (ctx->iv_state == IV_STATE_UNINITIALISED)
  ------------------
  |  |   25|      0|# define IV_STATE_UNINITIALISED 0  /* initial state is not initialized */
  ------------------
  |  Branch (195:17): [True: 0, False: 0]
  ------------------
  196|      0|                return 0;
  197|      0|            if (ctx->ivlen > p->data_size) {
  ------------------
  |  Branch (197:17): [True: 0, False: 0]
  ------------------
  198|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|                return 0;
  200|      0|            }
  201|      0|            if (!OSSL_PARAM_set_octet_string_or_ptr(p, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (201:17): [True: 0, False: 0]
  ------------------
  202|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  203|      0|                return 0;
  204|      0|            }
  205|      0|            break;
  206|       |
  207|      0|        case PIDX_CIPHER_PARAM_AEAD_TLS1_AAD_PAD:
  ------------------
  |  |   72|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_AAD_PAD 41
  ------------------
  |  Branch (207:9): [True: 0, False: 79]
  ------------------
  208|      0|            if (!OSSL_PARAM_set_size_t(p, ctx->tls_aad_pad_sz)) {
  ------------------
  |  Branch (208:17): [True: 0, False: 0]
  ------------------
  209|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|                return 0;
  211|      0|            }
  212|      0|            break;
  213|       |
  214|      0|        case PIDX_CIPHER_PARAM_AEAD_TAG:
  ------------------
  |  |   69|      0|#define PIDX_CIPHER_PARAM_AEAD_TAG 38
  ------------------
  |  Branch (214:9): [True: 0, False: 79]
  ------------------
  215|      0|            sz = p->data_size;
  216|      0|            if (sz == 0
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|      0|                || sz > EVP_GCM_TLS_TAG_LEN
  ------------------
  |  |  487|      0|# define EVP_GCM_TLS_TAG_LEN                             16
  ------------------
  |  Branch (217:20): [True: 0, False: 0]
  ------------------
  218|      0|                || !ctx->enc
  ------------------
  |  Branch (218:20): [True: 0, False: 0]
  ------------------
  219|      0|                || ctx->taglen == UNINITIALISED_SIZET) {
  ------------------
  |  |   14|      0|# define UNINITIALISED_SIZET ((size_t)-1)
  ------------------
  |  Branch (219:20): [True: 0, False: 0]
  ------------------
  220|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  221|      0|                return 0;
  222|      0|            }
  223|      0|            if (!OSSL_PARAM_set_octet_string(p, ctx->buf, sz)) {
  ------------------
  |  Branch (223:17): [True: 0, False: 0]
  ------------------
  224|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|                return 0;
  226|      0|            }
  227|      0|            break;
  228|       |
  229|      0|        case PIDX_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN:
  ------------------
  |  |   73|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN 42
  ------------------
  |  Branch (229:9): [True: 0, False: 79]
  ------------------
  230|      0|            if (p->data == NULL
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                || p->data_type != OSSL_PARAM_OCTET_STRING
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (231:20): [True: 0, False: 0]
  ------------------
  232|      0|                || !getivgen(ctx, p->data, p->data_size))
  ------------------
  |  Branch (232:20): [True: 0, False: 0]
  ------------------
  233|      0|                return 0;
  234|      0|            break;
  235|      0|        case PIDX_CIPHER_PARAM_AEAD_IV_GENERATED:
  ------------------
  |  |   67|      0|#define PIDX_CIPHER_PARAM_AEAD_IV_GENERATED 36
  ------------------
  |  Branch (235:9): [True: 0, False: 79]
  ------------------
  236|      0|            if (!OSSL_PARAM_set_uint(p, ctx->iv_gen_rand))
  ------------------
  |  Branch (236:17): [True: 0, False: 0]
  ------------------
  237|      0|                return 0;
  238|     79|        }
  239|     79|    return 1;
  240|     79|}
ossl_gcm_set_ctx_params:
  243|    158|{
  244|    158|    PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
  245|    158|    const OSSL_PARAM *p;
  246|    158|    size_t sz;
  247|    158|    void *vp;
  248|       |
  249|    158|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (249:9): [True: 158, False: 0]
  ------------------
  250|    158|        return 1;
  251|       |
  252|      0|    for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (252:22): [True: 0, False: 0]
  ------------------
  253|      0|        switch (ossl_cipher_aead_set_ctx_params_find_pidx(p->key)) {
  254|      0|        default:
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  ------------------
  255|      0|            break;
  256|       |
  257|      0|        case PIDX_CIPHER_PARAM_AEAD_TAG:
  ------------------
  |  |   69|      0|#define PIDX_CIPHER_PARAM_AEAD_TAG 38
  ------------------
  |  Branch (257:9): [True: 0, False: 0]
  ------------------
  258|      0|            vp = ctx->buf;
  259|      0|            if (!OSSL_PARAM_get_octet_string(p, &vp, EVP_GCM_TLS_TAG_LEN, &sz)) {
  ------------------
  |  |  487|      0|# define EVP_GCM_TLS_TAG_LEN                             16
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|                return 0;
  262|      0|            }
  263|      0|            if (sz == 0 || ctx->enc) {
  ------------------
  |  Branch (263:17): [True: 0, False: 0]
  |  Branch (263:28): [True: 0, False: 0]
  ------------------
  264|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_TAG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  265|      0|                return 0;
  266|      0|            }
  267|      0|            ctx->taglen = sz;
  268|      0|            break;
  269|       |
  270|      0|        case PIDX_CIPHER_PARAM_AEAD_IVLEN:
  ------------------
  |  |   66|      0|#define PIDX_CIPHER_PARAM_AEAD_IVLEN PIDX_CIPHER_PARAM_IVLEN
  |  |  ------------------
  |  |  |  |   89|      0|#define PIDX_CIPHER_PARAM_IVLEN 55
  |  |  ------------------
  ------------------
  |  Branch (270:9): [True: 0, False: 0]
  ------------------
  271|      0|            if (!OSSL_PARAM_get_size_t(p, &sz)) {
  ------------------
  |  Branch (271:17): [True: 0, False: 0]
  ------------------
  272|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|                return 0;
  274|      0|            }
  275|      0|            if (sz == 0 || sz > sizeof(ctx->iv)) {
  ------------------
  |  Branch (275:17): [True: 0, False: 0]
  |  Branch (275:28): [True: 0, False: 0]
  ------------------
  276|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  277|      0|                return 0;
  278|      0|            }
  279|      0|            if (ctx->ivlen != sz) {
  ------------------
  |  Branch (279:17): [True: 0, False: 0]
  ------------------
  280|       |                /* If the iv was already set or autogenerated, it is invalid. */
  281|      0|                if (ctx->iv_state != IV_STATE_UNINITIALISED)
  ------------------
  |  |   25|      0|# define IV_STATE_UNINITIALISED 0  /* initial state is not initialized */
  ------------------
  |  Branch (281:21): [True: 0, False: 0]
  ------------------
  282|      0|                    ctx->iv_state = IV_STATE_FINISHED;
  ------------------
  |  |   28|      0|# define IV_STATE_FINISHED      3  /* the iv has been used - so don't reuse it */
  ------------------
  283|      0|                ctx->ivlen = sz;
  284|      0|            }
  285|      0|            break;
  286|       |
  287|      0|        case PIDX_CIPHER_PARAM_AEAD_TLS1_AAD:
  ------------------
  |  |   71|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_AAD 40
  ------------------
  |  Branch (287:9): [True: 0, False: 0]
  ------------------
  288|      0|            if (p->data_type != OSSL_PARAM_OCTET_STRING) {
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (288:17): [True: 0, False: 0]
  ------------------
  289|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  290|      0|                return 0;
  291|      0|            }
  292|      0|            sz = gcm_tls_init(ctx, p->data, p->data_size);
  293|      0|            if (sz == 0) {
  ------------------
  |  Branch (293:17): [True: 0, False: 0]
  ------------------
  294|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_AAD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  295|      0|                return 0;
  296|      0|            }
  297|      0|            ctx->tls_aad_pad_sz = sz;
  298|      0|            break;
  299|       |
  300|      0|        case PIDX_CIPHER_PARAM_AEAD_TLS1_IV_FIXED:
  ------------------
  |  |   74|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_IV_FIXED 43
  ------------------
  |  Branch (300:9): [True: 0, False: 0]
  ------------------
  301|      0|            if (p->data_type != OSSL_PARAM_OCTET_STRING) {
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (301:17): [True: 0, False: 0]
  ------------------
  302|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|      0|                return 0;
  304|      0|            }
  305|      0|            if (gcm_tls_iv_set_fixed(ctx, p->data, p->data_size) == 0) {
  ------------------
  |  Branch (305:17): [True: 0, False: 0]
  ------------------
  306|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  307|      0|                return 0;
  308|      0|            }
  309|      0|            break;
  310|       |
  311|      0|        case PIDX_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV:
  ------------------
  |  |   75|      0|#define PIDX_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV 44
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  ------------------
  312|      0|            if (p->data == NULL
  ------------------
  |  Branch (312:17): [True: 0, False: 0]
  ------------------
  313|      0|                || p->data_type != OSSL_PARAM_OCTET_STRING
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (313:20): [True: 0, False: 0]
  ------------------
  314|      0|                || !setivinv(ctx, p->data, p->data_size))
  ------------------
  |  Branch (314:20): [True: 0, False: 0]
  ------------------
  315|      0|                return 0;
  316|      0|            break;
  317|      0|        }
  318|      0|    return 1;
  319|      0|}
ciphercommon_gcm.c:gcm_init:
   52|    158|{
   53|    158|    PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
   54|       |
   55|    158|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (55:9): [True: 0, False: 158]
  ------------------
   56|      0|        return 0;
   57|       |
   58|    158|    ctx->enc = enc;
   59|       |
   60|    158|    if (iv != NULL) {
  ------------------
  |  Branch (60:9): [True: 0, False: 158]
  ------------------
   61|      0|        if (ivlen == 0 || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  |  Branch (61:27): [True: 0, False: 0]
  ------------------
   62|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   63|      0|            return 0;
   64|      0|        }
   65|      0|        ctx->ivlen = ivlen;
   66|      0|        memcpy(ctx->iv, iv, ivlen);
   67|      0|        ctx->iv_state = IV_STATE_BUFFERED;
  ------------------
  |  |   26|      0|# define IV_STATE_BUFFERED      1  /* iv has been copied to the iv buffer */
  ------------------
   68|      0|    }
   69|       |
   70|    158|    if (key != NULL) {
  ------------------
  |  Branch (70:9): [True: 79, False: 79]
  ------------------
   71|     79|        if (keylen != ctx->keylen) {
  ------------------
  |  Branch (71:13): [True: 0, False: 79]
  ------------------
   72|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   73|      0|            return 0;
   74|      0|        }
   75|     79|        if (!ctx->hw->setkey(ctx, key, ctx->keylen))
  ------------------
  |  Branch (75:13): [True: 0, False: 79]
  ------------------
   76|      0|            return 0;
   77|     79|        ctx->tls_enc_records = 0;
   78|     79|    }
   79|    158|    return ossl_gcm_set_ctx_params(ctx, params);
   80|    158|}

blake2_prov.c:blake2s256_get_params:
  170|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  171|      1|{ \
  172|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  173|      1|} \
blake2_prov.c:blake2b512_get_params:
  170|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  171|      1|{ \
  172|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  173|      1|} \

ossl_digest_default_get_params:
   16|     27|{
   17|     27|    OSSL_PARAM *p = NULL;
   18|       |
   19|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);
  ------------------
  |  |  220|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
   20|     27|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blksz)) {
  ------------------
  |  Branch (20:9): [True: 27, False: 0]
  |  Branch (20:22): [True: 0, False: 27]
  ------------------
   21|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   22|      0|        return 0;
   23|      0|    }
   24|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
  ------------------
  |  |  223|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
   25|     27|    if (p != NULL && !OSSL_PARAM_set_size_t(p, paramsz)) {
  ------------------
  |  Branch (25:9): [True: 27, False: 0]
  |  Branch (25:22): [True: 0, False: 27]
  ------------------
   26|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   27|      0|        return 0;
   28|      0|    }
   29|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_XOF);
  ------------------
  |  |  225|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
   30|     27|    if (p != NULL
  ------------------
  |  Branch (30:9): [True: 27, False: 0]
  ------------------
   31|     27|        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
  ------------------
  |  |   19|     27|#define PROV_DIGEST_FLAG_XOF             0x0001
  ------------------
  |  Branch (31:12): [True: 0, False: 27]
  ------------------
   32|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   33|      0|        return 0;
   34|      0|    }
   35|     27|    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_ALGID_ABSENT);
  ------------------
  |  |  219|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
   36|     27|    if (p != NULL
  ------------------
  |  Branch (36:9): [True: 27, False: 0]
  ------------------
   37|     27|        && !OSSL_PARAM_set_int(p, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
  ------------------
  |  |   20|     27|#define PROV_DIGEST_FLAG_ALGID_ABSENT    0x0002
  ------------------
  |  Branch (37:12): [True: 0, False: 27]
  ------------------
   38|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   39|      0|        return 0;
   40|      0|    }
   41|     27|    return 1;
   42|     27|}

cipher_aes.c:aes_256_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_ecb_newctx:
  204|     79|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  205|     79|{                                                                              \
  206|     79|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (206:32): [True: 79, False: 0]
  ------------------
  207|     79|                                                     : NULL;                   \
  208|     79|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (208:10): [True: 79, False: 0]
  ------------------
  209|     79|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  210|     79|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  211|     79|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  212|     79|                                     provctx);                                 \
  213|     79|     }                                                                         \
  214|     79|     return ctx;                                                               \
  215|     79|}                                                                              \
cipher_aes.c:aes_128_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_256_cbc_get_params:
  198|     80|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|     80|{                                                                              \
  200|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|     80|                                          flags, kbits, blkbits, ivbits);      \
  202|     80|}                                                                              \
cipher_aes.c:aes_192_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_cbc_get_params:
  198|     80|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|     80|{                                                                              \
  200|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|     80|                                          flags, kbits, blkbits, ivbits);      \
  202|     80|}                                                                              \
cipher_aes.c:aes_256_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_256_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_256_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_256_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_256_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_192_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_128_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aes.c:aes_cbc_cts_gettable_ctx_params:
  347|      3|                                              ossl_unused void *provctx)       \
  348|      3|{                                                                              \
  349|      3|    return name##_known_gettable_ctx_params;                                   \
  350|      3|}
cipher_aria.c:aria_256_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_256_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_192_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_aria.c:aria_128_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_cbc_get_params:
  198|     80|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|     80|{                                                                              \
  200|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|     80|                                          flags, kbits, blkbits, ivbits);      \
  202|     80|}                                                                              \
cipher_camellia.c:camellia_192_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_cbc_get_params:
  198|     80|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|     80|{                                                                              \
  200|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|     80|                                          flags, kbits, blkbits, ivbits);      \
  202|     80|}                                                                              \
cipher_camellia.c:camellia_256_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_ofb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb1_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb8_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_256_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_192_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_128_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_camellia.c:camellia_cbc_cts_gettable_ctx_params:
  347|      3|                                              ossl_unused void *provctx)       \
  348|      3|{                                                                              \
  349|      3|    return name##_known_gettable_ctx_params;                                   \
  350|      3|}
cipher_sm4.c:sm4_128_ecb_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_sm4.c:sm4_128_cbc_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_sm4.c:sm4_128_ctr_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_sm4.c:sm4_128_ofb128_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
cipher_sm4.c:sm4_128_cfb128_get_params:
  198|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  199|      1|{                                                                              \
  200|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  201|      1|                                          flags, kbits, blkbits, ivbits);      \
  202|      1|}                                                                              \
ossl_tdes_gettable_ctx_params:
  347|     11|                                              ossl_unused void *provctx)       \
  348|     11|{                                                                              \
  349|     11|    return name##_known_gettable_ctx_params;                                   \
  350|     11|}
ossl_cipher_generic_gettable_ctx_params:
  347|     83|                                              ossl_unused void *provctx)       \
  348|     83|{                                                                              \
  349|     83|    return name##_known_gettable_ctx_params;                                   \
  350|     83|}

cipher_aes_ccm.c:aes_128_ccm_get_params:
   20|    159|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|    159|{                                                                              \
   22|    159|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|    159|                                          flags, kbits, blkbits, ivbits);      \
   24|    159|}                                                                              \
cipher_aes_ccm.c:aes_192_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_ccm.c:aes_256_ccm_get_params:
   20|    159|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|    159|{                                                                              \
   22|    159|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|    159|                                          flags, kbits, blkbits, ivbits);      \
   24|    159|}                                                                              \
cipher_aes_gcm.c:aes_128_gcm_get_params:
   20|     80|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|     80|{                                                                              \
   22|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|     80|                                          flags, kbits, blkbits, ivbits);      \
   24|     80|}                                                                              \
cipher_aes_gcm.c:aes_192_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_gcm.c:aes256gcm_newctx:
   26|     79|static void * alg##kbits##lc##_newctx(void *provctx)                           \
   27|     79|{                                                                              \
   28|     79|    return alg##_##lc##_newctx(provctx, kbits);                                \
   29|     79|}                                                                              \
cipher_aes_gcm.c:aes_256_gcm_get_params:
   20|     80|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|     80|{                                                                              \
   22|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|     80|                                          flags, kbits, blkbits, ivbits);      \
   24|     80|}                                                                              \
cipher_aria_ccm.c:aria_128_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_ccm.c:aria_192_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_ccm.c:aria_256_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_gcm.c:aria_128_gcm_get_params:
   20|     80|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|     80|{                                                                              \
   22|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|     80|                                          flags, kbits, blkbits, ivbits);      \
   24|     80|}                                                                              \
cipher_aria_gcm.c:aria_192_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_gcm.c:aria_256_gcm_get_params:
   20|     80|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|     80|{                                                                              \
   22|     80|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|     80|                                          flags, kbits, blkbits, ivbits);      \
   24|     80|}                                                                              \
cipher_sm4_ccm.c:sm4_128_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_sm4_gcm.c:sm4_128_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \

md5_prov.c:md5_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
md5_sha1_prov.c:md5_sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
null_prov.c:nullmd_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
ripemd_prov.c:ripemd160_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_192_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

ossl_prov_drbg_nonce_ctx_new:
  272|      4|{
  273|      4|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|       |
  275|      4|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 4]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      4|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|      4|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 4]
  ------------------
  280|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|      4|    return dngbl;
  285|      4|}
ossl_prov_drbg_nonce_ctx_free:
  288|      2|{
  289|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  290|       |
  291|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 2]
  ------------------
  292|      0|        return;
  293|       |
  294|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  295|       |
  296|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|      2|}

seed_src.c:seed_src_new:
   47|      1|{
   48|      1|    PROV_SEED_SRC *s;
   49|       |
   50|      1|    if (parent != NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 1]
  ------------------
   51|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|      0|        return NULL;
   53|      0|    }
   54|       |
   55|      1|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      1|    if (s == NULL)
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        return NULL;
   58|       |
   59|      1|    s->provctx = provctx;
   60|      1|    s->state = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      1|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   61|      1|    return s;
   62|      1|}
seed_src.c:seed_src_free:
   65|      1|{
   66|      1|    OPENSSL_free(vseed);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      1|}
seed_src.c:seed_src_instantiate:
   73|      1|{
   74|      1|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
   75|       |
   76|      1|    s->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      1|# define EVP_RAND_STATE_READY            1
  ------------------
   77|      1|    return 1;
   78|      1|}
seed_src.c:seed_src_lock:
  221|      1|{
  222|      1|    return 1;
  223|      1|}
seed_src.c:seed_src_unlock:
  226|      1|{
  227|      1|}

ossl_rand_pool_init:
  570|      1|{
  571|      1|    size_t i;
  572|       |
  573|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (573:17): [True: 4, False: 1]
  ------------------
  574|      4|        random_devices[i].fd = -1;
  575|       |
  576|      1|    return 1;
  577|      1|}
ossl_rand_pool_cleanup:
  580|      1|{
  581|      1|    size_t i;
  582|       |
  583|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (583:17): [True: 4, False: 1]
  ------------------
  584|      4|        close_random_device(i);
  585|      1|}
rand_unix.c:close_random_device:
  561|      4|{
  562|      4|    struct random_device *rd = &random_devices[n];
  563|       |
  564|      4|    if (check_random_device(rd))
  ------------------
  |  Branch (564:9): [True: 0, False: 4]
  ------------------
  565|      0|        close(rd->fd);
  566|      4|    rd->fd = -1;
  567|      4|}
rand_unix.c:check_random_device:
  516|      4|{
  517|      4|    struct stat st;
  518|       |
  519|      4|    return rd->fd != -1
  ------------------
  |  Branch (519:12): [True: 0, False: 4]
  ------------------
  520|      4|           && fstat(rd->fd, &st) != -1
  ------------------
  |  Branch (520:15): [True: 0, False: 0]
  ------------------
  521|      4|           && rd->dev == st.st_dev
  ------------------
  |  Branch (521:15): [True: 0, False: 0]
  ------------------
  522|      4|           && rd->ino == st.st_ino
  ------------------
  |  Branch (522:15): [True: 0, False: 0]
  ------------------
  523|      4|           && ((rd->mode ^ st.st_mode) & ~(S_IRWXU | S_IRWXG | S_IRWXO)) == 0
  ------------------
  |  Branch (523:15): [True: 0, False: 0]
  ------------------
  524|      4|           && rd->rdev == st.st_rdev;
  ------------------
  |  Branch (524:15): [True: 0, False: 0]
  ------------------
  525|      4|}

ossl_prov_is_running:
   20|    395|{
   21|    395|    return 1;
   22|    395|}

ossl_quic_demux_new:
   75|     79|{
   76|     79|    QUIC_DEMUX *demux;
   77|       |
   78|     79|    demux = OPENSSL_zalloc(sizeof(QUIC_DEMUX));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|     79|    if (demux == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 79]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|     79|    demux->net_bio                  = net_bio;
   83|     79|    demux->short_conn_id_len        = short_conn_id_len;
   84|       |    /* We update this if possible when we get a BIO. */
   85|     79|    demux->mtu                      = DEMUX_DEFAULT_MTU;
  ------------------
  |  |   22|     79|#define DEMUX_DEFAULT_MTU        1500
  ------------------
   86|     79|    demux->now                      = now;
   87|     79|    demux->now_arg                  = now_arg;
   88|       |
   89|     79|    if (net_bio != NULL
  ------------------
  |  Branch (89:9): [True: 0, False: 79]
  ------------------
   90|     79|        && BIO_dgram_get_local_addr_cap(net_bio)
  ------------------
  |  |  678|     79|         (int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP, 0, NULL)
  |  |  ------------------
  |  |  |  |  179|      0|# define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP      82
  |  |  ------------------
  |  |  |  Branch (678:10): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   91|     79|        && BIO_dgram_set_local_addr_enable(net_bio, 1))
  ------------------
  |  |  682|      0|         (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE, (enable), NULL)
  |  |  ------------------
  |  |  |  |  181|      0|# define BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE   84
  |  |  ------------------
  |  |  |  Branch (682:10): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   92|      0|        demux->use_local_addr = 1;
   93|       |
   94|     79|    return demux;
   95|     79|}
ossl_quic_demux_free:
  109|     79|{
  110|     79|    if (demux == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 79]
  ------------------
  111|      0|        return;
  112|       |
  113|       |    /* Free all URXEs we are holding. */
  114|     79|    demux_free_urxl(&demux->urx_free);
  115|     79|    demux_free_urxl(&demux->urx_pending);
  116|       |
  117|     79|    OPENSSL_free(demux);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|     79|}
ossl_quic_demux_set_bio:
  121|     79|{
  122|     79|    unsigned int mtu;
  123|       |
  124|     79|    demux->net_bio = net_bio;
  125|       |
  126|     79|    if (net_bio != NULL) {
  ------------------
  |  Branch (126:9): [True: 79, False: 0]
  ------------------
  127|       |        /*
  128|       |         * Try to determine our MTU if possible. The BIO is not required to
  129|       |         * support this, in which case we remain at the last known MTU, or our
  130|       |         * initial default.
  131|       |         */
  132|     79|        mtu = BIO_dgram_get_mtu(net_bio);
  ------------------
  |  |  694|     79|         (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU, 0, NULL)
  |  |  ------------------
  |  |  |  |  125|     79|# define BIO_CTRL_DGRAM_GET_MTU            41/* get cached value for MTU */
  |  |  ------------------
  ------------------
  133|     79|        if (mtu >= QUIC_MIN_INITIAL_DGRAM_LEN)
  ------------------
  |  |   97|     79|#  define QUIC_MIN_INITIAL_DGRAM_LEN  1200
  ------------------
  |  Branch (133:13): [True: 79, False: 0]
  ------------------
  134|     79|            ossl_quic_demux_set_mtu(demux, mtu); /* best effort */
  135|     79|    }
  136|     79|}
ossl_quic_demux_set_mtu:
  139|     79|{
  140|     79|    if (mtu < QUIC_MIN_INITIAL_DGRAM_LEN)
  ------------------
  |  |   97|     79|#  define QUIC_MIN_INITIAL_DGRAM_LEN  1200
  ------------------
  |  Branch (140:9): [True: 0, False: 79]
  ------------------
  141|      0|        return 0;
  142|       |
  143|     79|    demux->mtu = mtu;
  144|     79|    return 1;
  145|     79|}
ossl_quic_demux_set_default_handler:
  150|     79|{
  151|     79|    demux->default_cb       = cb;
  152|     79|    demux->default_cb_arg   = cb_arg;
  153|     79|}
ossl_quic_demux_pump:
  381|    158|{
  382|    158|    int ret;
  383|       |
  384|    158|    if (ossl_list_urxe_head(&demux->urx_pending) == NULL) {
  ------------------
  |  Branch (384:9): [True: 158, False: 0]
  ------------------
  385|    158|        ret = demux_ensure_free_urxe(demux, DEMUX_MAX_MSGS_PER_CALL);
  ------------------
  |  |   20|    158|#define DEMUX_MAX_MSGS_PER_CALL    32
  ------------------
  386|    158|        if (ret != 1)
  ------------------
  |  Branch (386:13): [True: 0, False: 158]
  ------------------
  387|      0|            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
  ------------------
  |  |  278|      0|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  388|       |
  389|    158|        ret = demux_recv(demux);
  390|    158|        if (ret != QUIC_DEMUX_PUMP_RES_OK)
  ------------------
  |  |  276|    158|#define QUIC_DEMUX_PUMP_RES_OK              1
  ------------------
  |  Branch (390:13): [True: 158, False: 0]
  ------------------
  391|    158|            return ret;
  392|       |
  393|       |        /*
  394|       |         * If demux_recv returned successfully, we should always have something.
  395|       |         */
  396|      0|        assert(ossl_list_urxe_head(&demux->urx_pending) != NULL);
  397|      0|    }
  398|       |
  399|      0|    if ((ret = demux_process_pending_urxl(demux)) <= 0)
  ------------------
  |  Branch (399:9): [True: 0, False: 0]
  ------------------
  400|      0|        return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
  ------------------
  |  |  278|      0|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  401|       |
  402|      0|    return QUIC_DEMUX_PUMP_RES_OK;
  ------------------
  |  |  276|      0|#define QUIC_DEMUX_PUMP_RES_OK              1
  ------------------
  403|      0|}
quic_demux.c:demux_free_urxl:
   98|    158|{
   99|    158|    QUIC_URXE *e, *enext;
  100|       |
  101|  2.68k|    for (e = ossl_list_urxe_head(l); e != NULL; e = enext) {
  ------------------
  |  Branch (101:38): [True: 2.52k, False: 158]
  ------------------
  102|  2.52k|        enext = ossl_list_urxe_next(e);
  103|  2.52k|        ossl_list_urxe_remove(l, e);
  104|  2.52k|        OPENSSL_free(e);
  ------------------
  |  |  115|  2.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  105|  2.52k|    }
  106|    158|}
quic_demux.c:demux_ensure_free_urxe:
  211|    158|{
  212|    158|    QUIC_URXE *e;
  213|       |
  214|  2.68k|    while (ossl_list_urxe_num(&demux->urx_free) < min_num_free) {
  ------------------
  |  Branch (214:12): [True: 2.52k, False: 158]
  ------------------
  215|  2.52k|        e = demux_alloc_urxe(demux->mtu);
  216|  2.52k|        if (e == NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 2.52k]
  ------------------
  217|      0|            return 0;
  218|       |
  219|  2.52k|        ossl_list_urxe_insert_tail(&demux->urx_free, e);
  220|  2.52k|        e->demux_state = URXE_DEMUX_STATE_FREE;
  ------------------
  |  |   16|  2.52k|#define URXE_DEMUX_STATE_FREE       0 /* on urx_free list */
  ------------------
  221|  2.52k|    }
  222|       |
  223|    158|    return 1;
  224|    158|}
quic_demux.c:demux_alloc_urxe:
  156|  2.52k|{
  157|  2.52k|    QUIC_URXE *e;
  158|       |
  159|  2.52k|    if (alloc_len >= SIZE_MAX - sizeof(QUIC_URXE))
  ------------------
  |  Branch (159:9): [True: 0, False: 2.52k]
  ------------------
  160|      0|        return NULL;
  161|       |
  162|  2.52k|    e = OPENSSL_malloc(sizeof(QUIC_URXE) + alloc_len);
  ------------------
  |  |  102|  2.52k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|  2.52k|    if (e == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 2.52k]
  ------------------
  164|      0|        return NULL;
  165|       |
  166|  2.52k|    ossl_list_urxe_init_elem(e);
  167|  2.52k|    e->alloc_len   = alloc_len;
  168|  2.52k|    e->data_len    = 0;
  169|  2.52k|    return e;
  170|  2.52k|}
quic_demux.c:demux_recv:
  235|    158|{
  236|    158|    BIO_MSG msg[DEMUX_MAX_MSGS_PER_CALL];
  237|    158|    size_t rd, i;
  238|    158|    QUIC_URXE *urxe = ossl_list_urxe_head(&demux->urx_free), *unext;
  239|    158|    OSSL_TIME now;
  240|       |
  241|       |    /* This should never be called when we have any pending URXE. */
  242|    158|    assert(ossl_list_urxe_head(&demux->urx_pending) == NULL);
  243|    158|    assert(urxe->demux_state == URXE_DEMUX_STATE_FREE);
  244|       |
  245|    158|    if (demux->net_bio == NULL)
  ------------------
  |  Branch (245:9): [True: 0, False: 158]
  ------------------
  246|       |        /*
  247|       |         * If no BIO is plugged in, treat this as no datagram being available.
  248|       |         */
  249|      0|        return QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL;
  ------------------
  |  |  277|      0|#define QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL  (-1)
  ------------------
  250|       |
  251|       |    /*
  252|       |     * Opportunistically receive as many messages as possible in a single
  253|       |     * syscall, determined by how many free URXEs are available.
  254|       |     */
  255|  5.21k|    for (i = 0; i < (ossl_ssize_t)OSSL_NELEM(msg);
  ------------------
  |  |   14|  5.21k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (255:17): [True: 5.05k, False: 158]
  ------------------
  256|  5.05k|            ++i, urxe = ossl_list_urxe_next(urxe)) {
  257|  5.05k|        if (urxe == NULL) {
  ------------------
  |  Branch (257:13): [True: 0, False: 5.05k]
  ------------------
  258|       |            /* We need at least one URXE to receive into. */
  259|      0|            if (!ossl_assert(i > 0))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|      0|                return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
  ------------------
  |  |  278|      0|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  261|       |
  262|      0|            break;
  263|      0|        }
  264|       |
  265|       |        /* Ensure the URXE is big enough. */
  266|  5.05k|        urxe = demux_reserve_urxe(demux, urxe, demux->mtu);
  267|  5.05k|        if (urxe == NULL)
  ------------------
  |  Branch (267:13): [True: 0, False: 5.05k]
  ------------------
  268|       |            /* Allocation error, fail. */
  269|      0|            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
  ------------------
  |  |  278|      0|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  270|       |
  271|       |        /* Ensure we zero any fields added to BIO_MSG at a later date. */
  272|  5.05k|        memset(&msg[i], 0, sizeof(BIO_MSG));
  273|  5.05k|        msg[i].data     = ossl_quic_urxe_data(urxe);
  274|  5.05k|        msg[i].data_len = urxe->alloc_len;
  275|  5.05k|        msg[i].peer     = &urxe->peer;
  276|  5.05k|        BIO_ADDR_clear(&urxe->peer);
  277|  5.05k|        if (demux->use_local_addr)
  ------------------
  |  Branch (277:13): [True: 0, False: 5.05k]
  ------------------
  278|      0|            msg[i].local = &urxe->local;
  279|  5.05k|        else
  280|  5.05k|            BIO_ADDR_clear(&urxe->local);
  281|  5.05k|    }
  282|       |
  283|    158|    ERR_set_mark();
  284|    158|    if (!BIO_recvmmsg(demux->net_bio, msg, sizeof(BIO_MSG), i, 0, &rd)) {
  ------------------
  |  Branch (284:9): [True: 158, False: 0]
  ------------------
  285|    158|        if (BIO_err_is_non_fatal(ERR_peek_last_error())) {
  ------------------
  |  Branch (285:13): [True: 158, False: 0]
  ------------------
  286|       |            /* Transient error, clear the error and stop. */
  287|    158|            ERR_pop_to_mark();
  288|    158|            return QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL;
  ------------------
  |  |  277|    158|#define QUIC_DEMUX_PUMP_RES_TRANSIENT_FAIL  (-1)
  ------------------
  289|    158|        } else {
  290|       |            /* Non-transient error, do not clear the error. */
  291|      0|            ERR_clear_last_mark();
  292|      0|            return QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL;
  ------------------
  |  |  278|      0|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  293|      0|        }
  294|    158|    }
  295|       |
  296|      0|    ERR_clear_last_mark();
  297|      0|    now = demux->now != NULL ? demux->now(demux->now_arg) : ossl_time_zero();
  ------------------
  |  Branch (297:11): [True: 0, False: 0]
  ------------------
  298|       |
  299|      0|    urxe = ossl_list_urxe_head(&demux->urx_free);
  300|      0|    for (i = 0; i < rd; ++i, urxe = unext) {
  ------------------
  |  Branch (300:17): [True: 0, False: 0]
  ------------------
  301|      0|        unext = ossl_list_urxe_next(urxe);
  302|       |        /* Set URXE with actual length of received datagram. */
  303|      0|        urxe->data_len      = msg[i].data_len;
  304|       |        /* Time we received datagram. */
  305|      0|        urxe->time          = now;
  306|      0|        urxe->datagram_id   = demux->next_datagram_id++;
  307|       |        /* Move from free list to pending list. */
  308|      0|        ossl_list_urxe_remove(&demux->urx_free, urxe);
  309|      0|        ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);
  310|      0|        urxe->demux_state = URXE_DEMUX_STATE_PENDING;
  ------------------
  |  |   17|      0|#define URXE_DEMUX_STATE_PENDING    1 /* on urx_pending list */
  ------------------
  311|      0|    }
  312|       |
  313|      0|    return QUIC_DEMUX_PUMP_RES_OK;
  ------------------
  |  |  276|      0|#define QUIC_DEMUX_PUMP_RES_OK              1
  ------------------
  314|    158|}
quic_demux.c:demux_reserve_urxe:
  206|  5.05k|{
  207|  5.05k|    return e->alloc_len < alloc_len ? demux_resize_urxe(demux, e, alloc_len) : e;
  ------------------
  |  Branch (207:12): [True: 0, False: 5.05k]
  ------------------
  208|  5.05k|}

ossl_quic_engine_new:
   27|     79|{
   28|     79|    QUIC_ENGINE *qeng;
   29|       |
   30|     79|    if ((qeng = OPENSSL_zalloc(sizeof(QUIC_ENGINE))) == NULL)
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (30:9): [True: 0, False: 79]
  ------------------
   31|      0|        return NULL;
   32|       |
   33|     79|    qeng->libctx            = args->libctx;
   34|     79|    qeng->propq             = args->propq;
   35|     79|    qeng->mutex             = args->mutex;
   36|       |
   37|     79|    if (!qeng_init(qeng, args->reactor_flags)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 79]
  ------------------
   38|      0|        OPENSSL_free(qeng);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        return NULL;
   40|      0|    }
   41|       |
   42|     79|    return qeng;
   43|     79|}
ossl_quic_engine_free:
   46|     79|{
   47|     79|    if (qeng == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 79]
  ------------------
   48|      0|        return;
   49|       |
   50|     79|    qeng_cleanup(qeng);
   51|     79|    OPENSSL_free(qeng);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|     79|}
ossl_quic_engine_get0_reactor:
   68|    237|{
   69|    237|    return &qeng->rtor;
   70|    237|}
ossl_quic_engine_get0_mutex:
   73|    316|{
   74|    316|    return qeng->mutex;
   75|    316|}
ossl_quic_engine_set_time_cb:
  105|     79|{
  106|     79|    qeng->now_cb = now_cb;
  107|     79|    qeng->now_cb_arg = now_cb_arg;
  108|     79|}
ossl_quic_engine_update_poll_descriptors:
  126|     79|{
  127|     79|    QUIC_PORT *port;
  128|       |
  129|       |    /*
  130|       |     * TODO(QUIC MULTIPORT): The implementation of
  131|       |     * ossl_quic_port_update_poll_descriptors assumes an engine only ever has a
  132|       |     * single port for now due to reactor limitations. This limitation will be
  133|       |     * removed in future.
  134|       |     *
  135|       |     * TODO(QUIC MULTIPORT): Consider only iterating the port list when dirty at
  136|       |     * the engine level in future when we can have multiple ports. This is not
  137|       |     * important currently as the port list has a single entry.
  138|       |     */
  139|     79|    OSSL_LIST_FOREACH(port, port, &qeng->port_list)
  ------------------
  |  |   28|     79|    OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
  |  |  ------------------
  |  |  |  |   24|     79|    for ((p) = (init);                                                      \
  |  |  |  |   25|    158|         (p) != NULL;                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (25:10): [True: 79, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   26|     79|         (p) = ossl_list_##name##_next(p))
  |  |  ------------------
  ------------------
  140|     79|        ossl_quic_port_update_poll_descriptors(port, force);
  141|     79|}
ossl_quic_engine_create_port:
  150|     79|{
  151|     79|    QUIC_PORT_ARGS largs = *args;
  152|       |
  153|     79|    if (ossl_list_port_num(&qeng->port_list) > 0)
  ------------------
  |  Branch (153:9): [True: 0, False: 79]
  ------------------
  154|       |        /* TODO(QUIC MULTIPORT): We currently support only one port. */
  155|      0|        return NULL;
  156|       |
  157|     79|    if (largs.engine != NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 79]
  ------------------
  158|      0|        return NULL;
  159|       |
  160|     79|    largs.engine = qeng;
  161|     79|    return ossl_quic_port_new(&largs);
  162|     79|}
quic_engine.c:qeng_init:
   55|     79|{
   56|     79|    return ossl_quic_reactor_init(&qeng->rtor, qeng_tick, qeng,
   57|     79|                                  qeng->mutex,
   58|     79|                                  ossl_time_zero(), reactor_flags);
   59|     79|}
quic_engine.c:qeng_tick:
  175|    158|{
  176|    158|    QUIC_ENGINE *qeng = arg;
  177|    158|    QUIC_PORT *port;
  178|       |
  179|    158|    res->net_read_desired     = 0;
  180|    158|    res->net_write_desired    = 0;
  181|    158|    res->notify_other_threads = 0;
  182|    158|    res->tick_deadline        = ossl_time_infinite();
  183|       |
  184|    158|    if (qeng->inhibit_tick)
  ------------------
  |  Branch (184:9): [True: 0, False: 158]
  ------------------
  185|      0|        return;
  186|       |
  187|       |    /* Iterate through all ports and service them. */
  188|    158|    OSSL_LIST_FOREACH(port, port, &qeng->port_list) {
  ------------------
  |  |   28|    158|    OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
  |  |  ------------------
  |  |  |  |   24|    158|    for ((p) = (init);                                                      \
  |  |  |  |   25|    316|         (p) != NULL;                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (25:10): [True: 158, False: 158]
  |  |  |  |  ------------------
  |  |  |  |   26|    158|         (p) = ossl_list_##name##_next(p))
  |  |  ------------------
  ------------------
  189|    158|        QUIC_TICK_RESULT subr = {0};
  190|       |
  191|    158|        ossl_quic_port_subtick(port, &subr, flags);
  192|    158|        ossl_quic_tick_result_merge_into(res, &subr);
  193|    158|    }
  194|    158|}
quic_engine.c:qeng_cleanup:
   62|     79|{
   63|     79|    assert(ossl_list_port_num(&qeng->port_list) == 0);
   64|     79|    ossl_quic_reactor_cleanup(&qeng->rtor);
   65|     79|}

ossl_quic_free:
  749|     79|{
  750|     79|    QCTX ctx;
  751|     79|    int is_default;
  752|       |
  753|       |    /* We should never be called on anything but a QSO. */
  754|     79|    if (!expect_quic_any(s, &ctx))
  ------------------
  |  |  423|     79|#define expect_quic_any expect_quic_csld
  ------------------
  |  Branch (754:9): [True: 0, False: 79]
  ------------------
  755|      0|        return;
  756|       |
  757|     79|    if (ctx.is_domain) {
  ------------------
  |  Branch (757:9): [True: 0, False: 79]
  ------------------
  758|      0|        quic_free_domain(&ctx);
  759|      0|        return;
  760|      0|    }
  761|       |
  762|     79|    if (ctx.is_listener) {
  ------------------
  |  Branch (762:9): [True: 79, False: 0]
  ------------------
  763|     79|        quic_free_listener(&ctx);
  764|     79|        return;
  765|     79|    }
  766|       |
  767|      0|    qctx_lock(&ctx);
  768|       |
  769|      0|    if (ctx.is_stream) {
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|       |        /*
  771|       |         * When a QSSO is freed, the XSO is freed immediately, because the XSO
  772|       |         * itself only contains API personality layer data. However the
  773|       |         * underlying QUIC_STREAM is not freed immediately but is instead marked
  774|       |         * as deleted for later collection.
  775|       |         */
  776|       |
  777|      0|        assert(ctx.qc->num_xso > 0);
  778|      0|        --ctx.qc->num_xso;
  779|       |
  780|       |        /* If a stream's send part has not been finished, auto-reset it. */
  781|      0|        if ((   ctx.xso->stream->send_state == QUIC_SSTREAM_STATE_READY
  ------------------
  |  |   52|      0|#define QUIC_SSTREAM_STATE_READY        1   /* \                    */
  ------------------
  |  Branch (781:17): [True: 0, False: 0]
  ------------------
  782|      0|             || ctx.xso->stream->send_state == QUIC_SSTREAM_STATE_SEND)
  ------------------
  |  |   53|      0|#define QUIC_SSTREAM_STATE_SEND         2   /* |-- sstream != NULL  */
  ------------------
  |  Branch (782:17): [True: 0, False: 0]
  ------------------
  783|      0|            && !ossl_quic_sstream_get_final_size(ctx.xso->stream->sstream, NULL))
  ------------------
  |  Branch (783:16): [True: 0, False: 0]
  ------------------
  784|      0|            ossl_quic_stream_map_reset_stream_send_part(ossl_quic_channel_get_qsm(ctx.qc->ch),
  785|      0|                                                        ctx.xso->stream, 0);
  786|       |
  787|       |        /* Do STOP_SENDING for the receive part, if applicable. */
  788|      0|        if (   ctx.xso->stream->recv_state == QUIC_RSTREAM_STATE_RECV
  ------------------
  |  |   73|      0|#define QUIC_RSTREAM_STATE_RECV         1   /* \                    */
  ------------------
  |  Branch (788:16): [True: 0, False: 0]
  ------------------
  789|      0|            || ctx.xso->stream->recv_state == QUIC_RSTREAM_STATE_SIZE_KNOWN)
  ------------------
  |  |   74|      0|#define QUIC_RSTREAM_STATE_SIZE_KNOWN   2   /* |-- rstream != NULL  */
  ------------------
  |  Branch (789:16): [True: 0, False: 0]
  ------------------
  790|      0|            ossl_quic_stream_map_stop_sending_recv_part(ossl_quic_channel_get_qsm(ctx.qc->ch),
  791|      0|                                                        ctx.xso->stream, 0);
  792|       |
  793|       |        /* Update stream state. */
  794|      0|        ctx.xso->stream->deleted = 1;
  795|      0|        ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(ctx.qc->ch),
  796|      0|                                          ctx.xso->stream);
  797|       |
  798|      0|        is_default = (ctx.xso == ctx.qc->default_xso);
  799|      0|        qctx_unlock(&ctx);
  800|       |
  801|       |        /*
  802|       |         * Unref the connection in most cases; the XSO has a ref to the QC and
  803|       |         * not vice versa. But for a default XSO, to avoid circular references,
  804|       |         * the QC refs the XSO but the XSO does not ref the QC. If we are the
  805|       |         * default XSO, we only get here when the QC is being torn down anyway,
  806|       |         * so don't call SSL_free(qc) as we are already in it.
  807|       |         */
  808|      0|        if (!is_default)
  ------------------
  |  Branch (808:13): [True: 0, False: 0]
  ------------------
  809|      0|            SSL_free(&ctx.qc->obj.ssl);
  810|       |
  811|       |        /* Note: SSL_free calls OPENSSL_free(xso) for us */
  812|      0|        return;
  813|      0|    }
  814|       |
  815|       |    /*
  816|       |     * Free the default XSO, if any. The QUIC_STREAM is not deleted at this
  817|       |     * stage, but is freed during the channel free when the whole QSM is freed.
  818|       |     */
  819|      0|    if (ctx.qc->default_xso != NULL) {
  ------------------
  |  Branch (819:9): [True: 0, False: 0]
  ------------------
  820|      0|        QUIC_XSO *xso = ctx.qc->default_xso;
  821|       |
  822|      0|        qctx_unlock(&ctx);
  823|      0|        SSL_free(&xso->obj.ssl);
  824|      0|        qctx_lock(&ctx);
  825|      0|        ctx.qc->default_xso = NULL;
  826|      0|    }
  827|       |
  828|       |    /* Ensure we have no remaining XSOs. */
  829|      0|    assert(ctx.qc->num_xso == 0);
  830|       |
  831|      0|#if !defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
  832|      0|    if (ctx.qc->is_thread_assisted && ctx.qc->started) {
  ------------------
  |  Branch (832:9): [True: 0, False: 0]
  |  Branch (832:39): [True: 0, False: 0]
  ------------------
  833|      0|        ossl_quic_thread_assist_wait_stopped(&ctx.qc->thread_assist);
  834|      0|        ossl_quic_thread_assist_cleanup(&ctx.qc->thread_assist);
  835|      0|    }
  836|      0|#endif
  837|       |
  838|       |    /*
  839|       |     * Note: SSL_free (that called this function) calls OPENSSL_free(ctx.qc) for
  840|       |     * us
  841|       |     */
  842|      0|    qc_cleanup(ctx.qc, /*have_lock=*/1);
  843|       |    /* Note: SSL_free calls OPENSSL_free(qc) for us */
  844|       |
  845|      0|    if (ctx.qc->listener != NULL)
  ------------------
  |  Branch (845:9): [True: 0, False: 0]
  ------------------
  846|      0|        SSL_free(&ctx.qc->listener->obj.ssl);
  847|      0|    if (ctx.qc->domain != NULL)
  ------------------
  |  Branch (847:9): [True: 0, False: 0]
  ------------------
  848|      0|        SSL_free(&ctx.qc->domain->obj.ssl);
  849|      0|}
ossl_quic_set_override_now_cb:
  891|     79|{
  892|     79|    QCTX ctx;
  893|       |
  894|     79|    if (!expect_quic_any(s, &ctx))
  ------------------
  |  |  423|     79|#define expect_quic_any expect_quic_csld
  ------------------
  |  Branch (894:9): [True: 0, False: 79]
  ------------------
  895|      0|        return 0;
  896|       |
  897|     79|    qctx_lock(&ctx);
  898|       |
  899|     79|    ossl_quic_engine_set_time_cb(ctx.obj->engine, now_cb, now_cb_arg);
  900|       |
  901|     79|    qctx_unlock(&ctx);
  902|     79|    return 1;
  903|     79|}
ossl_quic_conn_set0_net_rbio:
 1183|     79|{
 1184|     79|    QCTX ctx;
 1185|       |
 1186|     79|    if (!expect_quic_csl(s, &ctx))
  ------------------
  |  Branch (1186:9): [True: 0, False: 79]
  ------------------
 1187|      0|        return;
 1188|       |
 1189|       |    /* Returns 0 if no change. */
 1190|     79|    if (!quic_set0_net_rbio(ctx.obj, net_rbio))
  ------------------
  |  Branch (1190:9): [True: 0, False: 79]
  ------------------
 1191|      0|        return;
 1192|     79|}
ossl_quic_conn_set0_net_wbio:
 1195|     79|{
 1196|     79|    QCTX ctx;
 1197|       |
 1198|     79|    if (!expect_quic_csl(s, &ctx))
  ------------------
  |  Branch (1198:9): [True: 0, False: 79]
  ------------------
 1199|      0|        return;
 1200|       |
 1201|       |    /* Returns 0 if no change. */
 1202|     79|    if (!quic_set0_net_wbio(ctx.obj, net_wbio))
  ------------------
  |  Branch (1202:9): [True: 0, False: 79]
  ------------------
 1203|      0|        return;
 1204|     79|}
ossl_quic_conn_get_net_rbio:
 1207|    158|{
 1208|    158|    QCTX ctx;
 1209|    158|    QUIC_PORT *port;
 1210|       |
 1211|    158|    if (!expect_quic_csl(s, &ctx))
  ------------------
  |  Branch (1211:9): [True: 0, False: 158]
  ------------------
 1212|      0|        return NULL;
 1213|       |
 1214|    158|    port = ossl_quic_obj_get0_port(ctx.obj);
 1215|    158|    assert(port != NULL);
 1216|    158|    return ossl_quic_port_get_net_rbio(port);
 1217|    158|}
ossl_quic_conn_get_net_wbio:
 1220|     79|{
 1221|     79|    QCTX ctx;
 1222|     79|    QUIC_PORT *port;
 1223|       |
 1224|     79|    if (!expect_quic_csl(s, &ctx))
  ------------------
  |  Branch (1224:9): [True: 0, False: 79]
  ------------------
 1225|      0|        return NULL;
 1226|       |
 1227|     79|    port = ossl_quic_obj_get0_port(ctx.obj);
 1228|     79|    assert(port != NULL);
 1229|     79|    return ossl_quic_port_get_net_wbio(port);
 1230|     79|}
ossl_quic_set_accept_state:
 1725|     79|{
 1726|     79|    QCTX ctx;
 1727|       |
 1728|     79|    if (!is_quic_c(s, &ctx, raiseerrs))
  ------------------
  |  Branch (1728:9): [True: 79, False: 0]
  ------------------
 1729|     79|        return 0;
 1730|       |
 1731|      0|    if (ctx.qc->as_server_state == 1)
  ------------------
  |  Branch (1731:9): [True: 0, False: 0]
  ------------------
 1732|      0|        return 1;
 1733|       |
 1734|       |    /* Cannot be changed after handshake started */
 1735|      0|    if (ctx.qc->started) {
  ------------------
  |  Branch (1735:9): [True: 0, False: 0]
  ------------------
 1736|      0|        if (raiseerrs)
  ------------------
  |  Branch (1736:13): [True: 0, False: 0]
  ------------------
 1737|      0|            QUIC_RAISE_NON_NORMAL_ERROR(NULL, SSL_R_INVALID_COMMAND, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
 1738|      0|        return 0;
 1739|      0|    }
 1740|       |
 1741|      0|    ctx.qc->as_server_state = 1;
 1742|      0|    return 1;
 1743|      0|}
ossl_quic_get_error:
 2367|     79|{
 2368|     79|    QCTX ctx;
 2369|     79|    int net_error, last_error;
 2370|       |
 2371|       |    /* SSL_get_errors() should not raise new errors */
 2372|     79|    if (!is_quic_cs(s, &ctx, 0 /* suppress errors */))
  ------------------
  |  Branch (2372:9): [True: 79, False: 0]
  ------------------
 2373|     79|        return SSL_ERROR_SSL;
  ------------------
  |  | 1252|     79|# define SSL_ERROR_SSL                   1
  ------------------
 2374|       |
 2375|      0|    qctx_lock(&ctx);
 2376|      0|    net_error = ossl_quic_channel_net_error(ctx.qc->ch);
 2377|      0|    last_error = ctx.is_stream ? ctx.xso->last_error : ctx.qc->last_error;
  ------------------
  |  Branch (2377:18): [True: 0, False: 0]
  ------------------
 2378|      0|    qctx_unlock(&ctx);
 2379|       |
 2380|      0|    if (net_error)
  ------------------
  |  Branch (2380:9): [True: 0, False: 0]
  ------------------
 2381|      0|        return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1256|      0|# define SSL_ERROR_SYSCALL               5/* look at error stack/return
  ------------------
 2382|       |
 2383|      0|    return last_error;
 2384|      0|}
ossl_quic_new_listener:
 4284|     79|{
 4285|     79|    QUIC_LISTENER *ql = NULL;
 4286|     79|    QUIC_ENGINE_ARGS engine_args = {0};
 4287|     79|    QUIC_PORT_ARGS port_args = {0};
 4288|       |
 4289|     79|    if ((ql = OPENSSL_zalloc(sizeof(*ql))) == NULL) {
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4289:9): [True: 0, False: 79]
  ------------------
 4290|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_CRYPTO_LIB, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
 4291|      0|        goto err;
 4292|      0|    }
 4293|       |
 4294|     79|#if defined(OPENSSL_THREADS)
 4295|     79|    if ((ql->mutex = ossl_crypto_mutex_new()) == NULL) {
  ------------------
  |  Branch (4295:9): [True: 0, False: 79]
  ------------------
 4296|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_CRYPTO_LIB, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
 4297|      0|        goto err;
 4298|      0|    }
 4299|     79|#endif
 4300|       |
 4301|     79|    engine_args.libctx  = ctx->libctx;
 4302|     79|    engine_args.propq   = ctx->propq;
 4303|     79|#if defined(OPENSSL_THREADS)
 4304|     79|    engine_args.mutex   = ql->mutex;
 4305|     79|#endif
 4306|       |
 4307|     79|    if (need_notifier_for_domain_flags(ctx->domain_flags))
  ------------------
  |  Branch (4307:9): [True: 0, False: 79]
  ------------------
 4308|      0|        engine_args.reactor_flags |= QUIC_REACTOR_FLAG_USE_NOTIFIER;
  ------------------
  |  |  145|      0|#define QUIC_REACTOR_FLAG_USE_NOTIFIER      (1U << 0)
  ------------------
 4309|       |
 4310|     79|    if ((ql->engine = ossl_quic_engine_new(&engine_args)) == NULL) {
  ------------------
  |  Branch (4310:9): [True: 0, False: 79]
  ------------------
 4311|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
 4312|      0|        goto err;
 4313|      0|    }
 4314|       |
 4315|     79|    port_args.channel_ctx       = ctx;
 4316|     79|    port_args.is_multi_conn     = 1;
 4317|     79|    port_args.get_conn_user_ssl = alloc_port_user_ssl;
 4318|     79|    port_args.user_ssl_arg = ql;
 4319|     79|    if ((flags & SSL_LISTENER_FLAG_NO_VALIDATE) == 0)
  ------------------
  |  | 2359|     79|#define SSL_LISTENER_FLAG_NO_VALIDATE   (1UL << 1)
  ------------------
  |  Branch (4319:9): [True: 79, False: 0]
  ------------------
 4320|     79|        port_args.do_addr_validation = 1;
 4321|     79|    ql->port = ossl_quic_engine_create_port(ql->engine, &port_args);
 4322|     79|    if (ql->port == NULL) {
  ------------------
  |  Branch (4322:9): [True: 0, False: 79]
  ------------------
 4323|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
 4324|      0|        goto err;
 4325|      0|    }
 4326|       |
 4327|       |    /* TODO(QUIC FUTURE): Implement SSL_LISTENER_FLAG_NO_ACCEPT */
 4328|       |
 4329|     79|    ossl_quic_port_set_allow_incoming(ql->port, 1);
 4330|       |
 4331|       |    /* Initialise the QUIC_LISTENER's object header. */
 4332|     79|    if (!ossl_quic_obj_init(&ql->obj, ctx, SSL_TYPE_QUIC_LISTENER, NULL,
  ------------------
  |  | 1228|     79|#define SSL_TYPE_QUIC_LISTENER      0x82
  ------------------
  |  Branch (4332:9): [True: 0, False: 79]
  ------------------
 4333|     79|                            ql->engine, ql->port))
 4334|      0|        goto err;
 4335|       |
 4336|     79|    return &ql->obj.ssl;
 4337|       |
 4338|      0|err:
 4339|      0|    if (ql != NULL)
  ------------------
  |  Branch (4339:9): [True: 0, False: 0]
  ------------------
 4340|      0|        ossl_quic_engine_free(ql->engine);
 4341|       |
 4342|      0|#if defined(OPENSSL_THREADS)
 4343|      0|    ossl_crypto_mutex_free(&ql->mutex);
 4344|      0|#endif
 4345|      0|    OPENSSL_free(ql);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4346|      0|    return NULL;
 4347|     79|}
ossl_quic_accept_connection:
 4595|     79|{
 4596|     79|    int ret;
 4597|     79|    QCTX ctx;
 4598|     79|    SSL *conn_ssl = NULL;
 4599|     79|    SSL_CONNECTION *conn = NULL;
 4600|     79|    QUIC_CHANNEL *new_ch = NULL;
 4601|     79|    QUIC_CONNECTION *qc;
 4602|     79|    int no_block = ((flags & SSL_ACCEPT_CONNECTION_NO_BLOCK) != 0);
  ------------------
  |  | 2363|     79|#define SSL_ACCEPT_CONNECTION_NO_BLOCK  (1UL << 0)
  ------------------
 4603|       |
 4604|     79|    if (!expect_quic_listener(ssl, &ctx))
  ------------------
  |  Branch (4604:9): [True: 0, False: 79]
  ------------------
 4605|      0|        return NULL;
 4606|       |
 4607|     79|    qctx_lock_for_io(&ctx);
 4608|       |
 4609|     79|    if (!ql_listen(ctx.ql))
  ------------------
  |  Branch (4609:9): [True: 0, False: 79]
  ------------------
 4610|      0|        goto out;
 4611|       |
 4612|       |    /* Wait for an incoming connection if needed. */
 4613|     79|    new_ch = ossl_quic_port_pop_incoming(ctx.ql->port);
 4614|     79|    if (new_ch == NULL && ossl_quic_port_is_running(ctx.ql->port)) {
  ------------------
  |  Branch (4614:9): [True: 79, False: 0]
  |  Branch (4614:27): [True: 79, False: 0]
  ------------------
 4615|     79|        if (!no_block && qctx_blocking(&ctx)) {
  ------------------
  |  Branch (4615:13): [True: 79, False: 0]
  |  Branch (4615:26): [True: 0, False: 79]
  ------------------
 4616|      0|            ret = block_until_pred(&ctx, quic_accept_connection_wait,
 4617|      0|                                   ctx.ql->port, 0);
 4618|      0|            if (ret < 1)
  ------------------
  |  Branch (4618:17): [True: 0, False: 0]
  ------------------
 4619|      0|                goto out;
 4620|     79|        } else {
 4621|     79|            qctx_maybe_autotick(&ctx);
 4622|     79|        }
 4623|       |
 4624|     79|        if (!ossl_quic_port_is_running(ctx.ql->port))
  ------------------
  |  Branch (4624:13): [True: 0, False: 79]
  ------------------
 4625|      0|            goto out;
 4626|       |
 4627|     79|        new_ch = ossl_quic_port_pop_incoming(ctx.ql->port);
 4628|     79|    }
 4629|       |
 4630|     79|    if (new_ch == NULL && ossl_quic_port_is_running(ctx.ql->port)) {
  ------------------
  |  Branch (4630:9): [True: 79, False: 0]
  |  Branch (4630:27): [True: 79, False: 0]
  ------------------
 4631|       |        /* No connections already queued. */
 4632|     79|        ossl_quic_reactor_tick(ossl_quic_engine_get0_reactor(ctx.ql->engine), 0);
 4633|       |
 4634|     79|        new_ch = ossl_quic_port_pop_incoming(ctx.ql->port);
 4635|     79|    }
 4636|       |
 4637|       |    /*
 4638|       |     * port_make_channel pre-allocates our user_ssl for us for each newly
 4639|       |     * created channel, so once we pop the new channel from the port above
 4640|       |     * we just need to extract it
 4641|       |     */
 4642|     79|    if (new_ch == NULL
  ------------------
  |  Branch (4642:9): [True: 79, False: 0]
  ------------------
 4643|     79|        || (conn_ssl = ossl_quic_channel_get0_tls(new_ch)) == NULL
  ------------------
  |  Branch (4643:12): [True: 0, False: 0]
  ------------------
 4644|     79|        || (conn = SSL_CONNECTION_FROM_SSL(conn_ssl)) == NULL
  ------------------
  |  |   39|      0|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|      0|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   33|      0|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|      0|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|      0|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|      0|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|      0|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|      0|          : NULL)))
  |  |  ------------------
  ------------------
  |  Branch (4644:12): [True: 0, False: 0]
  ------------------
 4645|     79|        || (conn_ssl = SSL_CONNECTION_GET_USER_SSL(conn)) == NULL)
  ------------------
  |  |   28|      0|# define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  |  Branch (4645:12): [True: 0, False: 0]
  ------------------
 4646|     79|        goto out;
 4647|      0|    qc = (QUIC_CONNECTION *)conn_ssl;
 4648|      0|    qc->listener = ctx.ql;
 4649|      0|    qc->pending = 0;
 4650|      0|    if (!SSL_up_ref(&ctx.ql->obj.ssl)) {
  ------------------
  |  Branch (4650:9): [True: 0, False: 0]
  ------------------
 4651|      0|        SSL_free(conn_ssl);
 4652|      0|        SSL_free(ossl_quic_channel_get0_tls(new_ch));
 4653|      0|        conn_ssl = NULL;
 4654|      0|    }
 4655|       |
 4656|     79|out:
 4657|     79|    qctx_unlock(&ctx);
 4658|     79|    return conn_ssl;
 4659|      0|}
ossl_quic_free_token_store:
 4756|     79|{
 4757|     79|    int refs;
 4758|       |
 4759|     79|    if (hdl == NULL)
  ------------------
  |  Branch (4759:9): [True: 79, False: 0]
  ------------------
 4760|     79|        return;
 4761|       |
 4762|      0|    if (!CRYPTO_DOWN_REF(&hdl->references, &refs))
  ------------------
  |  Branch (4762:9): [True: 0, False: 0]
  ------------------
 4763|      0|        return;
 4764|       |
 4765|      0|    if (refs > 0)
  ------------------
  |  Branch (4765:9): [True: 0, False: 0]
  ------------------
 4766|      0|        return;
 4767|       |
 4768|       |    /* last reference, we can clean up */
 4769|      0|    ossl_crypto_mutex_free(&hdl->mutex);
 4770|      0|    lh_QUIC_TOKEN_doall(hdl->cache, free_this_token);
 4771|      0|    lh_QUIC_TOKEN_free(hdl->cache);
 4772|      0|    OPENSSL_free(hdl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4773|      0|    return;
 4774|      0|}
ossl_quic_ctx_ctrl:
 5022|     79|{
 5023|     79|    switch (cmd) {
 5024|     79|    default:
  ------------------
  |  Branch (5024:5): [True: 79, False: 0]
  ------------------
 5025|     79|        return ssl3_ctx_ctrl(ctx, cmd, larg, parg);
 5026|     79|    }
 5027|     79|}
ossl_quic_num_ciphers:
 5076|     79|{
 5077|     79|    return 0;
 5078|     79|}
quic_impl.c:quic_set_last_error:
   80|     79|{
   81|     79|    if (!ctx->in_io)
  ------------------
  |  Branch (81:9): [True: 0, False: 79]
  ------------------
   82|      0|        return;
   83|       |
   84|     79|    if (ctx->is_stream && ctx->xso != NULL)
  ------------------
  |  Branch (84:9): [True: 0, False: 79]
  |  Branch (84:27): [True: 0, False: 0]
  ------------------
   85|      0|        ctx->xso->last_error = last_error;
   86|     79|    else if (!ctx->is_stream && ctx->qc != NULL)
  ------------------
  |  Branch (86:14): [True: 79, False: 0]
  |  Branch (86:33): [True: 0, False: 79]
  ------------------
   87|      0|        ctx->qc->last_error = last_error;
   88|     79|}
quic_impl.c:quic_unref_port_bios:
  681|     79|{
  682|     79|    BIO *b;
  683|       |
  684|     79|    b = ossl_quic_port_get_net_rbio(port);
  685|     79|    BIO_free_all(b);
  686|       |
  687|     79|    b = ossl_quic_port_get_net_wbio(port);
  688|     79|    BIO_free_all(b);
  689|     79|}
quic_impl.c:expect_quic_csld:
  419|    158|{
  420|    158|    return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L | QCTX_D);
  ------------------
  |  |  194|    158|#define QCTX_C              (1U << 0)
  ------------------
                  return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L | QCTX_D);
  ------------------
  |  |  195|    158|#define QCTX_S              (1U << 1)
  ------------------
                  return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L | QCTX_D);
  ------------------
  |  |  196|    158|#define QCTX_L              (1U << 2)
  ------------------
                  return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L | QCTX_D);
  ------------------
  |  |  201|    158|#define QCTX_D              (1U << 7)
  ------------------
  421|    158|}
quic_impl.c:expect_quic_as:
  256|    790|{
  257|    790|    int ok = 0, locked = 0, lock_requested = ((flags & QCTX_LOCK) != 0);
  ------------------
  |  |  199|    790|#define QCTX_LOCK           (1U << 5)
  ------------------
  258|    790|    QUIC_DOMAIN *qd;
  259|    790|    QUIC_LISTENER *ql;
  260|    790|    QUIC_CONNECTION *qc;
  261|    790|    QUIC_XSO *xso;
  262|       |
  263|    790|    if ((flags & QCTX_AUTO_S) != 0)
  ------------------
  |  |  197|    790|#define QCTX_AUTO_S         (1U << 3)
  ------------------
  |  Branch (263:9): [True: 0, False: 790]
  ------------------
  264|      0|        flags |= QCTX_S;
  ------------------
  |  |  195|      0|#define QCTX_S              (1U << 1)
  ------------------
  265|       |
  266|    790|    ctx->obj            = NULL;
  267|    790|    ctx->qd             = NULL;
  268|    790|    ctx->ql             = NULL;
  269|    790|    ctx->qc             = NULL;
  270|    790|    ctx->xso            = NULL;
  271|    790|    ctx->is_stream      = 0;
  272|    790|    ctx->is_listener    = 0;
  273|    790|    ctx->is_domain      = 0;
  274|    790|    ctx->in_io          = ((flags & QCTX_IO) != 0);
  ------------------
  |  |  200|    790|#define QCTX_IO             (1U << 6)
  ------------------
  275|       |
  276|    790|    if (s == NULL) {
  ------------------
  |  Branch (276:9): [True: 0, False: 790]
  ------------------
  277|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_PASSED_NULL_PARAMETER, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
  278|      0|        goto err;
  279|      0|    }
  280|       |
  281|    790|    switch (s->type) {
  282|      0|    case SSL_TYPE_QUIC_DOMAIN:
  ------------------
  |  | 1229|      0|#define SSL_TYPE_QUIC_DOMAIN        0x83
  ------------------
  |  Branch (282:5): [True: 0, False: 790]
  ------------------
  283|      0|        if ((flags & QCTX_D) == 0) {
  ------------------
  |  |  201|      0|#define QCTX_D              (1U << 7)
  ------------------
  |  Branch (283:13): [True: 0, False: 0]
  ------------------
  284|      0|            wrong_type(s, flags);
  285|      0|            goto err;
  286|      0|        }
  287|       |
  288|      0|        qd                  = (QUIC_DOMAIN *)s;
  289|      0|        ctx->obj            = &qd->obj;
  290|      0|        ctx->qd             = qd;
  291|      0|        ctx->is_domain      = 1;
  292|      0|        break;
  293|       |
  294|    790|    case SSL_TYPE_QUIC_LISTENER:
  ------------------
  |  | 1228|    790|#define SSL_TYPE_QUIC_LISTENER      0x82
  ------------------
  |  Branch (294:5): [True: 790, False: 0]
  ------------------
  295|    790|        if ((flags & QCTX_L) == 0) {
  ------------------
  |  |  196|    790|#define QCTX_L              (1U << 2)
  ------------------
  |  Branch (295:13): [True: 158, False: 632]
  ------------------
  296|    158|            wrong_type(s, flags);
  297|    158|            goto err;
  298|    158|        }
  299|       |
  300|    632|        ql                  = (QUIC_LISTENER *)s;
  301|    632|        ctx->obj            = &ql->obj;
  302|    632|        ctx->qd             = ql->domain;
  303|    632|        ctx->ql             = ql;
  304|    632|        ctx->is_listener    = 1;
  305|    632|        break;
  306|       |
  307|      0|    case SSL_TYPE_QUIC_CONNECTION:
  ------------------
  |  | 1226|      0|#define SSL_TYPE_QUIC_CONNECTION    0x80
  ------------------
  |  Branch (307:5): [True: 0, False: 790]
  ------------------
  308|      0|        qc                  = (QUIC_CONNECTION *)s;
  309|      0|        ctx->obj            = &qc->obj;
  310|      0|        ctx->qd             = qc->domain;
  311|      0|        ctx->ql             = qc->listener; /* never changes, so can be read without lock */
  312|      0|        ctx->qc             = qc;
  313|       |
  314|      0|        if ((flags & QCTX_AUTO_S) != 0) {
  ------------------
  |  |  197|      0|#define QCTX_AUTO_S         (1U << 3)
  ------------------
  |  Branch (314:13): [True: 0, False: 0]
  ------------------
  315|      0|            if ((flags & QCTX_IO) != 0)
  ------------------
  |  |  200|      0|#define QCTX_IO             (1U << 6)
  ------------------
  |  Branch (315:17): [True: 0, False: 0]
  ------------------
  316|      0|                qctx_lock_for_io(ctx);
  317|      0|            else
  318|      0|                qctx_lock(ctx);
  319|       |
  320|      0|            locked = 1;
  321|      0|        }
  322|       |
  323|      0|        if ((flags & QCTX_AUTO_S) != 0 && qc->default_xso == NULL) {
  ------------------
  |  |  197|      0|#define QCTX_AUTO_S         (1U << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 0]
  |  Branch (323:43): [True: 0, False: 0]
  ------------------
  324|      0|            if (!quic_mutation_allowed(qc, /*req_active=*/0)) {
  ------------------
  |  Branch (324:17): [True: 0, False: 0]
  ------------------
  325|      0|                QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_PROTOCOL_IS_SHUTDOWN, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
  326|      0|                goto err;
  327|      0|            }
  328|       |
  329|       |            /* If we haven't finished the handshake, try to advance it. */
  330|      0|            if (quic_do_handshake(ctx) < 1)
  ------------------
  |  Branch (330:17): [True: 0, False: 0]
  ------------------
  331|       |                /* ossl_quic_do_handshake raised error here */
  332|      0|                goto err;
  333|       |
  334|      0|            if ((flags & QCTX_REMOTE_INIT) != 0) {
  ------------------
  |  |  198|      0|#define QCTX_REMOTE_INIT    (1U << 4)
  ------------------
  |  Branch (334:17): [True: 0, False: 0]
  ------------------
  335|      0|                if (!qc_wait_for_default_xso_for_read(ctx, /*peek=*/0))
  ------------------
  |  Branch (335:21): [True: 0, False: 0]
  ------------------
  336|      0|                    goto err;
  337|      0|            } else {
  338|      0|                if (!qc_try_create_default_xso_for_write(ctx))
  ------------------
  |  Branch (338:21): [True: 0, False: 0]
  ------------------
  339|      0|                    goto err;
  340|      0|            }
  341|      0|        }
  342|       |
  343|      0|        if ((flags & QCTX_C) == 0
  ------------------
  |  |  194|      0|#define QCTX_C              (1U << 0)
  ------------------
  |  Branch (343:13): [True: 0, False: 0]
  ------------------
  344|      0|            && (qc->default_xso == NULL || (flags & QCTX_S) == 0)) {
  ------------------
  |  |  195|      0|#define QCTX_S              (1U << 1)
  ------------------
  |  Branch (344:17): [True: 0, False: 0]
  |  Branch (344:44): [True: 0, False: 0]
  ------------------
  345|      0|            wrong_type(s, flags);
  346|      0|            goto err;
  347|      0|        }
  348|       |
  349|      0|        ctx->xso            = qc->default_xso;
  350|      0|        break;
  351|       |
  352|      0|    case SSL_TYPE_QUIC_XSO:
  ------------------
  |  | 1227|      0|#define SSL_TYPE_QUIC_XSO           0x81
  ------------------
  |  Branch (352:5): [True: 0, False: 790]
  ------------------
  353|      0|        if ((flags & QCTX_S) == 0) {
  ------------------
  |  |  195|      0|#define QCTX_S              (1U << 1)
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            wrong_type(s, flags);
  355|      0|            goto err;
  356|      0|        }
  357|       |
  358|      0|        xso                 = (QUIC_XSO *)s;
  359|      0|        ctx->obj            = &xso->obj;
  360|      0|        ctx->qd             = xso->conn->domain;
  361|      0|        ctx->ql             = xso->conn->listener;
  362|      0|        ctx->qc             = xso->conn;
  363|      0|        ctx->xso            = xso;
  364|      0|        ctx->is_stream      = 1;
  365|      0|        break;
  366|       |
  367|      0|    default:
  ------------------
  |  Branch (367:5): [True: 0, False: 790]
  ------------------
  368|      0|        QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
  369|      0|        goto err;
  370|    790|    }
  371|       |
  372|    632|    if (lock_requested && !locked) {
  ------------------
  |  Branch (372:9): [True: 0, False: 632]
  |  Branch (372:27): [True: 0, False: 0]
  ------------------
  373|      0|        if ((flags & QCTX_IO) != 0)
  ------------------
  |  |  200|      0|#define QCTX_IO             (1U << 6)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  ------------------
  374|      0|            qctx_lock_for_io(ctx);
  375|      0|        else
  376|      0|            qctx_lock(ctx);
  377|       |
  378|      0|        locked = 1;
  379|      0|    }
  380|       |
  381|    632|    ok = 1;
  382|    790|err:
  383|    790|    if (locked && (!ok || !lock_requested))
  ------------------
  |  Branch (383:9): [True: 0, False: 790]
  |  Branch (383:20): [True: 0, False: 0]
  |  Branch (383:27): [True: 0, False: 0]
  ------------------
  384|      0|        qctx_unlock(ctx);
  385|       |
  386|    790|    return ok;
  387|    632|}
quic_impl.c:wrong_type:
  209|    158|{
  210|    158|    const uint32_t mask = QCTX_C | QCTX_S | QCTX_L | QCTX_D;
  ------------------
  |  |  194|    158|#define QCTX_C              (1U << 0)
  ------------------
                  const uint32_t mask = QCTX_C | QCTX_S | QCTX_L | QCTX_D;
  ------------------
  |  |  195|    158|#define QCTX_S              (1U << 1)
  ------------------
                  const uint32_t mask = QCTX_C | QCTX_S | QCTX_L | QCTX_D;
  ------------------
  |  |  196|    158|#define QCTX_L              (1U << 2)
  ------------------
                  const uint32_t mask = QCTX_C | QCTX_S | QCTX_L | QCTX_D;
  ------------------
  |  |  201|    158|#define QCTX_D              (1U << 7)
  ------------------
  211|    158|    int code = ERR_R_UNSUPPORTED;
  ------------------
  |  |  363|    158|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|    158|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|    158|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|    158|    if ((flags & QCTX_NO_ERROR) != 0)
  ------------------
  |  |  202|    158|#define QCTX_NO_ERROR       (1U << 8)
  ------------------
  |  Branch (213:9): [True: 158, False: 0]
  ------------------
  214|    158|        return 1;
  215|      0|    else if ((flags & mask) == QCTX_D)
  ------------------
  |  |  201|      0|#define QCTX_D              (1U << 7)
  ------------------
  |  Branch (215:14): [True: 0, False: 0]
  ------------------
  216|      0|        code = SSL_R_DOMAIN_USE_ONLY;
  ------------------
  |  |  111|      0|# define SSL_R_DOMAIN_USE_ONLY                            422
  ------------------
  217|      0|    else if ((flags & mask) == QCTX_L)
  ------------------
  |  |  196|      0|#define QCTX_L              (1U << 2)
  ------------------
  |  Branch (217:14): [True: 0, False: 0]
  ------------------
  218|      0|        code = SSL_R_LISTENER_USE_ONLY;
  ------------------
  |  |  170|      0|# define SSL_R_LISTENER_USE_ONLY                          421
  ------------------
  219|      0|    else if ((flags & mask) == QCTX_C)
  ------------------
  |  |  194|      0|#define QCTX_C              (1U << 0)
  ------------------
  |  Branch (219:14): [True: 0, False: 0]
  ------------------
  220|      0|        code = SSL_R_CONN_USE_ONLY;
  ------------------
  |  |   87|      0|# define SSL_R_CONN_USE_ONLY                              356
  ------------------
  221|      0|    else if ((flags & mask) == QCTX_S
  ------------------
  |  |  195|      0|#define QCTX_S              (1U << 1)
  ------------------
  |  Branch (221:14): [True: 0, False: 0]
  ------------------
  222|      0|             || (flags & mask) == (QCTX_C | QCTX_S))
  ------------------
  |  |  194|      0|#define QCTX_C              (1U << 0)
  ------------------
                           || (flags & mask) == (QCTX_C | QCTX_S))
  ------------------
  |  |  195|      0|#define QCTX_S              (1U << 1)
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|        code = SSL_R_NO_STREAM;
  ------------------
  |  |  214|      0|# define SSL_R_NO_STREAM                                  355
  ------------------
  224|       |
  225|      0|    return QUIC_RAISE_NON_NORMAL_ERROR(NULL, code, NULL);
  ------------------
  |  |  147|      0|    quic_raise_non_normal_error((ctx),                          \
  |  |  148|      0|                                OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                               OPENSSL_FILE, OPENSSL_LINE,     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  149|      0|                                OPENSSL_FUNC,                   \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  150|      0|                                (reason),                       \
  |  |  151|      0|                                (msg))
  ------------------
  226|    158|}
quic_impl.c:quic_free_listener:
  722|     79|{
  723|     79|    quic_unref_port_bios(ctx->ql->port);
  724|     79|    ossl_quic_port_drop_incoming(ctx->ql->port);
  725|     79|    ossl_quic_port_free(ctx->ql->port);
  726|       |
  727|     79|    if (ctx->ql->domain == NULL) {
  ------------------
  |  Branch (727:9): [True: 79, False: 0]
  ------------------
  728|     79|        ossl_quic_engine_free(ctx->ql->engine);
  729|     79|#if defined(OPENSSL_THREADS)
  730|     79|        ossl_crypto_mutex_free(&ctx->ql->mutex);
  731|     79|#endif
  732|     79|    } else {
  733|      0|        SSL_free(&ctx->ql->domain->obj.ssl);
  734|      0|    }
  735|     79|}
quic_impl.c:qctx_lock:
  479|    158|{
  480|    158|#if defined(OPENSSL_THREADS)
  481|    158|    assert(ctx->obj != NULL);
  482|    158|    ossl_crypto_mutex_lock(ossl_quic_obj_get0_mutex(ctx->obj));
  483|    158|#endif
  484|    158|}
quic_impl.c:qctx_unlock:
  489|    158|{
  490|    158|#if defined(OPENSSL_THREADS)
  491|    158|    assert(ctx->obj != NULL);
  492|    158|    ossl_crypto_mutex_unlock(ossl_quic_obj_get0_mutex(ctx->obj));
  493|    158|#endif
  494|    158|}
quic_impl.c:expect_quic_csl:
  414|    395|{
  415|    395|    return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L);
  ------------------
  |  |  194|    395|#define QCTX_C              (1U << 0)
  ------------------
                  return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L);
  ------------------
  |  |  195|    395|#define QCTX_S              (1U << 1)
  ------------------
                  return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L);
  ------------------
  |  |  196|    395|#define QCTX_L              (1U << 2)
  ------------------
  416|    395|}
quic_impl.c:quic_set0_net_rbio:
 1142|     79|{
 1143|     79|    QUIC_PORT *port;
 1144|     79|    BIO *old_rbio = NULL;
 1145|       |
 1146|     79|    port = ossl_quic_obj_get0_port(obj);
 1147|     79|    old_rbio = ossl_quic_port_get_net_rbio(port);
 1148|     79|    if (old_rbio == net_rbio)
  ------------------
  |  Branch (1148:9): [True: 0, False: 79]
  ------------------
 1149|      0|        return 0;
 1150|       |
 1151|     79|    if (!ossl_quic_port_set_net_rbio(port, net_rbio))
  ------------------
  |  Branch (1151:9): [True: 0, False: 79]
  ------------------
 1152|      0|        return 0;
 1153|       |
 1154|     79|    BIO_free_all(old_rbio);
 1155|     79|    if (net_rbio != NULL)
  ------------------
  |  Branch (1155:9): [True: 79, False: 0]
  ------------------
 1156|     79|        BIO_set_nbio(net_rbio, 1); /* best effort autoconfig */
  ------------------
  |  |  502|     79|# define BIO_set_nbio(b,n)               BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
  |  |  ------------------
  |  |  |  |  433|     79|# define BIO_C_SET_NBIO                          102
  |  |  ------------------
  ------------------
 1157|       |
 1158|     79|    return 1;
 1159|     79|}
quic_impl.c:quic_set0_net_wbio:
 1163|     79|{
 1164|     79|    QUIC_PORT *port;
 1165|     79|    BIO *old_wbio = NULL;
 1166|       |
 1167|     79|    port = ossl_quic_obj_get0_port(obj);
 1168|     79|    old_wbio = ossl_quic_port_get_net_wbio(port);
 1169|     79|    if (old_wbio == net_wbio)
  ------------------
  |  Branch (1169:9): [True: 0, False: 79]
  ------------------
 1170|      0|        return 0;
 1171|       |
 1172|     79|    if (!ossl_quic_port_set_net_wbio(port, net_wbio))
  ------------------
  |  Branch (1172:9): [True: 0, False: 79]
  ------------------
 1173|      0|        return 0;
 1174|       |
 1175|     79|    BIO_free_all(old_wbio);
 1176|     79|    if (net_wbio != NULL)
  ------------------
  |  Branch (1176:9): [True: 79, False: 0]
  ------------------
 1177|     79|        BIO_set_nbio(net_wbio, 1); /* best effort autoconfig */
  ------------------
  |  |  502|     79|# define BIO_set_nbio(b,n)               BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
  |  |  ------------------
  |  |  |  |  433|     79|# define BIO_C_SET_NBIO                          102
  |  |  ------------------
  ------------------
 1178|       |
 1179|     79|    return 1;
 1180|     79|}
quic_impl.c:qctx_blocking:
  537|     79|{
  538|     79|    return ossl_quic_obj_blocking(ctx->obj);
  539|     79|}
quic_impl.c:is_quic_c:
  390|     79|{
  391|     79|    uint32_t flags = QCTX_C;
  ------------------
  |  |  194|     79|#define QCTX_C              (1U << 0)
  ------------------
  392|       |
  393|     79|    if (!raiseerrs)
  ------------------
  |  Branch (393:9): [True: 79, False: 0]
  ------------------
  394|     79|        flags |= QCTX_NO_ERROR;
  ------------------
  |  |  202|     79|#define QCTX_NO_ERROR       (1U << 8)
  ------------------
  395|     79|    return expect_quic_as(s, ctx, flags);
  396|     79|}
quic_impl.c:qctx_lock_for_io:
  497|     79|{
  498|     79|    qctx_lock(ctx);
  499|     79|    ctx->in_io = 1;
  500|       |
  501|       |    /*
  502|       |     * We are entering an I/O function so we must update the values returned by
  503|       |     * SSL_get_error and SSL_want. Set no error. This will be overridden later
  504|       |     * if a call to QUIC_RAISE_NORMAL_ERROR or QUIC_RAISE_NON_NORMAL_ERROR
  505|       |     * occurs during the API call.
  506|       |     */
  507|     79|    quic_set_last_error(ctx, SSL_ERROR_NONE);
  ------------------
  |  | 1251|     79|# define SSL_ERROR_NONE                  0
  ------------------
  508|     79|}
quic_impl.c:is_quic_cs:
  400|     79|{
  401|     79|    uint32_t flags = QCTX_C | QCTX_S;
  ------------------
  |  |  194|     79|#define QCTX_C              (1U << 0)
  ------------------
                  uint32_t flags = QCTX_C | QCTX_S;
  ------------------
  |  |  195|     79|#define QCTX_S              (1U << 1)
  ------------------
  402|       |
  403|     79|    if (!raiseerrs)
  ------------------
  |  Branch (403:9): [True: 79, False: 0]
  ------------------
  404|     79|        flags |= QCTX_NO_ERROR;
  ------------------
  |  |  202|     79|#define QCTX_NO_ERROR       (1U << 8)
  ------------------
  405|     79|    return expect_quic_as(s, ctx, flags);
  406|     79|}
quic_impl.c:qctx_should_autotick:
 3663|     79|{
 3664|     79|    int event_handling_mode;
 3665|     79|    QUIC_OBJ *obj = ctx->obj;
 3666|       |
 3667|     79|    for (; (event_handling_mode = obj->event_handling_mode) == SSL_VALUE_EVENT_HANDLING_MODE_INHERIT
  ------------------
  |  | 2484|    158|# define SSL_VALUE_EVENT_HANDLING_MODE_INHERIT      0
  ------------------
  |  Branch (3667:12): [True: 79, False: 0]
  ------------------
 3668|     79|           && obj->parent_obj != NULL; obj = obj->parent_obj);
  ------------------
  |  Branch (3668:15): [True: 0, False: 79]
  ------------------
 3669|       |
 3670|     79|    return event_handling_mode != SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT;
  ------------------
  |  | 2486|     79|# define SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT     2
  ------------------
 3671|     79|}
quic_impl.c:qctx_maybe_autotick:
 3675|     79|{
 3676|     79|    if (!qctx_should_autotick(ctx))
  ------------------
  |  Branch (3676:9): [True: 0, False: 79]
  ------------------
 3677|      0|        return;
 3678|       |
 3679|     79|    ossl_quic_reactor_tick(ossl_quic_obj_get0_reactor(ctx->obj), 0);
 3680|     79|}
quic_impl.c:need_notifier_for_domain_flags:
 1789|     79|{
 1790|     79|    return (domain_flags & SSL_DOMAIN_FLAG_THREAD_ASSISTED) != 0
  ------------------
  |  | 2374|     79|#define SSL_DOMAIN_FLAG_THREAD_ASSISTED     (1U << 2)
  ------------------
  |  Branch (1790:12): [True: 0, False: 79]
  ------------------
 1791|     79|        || ((domain_flags & SSL_DOMAIN_FLAG_MULTI_THREAD) != 0
  ------------------
  |  | 2373|     79|#define SSL_DOMAIN_FLAG_MULTI_THREAD        (1U << 1)
  ------------------
  |  Branch (1791:13): [True: 79, False: 0]
  ------------------
 1792|     79|            && (domain_flags & SSL_DOMAIN_FLAG_BLOCKING) != 0);
  ------------------
  |  | 2375|     79|#define SSL_DOMAIN_FLAG_BLOCKING            (1U << 3)
  ------------------
  |  Branch (1792:16): [True: 0, False: 79]
  ------------------
 1793|     79|}
quic_impl.c:expect_quic_listener:
  426|     79|{
  427|     79|    return expect_quic_as(s, ctx, QCTX_L);
  ------------------
  |  |  196|     79|#define QCTX_L              (1U << 2)
  ------------------
  428|     79|}
quic_impl.c:ql_listen:
 4550|     79|{
 4551|     79|    if (ql->listening)
  ------------------
  |  Branch (4551:9): [True: 0, False: 79]
  ------------------
 4552|      0|        return 1;
 4553|       |
 4554|     79|    ossl_quic_port_set_allow_incoming(ql->port, 1);
 4555|     79|    ql->listening = 1;
 4556|     79|    return 1;
 4557|     79|}

ossl_quic_lcidm_new:
  104|     79|{
  105|     79|    QUIC_LCIDM *lcidm = NULL;
  106|       |
  107|     79|    if (lcid_len > QUIC_MAX_CONN_ID_LEN)
  ------------------
  |  |   75|     79|#  define QUIC_MAX_CONN_ID_LEN   20
  ------------------
  |  Branch (107:9): [True: 0, False: 79]
  ------------------
  108|      0|        goto err;
  109|       |
  110|     79|    if ((lcidm = OPENSSL_zalloc(sizeof(*lcidm))) == NULL)
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 79]
  ------------------
  111|      0|        goto err;
  112|       |
  113|       |    /* generate a random key for the hash tables hash function */
  114|     79|    if (!RAND_bytes_ex(libctx, (unsigned char *)&lcidm->hash_key,
  ------------------
  |  Branch (114:9): [True: 0, False: 79]
  ------------------
  115|     79|                       sizeof(uint64_t) * 2, 0))
  116|      0|        goto err;
  117|       |
  118|     79|    if ((lcidm->lcids = lh_QUIC_LCID_new(lcid_hash, lcid_comp)) == NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 79]
  ------------------
  119|      0|        goto err;
  120|       |
  121|     79|    if ((lcidm->conns = lh_QUIC_LCIDM_CONN_new(lcidm_conn_hash,
  ------------------
  |  Branch (121:9): [True: 0, False: 79]
  ------------------
  122|     79|                                               lcidm_conn_comp)) == NULL)
  123|      0|        goto err;
  124|       |
  125|     79|    lcidm->libctx   = libctx;
  126|     79|    lcidm->lcid_len = lcid_len;
  127|     79|    return lcidm;
  128|       |
  129|      0|err:
  130|      0|    if (lcidm != NULL) {
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|        lh_QUIC_LCID_free(lcidm->lcids);
  132|      0|        lh_QUIC_LCIDM_CONN_free(lcidm->conns);
  133|      0|        OPENSSL_free(lcidm);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  134|      0|    }
  135|      0|    return NULL;
  136|     79|}
ossl_quic_lcidm_free:
  146|     79|{
  147|     79|    if (lcidm == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 79]
  ------------------
  148|      0|        return;
  149|       |
  150|       |    /*
  151|       |     * Calling OPENSSL_lh_delete during a doall call is unsafe with our
  152|       |     * current LHASH implementation for several reasons:
  153|       |     *
  154|       |     * - firstly, because deletes can cause the hashtable to be contracted,
  155|       |     *   resulting in rehashing which might cause items in later buckets to
  156|       |     *   move to earlier buckets, which might cause doall to skip an item,
  157|       |     *   resulting in a memory leak;
  158|       |     *
  159|       |     * - secondly, because doall in general is not safe across hashtable
  160|       |     *   size changes, as it caches hashtable size and pointer values
  161|       |     *   while operating.
  162|       |     *
  163|       |     * The fix for this is to disable hashtable contraction using the following
  164|       |     * call, which guarantees that no rehashing will occur so long as we only
  165|       |     * call delete and not insert.
  166|       |     */
  167|     79|    lh_QUIC_LCIDM_CONN_set_down_load(lcidm->conns, 0);
  168|       |
  169|     79|    lh_QUIC_LCIDM_CONN_doall_arg(lcidm->conns, lcidm_delete_conn_, lcidm);
  170|       |
  171|     79|    lh_QUIC_LCID_free(lcidm->lcids);
  172|     79|    lh_QUIC_LCIDM_CONN_free(lcidm->conns);
  173|     79|    OPENSSL_free(lcidm);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  174|     79|}

OSSL_QUIC_client_method:
  304|    237|        { \
  305|    237|        static const SSL_METHOD func_name##_data= { \
  306|    237|                version, \
  307|    237|                0, \
  308|    237|                0, \
  309|    237|                ossl_quic_new, \
  310|    237|                ossl_quic_free, \
  311|    237|                ossl_quic_reset, \
  312|    237|                ossl_quic_init, \
  313|    237|                NULL /* clear */, \
  314|    237|                ossl_quic_deinit, \
  315|    237|                q_accept, \
  316|    237|                q_connect, \
  317|    237|                ossl_quic_read, \
  318|    237|                ossl_quic_peek, \
  319|    237|                ossl_quic_write, \
  320|    237|                NULL /* shutdown */, \
  321|    237|                NULL /* renegotiate */, \
  322|    237|                ossl_quic_renegotiate_check, \
  323|    237|                NULL /* read_bytes */, \
  324|    237|                NULL /* write_bytes */, \
  325|    237|                NULL /* dispatch_alert */, \
  326|    237|                ossl_quic_ctrl, \
  327|    237|                ossl_quic_ctx_ctrl, \
  328|    237|                ossl_quic_get_cipher_by_char, \
  329|    237|                NULL /* put_cipher_by_char */, \
  330|    237|                ossl_quic_pending, \
  331|    237|                ossl_quic_num_ciphers, \
  332|    237|                ossl_quic_get_cipher, \
  333|    237|                tls1_default_timeout, \
  334|    237|                &enc_data, \
  335|    237|                ssl_undefined_void_function, \
  336|    237|                ossl_quic_callback_ctrl, \
  337|    237|                ossl_quic_ctx_callback_ctrl, \
  338|    237|        }; \
  339|    237|        return &func_name##_data; \
  340|    237|        }
OSSL_QUIC_client_thread_method:
  304|    237|        { \
  305|    237|        static const SSL_METHOD func_name##_data= { \
  306|    237|                version, \
  307|    237|                0, \
  308|    237|                0, \
  309|    237|                ossl_quic_new, \
  310|    237|                ossl_quic_free, \
  311|    237|                ossl_quic_reset, \
  312|    237|                ossl_quic_init, \
  313|    237|                NULL /* clear */, \
  314|    237|                ossl_quic_deinit, \
  315|    237|                q_accept, \
  316|    237|                q_connect, \
  317|    237|                ossl_quic_read, \
  318|    237|                ossl_quic_peek, \
  319|    237|                ossl_quic_write, \
  320|    237|                NULL /* shutdown */, \
  321|    237|                NULL /* renegotiate */, \
  322|    237|                ossl_quic_renegotiate_check, \
  323|    237|                NULL /* read_bytes */, \
  324|    237|                NULL /* write_bytes */, \
  325|    237|                NULL /* dispatch_alert */, \
  326|    237|                ossl_quic_ctrl, \
  327|    237|                ossl_quic_ctx_ctrl, \
  328|    237|                ossl_quic_get_cipher_by_char, \
  329|    237|                NULL /* put_cipher_by_char */, \
  330|    237|                ossl_quic_pending, \
  331|    237|                ossl_quic_num_ciphers, \
  332|    237|                ossl_quic_get_cipher, \
  333|    237|                tls1_default_timeout, \
  334|    237|                &enc_data, \
  335|    237|                ssl_undefined_void_function, \
  336|    237|                ossl_quic_callback_ctrl, \
  337|    237|                ossl_quic_ctx_callback_ctrl, \
  338|    237|        }; \
  339|    237|        return &func_name##_data; \
  340|    237|        }
OSSL_QUIC_server_method:
  304|    237|        { \
  305|    237|        static const SSL_METHOD func_name##_data= { \
  306|    237|                version, \
  307|    237|                0, \
  308|    237|                0, \
  309|    237|                ossl_quic_new, \
  310|    237|                ossl_quic_free, \
  311|    237|                ossl_quic_reset, \
  312|    237|                ossl_quic_init, \
  313|    237|                NULL /* clear */, \
  314|    237|                ossl_quic_deinit, \
  315|    237|                q_accept, \
  316|    237|                q_connect, \
  317|    237|                ossl_quic_read, \
  318|    237|                ossl_quic_peek, \
  319|    237|                ossl_quic_write, \
  320|    237|                NULL /* shutdown */, \
  321|    237|                NULL /* renegotiate */, \
  322|    237|                ossl_quic_renegotiate_check, \
  323|    237|                NULL /* read_bytes */, \
  324|    237|                NULL /* write_bytes */, \
  325|    237|                NULL /* dispatch_alert */, \
  326|    237|                ossl_quic_ctrl, \
  327|    237|                ossl_quic_ctx_ctrl, \
  328|    237|                ossl_quic_get_cipher_by_char, \
  329|    237|                NULL /* put_cipher_by_char */, \
  330|    237|                ossl_quic_pending, \
  331|    237|                ossl_quic_num_ciphers, \
  332|    237|                ossl_quic_get_cipher, \
  333|    237|                tls1_default_timeout, \
  334|    237|                &enc_data, \
  335|    237|                ssl_undefined_void_function, \
  336|    237|                ossl_quic_callback_ctrl, \
  337|    237|                ossl_quic_ctx_callback_ctrl, \
  338|    237|        }; \
  339|    237|        return &func_name##_data; \
  340|    237|        }

ossl_quic_obj_init:
   22|     79|{
   23|     79|    int is_event_leader = (engine != NULL);
   24|     79|    int is_port_leader  = (port != NULL);
   25|       |
   26|     79|    if (!ossl_assert(obj != NULL && !obj->init_done && SSL_TYPE_IS_QUIC(type)
  ------------------
  |  |   52|    553|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 79, False: 0]
  |  |  |  Branch (52:43): [True: 79, False: 0]
  |  |  |  Branch (52:43): [True: 79, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 79, False: 0]
  |  |  ------------------
  |  |   53|     79|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (26:9): [True: 0, False: 79]
  ------------------
   27|     79|                     && (parent_obj == NULL || IS_QUIC(parent_obj))))
   28|      0|        return 0;
   29|       |
   30|       |    /* Event leader is always the root object. */
   31|     79|    if (!ossl_assert(!is_event_leader || parent_obj == NULL))
  ------------------
  |  |   52|    158|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 79]
  |  |  |  Branch (52:43): [True: 79, False: 0]
  |  |  ------------------
  |  |   53|     79|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (31:9): [True: 0, False: 79]
  ------------------
   32|      0|        return 0;
   33|       |
   34|     79|    if (!ossl_ssl_init(&obj->ssl, ctx, ctx->method, type))
  ------------------
  |  Branch (34:9): [True: 0, False: 79]
  ------------------
   35|      0|        goto err;
   36|       |
   37|     79|    obj->domain_flags       = ctx->domain_flags;
   38|     79|    obj->parent_obj         = (QUIC_OBJ *)parent_obj;
   39|     79|    obj->is_event_leader    = is_event_leader;
   40|     79|    obj->is_port_leader     = is_port_leader;
   41|     79|    obj->engine             = engine;
   42|     79|    obj->port               = port;
   43|     79|    obj->req_blocking_mode  = QUIC_BLOCKING_MODE_INHERIT;
   44|     79|    if (!obj_update_cache(obj))
  ------------------
  |  Branch (44:9): [True: 0, False: 79]
  ------------------
   45|      0|        goto err;
   46|       |
   47|     79|    obj->init_done          = 1;
   48|     79|    return 1;
   49|       |
   50|      0|err:
   51|      0|    obj->is_event_leader = 0;
   52|      0|    obj->is_port_leader  = 0;
   53|      0|    return 0;
   54|     79|}
ossl_quic_obj_get0_handshake_layer:
   84|    474|{
   85|    474|    assert(obj != NULL && obj->init_done);
   86|       |
   87|    474|    if (obj->ssl.type != SSL_TYPE_QUIC_CONNECTION)
  ------------------
  |  | 1226|    474|#define SSL_TYPE_QUIC_CONNECTION    0x80
  ------------------
  |  Branch (87:9): [True: 474, False: 0]
  ------------------
   88|    474|        return NULL;
   89|       |
   90|      0|    return SSL_CONNECTION_FROM_SSL_ONLY(((QUIC_CONNECTION *)obj)->tls);
  ------------------
  |  |   23|      0|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|      0|    ((ssl) == NULL ? NULL                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   18|      0|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|      0|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|      0|       ? (c SSL_CONNECTION *)(ssl)                \
  |  |  |  |   20|      0|       : NULL))
  |  |  ------------------
  ------------------
   91|    474|}
ossl_quic_obj_can_support_blocking:
   95|     79|{
   96|     79|    QUIC_REACTOR *rtor;
   97|       |
   98|     79|    assert(obj != NULL);
   99|     79|    rtor = ossl_quic_obj_get0_reactor(obj);
  100|       |
  101|     79|    if ((obj->domain_flags
  ------------------
  |  Branch (101:9): [True: 0, False: 79]
  ------------------
  102|     79|            & (SSL_DOMAIN_FLAG_LEGACY_BLOCKING | SSL_DOMAIN_FLAG_BLOCKING)) == 0)
  ------------------
  |  | 2376|     79|#define SSL_DOMAIN_FLAG_LEGACY_BLOCKING     (1U << 4)
  ------------------
                          & (SSL_DOMAIN_FLAG_LEGACY_BLOCKING | SSL_DOMAIN_FLAG_BLOCKING)) == 0)
  ------------------
  |  | 2375|     79|#define SSL_DOMAIN_FLAG_BLOCKING            (1U << 3)
  ------------------
  103|      0|        return 0;
  104|       |
  105|     79|    return ossl_quic_reactor_can_poll_r(rtor)
  ------------------
  |  Branch (105:12): [True: 0, False: 79]
  ------------------
  106|     79|        || ossl_quic_reactor_can_poll_w(rtor);
  ------------------
  |  Branch (106:12): [True: 0, False: 79]
  ------------------
  107|     79|}
ossl_quic_obj_desires_blocking:
  110|     79|{
  111|     79|    unsigned int req_blocking_mode;
  112|       |
  113|     79|    assert(obj != NULL);
  114|     79|    for (; (req_blocking_mode = obj->req_blocking_mode) == QUIC_BLOCKING_MODE_INHERIT
  ------------------
  |  Branch (114:12): [True: 79, False: 0]
  ------------------
  115|     79|           && obj->parent_obj != NULL; obj = obj->parent_obj);
  ------------------
  |  Branch (115:15): [True: 0, False: 79]
  ------------------
  116|       |
  117|     79|    return req_blocking_mode != QUIC_BLOCKING_MODE_NONBLOCKING;
  118|     79|}
ossl_quic_obj_blocking:
  121|     79|{
  122|     79|    assert(obj != NULL);
  123|       |
  124|     79|    if (!ossl_quic_obj_desires_blocking(obj))
  ------------------
  |  Branch (124:9): [True: 0, False: 79]
  ------------------
  125|      0|        return 0;
  126|       |
  127|     79|    ossl_quic_engine_update_poll_descriptors(ossl_quic_obj_get0_engine(obj),
  128|     79|                                             /*force=*/0);
  129|     79|    return ossl_quic_obj_can_support_blocking(obj);
  130|     79|}
quic_obj.c:obj_update_cache:
   57|     79|{
   58|     79|    QUIC_OBJ *p;
   59|       |
   60|     79|    for (p = obj; p != NULL && !p->is_event_leader;
  ------------------
  |  Branch (60:19): [True: 79, False: 0]
  |  Branch (60:32): [True: 0, False: 79]
  ------------------
   61|     79|         p = p->parent_obj)
   62|      0|        if (!ossl_assert(p == obj || p->init_done))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            return 0;
   64|       |
   65|     79|    if (!ossl_assert(p != NULL))
  ------------------
  |  |   52|     79|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     79|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (65:9): [True: 0, False: 79]
  ------------------
   66|      0|        return 0;
   67|       |
   68|       |    /*
   69|       |     * Offset of ->ssl is guaranteed to be 0 but the NULL check makes ubsan
   70|       |     * happy.
   71|       |     */
   72|     79|    obj->cached_event_leader    = p;
   73|     79|    obj->engine                 = p->engine;
   74|       |
   75|     79|    for (p = obj; p != NULL && !p->is_port_leader;
  ------------------
  |  Branch (75:19): [True: 79, False: 0]
  |  Branch (75:32): [True: 0, False: 79]
  ------------------
   76|     79|         p = p->parent_obj);
   77|       |
   78|     79|    obj->cached_port_leader     = p;
   79|     79|    obj->port                   = (p != NULL) ? p->port : NULL;
  ------------------
  |  Branch (79:35): [True: 79, False: 0]
  ------------------
   80|     79|    return 1;
   81|     79|}

quic_impl.c:ossl_quic_obj_get0_mutex:
  276|    316|{
  277|    316|    return ossl_quic_engine_get0_mutex(ossl_quic_obj_get0_engine(obj));
  278|    316|}
quic_impl.c:ossl_quic_obj_get0_engine:
  190|    395|{
  191|    395|    assert(obj->init_done);
  192|    395|    assert(obj->engine != NULL);
  193|    395|    return obj->engine;
  194|    395|}
quic_impl.c:ossl_quic_obj_get0_port:
  199|    395|{
  200|    395|    assert(obj->init_done);
  201|    395|    return obj->port;
  202|    395|}
quic_impl.c:ossl_quic_obj_get0_reactor:
  286|     79|{
  287|     79|    return ossl_quic_engine_get0_reactor(ossl_quic_obj_get0_engine(obj));
  288|     79|}
quic_obj.c:ossl_quic_obj_get0_reactor:
  286|     79|{
  287|     79|    return ossl_quic_engine_get0_reactor(ossl_quic_obj_get0_engine(obj));
  288|     79|}
quic_obj.c:ossl_quic_obj_get0_engine:
  190|    158|{
  191|    158|    assert(obj->init_done);
  192|    158|    assert(obj->engine != NULL);
  193|    158|    return obj->engine;
  194|    158|}

ossl_quic_port_new:
  101|     79|{
  102|     79|    QUIC_PORT *port;
  103|       |
  104|     79|    if ((port = OPENSSL_zalloc(sizeof(QUIC_PORT))) == NULL)
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (104:9): [True: 0, False: 79]
  ------------------
  105|      0|        return NULL;
  106|       |
  107|     79|    port->engine        = args->engine;
  108|     79|    port->channel_ctx   = args->channel_ctx;
  109|     79|    port->is_multi_conn = args->is_multi_conn;
  110|     79|    port->validate_addr = args->do_addr_validation;
  111|     79|    port->get_conn_user_ssl = args->get_conn_user_ssl;
  112|     79|    port->user_ssl_arg = args->user_ssl_arg;
  113|       |
  114|     79|    if (!port_init(port)) {
  ------------------
  |  Branch (114:9): [True: 0, False: 79]
  ------------------
  115|      0|        OPENSSL_free(port);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|      0|        return NULL;
  117|      0|    }
  118|       |
  119|     79|    return port;
  120|     79|}
ossl_quic_port_free:
  123|     79|{
  124|     79|    if (port == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 79]
  ------------------
  125|      0|        return;
  126|       |
  127|     79|    port_cleanup(port);
  128|     79|    OPENSSL_free(port);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|     79|}
ossl_quic_port_is_running:
  227|    553|{
  228|    553|    return port->state == QUIC_PORT_STATE_RUNNING;
  229|    553|}
ossl_quic_port_get_net_rbio:
  293|    316|{
  294|    316|    return port->net_rbio;
  295|    316|}
ossl_quic_port_get_net_wbio:
  298|    237|{
  299|    237|    return port->net_wbio;
  300|    237|}
ossl_quic_port_update_poll_descriptors:
  333|     79|{
  334|     79|    int ok = 1;
  335|       |
  336|     79|    if (!force && !port->bio_changed)
  ------------------
  |  Branch (336:9): [True: 79, False: 0]
  |  Branch (336:19): [True: 0, False: 79]
  ------------------
  337|      0|        return 0;
  338|       |
  339|     79|    if (!port_update_poll_desc(port, port->net_rbio, /*for_write=*/0))
  ------------------
  |  Branch (339:9): [True: 0, False: 79]
  ------------------
  340|      0|        ok = 0;
  341|       |
  342|     79|    if (!port_update_poll_desc(port, port->net_wbio, /*for_write=*/1))
  ------------------
  |  Branch (342:9): [True: 0, False: 79]
  ------------------
  343|      0|        ok = 0;
  344|       |
  345|     79|    port->bio_changed = 0;
  346|     79|    return ok;
  347|     79|}
ossl_quic_port_set_net_rbio:
  415|     79|{
  416|     79|    if (port->net_rbio == net_rbio)
  ------------------
  |  Branch (416:9): [True: 0, False: 79]
  ------------------
  417|      0|        return 1;
  418|       |
  419|     79|    if (!port_update_poll_desc(port, net_rbio, /*for_write=*/0))
  ------------------
  |  Branch (419:9): [True: 0, False: 79]
  ------------------
  420|      0|        return 0;
  421|       |
  422|     79|    ossl_quic_demux_set_bio(port->demux, net_rbio);
  423|     79|    port->net_rbio = net_rbio;
  424|     79|    port_update_addressing_mode(port);
  425|     79|    return 1;
  426|     79|}
ossl_quic_port_set_net_wbio:
  429|     79|{
  430|     79|    QUIC_CHANNEL *ch;
  431|       |
  432|     79|    if (port->net_wbio == net_wbio)
  ------------------
  |  Branch (432:9): [True: 0, False: 79]
  ------------------
  433|      0|        return 1;
  434|       |
  435|     79|    if (!port_update_poll_desc(port, net_wbio, /*for_write=*/1))
  ------------------
  |  Branch (435:9): [True: 0, False: 79]
  ------------------
  436|      0|        return 0;
  437|       |
  438|     79|    OSSL_LIST_FOREACH(ch, ch, &port->channel_list)
  ------------------
  |  |   28|     79|    OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
  |  |  ------------------
  |  |  |  |   24|     79|    for ((p) = (init);                                                      \
  |  |  |  |   25|     79|         (p) != NULL;                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (25:10): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   26|     79|         (p) = ossl_list_##name##_next(p))
  |  |  ------------------
  ------------------
  439|      0|        ossl_qtx_set_bio(ch->qtx, net_wbio);
  440|       |
  441|     79|    port->net_wbio = net_wbio;
  442|     79|    port_update_addressing_mode(port);
  443|     79|    return 1;
  444|     79|}
ossl_quic_port_pop_incoming:
  595|    316|{
  596|    316|    QUIC_CHANNEL *ch;
  597|       |
  598|    316|    ch = ossl_list_incoming_ch_head(&port->incoming_channel_list);
  599|    316|    if (ch == NULL)
  ------------------
  |  Branch (599:9): [True: 316, False: 0]
  ------------------
  600|    316|        return NULL;
  601|       |
  602|      0|    ossl_list_incoming_ch_remove(&port->incoming_channel_list, ch);
  603|      0|    return ch;
  604|    316|}
ossl_quic_port_drop_incoming:
  612|     79|{
  613|     79|    QUIC_CHANNEL *ch;
  614|     79|    SSL *tls;
  615|     79|    SSL *user_ssl;
  616|     79|    SSL_CONNECTION *sc;
  617|       |
  618|     79|    for (;;) {
  619|     79|        ch = ossl_quic_port_pop_incoming(port);
  620|     79|        if (ch == NULL)
  ------------------
  |  Branch (620:13): [True: 79, False: 0]
  ------------------
  621|     79|            break;
  622|       |
  623|      0|        tls = ossl_quic_channel_get0_tls(ch);
  624|       |        /*
  625|       |         * The user ssl may or may not have been created via the
  626|       |         * get_conn_user_ssl callback in the QUIC stack.  The
  627|       |         * differentiation being if the user_ssl pointer and tls pointer
  628|       |         * are different.  If they are, then the user_ssl needs freeing here
  629|       |         * which sends us through ossl_quic_free, which then drops the actual
  630|       |         * ch->tls ref and frees the channel
  631|       |         */
  632|      0|        sc = SSL_CONNECTION_FROM_SSL(tls);
  ------------------
  |  |   39|      0|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|      0|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   33|      0|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|      0|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|      0|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|      0|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|      0|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|      0|          : NULL)))
  |  |  ------------------
  ------------------
  633|      0|        if (sc == NULL)
  ------------------
  |  Branch (633:13): [True: 0, False: 0]
  ------------------
  634|      0|            break;
  635|       |
  636|      0|        user_ssl = SSL_CONNECTION_GET_USER_SSL(sc);
  ------------------
  |  |   28|      0|# define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  637|      0|        if (user_ssl == tls) {
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            ossl_quic_channel_free(ch);
  639|      0|            SSL_free(tls);
  640|      0|        } else {
  641|      0|            SSL_free(user_ssl);
  642|      0|        }
  643|      0|    }
  644|     79|}
ossl_quic_port_set_allow_incoming:
  647|    158|{
  648|    158|    port->allow_incoming = allow_incoming;
  649|    158|}
ossl_quic_port_subtick:
  662|    158|{
  663|    158|    QUIC_CHANNEL *ch;
  664|       |
  665|    158|    res->net_read_desired       = ossl_quic_port_is_running(port);
  666|    158|    res->net_write_desired      = 0;
  667|    158|    res->notify_other_threads   = 0;
  668|    158|    res->tick_deadline          = ossl_time_infinite();
  669|       |
  670|    158|    if (!port->engine->inhibit_tick) {
  ------------------
  |  Branch (670:9): [True: 158, False: 0]
  ------------------
  671|       |        /* Handle any incoming data from network. */
  672|    158|        if (ossl_quic_port_is_running(port))
  ------------------
  |  Branch (672:13): [True: 158, False: 0]
  ------------------
  673|    158|            port_rx_pre(port);
  674|       |
  675|       |        /* Iterate through all channels and service them. */
  676|    158|        OSSL_LIST_FOREACH(ch, ch, &port->channel_list) {
  ------------------
  |  |   28|    158|    OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
  |  |  ------------------
  |  |  |  |   24|    158|    for ((p) = (init);                                                      \
  |  |  |  |   25|    158|         (p) != NULL;                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (25:10): [True: 0, False: 158]
  |  |  |  |  ------------------
  |  |  |  |   26|    158|         (p) = ossl_list_##name##_next(p))
  |  |  ------------------
  ------------------
  677|      0|            QUIC_TICK_RESULT subr = {0};
  678|       |
  679|      0|            ossl_quic_channel_subtick(ch, &subr, flags);
  680|      0|            ossl_quic_tick_result_merge_into(res, &subr);
  681|      0|        }
  682|    158|    }
  683|    158|}
quic_port.c:port_init:
  132|     79|{
  133|     79|    size_t rx_short_dcid_len = (port->is_multi_conn ? INIT_DCID_LEN : 0);
  ------------------
  |  |   27|     79|#define INIT_DCID_LEN                   8
  ------------------
  |  Branch (133:33): [True: 79, False: 0]
  ------------------
  134|     79|    int key_len = -1;
  135|     79|    EVP_CIPHER *cipher = NULL;
  136|     79|    unsigned char *token_key = NULL;
  137|     79|    int ret = 0;
  138|       |
  139|     79|    if (port->engine == NULL || port->channel_ctx == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 79]
  |  Branch (139:33): [True: 0, False: 79]
  ------------------
  140|      0|        goto err;
  141|       |
  142|     79|    if ((port->err_state = OSSL_ERR_STATE_new()) == NULL)
  ------------------
  |  Branch (142:9): [True: 0, False: 79]
  ------------------
  143|      0|        goto err;
  144|       |
  145|     79|    if ((port->demux = ossl_quic_demux_new(/*BIO=*/NULL,
  ------------------
  |  Branch (145:9): [True: 0, False: 79]
  ------------------
  146|     79|                                           /*Short CID Len=*/rx_short_dcid_len,
  147|     79|                                           get_time, port)) == NULL)
  148|      0|        goto err;
  149|       |
  150|     79|    ossl_quic_demux_set_default_handler(port->demux,
  151|     79|                                        port_default_packet_handler,
  152|     79|                                        port);
  153|       |
  154|     79|    if ((port->srtm = ossl_quic_srtm_new(port->engine->libctx,
  ------------------
  |  Branch (154:9): [True: 0, False: 79]
  ------------------
  155|     79|                                         port->engine->propq)) == NULL)
  156|      0|        goto err;
  157|       |
  158|     79|    if ((port->lcidm = ossl_quic_lcidm_new(port->engine->libctx,
  ------------------
  |  Branch (158:9): [True: 0, False: 79]
  ------------------
  159|     79|                                           rx_short_dcid_len)) == NULL)
  160|      0|        goto err;
  161|       |
  162|     79|    port->rx_short_dcid_len = (unsigned char)rx_short_dcid_len;
  163|     79|    port->tx_init_dcid_len  = INIT_DCID_LEN;
  ------------------
  |  |   27|     79|#define INIT_DCID_LEN                   8
  ------------------
  164|     79|    port->state             = QUIC_PORT_STATE_RUNNING;
  165|       |
  166|     79|    ossl_list_port_insert_tail(&port->engine->port_list, port);
  167|     79|    port->on_engine_list    = 1;
  168|     79|    port->bio_changed       = 1;
  169|       |
  170|       |    /* Generate random key for token encryption */
  171|     79|    if ((port->token_ctx = EVP_CIPHER_CTX_new()) == NULL
  ------------------
  |  Branch (171:9): [True: 0, False: 79]
  ------------------
  172|     79|        || (cipher = EVP_CIPHER_fetch(port->engine->libctx,
  ------------------
  |  Branch (172:12): [True: 0, False: 79]
  ------------------
  173|     79|                                      "AES-256-GCM", NULL)) == NULL
  174|     79|        || !EVP_EncryptInit_ex(port->token_ctx, cipher, NULL, NULL, NULL)
  ------------------
  |  Branch (174:12): [True: 0, False: 79]
  ------------------
  175|     79|        || (key_len = EVP_CIPHER_CTX_get_key_length(port->token_ctx)) <= 0
  ------------------
  |  Branch (175:12): [True: 0, False: 79]
  ------------------
  176|     79|        || (token_key = OPENSSL_malloc(key_len)) == NULL
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (176:12): [True: 0, False: 79]
  ------------------
  177|     79|        || !RAND_priv_bytes_ex(port->engine->libctx, token_key, key_len, 0)
  ------------------
  |  Branch (177:12): [True: 0, False: 79]
  ------------------
  178|     79|        || !EVP_EncryptInit_ex(port->token_ctx, NULL, NULL, token_key, NULL))
  ------------------
  |  Branch (178:12): [True: 0, False: 79]
  ------------------
  179|      0|        goto err;
  180|       |
  181|     79|    ret = 1;
  182|     79|err:
  183|     79|    EVP_CIPHER_free(cipher);
  184|     79|    if (key_len >= 1)
  ------------------
  |  Branch (184:9): [True: 79, False: 0]
  ------------------
  185|     79|        OPENSSL_clear_free(token_key, key_len);
  ------------------
  |  |  113|     79|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  186|      0|    else
  187|      0|        OPENSSL_free(token_key);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  188|     79|    if (!ret)
  ------------------
  |  Branch (188:9): [True: 0, False: 79]
  ------------------
  189|      0|        port_cleanup(port);
  190|     79|    return ret;
  191|     79|}
quic_port.c:port_cleanup:
  194|     79|{
  195|     79|    assert(ossl_list_ch_num(&port->channel_list) == 0);
  196|       |
  197|     79|    ossl_quic_demux_free(port->demux);
  198|     79|    port->demux = NULL;
  199|       |
  200|     79|    ossl_quic_srtm_free(port->srtm);
  201|     79|    port->srtm = NULL;
  202|       |
  203|     79|    ossl_quic_lcidm_free(port->lcidm);
  204|     79|    port->lcidm = NULL;
  205|       |
  206|     79|    OSSL_ERR_STATE_free(port->err_state);
  207|     79|    port->err_state = NULL;
  208|       |
  209|     79|    if (port->on_engine_list) {
  ------------------
  |  Branch (209:9): [True: 79, False: 0]
  ------------------
  210|     79|        ossl_list_port_remove(&port->engine->port_list, port);
  211|     79|        port->on_engine_list = 0;
  212|     79|    }
  213|       |
  214|     79|    EVP_CIPHER_CTX_free(port->token_ctx);
  215|     79|    port->token_ctx = NULL;
  216|     79|}
quic_port.c:port_update_poll_desc:
  303|    316|{
  304|    316|    BIO_POLL_DESCRIPTOR d = {0};
  305|       |
  306|    316|    if (net_bio == NULL
  ------------------
  |  Branch (306:9): [True: 0, False: 316]
  ------------------
  307|    316|        || (!for_write && !BIO_get_rpoll_descriptor(net_bio, &d))
  ------------------
  |  Branch (307:13): [True: 158, False: 158]
  |  Branch (307:27): [True: 158, False: 0]
  ------------------
  308|    316|        || (for_write && !BIO_get_wpoll_descriptor(net_bio, &d)))
  ------------------
  |  Branch (308:13): [True: 158, False: 0]
  |  Branch (308:26): [True: 158, False: 0]
  ------------------
  309|       |        /* Non-pollable BIO */
  310|    316|        d.type = BIO_POLL_DESCRIPTOR_TYPE_NONE;
  ------------------
  |  |  412|    316|#define BIO_POLL_DESCRIPTOR_TYPE_NONE       0
  ------------------
  311|       |
  312|    316|    if (!validate_poll_descriptor(&d))
  ------------------
  |  Branch (312:9): [True: 0, False: 316]
  ------------------
  313|      0|        return 0;
  314|       |
  315|       |    /*
  316|       |     * TODO(QUIC MULTIPORT): We currently only support one port per
  317|       |     * engine/domain. This is necessitated because QUIC_REACTOR only supports a
  318|       |     * single pollable currently. In the future, once complete polling
  319|       |     * infrastructure has been implemented, this limitation can be removed.
  320|       |     *
  321|       |     * For now, just update the descriptor on the engine's reactor as we are
  322|       |     * guaranteed to be the only port under it.
  323|       |     */
  324|    316|    if (for_write)
  ------------------
  |  Branch (324:9): [True: 158, False: 158]
  ------------------
  325|    158|        ossl_quic_reactor_set_poll_w(&port->engine->rtor, &d);
  326|    158|    else
  327|    158|        ossl_quic_reactor_set_poll_r(&port->engine->rtor, &d);
  328|       |
  329|    316|    return 1;
  330|    316|}
quic_port.c:validate_poll_descriptor:
  283|    316|{
  284|    316|    if (d->type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD && d->value.fd < 0) {
  ------------------
  |  |  413|    632|#define BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD    1
  ------------------
  |  Branch (284:9): [True: 0, False: 316]
  |  Branch (284:56): [True: 0, False: 0]
  ------------------
  285|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  286|      0|        return 0;
  287|      0|    }
  288|       |
  289|    316|    return 1;
  290|    316|}
quic_port.c:port_update_addressing_mode:
  379|    158|{
  380|    158|    long rcaps = 0, wcaps = 0;
  381|       |
  382|    158|    if (port->net_rbio != NULL)
  ------------------
  |  Branch (382:9): [True: 158, False: 0]
  ------------------
  383|    158|        rcaps = BIO_dgram_get_effective_caps(port->net_rbio);
  ------------------
  |  |  684|    158|         (uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS, 0, NULL)
  |  |  ------------------
  |  |  |  |  182|    158|# define BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS      85
  |  |  ------------------
  ------------------
  384|       |
  385|    158|    if (port->net_wbio != NULL)
  ------------------
  |  Branch (385:9): [True: 79, False: 79]
  ------------------
  386|     79|        wcaps = BIO_dgram_get_effective_caps(port->net_wbio);
  ------------------
  |  |  684|     79|         (uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS, 0, NULL)
  |  |  ------------------
  |  |  |  |  182|     79|# define BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS      85
  |  |  ------------------
  ------------------
  387|       |
  388|    158|    port->addressed_mode_r = ((rcaps & BIO_DGRAM_CAP_PROVIDES_SRC_ADDR) != 0);
  ------------------
  |  |  201|    158|# define BIO_DGRAM_CAP_PROVIDES_SRC_ADDR    (1U << 2)
  ------------------
  389|    158|    port->addressed_mode_w = ((wcaps & BIO_DGRAM_CAP_HANDLES_DST_ADDR) != 0);
  ------------------
  |  |  200|    158|# define BIO_DGRAM_CAP_HANDLES_DST_ADDR     (1U << 1)
  ------------------
  390|    158|    port->bio_changed = 1;
  391|    158|}
quic_port.c:port_rx_pre:
  687|    158|{
  688|    158|    int ret;
  689|       |
  690|       |    /*
  691|       |     * Originally, this check (don't RX before we have sent anything if we are
  692|       |     * not a server, because there can't be anything) was just intended as a
  693|       |     * minor optimisation. However, it is actually required on Windows, and
  694|       |     * removing this check will cause Windows to break.
  695|       |     *
  696|       |     * The reason is that under Win32, recvfrom() does not work on a UDP socket
  697|       |     * which has not had bind() called (???). However, calling sendto() will
  698|       |     * automatically bind an unbound UDP socket. Therefore, if we call a Winsock
  699|       |     * recv-type function before calling a Winsock send-type function, that call
  700|       |     * will fail with WSAEINVAL, which we will regard as a permanent network
  701|       |     * error.
  702|       |     *
  703|       |     * Therefore, this check is essential as we do not require our API users to
  704|       |     * bind a socket first when using the API in client mode.
  705|       |     */
  706|    158|    if (!port->allow_incoming && !port->have_sent_any_pkt)
  ------------------
  |  Branch (706:9): [True: 0, False: 158]
  |  Branch (706:34): [True: 0, False: 0]
  ------------------
  707|      0|        return;
  708|       |
  709|       |    /*
  710|       |     * Get DEMUX to BIO_recvmmsg from the network and queue incoming datagrams
  711|       |     * to the appropriate QRX instances.
  712|       |     */
  713|    158|    ret = ossl_quic_demux_pump(port->demux);
  714|    158|    if (ret == QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL)
  ------------------
  |  |  278|    158|#define QUIC_DEMUX_PUMP_RES_PERMANENT_FAIL  (-2)
  ------------------
  |  Branch (714:9): [True: 0, False: 158]
  ------------------
  715|       |        /*
  716|       |         * We don't care about transient failure, but permanent failure means we
  717|       |         * should tear down the port. All connections skip straight to the
  718|       |         * Terminated state as there is no point trying to send CONNECTION_CLOSE
  719|       |         * frames if the network BIO is not operating correctly.
  720|       |         */
  721|      0|        ossl_quic_port_raise_net_error(port, NULL);
  722|    158|}

ossl_quic_reactor_init:
   27|     79|{
   28|     79|    rtor->poll_r.type       = BIO_POLL_DESCRIPTOR_TYPE_NONE;
  ------------------
  |  |  412|     79|#define BIO_POLL_DESCRIPTOR_TYPE_NONE       0
  ------------------
   29|     79|    rtor->poll_w.type       = BIO_POLL_DESCRIPTOR_TYPE_NONE;
  ------------------
  |  |  412|     79|#define BIO_POLL_DESCRIPTOR_TYPE_NONE       0
  ------------------
   30|     79|    rtor->net_read_desired  = 0;
   31|     79|    rtor->net_write_desired = 0;
   32|     79|    rtor->can_poll_r        = 0;
   33|     79|    rtor->can_poll_w        = 0;
   34|     79|    rtor->tick_deadline     = initial_tick_deadline;
   35|       |
   36|     79|    rtor->tick_cb           = tick_cb;
   37|     79|    rtor->tick_cb_arg       = tick_cb_arg;
   38|     79|    rtor->mutex             = mutex;
   39|       |
   40|     79|    rtor->cur_blocking_waiters = 0;
   41|       |
   42|     79|    if ((flags & QUIC_REACTOR_FLAG_USE_NOTIFIER) != 0) {
  ------------------
  |  |  145|     79|#define QUIC_REACTOR_FLAG_USE_NOTIFIER      (1U << 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 79]
  ------------------
   43|      0|        if (!ossl_rio_notifier_init(&rtor->notifier))
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            return 0;
   45|       |
   46|      0|        if ((rtor->notifier_cv = ossl_crypto_condvar_new()) == NULL) {
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            ossl_rio_notifier_cleanup(&rtor->notifier);
   48|      0|            return 0;
   49|      0|        }
   50|       |
   51|      0|        rtor->have_notifier = 1;
   52|     79|    } else {
   53|     79|        rtor->have_notifier = 0;
   54|     79|    }
   55|       |
   56|     79|    return 1;
   57|     79|}
ossl_quic_reactor_cleanup:
   60|     79|{
   61|     79|    if (rtor == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 79]
  ------------------
   62|      0|        return;
   63|       |
   64|     79|    if (rtor->have_notifier) {
  ------------------
  |  Branch (64:9): [True: 0, False: 79]
  ------------------
   65|      0|        ossl_rio_notifier_cleanup(&rtor->notifier);
   66|      0|        rtor->have_notifier = 0;
   67|       |
   68|      0|        ossl_crypto_condvar_free(&rtor->notifier_cv);
   69|      0|    }
   70|     79|}
ossl_quic_reactor_set_poll_r:
   73|    158|{
   74|    158|    if (r == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 158]
  ------------------
   75|      0|        rtor->poll_r.type = BIO_POLL_DESCRIPTOR_TYPE_NONE;
  ------------------
  |  |  412|      0|#define BIO_POLL_DESCRIPTOR_TYPE_NONE       0
  ------------------
   76|    158|    else
   77|    158|        rtor->poll_r = *r;
   78|       |
   79|    158|    rtor->can_poll_r
   80|    158|        = ossl_quic_reactor_can_support_poll_descriptor(rtor, &rtor->poll_r);
   81|    158|}
ossl_quic_reactor_set_poll_w:
   84|    158|{
   85|    158|    if (w == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 158]
  ------------------
   86|      0|        rtor->poll_w.type = BIO_POLL_DESCRIPTOR_TYPE_NONE;
  ------------------
  |  |  412|      0|#define BIO_POLL_DESCRIPTOR_TYPE_NONE       0
  ------------------
   87|    158|    else
   88|    158|        rtor->poll_w = *w;
   89|       |
   90|    158|    rtor->can_poll_w
   91|    158|        = ossl_quic_reactor_can_support_poll_descriptor(rtor, &rtor->poll_w);
   92|    158|}
ossl_quic_reactor_can_support_poll_descriptor:
  106|    316|{
  107|    316|    return d->type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD;
  ------------------
  |  |  413|    316|#define BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD    1
  ------------------
  108|    316|}
ossl_quic_reactor_can_poll_r:
  111|     79|{
  112|     79|    return rtor->can_poll_r;
  113|     79|}
ossl_quic_reactor_can_poll_w:
  116|     79|{
  117|     79|    return rtor->can_poll_w;
  118|     79|}
ossl_quic_reactor_tick:
  136|    158|{
  137|    158|    QUIC_TICK_RESULT res = {0};
  138|       |
  139|       |    /*
  140|       |     * Note that the tick callback cannot fail; this is intentional. Arguably it
  141|       |     * does not make that much sense for ticking to 'fail' (in the sense of an
  142|       |     * explicit error indicated to the user) because ticking is by its nature
  143|       |     * best effort. If something fatal happens with a connection we can report
  144|       |     * it on the next actual application I/O call.
  145|       |     */
  146|    158|    rtor->tick_cb(&res, rtor->tick_cb_arg, flags);
  147|       |
  148|    158|    rtor->net_read_desired  = res.net_read_desired;
  149|    158|    rtor->net_write_desired = res.net_write_desired;
  150|    158|    rtor->tick_deadline     = res.tick_deadline;
  151|    158|    if (res.notify_other_threads)
  ------------------
  |  Branch (151:9): [True: 0, False: 158]
  ------------------
  152|      0|        rtor_notify_other_threads(rtor);
  153|       |
  154|    158|    return 1;
  155|    158|}

ossl_quic_srtm_new:
  111|     79|{
  112|     79|    QUIC_SRTM *srtm = NULL;
  113|     79|    unsigned char key[16];
  114|     79|    EVP_CIPHER *ecb = NULL;
  115|       |
  116|     79|    if (RAND_priv_bytes_ex(libctx, key, sizeof(key), sizeof(key) * 8) != 1)
  ------------------
  |  Branch (116:9): [True: 0, False: 79]
  ------------------
  117|      0|        goto err;
  118|       |
  119|     79|    if ((srtm = OPENSSL_zalloc(sizeof(*srtm))) == NULL)
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 79]
  ------------------
  120|      0|        return NULL;
  121|       |
  122|       |    /* Use AES-128-ECB as a permutation over 128-bit SRTs. */
  123|     79|    if ((ecb = EVP_CIPHER_fetch(libctx, "AES-128-ECB", propq)) == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 79]
  ------------------
  124|      0|        goto err;
  125|       |
  126|     79|    if ((srtm->blind_ctx = EVP_CIPHER_CTX_new()) == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 79]
  ------------------
  127|      0|        goto err;
  128|       |
  129|     79|    if (!EVP_EncryptInit_ex2(srtm->blind_ctx, ecb, key, NULL, NULL))
  ------------------
  |  Branch (129:9): [True: 0, False: 79]
  ------------------
  130|      0|        goto err;
  131|       |
  132|     79|    EVP_CIPHER_free(ecb);
  133|     79|    ecb = NULL;
  134|       |
  135|       |    /* Create mappings. */
  136|     79|    if ((srtm->items_fwd = lh_SRTM_ITEM_new(items_fwd_hash, items_fwd_cmp)) == NULL
  ------------------
  |  Branch (136:9): [True: 0, False: 79]
  ------------------
  137|     79|        || (srtm->items_rev = lh_SRTM_ITEM_new(items_rev_hash, items_rev_cmp)) == NULL)
  ------------------
  |  Branch (137:12): [True: 0, False: 79]
  ------------------
  138|      0|        goto err;
  139|       |
  140|     79|    return srtm;
  141|       |
  142|      0|err:
  143|       |    /*
  144|       |     * No cleansing of key needed as blinding exists only for side channel
  145|       |     * mitigation.
  146|       |     */
  147|      0|    ossl_quic_srtm_free(srtm);
  148|      0|    EVP_CIPHER_free(ecb);
  149|      0|    return NULL;
  150|     79|}
ossl_quic_srtm_free:
  165|     79|{
  166|     79|    if (srtm == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 79]
  ------------------
  167|      0|        return;
  168|       |
  169|     79|    lh_SRTM_ITEM_free(srtm->items_rev);
  170|     79|    if (srtm->items_fwd != NULL) {
  ------------------
  |  Branch (170:9): [True: 79, False: 0]
  ------------------
  171|     79|        lh_SRTM_ITEM_doall(srtm->items_fwd, srtm_free_each);
  172|     79|        lh_SRTM_ITEM_free(srtm->items_fwd);
  173|     79|    }
  174|       |
  175|     79|    EVP_CIPHER_CTX_free(srtm->blind_ctx);
  176|     79|    OPENSSL_free(srtm);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|     79|}

ssl_sort_cipher_list:
 3308|      2|{
 3309|      2|    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  ------------------
  |  |   26|      2|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3310|      2|          cipher_compare);
 3311|      2|    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  ------------------
  |  |   27|      2|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3312|      2|          cipher_compare);
 3313|      2|    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  ------------------
  |  |   28|      2|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3314|      2|}
ssl3_ctx_ctrl:
 3939|     79|{
 3940|     79|    switch (cmd) {
 3941|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 3942|      0|    case SSL_CTRL_SET_TMP_DH:
  ------------------
  |  | 1267|      0|#  define SSL_CTRL_SET_TMP_DH                    3
  ------------------
  |  Branch (3942:5): [True: 0, False: 79]
  ------------------
 3943|      0|        {
 3944|      0|            EVP_PKEY *pkdh = NULL;
 3945|      0|            if (parg == NULL) {
  ------------------
  |  Branch (3945:17): [True: 0, False: 0]
  ------------------
 3946|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3947|      0|                return 0;
 3948|      0|            }
 3949|      0|            pkdh = ssl_dh_to_pkey(parg);
 3950|      0|            if (pkdh == NULL) {
  ------------------
  |  Branch (3950:17): [True: 0, False: 0]
  ------------------
 3951|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_DH_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3952|      0|                return 0;
 3953|      0|            }
 3954|      0|            if (!SSL_CTX_set0_tmp_dh_pkey(ctx, pkdh)) {
  ------------------
  |  Branch (3954:17): [True: 0, False: 0]
  ------------------
 3955|      0|                EVP_PKEY_free(pkdh);
 3956|      0|                return 0;
 3957|      0|            }
 3958|      0|            return 1;
 3959|      0|        }
 3960|      0|    case SSL_CTRL_SET_TMP_DH_CB:
  ------------------
  |  | 1269|      0|#  define SSL_CTRL_SET_TMP_DH_CB                 6
  ------------------
  |  Branch (3960:5): [True: 0, False: 79]
  ------------------
 3961|      0|        {
 3962|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3963|      0|            return 0;
 3964|      0|        }
 3965|      0|#endif
 3966|      0|    case SSL_CTRL_SET_DH_AUTO:
  ------------------
  |  | 1366|      0|# define SSL_CTRL_SET_DH_AUTO                    118
  ------------------
  |  Branch (3966:5): [True: 0, False: 79]
  ------------------
 3967|      0|        ctx->cert->dh_tmp_auto = larg;
 3968|      0|        return 1;
 3969|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 3970|      0|    case SSL_CTRL_SET_TMP_ECDH:
  ------------------
  |  | 1268|      0|#  define SSL_CTRL_SET_TMP_ECDH                  4
  ------------------
  |  Branch (3970:5): [True: 0, False: 79]
  ------------------
 3971|      0|        {
 3972|      0|            if (parg == NULL) {
  ------------------
  |  Branch (3972:17): [True: 0, False: 0]
  ------------------
 3973|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3974|      0|                return 0;
 3975|      0|            }
 3976|      0|            return ssl_set_tmp_ecdh_groups(&ctx->ext.supportedgroups,
 3977|      0|                                           &ctx->ext.supportedgroups_len,
 3978|      0|                                           &ctx->ext.keyshares,
 3979|      0|                                           &ctx->ext.keyshares_len,
 3980|      0|                                           &ctx->ext.tuples,
 3981|      0|                                           &ctx->ext.tuples_len,
 3982|      0|                                           parg);
 3983|      0|        }
 3984|      0|#endif                          /* !OPENSSL_NO_DEPRECATED_3_0 */
 3985|      0|    case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
  ------------------
  |  | 1307|      0|# define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG      54
  ------------------
  |  Branch (3985:5): [True: 0, False: 79]
  ------------------
 3986|      0|        ctx->ext.servername_arg = parg;
 3987|      0|        break;
 3988|      0|    case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
  ------------------
  |  | 1312|      0|# define SSL_CTRL_SET_TLSEXT_TICKET_KEYS         59
  ------------------
  |  Branch (3988:5): [True: 0, False: 79]
  ------------------
 3989|      0|    case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
  ------------------
  |  | 1311|      0|# define SSL_CTRL_GET_TLSEXT_TICKET_KEYS         58
  ------------------
  |  Branch (3989:5): [True: 0, False: 79]
  ------------------
 3990|      0|        {
 3991|      0|            unsigned char *keys = parg;
 3992|      0|            long tick_keylen = (sizeof(ctx->ext.tick_key_name) +
 3993|      0|                                sizeof(ctx->ext.secure->tick_hmac_key) +
 3994|      0|                                sizeof(ctx->ext.secure->tick_aes_key));
 3995|      0|            if (keys == NULL)
  ------------------
  |  Branch (3995:17): [True: 0, False: 0]
  ------------------
 3996|      0|                return tick_keylen;
 3997|      0|            if (larg != tick_keylen) {
  ------------------
  |  Branch (3997:17): [True: 0, False: 0]
  ------------------
 3998|      0|                ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3999|      0|                return 0;
 4000|      0|            }
 4001|      0|            if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
  ------------------
  |  | 1312|      0|# define SSL_CTRL_SET_TLSEXT_TICKET_KEYS         59
  ------------------
  |  Branch (4001:17): [True: 0, False: 0]
  ------------------
 4002|      0|                memcpy(ctx->ext.tick_key_name, keys,
 4003|      0|                       sizeof(ctx->ext.tick_key_name));
 4004|      0|                memcpy(ctx->ext.secure->tick_hmac_key,
 4005|      0|                       keys + sizeof(ctx->ext.tick_key_name),
 4006|      0|                       sizeof(ctx->ext.secure->tick_hmac_key));
 4007|      0|                memcpy(ctx->ext.secure->tick_aes_key,
 4008|      0|                       keys + sizeof(ctx->ext.tick_key_name) +
 4009|      0|                       sizeof(ctx->ext.secure->tick_hmac_key),
 4010|      0|                       sizeof(ctx->ext.secure->tick_aes_key));
 4011|      0|            } else {
 4012|      0|                memcpy(keys, ctx->ext.tick_key_name,
 4013|      0|                       sizeof(ctx->ext.tick_key_name));
 4014|      0|                memcpy(keys + sizeof(ctx->ext.tick_key_name),
 4015|      0|                       ctx->ext.secure->tick_hmac_key,
 4016|      0|                       sizeof(ctx->ext.secure->tick_hmac_key));
 4017|      0|                memcpy(keys + sizeof(ctx->ext.tick_key_name) +
 4018|      0|                       sizeof(ctx->ext.secure->tick_hmac_key),
 4019|      0|                       ctx->ext.secure->tick_aes_key,
 4020|      0|                       sizeof(ctx->ext.secure->tick_aes_key));
 4021|      0|            }
 4022|      0|            return 1;
 4023|      0|        }
 4024|       |
 4025|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1374|      0|# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE     127
  ------------------
  |  Branch (4025:5): [True: 0, False: 79]
  ------------------
 4026|      0|        return ctx->ext.status_type;
 4027|       |
 4028|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1318|      0|# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE     65
  ------------------
  |  Branch (4028:5): [True: 0, False: 79]
  ------------------
 4029|      0|        ctx->ext.status_type = larg;
 4030|      0|        break;
 4031|       |
 4032|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
  ------------------
  |  | 1317|      0|# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG   64
  ------------------
  |  Branch (4032:5): [True: 0, False: 79]
  ------------------
 4033|      0|        ctx->ext.status_arg = parg;
 4034|      0|        return 1;
 4035|       |
 4036|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
  ------------------
  |  | 1376|      0|# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG   129
  ------------------
  |  Branch (4036:5): [True: 0, False: 79]
  ------------------
 4037|      0|        *(void**)parg = ctx->ext.status_arg;
 4038|      0|        break;
 4039|       |
 4040|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
  ------------------
  |  | 1375|      0|# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB       128
  ------------------
  |  Branch (4040:5): [True: 0, False: 79]
  ------------------
 4041|      0|        *(int (**)(SSL*, void*))parg = ctx->ext.status_cb;
 4042|      0|        break;
 4043|       |
 4044|      0|#ifndef OPENSSL_NO_SRP
 4045|      0|    case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
  ------------------
  |  | 1332|      0|# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME               79
  ------------------
  |  Branch (4045:5): [True: 0, False: 79]
  ------------------
 4046|      0|        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  ------------------
  |  |   91|      0|# define SSL_kSRP                0x00000020U
  ------------------
 4047|      0|        OPENSSL_free(ctx->srp_ctx.login);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4048|      0|        ctx->srp_ctx.login = NULL;
 4049|      0|        if (parg == NULL)
  ------------------
  |  Branch (4049:13): [True: 0, False: 0]
  ------------------
 4050|      0|            break;
 4051|      0|        if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
  ------------------
  |  Branch (4051:13): [True: 0, False: 0]
  |  Branch (4051:49): [True: 0, False: 0]
  ------------------
 4052|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4053|      0|            return 0;
 4054|      0|        }
 4055|      0|        if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4055:13): [True: 0, False: 0]
  ------------------
 4056|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4057|      0|            return 0;
 4058|      0|        }
 4059|      0|        break;
 4060|      0|    case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
  ------------------
  |  | 1334|      0|# define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD               81
  ------------------
  |  Branch (4060:5): [True: 0, False: 79]
  ------------------
 4061|      0|        ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
 4062|      0|            srp_password_from_info_cb;
 4063|      0|        if (ctx->srp_ctx.info != NULL)
  ------------------
  |  Branch (4063:13): [True: 0, False: 0]
  ------------------
 4064|      0|            OPENSSL_free(ctx->srp_ctx.info);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4065|      0|        if ((ctx->srp_ctx.info = OPENSSL_strdup((char *)parg)) == NULL) {
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4065:13): [True: 0, False: 0]
  ------------------
 4066|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4067|      0|            return 0;
 4068|      0|        }
 4069|      0|        break;
 4070|      0|    case SSL_CTRL_SET_SRP_ARG:
  ------------------
  |  | 1331|      0|# define SSL_CTRL_SET_SRP_ARG            78
  ------------------
  |  Branch (4070:5): [True: 0, False: 79]
  ------------------
 4071|      0|        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  ------------------
  |  |   91|      0|# define SSL_kSRP                0x00000020U
  ------------------
 4072|      0|        ctx->srp_ctx.SRP_cb_arg = parg;
 4073|      0|        break;
 4074|       |
 4075|      0|    case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
  ------------------
  |  | 1333|      0|# define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH               80
  ------------------
  |  Branch (4075:5): [True: 0, False: 79]
  ------------------
 4076|      0|        ctx->srp_ctx.strength = larg;
 4077|      0|        break;
 4078|      0|#endif
 4079|       |
 4080|      0|    case SSL_CTRL_SET_GROUPS:
  ------------------
  |  | 1345|      0|# define SSL_CTRL_SET_GROUPS                     91
  ------------------
  |  Branch (4080:5): [True: 0, False: 79]
  ------------------
 4081|      0|        return tls1_set_groups(&ctx->ext.supportedgroups,
 4082|      0|                               &ctx->ext.supportedgroups_len,
 4083|      0|                               &ctx->ext.keyshares,
 4084|      0|                               &ctx->ext.keyshares_len,
 4085|      0|                               &ctx->ext.tuples,
 4086|      0|                               &ctx->ext.tuples_len,
 4087|      0|                               parg, larg);
 4088|       |
 4089|     79|    case SSL_CTRL_SET_GROUPS_LIST:
  ------------------
  |  | 1346|     79|# define SSL_CTRL_SET_GROUPS_LIST                92
  ------------------
  |  Branch (4089:5): [True: 79, False: 0]
  ------------------
 4090|     79|        return tls1_set_groups_list(ctx,
 4091|     79|                                    &ctx->ext.supportedgroups,
 4092|     79|                                    &ctx->ext.supportedgroups_len,
 4093|     79|                                    &ctx->ext.keyshares,
 4094|     79|                                    &ctx->ext.keyshares_len,
 4095|     79|                                    &ctx->ext.tuples,
 4096|     79|                                    &ctx->ext.tuples_len,
 4097|     79|                                    parg);
 4098|       |
 4099|      0|    case SSL_CTRL_GET0_IMPLEMENTED_GROUPS:
  ------------------
  |  | 1386|      0|# define SSL_CTRL_GET0_IMPLEMENTED_GROUPS        139
  ------------------
  |  Branch (4099:5): [True: 0, False: 79]
  ------------------
 4100|      0|        return tls1_get0_implemented_groups(ctx->min_proto_version,
 4101|      0|                                            ctx->max_proto_version,
 4102|      0|                                            ctx->group_list,
 4103|      0|                                            ctx->group_list_len, larg, parg);
 4104|       |
 4105|      0|    case SSL_CTRL_SET_SIGALGS:
  ------------------
  |  | 1348|      0|# define SSL_CTRL_SET_SIGALGS                    97
  ------------------
  |  Branch (4105:5): [True: 0, False: 79]
  ------------------
 4106|      0|        return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
 4107|       |
 4108|      0|    case SSL_CTRL_SET_SIGALGS_LIST:
  ------------------
  |  | 1349|      0|# define SSL_CTRL_SET_SIGALGS_LIST               98
  ------------------
  |  Branch (4108:5): [True: 0, False: 79]
  ------------------
 4109|      0|        return tls1_set_sigalgs_list(ctx, ctx->cert, parg, 0);
 4110|       |
 4111|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS:
  ------------------
  |  | 1352|      0|# define SSL_CTRL_SET_CLIENT_SIGALGS             101
  ------------------
  |  Branch (4111:5): [True: 0, False: 79]
  ------------------
 4112|      0|        return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
 4113|       |
 4114|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  ------------------
  |  | 1353|      0|# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST        102
  ------------------
  |  Branch (4114:5): [True: 0, False: 79]
  ------------------
 4115|      0|        return tls1_set_sigalgs_list(ctx, ctx->cert, parg, 1);
 4116|       |
 4117|      0|    case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  ------------------
  |  | 1355|      0|# define SSL_CTRL_SET_CLIENT_CERT_TYPES          104
  ------------------
  |  Branch (4117:5): [True: 0, False: 79]
  ------------------
 4118|      0|        return ssl3_set_req_cert_type(ctx->cert, parg, larg);
 4119|       |
 4120|      0|    case SSL_CTRL_BUILD_CERT_CHAIN:
  ------------------
  |  | 1356|      0|# define SSL_CTRL_BUILD_CERT_CHAIN               105
  ------------------
  |  Branch (4120:5): [True: 0, False: 79]
  ------------------
 4121|      0|        return ssl_build_cert_chain(NULL, ctx, larg);
 4122|       |
 4123|      0|    case SSL_CTRL_SET_VERIFY_CERT_STORE:
  ------------------
  |  | 1357|      0|# define SSL_CTRL_SET_VERIFY_CERT_STORE          106
  ------------------
  |  Branch (4123:5): [True: 0, False: 79]
  ------------------
 4124|      0|        return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
 4125|       |
 4126|      0|    case SSL_CTRL_SET_CHAIN_CERT_STORE:
  ------------------
  |  | 1358|      0|# define SSL_CTRL_SET_CHAIN_CERT_STORE           107
  ------------------
  |  Branch (4126:5): [True: 0, False: 79]
  ------------------
 4127|      0|        return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
 4128|       |
 4129|      0|    case SSL_CTRL_GET_VERIFY_CERT_STORE:
  ------------------
  |  | 1384|      0|# define SSL_CTRL_GET_VERIFY_CERT_STORE          137
  ------------------
  |  Branch (4129:5): [True: 0, False: 79]
  ------------------
 4130|      0|        return ssl_cert_get_cert_store(ctx->cert, parg, 0);
 4131|       |
 4132|      0|    case SSL_CTRL_GET_CHAIN_CERT_STORE:
  ------------------
  |  | 1385|      0|# define SSL_CTRL_GET_CHAIN_CERT_STORE           138
  ------------------
  |  Branch (4132:5): [True: 0, False: 79]
  ------------------
 4133|      0|        return ssl_cert_get_cert_store(ctx->cert, parg, 1);
 4134|       |
 4135|       |        /* A Thawte special :-) */
 4136|      0|    case SSL_CTRL_EXTRA_CHAIN_CERT:
  ------------------
  |  | 1277|      0|# define SSL_CTRL_EXTRA_CHAIN_CERT               14
  ------------------
  |  Branch (4136:5): [True: 0, False: 79]
  ------------------
 4137|      0|        if (ctx->extra_certs == NULL) {
  ------------------
  |  Branch (4137:13): [True: 0, False: 0]
  ------------------
 4138|      0|            if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
  ------------------
  |  |   82|      0|#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4138:17): [True: 0, False: 0]
  ------------------
 4139|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4140|      0|                return 0;
 4141|      0|            }
 4142|      0|        }
 4143|      0|        if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
  ------------------
  |  |   89|      0|#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
  ------------------
  |  Branch (4143:13): [True: 0, False: 0]
  ------------------
 4144|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4145|      0|            return 0;
 4146|      0|        }
 4147|      0|        break;
 4148|       |
 4149|      0|    case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
  ------------------
  |  | 1340|      0|# define SSL_CTRL_GET_EXTRA_CHAIN_CERTS          82
  ------------------
  |  Branch (4149:5): [True: 0, False: 79]
  ------------------
 4150|      0|        if (ctx->extra_certs == NULL && larg == 0)
  ------------------
  |  Branch (4150:13): [True: 0, False: 0]
  |  Branch (4150:41): [True: 0, False: 0]
  ------------------
 4151|      0|            *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
 4152|      0|        else
 4153|      0|            *(STACK_OF(X509) **)parg = ctx->extra_certs;
 4154|      0|        break;
 4155|       |
 4156|      0|    case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
  ------------------
  |  | 1341|      0|# define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS        83
  ------------------
  |  Branch (4156:5): [True: 0, False: 79]
  ------------------
 4157|      0|        OSSL_STACK_OF_X509_free(ctx->extra_certs);
 4158|      0|        ctx->extra_certs = NULL;
 4159|      0|        break;
 4160|       |
 4161|      0|    case SSL_CTRL_CHAIN:
  ------------------
  |  | 1342|      0|# define SSL_CTRL_CHAIN                          88
  ------------------
  |  Branch (4161:5): [True: 0, False: 79]
  ------------------
 4162|      0|        if (larg)
  ------------------
  |  Branch (4162:13): [True: 0, False: 0]
  ------------------
 4163|      0|            return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
 4164|      0|        else
 4165|      0|            return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
 4166|       |
 4167|      0|    case SSL_CTRL_CHAIN_CERT:
  ------------------
  |  | 1343|      0|# define SSL_CTRL_CHAIN_CERT                     89
  ------------------
  |  Branch (4167:5): [True: 0, False: 79]
  ------------------
 4168|      0|        if (larg)
  ------------------
  |  Branch (4168:13): [True: 0, False: 0]
  ------------------
 4169|      0|            return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
 4170|      0|        else
 4171|      0|            return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
 4172|       |
 4173|      0|    case SSL_CTRL_GET_CHAIN_CERTS:
  ------------------
  |  | 1363|      0|# define SSL_CTRL_GET_CHAIN_CERTS                115
  ------------------
  |  Branch (4173:5): [True: 0, False: 79]
  ------------------
 4174|      0|        *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
 4175|      0|        break;
 4176|       |
 4177|      0|    case SSL_CTRL_SELECT_CURRENT_CERT:
  ------------------
  |  | 1364|      0|# define SSL_CTRL_SELECT_CURRENT_CERT            116
  ------------------
  |  Branch (4177:5): [True: 0, False: 79]
  ------------------
 4178|      0|        return ssl_cert_select_current(ctx->cert, (X509 *)parg);
 4179|       |
 4180|      0|    case SSL_CTRL_SET_CURRENT_CERT:
  ------------------
  |  | 1365|      0|# define SSL_CTRL_SET_CURRENT_CERT               117
  ------------------
  |  Branch (4180:5): [True: 0, False: 79]
  ------------------
 4181|      0|        return ssl_cert_set_current(ctx->cert, larg);
 4182|       |
 4183|      0|    default:
  ------------------
  |  Branch (4183:5): [True: 0, False: 79]
  ------------------
 4184|      0|        return 0;
 4185|     79|    }
 4186|      0|    return 1;
 4187|     79|}
ssl3_get_cipher_by_std_name:
 4267|    237|{
 4268|    237|    SSL_CIPHER *tbl;
 4269|    237|    SSL_CIPHER *alltabs[] = {tls13_ciphers, ssl3_ciphers, ssl3_scsvs};
 4270|    237|    size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS,
  ------------------
  |  |   26|    237|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|    237|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
                  size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS,
  ------------------
  |  |   27|    237|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|    237|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4271|    237|                              SSL3_NUM_SCSVS};
  ------------------
  |  |   28|    237|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|    237|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4272|       |
 4273|       |    /* this is not efficient, necessary to optimize this? */
 4274|    237|    for (j = 0; j < OSSL_NELEM(alltabs); j++) {
  ------------------
  |  |   14|    237|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (4274:17): [True: 237, False: 0]
  ------------------
 4275|    474|        for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
  ------------------
  |  Branch (4275:39): [True: 474, False: 0]
  ------------------
 4276|    474|            if (tbl->stdname == NULL)
  ------------------
  |  Branch (4276:17): [True: 0, False: 474]
  ------------------
 4277|      0|                continue;
 4278|    474|            if (strcmp(stdname, tbl->stdname) == 0) {
  ------------------
  |  Branch (4278:17): [True: 237, False: 237]
  ------------------
 4279|    237|                return tbl;
 4280|    237|            }
 4281|    474|        }
 4282|    237|    }
 4283|      0|    return NULL;
 4284|    237|}
s3_lib.c:cipher_compare:
 3298|  1.94k|{
 3299|  1.94k|    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
 3300|  1.94k|    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
 3301|       |
 3302|  1.94k|    if (ap->id == bp->id)
  ------------------
  |  Branch (3302:9): [True: 0, False: 1.94k]
  ------------------
 3303|      0|        return 0;
 3304|  1.94k|    return ap->id < bp->id ? -1 : 1;
  ------------------
  |  Branch (3304:12): [True: 1.25k, False: 694]
  ------------------
 3305|  1.94k|}

SSL_get_ex_data_X509_STORE_CTX_idx:
   57|     81|{
   58|       |
   59|     81|    if (!RUN_ONCE(&ssl_x509_store_ctx_once, ssl_x509_store_ctx_init))
  ------------------
  |  |  130|     81|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 81, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (59:9): [True: 0, False: 81]
  ------------------
   60|      0|        return -1;
   61|     81|    return ssl_x509_store_ctx_idx;
   62|     81|}
ssl_cert_new:
   65|     79|{
   66|     79|    CERT *ret = NULL;
   67|       |
   68|       |    /* Should never happen */
   69|     79|    if (!ossl_assert(ssl_pkey_num >= SSL_PKEY_NUM))
  ------------------
  |  |   52|     79|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     79|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (69:9): [True: 0, False: 79]
  ------------------
   70|      0|        return NULL;
   71|       |
   72|     79|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|     79|    if (ret == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 79]
  ------------------
   74|      0|        return NULL;
   75|       |
   76|     79|    ret->ssl_pkey_num = ssl_pkey_num;
   77|     79|    ret->pkeys = OPENSSL_zalloc(ret->ssl_pkey_num * sizeof(CERT_PKEY));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|     79|    if (ret->pkeys == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 79]
  ------------------
   79|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|       |
   83|     79|    ret->key = &(ret->pkeys[SSL_PKEY_RSA]);
  ------------------
  |  |  320|     79|# define SSL_PKEY_RSA            0
  ------------------
   84|     79|    ret->sec_cb = ssl_security_default_callback;
   85|     79|    ret->sec_level = OPENSSL_TLS_SECURITY_LEVEL;
  ------------------
  |  |   31|     79|#  define OPENSSL_TLS_SECURITY_LEVEL 2
  ------------------
   86|     79|    ret->sec_ex = NULL;
   87|     79|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 79]
  ------------------
   88|      0|        OPENSSL_free(ret->pkeys);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      0|        return NULL;
   91|      0|    }
   92|       |
   93|     79|    return ret;
   94|     79|}
ssl_cert_clear_certs:
  242|     79|{
  243|     79|    size_t i;
  244|       |#ifndef OPENSSL_NO_COMP_ALG
  245|       |    int j;
  246|       |#endif
  247|       |
  248|     79|    if (c == NULL)
  ------------------
  |  Branch (248:9): [True: 0, False: 79]
  ------------------
  249|      0|        return;
  250|  1.02k|    for (i = 0; i < c->ssl_pkey_num; i++) {
  ------------------
  |  Branch (250:17): [True: 948, False: 79]
  ------------------
  251|    948|        CERT_PKEY *cpk = c->pkeys + i;
  252|    948|        X509_free(cpk->x509);
  253|    948|        cpk->x509 = NULL;
  254|    948|        EVP_PKEY_free(cpk->privatekey);
  255|    948|        cpk->privatekey = NULL;
  256|    948|        OSSL_STACK_OF_X509_free(cpk->chain);
  257|    948|        cpk->chain = NULL;
  258|    948|        OPENSSL_free(cpk->serverinfo);
  ------------------
  |  |  115|    948|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    948|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    948|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|    948|        cpk->serverinfo = NULL;
  260|    948|        cpk->serverinfo_length = 0;
  261|       |#ifndef OPENSSL_NO_COMP_ALG
  262|       |        for (j = 0; j < TLSEXT_comp_cert_limit; j++) {
  263|       |            OSSL_COMP_CERT_free(cpk->comp_cert[j]);
  264|       |            cpk->comp_cert[j] = NULL;
  265|       |            cpk->cert_comp_used = 0;
  266|       |        }
  267|       |#endif
  268|    948|    }
  269|     79|}
ssl_cert_free:
  272|     79|{
  273|     79|    int i;
  274|       |
  275|     79|    if (c == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 79]
  ------------------
  276|      0|        return;
  277|     79|    CRYPTO_DOWN_REF(&c->references, &i);
  278|     79|    REF_PRINT_COUNT("CERT", i, c);
  ------------------
  |  |  301|     79|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     79|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     79|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     79|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|     79|    if (i > 0)
  ------------------
  |  Branch (279:9): [True: 0, False: 79]
  ------------------
  280|      0|        return;
  281|     79|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
  282|       |
  283|     79|    EVP_PKEY_free(c->dh_tmp);
  284|       |
  285|     79|    ssl_cert_clear_certs(c);
  286|     79|    OPENSSL_free(c->conf_sigalgs);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  287|     79|    OPENSSL_free(c->client_sigalgs);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  288|     79|    OPENSSL_free(c->ctype);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  289|     79|    X509_STORE_free(c->verify_store);
  290|     79|    X509_STORE_free(c->chain_store);
  291|     79|    custom_exts_free(&c->custext);
  292|     79|#ifndef OPENSSL_NO_PSK
  293|     79|    OPENSSL_free(c->psk_identity_hint);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  294|     79|#endif
  295|     79|    OPENSSL_free(c->pkeys);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|     79|    CRYPTO_FREE_REF(&c->references);
  297|     79|    OPENSSL_free(c);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  298|     79|}
ssl_cert.c:ssl_x509_store_ctx_init:
   49|      2|{
   50|      2|    ssl_x509_store_ctx_idx = X509_STORE_CTX_get_ex_new_index(0,
  ------------------
  |  |  757|      2|    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
  |  |  ------------------
  |  |  |  |  234|      2|# define CRYPTO_EX_INDEX_X509_STORE_CTX   5
  |  |  ------------------
  ------------------
   51|      2|                                                             "SSL for verify callback",
   52|      2|                                                             NULL, NULL, NULL);
   53|      2|    return ssl_x509_store_ctx_idx >= 0;
   54|      2|}

ssl_load_ciphers:
  315|     79|{
  316|     79|    size_t i;
  317|     79|    const ssl_cipher_table *t;
  318|     79|    EVP_KEYEXCH *kex = NULL;
  319|     79|    EVP_SIGNATURE *sig = NULL;
  320|       |
  321|     79|    ctx->disabled_enc_mask = 0;
  322|  1.97k|    for (i = 0, t = ssl_cipher_table_cipher; i < SSL_ENC_NUM_IDX; i++, t++) {
  ------------------
  |  |  355|  1.97k|# define SSL_ENC_NUM_IDX         24
  ------------------
  |  Branch (322:46): [True: 1.89k, False: 79]
  ------------------
  323|  1.89k|        if (t->nid != NID_undef) {
  ------------------
  |  |   18|  1.89k|#define NID_undef                       0
  ------------------
  |  Branch (323:13): [True: 1.81k, False: 79]
  ------------------
  324|  1.81k|            const EVP_CIPHER *cipher
  325|  1.81k|                = ssl_evp_cipher_fetch(ctx->libctx, t->nid, ctx->propq);
  326|       |
  327|  1.81k|            ctx->ssl_cipher_methods[i] = cipher;
  328|  1.81k|            if (cipher == NULL)
  ------------------
  |  Branch (328:17): [True: 711, False: 1.10k]
  ------------------
  329|    711|                ctx->disabled_enc_mask |= t->mask;
  330|  1.81k|        }
  331|  1.89k|    }
  332|     79|    ctx->disabled_mac_mask = 0;
  333|  1.18k|    for (i = 0, t = ssl_cipher_table_mac; i < SSL_MD_NUM_IDX; i++, t++) {
  ------------------
  |  |  203|  1.18k|#define SSL_MD_NUM_IDX  SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  1.18k|# define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (333:43): [True: 1.10k, False: 79]
  ------------------
  334|  1.10k|        const EVP_MD *md
  335|  1.10k|            = ssl_evp_md_fetch(ctx->libctx, t->nid, ctx->propq);
  336|       |
  337|  1.10k|        ctx->ssl_digest_methods[i] = md;
  338|  1.10k|        if (md == NULL) {
  ------------------
  |  Branch (338:13): [True: 553, False: 553]
  ------------------
  339|    553|            ctx->disabled_mac_mask |= t->mask;
  340|    553|        } else {
  341|    553|            int tmpsize = EVP_MD_get_size(md);
  342|       |
  343|    553|            if (!ossl_assert(tmpsize > 0))
  ------------------
  |  |   52|    553|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    553|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (343:17): [True: 0, False: 553]
  ------------------
  344|      0|                return 0;
  345|    553|            ctx->ssl_mac_secret_size[i] = tmpsize;
  346|    553|        }
  347|  1.10k|    }
  348|       |
  349|     79|    ctx->disabled_mkey_mask = 0;
  350|     79|    ctx->disabled_auth_mask = 0;
  351|       |
  352|       |    /*
  353|       |     * We ignore any errors from the fetches below. They are expected to fail
  354|       |     * if these algorithms are not available.
  355|       |     */
  356|     79|    ERR_set_mark();
  357|     79|    sig = EVP_SIGNATURE_fetch(ctx->libctx, "DSA", ctx->propq);
  358|     79|    if (sig == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 79]
  ------------------
  359|      0|        ctx->disabled_auth_mask |= SSL_aDSS;
  ------------------
  |  |  110|      0|# define SSL_aDSS                0x00000002U
  ------------------
  360|     79|    else
  361|     79|        EVP_SIGNATURE_free(sig);
  362|     79|    kex = EVP_KEYEXCH_fetch(ctx->libctx, "DH", ctx->propq);
  363|     79|    if (kex == NULL)
  ------------------
  |  Branch (363:9): [True: 0, False: 79]
  ------------------
  364|      0|        ctx->disabled_mkey_mask |= SSL_kDHE | SSL_kDHEPSK;
  ------------------
  |  |   83|      0|# define SSL_kDHE                0x00000002U
  ------------------
                      ctx->disabled_mkey_mask |= SSL_kDHE | SSL_kDHEPSK;
  ------------------
  |  |   95|      0|# define SSL_kDHEPSK             0x00000100U
  ------------------
  365|     79|    else
  366|     79|        EVP_KEYEXCH_free(kex);
  367|     79|    kex = EVP_KEYEXCH_fetch(ctx->libctx, "ECDH", ctx->propq);
  368|     79|    if (kex == NULL)
  ------------------
  |  Branch (368:9): [True: 0, False: 79]
  ------------------
  369|      0|        ctx->disabled_mkey_mask |= SSL_kECDHE | SSL_kECDHEPSK;
  ------------------
  |  |   85|      0|# define SSL_kECDHE              0x00000004U
  ------------------
                      ctx->disabled_mkey_mask |= SSL_kECDHE | SSL_kECDHEPSK;
  ------------------
  |  |   94|      0|# define SSL_kECDHEPSK           0x00000080U
  ------------------
  370|     79|    else
  371|     79|        EVP_KEYEXCH_free(kex);
  372|     79|    sig = EVP_SIGNATURE_fetch(ctx->libctx, "ECDSA", ctx->propq);
  373|     79|    if (sig == NULL)
  ------------------
  |  Branch (373:9): [True: 0, False: 79]
  ------------------
  374|      0|        ctx->disabled_auth_mask |= SSL_aECDSA;
  ------------------
  |  |  114|      0|# define SSL_aECDSA              0x00000008U
  ------------------
  375|     79|    else
  376|     79|        EVP_SIGNATURE_free(sig);
  377|     79|    ERR_pop_to_mark();
  378|       |
  379|       |#ifdef OPENSSL_NO_PSK
  380|       |    ctx->disabled_mkey_mask |= SSL_PSK;
  381|       |    ctx->disabled_auth_mask |= SSL_aPSK;
  382|       |#endif
  383|       |#ifdef OPENSSL_NO_SRP
  384|       |    ctx->disabled_mkey_mask |= SSL_kSRP;
  385|       |#endif
  386|       |
  387|       |    /*
  388|       |     * Check for presence of GOST 34.10 algorithms, and if they are not
  389|       |     * present, disable appropriate auth and key exchange
  390|       |     */
  391|     79|    memcpy(ctx->ssl_mac_pkey_id, default_mac_pkey_id,
  392|     79|           sizeof(ctx->ssl_mac_pkey_id));
  393|       |
  394|     79|    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX] =
  ------------------
  |  |  190|     79|# define SSL_MD_GOST89MAC_IDX 3
  ------------------
  395|     79|        get_optional_pkey_id(SN_id_Gost28147_89_MAC);
  ------------------
  |  | 4584|     79|#define SN_id_Gost28147_89_MAC          "gost-mac"
  ------------------
  396|     79|    if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX])
  ------------------
  |  |  190|     79|# define SSL_MD_GOST89MAC_IDX 3
  ------------------
  |  Branch (396:9): [True: 0, False: 79]
  ------------------
  397|      0|        ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX] = 32;
  ------------------
  |  |  190|      0|# define SSL_MD_GOST89MAC_IDX 3
  ------------------
  398|     79|    else
  399|     79|        ctx->disabled_mac_mask |= SSL_GOST89MAC;
  ------------------
  |  |  171|     79|# define SSL_GOST89MAC   0x00000008U
  ------------------
  400|       |
  401|     79|    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX] =
  ------------------
  |  |  194|     79|# define SSL_MD_GOST89MAC12_IDX 7
  ------------------
  402|     79|        get_optional_pkey_id(SN_gost_mac_12);
  ------------------
  |  | 4589|     79|#define SN_gost_mac_12          "gost-mac-12"
  ------------------
  403|     79|    if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX])
  ------------------
  |  |  194|     79|# define SSL_MD_GOST89MAC12_IDX 7
  ------------------
  |  Branch (403:9): [True: 0, False: 79]
  ------------------
  404|      0|        ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC12_IDX] = 32;
  ------------------
  |  |  194|      0|# define SSL_MD_GOST89MAC12_IDX 7
  ------------------
  405|     79|    else
  406|     79|        ctx->disabled_mac_mask |= SSL_GOST89MAC12;
  ------------------
  |  |  177|     79|# define SSL_GOST89MAC12         0x00000100U
  ------------------
  407|       |
  408|     79|    ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX] =
  ------------------
  |  |  199|     79|# define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
  409|     79|        get_optional_pkey_id(SN_magma_mac);
  ------------------
  |  | 5048|     79|#define SN_magma_mac            "magma-mac"
  ------------------
  410|     79|    if (ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX])
  ------------------
  |  |  199|     79|# define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
  |  Branch (410:9): [True: 0, False: 79]
  ------------------
  411|      0|        ctx->ssl_mac_secret_size[SSL_MD_MAGMAOMAC_IDX] = 32;
  ------------------
  |  |  199|      0|# define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
  412|     79|    else
  413|     79|        ctx->disabled_mac_mask |= SSL_MAGMAOMAC;
  ------------------
  |  |  179|     79|# define SSL_MAGMAOMAC           0x00000400U
  ------------------
  414|       |
  415|     79|    ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX] =
  ------------------
  |  |  200|     79|# define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
  416|     79|        get_optional_pkey_id(SN_kuznyechik_mac);
  ------------------
  |  | 5030|     79|#define SN_kuznyechik_mac               "kuznyechik-mac"
  ------------------
  417|     79|    if (ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX])
  ------------------
  |  |  200|     79|# define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
  |  Branch (417:9): [True: 0, False: 79]
  ------------------
  418|      0|        ctx->ssl_mac_secret_size[SSL_MD_KUZNYECHIKOMAC_IDX] = 32;
  ------------------
  |  |  200|      0|# define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
  419|     79|    else
  420|     79|        ctx->disabled_mac_mask |= SSL_KUZNYECHIKOMAC;
  ------------------
  |  |  180|     79|# define SSL_KUZNYECHIKOMAC      0x00000800U
  ------------------
  421|       |
  422|     79|    if (!get_optional_pkey_id(SN_id_GostR3410_2001))
  ------------------
  |  | 4554|     79|#define SN_id_GostR3410_2001            "gost2001"
  ------------------
  |  Branch (422:9): [True: 79, False: 0]
  ------------------
  423|     79|        ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
  ------------------
  |  |  118|     79|# define SSL_aGOST01             0x00000020U
  ------------------
                      ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  424|     79|    if (!get_optional_pkey_id(SN_id_GostR3410_2012_256))
  ------------------
  |  | 4765|     79|#define SN_id_GostR3410_2012_256                "gost2012_256"
  ------------------
  |  Branch (424:9): [True: 79, False: 0]
  ------------------
  425|     79|        ctx->disabled_auth_mask |= SSL_aGOST12;
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  426|     79|    if (!get_optional_pkey_id(SN_id_GostR3410_2012_512))
  ------------------
  |  | 4770|     79|#define SN_id_GostR3410_2012_512                "gost2012_512"
  ------------------
  |  Branch (426:9): [True: 79, False: 0]
  ------------------
  427|     79|        ctx->disabled_auth_mask |= SSL_aGOST12;
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  428|       |    /*
  429|       |     * Disable GOST key exchange if no GOST signature algs are available *
  430|       |     */
  431|     79|    if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) ==
  ------------------
  |  |  118|     79|# define SSL_aGOST01             0x00000020U
  ------------------
                  if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) ==
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  |  Branch (431:9): [True: 79, False: 0]
  ------------------
  432|     79|        (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  118|     79|# define SSL_aGOST01             0x00000020U
  ------------------
                      (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  433|     79|        ctx->disabled_mkey_mask |= SSL_kGOST;
  ------------------
  |  |   89|     79|# define SSL_kGOST               0x00000010U
  ------------------
  434|       |
  435|     79|    if ((ctx->disabled_auth_mask & SSL_aGOST12) ==  SSL_aGOST12)
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
                  if ((ctx->disabled_auth_mask & SSL_aGOST12) ==  SSL_aGOST12)
  ------------------
  |  |  122|     79|# define SSL_aGOST12             0x00000080U
  ------------------
  |  Branch (435:9): [True: 79, False: 0]
  ------------------
  436|     79|        ctx->disabled_mkey_mask |= SSL_kGOST18;
  ------------------
  |  |   97|     79|# define SSL_kGOST18             0x00000200U
  ------------------
  437|       |
  438|     79|    return 1;
  439|     79|}
SSL_CTX_set_ciphersuites:
 1391|     79|{
 1392|     79|    int ret = set_ciphersuites(&(ctx->tls13_ciphersuites), str);
 1393|       |
 1394|     79|    if (ret && ctx->cipher_list != NULL)
  ------------------
  |  Branch (1394:9): [True: 79, False: 0]
  |  Branch (1394:16): [True: 0, False: 79]
  ------------------
 1395|      0|        return update_cipher_list(ctx, &ctx->cipher_list, &ctx->cipher_list_by_id,
 1396|      0|                                  ctx->tls13_ciphersuites);
 1397|       |
 1398|     79|    return ret;
 1399|     79|}
ssl_create_cipher_list:
 1430|     79|{
 1431|     79|    int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases, i;
 1432|     79|    uint32_t disabled_mkey, disabled_auth, disabled_enc, disabled_mac;
 1433|     79|    STACK_OF(SSL_CIPHER) *cipherstack;
  ------------------
  |  |   31|     79|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1434|     79|    const char *rule_p;
 1435|     79|    CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
 1436|     79|    const SSL_CIPHER **ca_list = NULL;
 1437|     79|    const SSL_METHOD *ssl_method = ctx->method;
 1438|       |
 1439|       |    /*
 1440|       |     * Return with error if nothing to do.
 1441|       |     */
 1442|     79|    if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL)
  ------------------
  |  Branch (1442:9): [True: 0, False: 79]
  |  Branch (1442:29): [True: 0, False: 79]
  |  Branch (1442:52): [True: 0, False: 79]
  ------------------
 1443|      0|        return NULL;
 1444|       |
 1445|     79|    if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
  ------------------
  |  Branch (1445:9): [True: 0, False: 79]
  ------------------
 1446|      0|        return NULL;
 1447|       |
 1448|       |    /*
 1449|       |     * To reduce the work to do we only want to process the compiled
 1450|       |     * in algorithms, so we first get the mask of disabled ciphers.
 1451|       |     */
 1452|       |
 1453|     79|    disabled_mkey = ctx->disabled_mkey_mask;
 1454|     79|    disabled_auth = ctx->disabled_auth_mask;
 1455|     79|    disabled_enc = ctx->disabled_enc_mask;
 1456|     79|    disabled_mac = ctx->disabled_mac_mask;
 1457|       |
 1458|       |    /*
 1459|       |     * Now we have to collect the available ciphers from the compiled
 1460|       |     * in ciphers. We cannot get more than the number compiled in, so
 1461|       |     * it is used for allocation.
 1462|       |     */
 1463|     79|    num_of_ciphers = ssl_method->num_ciphers();
 1464|       |
 1465|     79|    if (num_of_ciphers > 0) {
  ------------------
  |  Branch (1465:9): [True: 0, False: 79]
  ------------------
 1466|      0|        co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1467|      0|        if (co_list == NULL)
  ------------------
  |  Branch (1467:13): [True: 0, False: 0]
  ------------------
 1468|      0|            return NULL;          /* Failure */
 1469|      0|    }
 1470|       |
 1471|     79|    ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
 1472|     79|                               disabled_mkey, disabled_auth, disabled_enc,
 1473|     79|                               disabled_mac, co_list, &head, &tail);
 1474|       |
 1475|       |    /* Now arrange all ciphers by preference. */
 1476|       |
 1477|       |    /*
 1478|       |     * Everything else being equal, prefer ephemeral ECDH over other key
 1479|       |     * exchange mechanisms.
 1480|       |     * For consistency, prefer ECDSA over RSA (though this only matters if the
 1481|       |     * server has both certificates, and is using the DEFAULT, or a client
 1482|       |     * preference).
 1483|       |     */
 1484|     79|    ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |   85|     79|# define SSL_kECDHE              0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  114|     79|# define SSL_aECDSA              0x00000008U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1485|     79|                          -1, &head, &tail);
 1486|     79|    ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head,
  ------------------
  |  |   85|     79|# define SSL_kECDHE              0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head,
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1487|     79|                          &tail);
 1488|     79|    ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
  ------------------
  |  |   85|     79|# define SSL_kECDHE              0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
  ------------------
  |  |  141|     79|#define CIPHER_DEL      3
  ------------------
 1489|     79|                          &tail);
 1490|       |
 1491|       |    /* Within each strength group, we prefer GCM over CHACHA... */
 1492|     79|    ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  155|     79|# define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  142|     79|# define SSL_AES128GCM           0x00001000U
  |  |  ------------------
  |  |               # define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  143|     79|# define SSL_AES256GCM           0x00002000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1493|     79|                          &head, &tail);
 1494|     79|    ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  159|     79|# define SSL_CHACHA20            (SSL_CHACHA20POLY1305)
  |  |  ------------------
  |  |  |  |  149|     79|# define SSL_CHACHA20POLY1305    0x00080000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1495|     79|                          &head, &tail);
 1496|       |
 1497|       |    /*
 1498|       |     * ...and generally, our preferred cipher is AES.
 1499|       |     * Note that AEADs will be bumped to take preference after sorting by
 1500|       |     * strength.
 1501|       |     */
 1502|     79|    ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  157|     79|# define SSL_AES                 (SSL_AES128|SSL_AES256|SSL_AESGCM|SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  136|     79|# define SSL_AES128              0x00000040U
  |  |  ------------------
  |  |               # define SSL_AES                 (SSL_AES128|SSL_AES256|SSL_AESGCM|SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  137|     79|# define SSL_AES256              0x00000080U
  |  |  ------------------
  |  |               # define SSL_AES                 (SSL_AES128|SSL_AES256|SSL_AESGCM|SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  155|     79|# define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     79|# define SSL_AES128GCM           0x00001000U
  |  |  |  |  ------------------
  |  |  |  |               # define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     79|# define SSL_AES256GCM           0x00002000U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               # define SSL_AES                 (SSL_AES128|SSL_AES256|SSL_AESGCM|SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  156|     79|# define SSL_AESCCM              (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|     79|# define SSL_AES128CCM           0x00004000U
  |  |  |  |  ------------------
  |  |  |  |               # define SSL_AESCCM              (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|     79|# define SSL_AES256CCM           0x00008000U
  |  |  |  |  ------------------
  |  |  |  |               # define SSL_AESCCM              (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|     79|# define SSL_AES128CCM8          0x00010000U
  |  |  |  |  ------------------
  |  |  |  |               # define SSL_AESCCM              (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|     79|# define SSL_AES256CCM8          0x00020000U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  155|     79|# define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  142|     79|# define SSL_AES128GCM           0x00001000U
  |  |  ------------------
  |  |               # define SSL_AESGCM              (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  143|     79|# define SSL_AES256GCM           0x00002000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1503|     79|                          -1, &head, &tail);
 1504|       |
 1505|       |    /* Temporarily enable everything else for sorting */
 1506|     79|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
  ------------------
  |  |  139|     79|#define CIPHER_ADD      1
  ------------------
 1507|       |
 1508|       |    /* Low priority for MD5 */
 1509|     79|    ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  168|     79|# define SSL_MD5                 0x00000001U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  142|     79|#define CIPHER_ORD      4
  ------------------
 1510|     79|                          &tail);
 1511|       |
 1512|       |    /*
 1513|       |     * Move anonymous ciphers to the end.  Usually, these will remain
 1514|       |     * disabled. (For applications that allow them, they aren't too bad, but
 1515|       |     * we prefer authenticated ciphers.)
 1516|       |     */
 1517|     79|    ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  112|     79|# define SSL_aNULL               0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  142|     79|#define CIPHER_ORD      4
  ------------------
 1518|     79|                          &tail);
 1519|       |
 1520|     79|    ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |   81|     79|# define SSL_kRSA                0x00000001U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  142|     79|#define CIPHER_ORD      4
  ------------------
 1521|     79|                          &tail);
 1522|     79|    ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |   87|     79|# define SSL_kPSK                0x00000008U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  142|     79|#define CIPHER_ORD      4
  ------------------
 1523|     79|                          &tail);
 1524|       |
 1525|       |    /* RC4 is sort-of broken -- move to the end */
 1526|     79|    ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  132|     79|# define SSL_RC4                 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  142|     79|#define CIPHER_ORD      4
  ------------------
 1527|     79|                          &tail);
 1528|       |
 1529|       |    /*
 1530|       |     * Now sort by symmetric encryption strength.  The above ordering remains
 1531|       |     * in force within each class
 1532|       |     */
 1533|     79|    if (!ssl_cipher_strength_sort(&head, &tail)) {
  ------------------
  |  Branch (1533:9): [True: 0, False: 79]
  ------------------
 1534|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1535|      0|        return NULL;
 1536|      0|    }
 1537|       |
 1538|       |    /*
 1539|       |     * Partially overrule strength sort to prefer TLS 1.2 ciphers/PRFs.
 1540|       |     */
 1541|     79|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1,
  ------------------
  |  |   26|     79|# define TLS1_2_VERSION                  0x0303
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  148|     79|#define CIPHER_BUMP     6
  ------------------
 1542|     79|                          &head, &tail);
 1543|       |
 1544|       |    /*
 1545|       |     * Irrespective of strength, enforce the following order:
 1546|       |     * (EC)DHE + AEAD > (EC)DHE > rest of AEAD > rest.
 1547|       |     * Within each group, ciphers remain sorted by strength and previous
 1548|       |     * preference, i.e.,
 1549|       |     * 1) ECDHE > DHE
 1550|       |     * 2) GCM > CHACHA
 1551|       |     * 3) AES > rest
 1552|       |     * 4) TLS 1.2 > legacy
 1553|       |     *
 1554|       |     * Because we now bump ciphers to the top of the list, we proceed in
 1555|       |     * reverse order of preference.
 1556|       |     */
 1557|     79|    ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  175|     79|# define SSL_AEAD                0x00000040U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  148|     79|#define CIPHER_BUMP     6
  ------------------
 1558|     79|                          &head, &tail);
 1559|     79|    ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0,
  ------------------
  |  |   83|     79|# define SSL_kDHE                0x00000002U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0,
  ------------------
  |  |   85|     79|# define SSL_kECDHE              0x00000004U
  ------------------
 1560|     79|                          CIPHER_BUMP, -1, &head, &tail);
  ------------------
  |  |  148|     79|#define CIPHER_BUMP     6
  ------------------
 1561|     79|    ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |   83|     79|# define SSL_kDHE                0x00000002U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |   85|     79|# define SSL_kECDHE              0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |  175|     79|# define SSL_AEAD                0x00000040U
  ------------------
 1562|     79|                          CIPHER_BUMP, -1, &head, &tail);
  ------------------
  |  |  148|     79|#define CIPHER_BUMP     6
  ------------------
 1563|       |
 1564|       |    /* Now disable everything (maintaining the ordering!) */
 1565|     79|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail);
  ------------------
  |  |  141|     79|#define CIPHER_DEL      3
  ------------------
 1566|       |
 1567|       |    /*
 1568|       |     * We also need cipher aliases for selecting based on the rule_str.
 1569|       |     * There might be two types of entries in the rule_str: 1) names
 1570|       |     * of ciphers themselves 2) aliases for groups of ciphers.
 1571|       |     * For 1) we need the available ciphers and for 2) the cipher
 1572|       |     * groups of cipher_aliases added together in one list (otherwise
 1573|       |     * we would be happy with just the cipher_aliases table).
 1574|       |     */
 1575|     79|    num_of_group_aliases = OSSL_NELEM(cipher_aliases);
  ------------------
  |  |   14|     79|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1576|     79|    num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
 1577|     79|    ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max);
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1578|     79|    if (ca_list == NULL) {
  ------------------
  |  Branch (1578:9): [True: 0, False: 79]
  ------------------
 1579|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1580|      0|        return NULL;          /* Failure */
 1581|      0|    }
 1582|     79|    ssl_cipher_collect_aliases(ca_list, num_of_group_aliases,
 1583|     79|                               disabled_mkey, disabled_auth, disabled_enc,
 1584|     79|                               disabled_mac, head);
 1585|       |
 1586|       |    /*
 1587|       |     * If the rule_string begins with DEFAULT, apply the default rule
 1588|       |     * before using the (possibly available) additional rules.
 1589|       |     */
 1590|     79|    ok = 1;
 1591|     79|    rule_p = rule_str;
 1592|     79|    if (HAS_PREFIX(rule_str, "DEFAULT")) {
  ------------------
  |  |   58|     79|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1593|      0|        ok = ssl_cipher_process_rulestr(OSSL_default_cipher_list(),
 1594|      0|                                        &head, &tail, ca_list, c);
 1595|      0|        rule_p += 7;
 1596|      0|        if (*rule_p == ':')
  ------------------
  |  Branch (1596:13): [True: 0, False: 0]
  ------------------
 1597|      0|            rule_p++;
 1598|      0|    }
 1599|       |
 1600|     79|    if (ok && (rule_p[0] != '\0'))
  ------------------
  |  Branch (1600:9): [True: 79, False: 0]
  |  Branch (1600:15): [True: 79, False: 0]
  ------------------
 1601|     79|        ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
 1602|       |
 1603|     79|    OPENSSL_free(ca_list);      /* Not needed anymore */
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1604|       |
 1605|     79|    if (!ok) {                  /* Rule processing failure */
  ------------------
  |  Branch (1605:9): [True: 0, False: 79]
  ------------------
 1606|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1607|      0|        return NULL;
 1608|      0|    }
 1609|       |
 1610|       |    /*
 1611|       |     * Allocate new "cipherstack" for the result, return with error
 1612|       |     * if we cannot get one.
 1613|       |     */
 1614|     79|    if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL) {
  ------------------
  |  | 1002|     79|#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (1614:9): [True: 0, False: 79]
  ------------------
 1615|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1616|      0|        return NULL;
 1617|      0|    }
 1618|       |
 1619|       |    /* Add TLSv1.3 ciphers first - we always prefer those if possible */
 1620|    316|    for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) {
  ------------------
  |  |  999|    316|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1620:17): [True: 237, False: 79]
  ------------------
 1621|    237|        const SSL_CIPHER *sslc = sk_SSL_CIPHER_value(tls13_ciphersuites, i);
  ------------------
  |  | 1000|    237|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 1622|       |
 1623|       |        /* Don't include any TLSv1.3 ciphers that are disabled */
 1624|    237|        if ((sslc->algorithm_enc & disabled_enc) != 0
  ------------------
  |  Branch (1624:13): [True: 0, False: 237]
  ------------------
 1625|    237|                || (ssl_cipher_table_mac[sslc->algorithm2
  ------------------
  |  Branch (1625:20): [True: 0, False: 237]
  ------------------
 1626|    237|                                         & SSL_HANDSHAKE_MAC_MASK].mask
  ------------------
  |  |  208|    237|# define SSL_HANDSHAKE_MAC_MASK  0xFF
  ------------------
 1627|    237|                    & ctx->disabled_mac_mask) != 0) {
 1628|      0|            sk_SSL_CIPHER_delete(tls13_ciphersuites, i);
  ------------------
  |  | 1007|      0|#define sk_SSL_CIPHER_delete(sk, i) ((const SSL_CIPHER *)OPENSSL_sk_delete(ossl_check_SSL_CIPHER_sk_type(sk), (i)))
  ------------------
 1629|      0|            i--;
 1630|      0|            continue;
 1631|      0|        }
 1632|       |
 1633|    237|        if (!sk_SSL_CIPHER_push(cipherstack, sslc)) {
  ------------------
  |  | 1009|    237|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1633:13): [True: 0, False: 237]
  ------------------
 1634|      0|            OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1635|      0|            sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1636|      0|            return NULL;
 1637|      0|        }
 1638|    237|    }
 1639|       |
 1640|     79|    OSSL_TRACE_BEGIN(TLS_CIPHER) {
  ------------------
  |  |  220|     79|    do {                                        \
  |  |  221|     79|        BIO *trc_out = NULL;                    \
  |  |  222|     79|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1641|      0|        BIO_printf(trc_out, "cipher selection:\n");
 1642|      0|    }
 1643|       |    /*
 1644|       |     * The cipher selection for the list is done. The ciphers are added
 1645|       |     * to the resulting precedence to the STACK_OF(SSL_CIPHER).
 1646|       |     */
 1647|     79|    for (curr = head; curr != NULL; curr = curr->next) {
  ------------------
  |  Branch (1647:23): [True: 0, False: 79]
  ------------------
 1648|      0|        if (curr->active) {
  ------------------
  |  Branch (1648:13): [True: 0, False: 0]
  ------------------
 1649|      0|            if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) {
  ------------------
  |  | 1009|      0|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1649:17): [True: 0, False: 0]
  ------------------
 1650|      0|                OPENSSL_free(co_list);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1651|      0|                sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1652|      0|                OSSL_TRACE_CANCEL(TLS_CIPHER);
  ------------------
  |  |  228|      0|    ((void)0)
  ------------------
 1653|      0|                return NULL;
 1654|      0|            }
 1655|      0|            if (trc_out != NULL)
  ------------------
  |  Branch (1655:17): [True: 0, False: 0]
  ------------------
 1656|      0|                BIO_printf(trc_out, "<%s>\n", curr->cipher->name);
 1657|      0|        }
 1658|      0|    }
 1659|     79|    OPENSSL_free(co_list);      /* Not needed any longer */
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1660|     79|    OSSL_TRACE_END(TLS_CIPHER);
  ------------------
  |  |  225|     79|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1661|       |
 1662|     79|    if (!update_cipher_list_by_id(cipher_list_by_id, cipherstack)) {
  ------------------
  |  Branch (1662:9): [True: 0, False: 79]
  ------------------
 1663|      0|        sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1664|      0|        return NULL;
 1665|      0|    }
 1666|     79|    sk_SSL_CIPHER_free(*cipher_list);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1667|     79|    *cipher_list = cipherstack;
 1668|       |
 1669|     79|    return cipherstack;
 1670|     79|}
SSL_COMP_get_compression_methods:
 1980|     83|{
 1981|     83|    STACK_OF(SSL_COMP) **rv;
  ------------------
  |  |   31|     83|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1982|       |
 1983|     83|    rv = (STACK_OF(SSL_COMP) **)OSSL_LIB_CTX_get_data(NULL,
 1984|     83|                                     OSSL_LIB_CTX_COMP_METHODS);
  ------------------
  |  |  121|     83|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
 1985|     83|    if (rv != NULL)
  ------------------
  |  Branch (1985:9): [True: 83, False: 0]
  ------------------
 1986|     83|        return *rv;
 1987|      0|    else
 1988|      0|        return NULL;
 1989|     83|}
ssl_get_md_idx:
 2136|    237|int ssl_get_md_idx(int md_nid) {
 2137|    237|    int i;
 2138|       |
 2139|  3.55k|    for(i = 0; i < SSL_MD_NUM_IDX; i++) {
  ------------------
  |  |  203|  3.55k|#define SSL_MD_NUM_IDX  SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  3.55k|# define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (2139:16): [True: 3.31k, False: 237]
  ------------------
 2140|  3.31k|        if (md_nid == ssl_cipher_table_mac[i].nid)
  ------------------
  |  Branch (2140:13): [True: 0, False: 3.31k]
  ------------------
 2141|      0|            return i;
 2142|  3.31k|    }
 2143|    237|    return -1;
 2144|    237|}
OSSL_default_cipher_list:
 2238|     79|{
 2239|     79|    return "ALL:!COMPLEMENTOFDEFAULT:!eNULL";
 2240|     79|}
OSSL_default_ciphersuites:
 2248|     79|{
 2249|     79|    return "TLS_AES_256_GCM_SHA384:"
 2250|     79|           "TLS_CHACHA20_POLY1305_SHA256:"
 2251|     79|           "TLS_AES_128_GCM_SHA256";
 2252|     79|}
ssl_ciph.c:get_optional_pkey_id:
  298|    553|{
  299|    553|    const EVP_PKEY_ASN1_METHOD *ameth;
  300|    553|    ENGINE *tmpeng = NULL;
  301|    553|    int pkey_id = 0;
  302|    553|    ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1);
  303|    553|    if (ameth) {
  ------------------
  |  Branch (303:9): [True: 0, False: 553]
  ------------------
  304|      0|        if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  305|      0|                                    ameth) <= 0)
  306|      0|            pkey_id = 0;
  307|      0|    }
  308|    553|    tls_engine_finish(tmpeng);
  309|    553|    return pkey_id;
  310|    553|}
ssl_ciph.c:set_ciphersuites:
 1308|     79|{
 1309|     79|    STACK_OF(SSL_CIPHER) *newciphers = sk_SSL_CIPHER_new_null();
  ------------------
  |  |   31|     79|# define STACK_OF(type) struct stack_st_##type
  ------------------
                  STACK_OF(SSL_CIPHER) *newciphers = sk_SSL_CIPHER_new_null();
  ------------------
  |  | 1002|     79|#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())
  ------------------
 1310|       |
 1311|     79|    if (newciphers == NULL)
  ------------------
  |  Branch (1311:9): [True: 0, False: 79]
  ------------------
 1312|      0|        return 0;
 1313|       |
 1314|       |    /* Parse the list. We explicitly allow an empty list */
 1315|     79|    if (*str != '\0'
  ------------------
  |  Branch (1315:9): [True: 79, False: 0]
  ------------------
 1316|     79|            && (CONF_parse_list(str, ':', 1, ciphersuite_cb, newciphers) <= 0
  ------------------
  |  Branch (1316:17): [True: 0, False: 79]
  ------------------
 1317|     79|                || sk_SSL_CIPHER_num(newciphers) == 0)) {
  ------------------
  |  |  999|     79|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1317:20): [True: 0, False: 79]
  ------------------
 1318|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1319|      0|        sk_SSL_CIPHER_free(newciphers);
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1320|      0|        return 0;
 1321|      0|    }
 1322|     79|    sk_SSL_CIPHER_free(*currciphers);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1323|     79|    *currciphers = newciphers;
 1324|       |
 1325|     79|    return 1;
 1326|     79|}
ssl_ciph.c:ciphersuite_cb:
 1281|    237|{
 1282|    237|    STACK_OF(SSL_CIPHER) *ciphersuites = (STACK_OF(SSL_CIPHER) *)arg;
  ------------------
  |  |   31|    237|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1283|    237|    const SSL_CIPHER *cipher;
 1284|       |    /* Arbitrary sized temp buffer for the cipher name. Should be big enough */
 1285|    237|    char name[80];
 1286|       |
 1287|    237|    if (len > (int)(sizeof(name) - 1))
  ------------------
  |  Branch (1287:9): [True: 0, False: 237]
  ------------------
 1288|       |        /* Anyway return 1 so we can parse rest of the list */
 1289|      0|        return 1;
 1290|       |
 1291|    237|    memcpy(name, elem, len);
 1292|    237|    name[len] = '\0';
 1293|       |
 1294|    237|    cipher = ssl3_get_cipher_by_std_name(name);
 1295|    237|    if (cipher == NULL)
  ------------------
  |  Branch (1295:9): [True: 0, False: 237]
  ------------------
 1296|       |        /* Ciphersuite not found but return 1 to parse rest of the list */
 1297|      0|        return 1;
 1298|       |
 1299|    237|    if (!sk_SSL_CIPHER_push(ciphersuites, cipher)) {
  ------------------
  |  | 1009|    237|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1299:9): [True: 0, False: 237]
  ------------------
 1300|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1301|      0|        return 0;
 1302|      0|    }
 1303|       |
 1304|    237|    return 1;
 1305|    237|}
ssl_ciph.c:check_suiteb_cipher_list:
 1233|     79|{
 1234|     79|    unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
 1235|     79|    if (HAS_PREFIX(*prule_str, "SUITEB128ONLY")) {
  ------------------
  |  |   58|     79|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1236|      0|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
  ------------------
  |  |  553|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY       0x10000
  ------------------
 1237|     79|    } else if (HAS_PREFIX(*prule_str, "SUITEB128C2")) {
  ------------------
  |  |   58|     79|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1238|      0|        suiteb_comb2 = 1;
 1239|      0|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  557|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000
  ------------------
 1240|     79|    } else if (HAS_PREFIX(*prule_str, "SUITEB128")) {
  ------------------
  |  |   58|     79|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1241|      0|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  557|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000
  ------------------
 1242|     79|    } else if (HAS_PREFIX(*prule_str, "SUITEB192")) {
  ------------------
  |  |   58|     79|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1243|      0|        suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
  ------------------
  |  |  555|      0|# define SSL_CERT_FLAG_SUITEB_192_LOS            0x20000
  ------------------
 1244|      0|    }
 1245|       |
 1246|     79|    if (suiteb_flags) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 79]
  ------------------
 1247|      0|        c->cert_flags &= ~SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  557|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000
  ------------------
 1248|      0|        c->cert_flags |= suiteb_flags;
 1249|     79|    } else {
 1250|     79|        suiteb_flags = c->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  557|     79|# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000
  ------------------
 1251|     79|    }
 1252|       |
 1253|     79|    if (!suiteb_flags)
  ------------------
  |  Branch (1253:9): [True: 79, False: 0]
  ------------------
 1254|     79|        return 1;
 1255|       |    /* Check version: if TLS 1.2 ciphers allowed we can use Suite B */
 1256|       |
 1257|      0|    if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_TLS1_2_CIPHERS)) {
  ------------------
  |  | 2191|      0|# define SSL_ENC_FLAG_TLS1_2_CIPHERS     0x10
  ------------------
  |  Branch (1257:9): [True: 0, False: 0]
  ------------------
 1258|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1259|      0|        return 0;
 1260|      0|    }
 1261|       |
 1262|      0|    switch (suiteb_flags) {
  ------------------
  |  Branch (1262:13): [True: 0, False: 0]
  ------------------
 1263|      0|    case SSL_CERT_FLAG_SUITEB_128_LOS:
  ------------------
  |  |  557|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000
  ------------------
  |  Branch (1263:5): [True: 0, False: 0]
  ------------------
 1264|      0|        if (suiteb_comb2)
  ------------------
  |  Branch (1264:13): [True: 0, False: 0]
  ------------------
 1265|      0|            *prule_str = "ECDHE-ECDSA-AES256-GCM-SHA384";
 1266|      0|        else
 1267|      0|            *prule_str =
 1268|      0|                "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384";
 1269|      0|        break;
 1270|      0|    case SSL_CERT_FLAG_SUITEB_128_LOS_ONLY:
  ------------------
  |  |  553|      0|# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY       0x10000
  ------------------
  |  Branch (1270:5): [True: 0, False: 0]
  ------------------
 1271|      0|        *prule_str = "ECDHE-ECDSA-AES128-GCM-SHA256";
 1272|      0|        break;
 1273|      0|    case SSL_CERT_FLAG_SUITEB_192_LOS:
  ------------------
  |  |  555|      0|# define SSL_CERT_FLAG_SUITEB_192_LOS            0x20000
  ------------------
  |  Branch (1273:5): [True: 0, False: 0]
  ------------------
 1274|      0|        *prule_str = "ECDHE-ECDSA-AES256-GCM-SHA384";
 1275|      0|        break;
 1276|      0|    }
 1277|      0|    return 1;
 1278|      0|}
ssl_ciph.c:ssl_cipher_collect_ciphers:
  653|     79|{
  654|     79|    int i, co_list_num;
  655|     79|    const SSL_CIPHER *c;
  656|       |
  657|       |    /*
  658|       |     * We have num_of_ciphers descriptions compiled in, depending on the
  659|       |     * method selected (SSLv3, TLSv1 etc).
  660|       |     * These will later be sorted in a linked list with at most num
  661|       |     * entries.
  662|       |     */
  663|       |
  664|       |    /* Get the initial list of ciphers */
  665|     79|    co_list_num = 0;            /* actual count of ciphers */
  666|     79|    for (i = 0; i < num_of_ciphers; i++) {
  ------------------
  |  Branch (666:17): [True: 0, False: 79]
  ------------------
  667|      0|        c = ssl_method->get_cipher(i);
  668|       |        /* drop those that use any of that is not available */
  669|      0|        if (c == NULL || !c->valid)
  ------------------
  |  Branch (669:13): [True: 0, False: 0]
  |  Branch (669:26): [True: 0, False: 0]
  ------------------
  670|      0|            continue;
  671|      0|        if ((c->algorithm_mkey & disabled_mkey) ||
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|            (c->algorithm_auth & disabled_auth) ||
  ------------------
  |  Branch (672:13): [True: 0, False: 0]
  ------------------
  673|      0|            (c->algorithm_enc & disabled_enc) ||
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            (c->algorithm_mac & disabled_mac))
  ------------------
  |  Branch (674:13): [True: 0, False: 0]
  ------------------
  675|      0|            continue;
  676|      0|        if (((ssl_method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) == 0) &&
  ------------------
  |  | 2186|      0|# define SSL_ENC_FLAG_DTLS               0x8
  ------------------
  |  Branch (676:13): [True: 0, False: 0]
  ------------------
  677|      0|            c->min_tls == 0)
  ------------------
  |  Branch (677:13): [True: 0, False: 0]
  ------------------
  678|      0|            continue;
  679|      0|        if (((ssl_method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) != 0) &&
  ------------------
  |  | 2186|      0|# define SSL_ENC_FLAG_DTLS               0x8
  ------------------
  |  Branch (679:13): [True: 0, False: 0]
  ------------------
  680|      0|            c->min_dtls == 0)
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|      0|            continue;
  682|       |
  683|      0|        co_list[co_list_num].cipher = c;
  684|      0|        co_list[co_list_num].next = NULL;
  685|      0|        co_list[co_list_num].prev = NULL;
  686|      0|        co_list[co_list_num].active = 0;
  687|      0|        co_list_num++;
  688|      0|    }
  689|       |
  690|       |    /*
  691|       |     * Prepare linked list from list entries
  692|       |     */
  693|     79|    if (co_list_num > 0) {
  ------------------
  |  Branch (693:9): [True: 0, False: 79]
  ------------------
  694|      0|        co_list[0].prev = NULL;
  695|       |
  696|      0|        if (co_list_num > 1) {
  ------------------
  |  Branch (696:13): [True: 0, False: 0]
  ------------------
  697|      0|            co_list[0].next = &co_list[1];
  698|       |
  699|      0|            for (i = 1; i < co_list_num - 1; i++) {
  ------------------
  |  Branch (699:25): [True: 0, False: 0]
  ------------------
  700|      0|                co_list[i].prev = &co_list[i - 1];
  701|      0|                co_list[i].next = &co_list[i + 1];
  702|      0|            }
  703|       |
  704|      0|            co_list[co_list_num - 1].prev = &co_list[co_list_num - 2];
  705|      0|        }
  706|       |
  707|      0|        co_list[co_list_num - 1].next = NULL;
  708|       |
  709|      0|        *head_p = &co_list[0];
  710|      0|        *tail_p = &co_list[co_list_num - 1];
  711|      0|    }
  712|     79|}
ssl_ciph.c:ssl_cipher_apply_rule:
  782|  1.58k|{
  783|  1.58k|    CIPHER_ORDER *head, *tail, *curr, *next, *last;
  784|  1.58k|    const SSL_CIPHER *cp;
  785|  1.58k|    int reverse = 0;
  786|       |
  787|  1.58k|    OSSL_TRACE_BEGIN(TLS_CIPHER) {
  ------------------
  |  |  220|  1.58k|    do {                                        \
  |  |  221|  1.58k|        BIO *trc_out = NULL;                    \
  |  |  222|  1.58k|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  788|      0|        BIO_printf(trc_out,
  789|      0|                   "Applying rule %d with %08x/%08x/%08x/%08x/%08x %08x (%d)\n",
  790|      0|                   rule, (unsigned int)alg_mkey, (unsigned int)alg_auth,
  791|      0|                   (unsigned int)alg_enc, (unsigned int)alg_mac, min_tls,
  792|      0|                   (unsigned int)algo_strength, (int)strength_bits);
  793|      0|    }
  794|       |
  795|  1.58k|    if (rule == CIPHER_DEL || rule == CIPHER_BUMP)
  ------------------
  |  |  141|  3.16k|#define CIPHER_DEL      3
  ------------------
                  if (rule == CIPHER_DEL || rule == CIPHER_BUMP)
  ------------------
  |  |  148|  1.42k|#define CIPHER_BUMP     6
  ------------------
  |  Branch (795:9): [True: 158, False: 1.42k]
  |  Branch (795:31): [True: 316, False: 1.10k]
  ------------------
  796|    474|        reverse = 1;            /* needed to maintain sorting between currently
  797|       |                                 * deleted ciphers */
  798|       |
  799|  1.58k|    head = *head_p;
  800|  1.58k|    tail = *tail_p;
  801|       |
  802|  1.58k|    if (reverse) {
  ------------------
  |  Branch (802:9): [True: 474, False: 1.10k]
  ------------------
  803|    474|        next = tail;
  804|    474|        last = head;
  805|  1.10k|    } else {
  806|  1.10k|        next = head;
  807|  1.10k|        last = tail;
  808|  1.10k|    }
  809|       |
  810|  1.58k|    curr = NULL;
  811|  1.58k|    for (;;) {
  812|  1.58k|        if (curr == last)
  ------------------
  |  Branch (812:13): [True: 1.58k, False: 0]
  ------------------
  813|  1.58k|            break;
  814|       |
  815|      0|        curr = next;
  816|       |
  817|      0|        if (curr == NULL)
  ------------------
  |  Branch (817:13): [True: 0, False: 0]
  ------------------
  818|      0|            break;
  819|       |
  820|      0|        next = reverse ? curr->prev : curr->next;
  ------------------
  |  Branch (820:16): [True: 0, False: 0]
  ------------------
  821|       |
  822|      0|        cp = curr->cipher;
  823|       |
  824|       |        /*
  825|       |         * Selection criteria is either the value of strength_bits
  826|       |         * or the algorithms used.
  827|       |         */
  828|      0|        if (strength_bits >= 0) {
  ------------------
  |  Branch (828:13): [True: 0, False: 0]
  ------------------
  829|      0|            if (strength_bits != cp->strength_bits)
  ------------------
  |  Branch (829:17): [True: 0, False: 0]
  ------------------
  830|      0|                continue;
  831|      0|        } else {
  832|      0|            if (trc_out != NULL) {
  ------------------
  |  Branch (832:17): [True: 0, False: 0]
  ------------------
  833|      0|                BIO_printf(trc_out,
  834|      0|                           "\nName: %s:"
  835|      0|                           "\nAlgo = %08x/%08x/%08x/%08x/%08x Algo_strength = %08x\n",
  836|      0|                           cp->name,
  837|      0|                           (unsigned int)cp->algorithm_mkey,
  838|      0|                           (unsigned int)cp->algorithm_auth,
  839|      0|                           (unsigned int)cp->algorithm_enc,
  840|      0|                           (unsigned int)cp->algorithm_mac,
  841|      0|                           cp->min_tls,
  842|      0|                           (unsigned int)cp->algo_strength);
  843|      0|            }
  844|      0|            if (cipher_id != 0 && (cipher_id != cp->id))
  ------------------
  |  Branch (844:17): [True: 0, False: 0]
  |  Branch (844:35): [True: 0, False: 0]
  ------------------
  845|      0|                continue;
  846|      0|            if (alg_mkey && !(alg_mkey & cp->algorithm_mkey))
  ------------------
  |  Branch (846:17): [True: 0, False: 0]
  |  Branch (846:29): [True: 0, False: 0]
  ------------------
  847|      0|                continue;
  848|      0|            if (alg_auth && !(alg_auth & cp->algorithm_auth))
  ------------------
  |  Branch (848:17): [True: 0, False: 0]
  |  Branch (848:29): [True: 0, False: 0]
  ------------------
  849|      0|                continue;
  850|      0|            if (alg_enc && !(alg_enc & cp->algorithm_enc))
  ------------------
  |  Branch (850:17): [True: 0, False: 0]
  |  Branch (850:28): [True: 0, False: 0]
  ------------------
  851|      0|                continue;
  852|      0|            if (alg_mac && !(alg_mac & cp->algorithm_mac))
  ------------------
  |  Branch (852:17): [True: 0, False: 0]
  |  Branch (852:28): [True: 0, False: 0]
  ------------------
  853|      0|                continue;
  854|      0|            if (min_tls && (min_tls != cp->min_tls))
  ------------------
  |  Branch (854:17): [True: 0, False: 0]
  |  Branch (854:28): [True: 0, False: 0]
  ------------------
  855|      0|                continue;
  856|      0|            if ((algo_strength & SSL_STRONG_MASK)
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
  |  Branch (856:17): [True: 0, False: 0]
  ------------------
  857|      0|                && !(algo_strength & SSL_STRONG_MASK & cp->algo_strength))
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
  |  Branch (857:20): [True: 0, False: 0]
  ------------------
  858|      0|                continue;
  859|      0|            if ((algo_strength & SSL_DEFAULT_MASK)
  ------------------
  |  |  242|      0|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
  |  Branch (859:17): [True: 0, False: 0]
  ------------------
  860|      0|                && !(algo_strength & SSL_DEFAULT_MASK & cp->algo_strength))
  ------------------
  |  |  242|      0|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
  |  Branch (860:20): [True: 0, False: 0]
  ------------------
  861|      0|                continue;
  862|      0|        }
  863|       |
  864|      0|        if (trc_out != NULL)
  ------------------
  |  Branch (864:13): [True: 0, False: 0]
  ------------------
  865|      0|            BIO_printf(trc_out, "Action = %d\n", rule);
  866|       |
  867|       |        /* add the cipher if it has not been added yet. */
  868|      0|        if (rule == CIPHER_ADD) {
  ------------------
  |  |  139|      0|#define CIPHER_ADD      1
  ------------------
  |  Branch (868:13): [True: 0, False: 0]
  ------------------
  869|       |            /* reverse == 0 */
  870|      0|            if (!curr->active) {
  ------------------
  |  Branch (870:17): [True: 0, False: 0]
  ------------------
  871|      0|                ll_append_tail(&head, curr, &tail);
  872|      0|                curr->active = 1;
  873|      0|            }
  874|      0|        }
  875|       |        /* Move the added cipher to this location */
  876|      0|        else if (rule == CIPHER_ORD) {
  ------------------
  |  |  142|      0|#define CIPHER_ORD      4
  ------------------
  |  Branch (876:18): [True: 0, False: 0]
  ------------------
  877|       |            /* reverse == 0 */
  878|      0|            if (curr->active) {
  ------------------
  |  Branch (878:17): [True: 0, False: 0]
  ------------------
  879|      0|                ll_append_tail(&head, curr, &tail);
  880|      0|            }
  881|      0|        } else if (rule == CIPHER_DEL) {
  ------------------
  |  |  141|      0|#define CIPHER_DEL      3
  ------------------
  |  Branch (881:20): [True: 0, False: 0]
  ------------------
  882|       |            /* reverse == 1 */
  883|      0|            if (curr->active) {
  ------------------
  |  Branch (883:17): [True: 0, False: 0]
  ------------------
  884|       |                /*
  885|       |                 * most recently deleted ciphersuites get best positions for
  886|       |                 * any future CIPHER_ADD (note that the CIPHER_DEL loop works
  887|       |                 * in reverse to maintain the order)
  888|       |                 */
  889|      0|                ll_append_head(&head, curr, &tail);
  890|      0|                curr->active = 0;
  891|      0|            }
  892|      0|        } else if (rule == CIPHER_BUMP) {
  ------------------
  |  |  148|      0|#define CIPHER_BUMP     6
  ------------------
  |  Branch (892:20): [True: 0, False: 0]
  ------------------
  893|      0|            if (curr->active)
  ------------------
  |  Branch (893:17): [True: 0, False: 0]
  ------------------
  894|      0|                ll_append_head(&head, curr, &tail);
  895|      0|        } else if (rule == CIPHER_KILL) {
  ------------------
  |  |  140|      0|#define CIPHER_KILL     2
  ------------------
  |  Branch (895:20): [True: 0, False: 0]
  ------------------
  896|       |            /* reverse == 0 */
  897|      0|            if (head == curr)
  ------------------
  |  Branch (897:17): [True: 0, False: 0]
  ------------------
  898|      0|                head = curr->next;
  899|      0|            else
  900|      0|                curr->prev->next = curr->next;
  901|      0|            if (tail == curr)
  ------------------
  |  Branch (901:17): [True: 0, False: 0]
  ------------------
  902|      0|                tail = curr->prev;
  903|      0|            curr->active = 0;
  904|      0|            if (curr->next != NULL)
  ------------------
  |  Branch (904:17): [True: 0, False: 0]
  ------------------
  905|      0|                curr->next->prev = curr->prev;
  906|      0|            if (curr->prev != NULL)
  ------------------
  |  Branch (906:17): [True: 0, False: 0]
  ------------------
  907|      0|                curr->prev->next = curr->next;
  908|      0|            curr->next = NULL;
  909|      0|            curr->prev = NULL;
  910|      0|        }
  911|      0|    }
  912|       |
  913|  1.58k|    *head_p = head;
  914|  1.58k|    *tail_p = tail;
  915|       |
  916|  1.58k|    OSSL_TRACE_END(TLS_CIPHER);
  ------------------
  |  |  225|  1.58k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  917|  1.58k|}
ssl_ciph.c:ssl_cipher_strength_sort:
  921|     79|{
  922|     79|    int32_t max_strength_bits;
  923|     79|    int i, *number_uses;
  924|     79|    CIPHER_ORDER *curr;
  925|       |
  926|       |    /*
  927|       |     * This routine sorts the ciphers with descending strength. The sorting
  928|       |     * must keep the pre-sorted sequence, so we apply the normal sorting
  929|       |     * routine as '+' movement to the end of the list.
  930|       |     */
  931|     79|    max_strength_bits = 0;
  932|     79|    curr = *head_p;
  933|     79|    while (curr != NULL) {
  ------------------
  |  Branch (933:12): [True: 0, False: 79]
  ------------------
  934|      0|        if (curr->active && (curr->cipher->strength_bits > max_strength_bits))
  ------------------
  |  Branch (934:13): [True: 0, False: 0]
  |  Branch (934:29): [True: 0, False: 0]
  ------------------
  935|      0|            max_strength_bits = curr->cipher->strength_bits;
  936|      0|        curr = curr->next;
  937|      0|    }
  938|       |
  939|     79|    number_uses = OPENSSL_zalloc(sizeof(int) * (max_strength_bits + 1));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  940|     79|    if (number_uses == NULL)
  ------------------
  |  Branch (940:9): [True: 0, False: 79]
  ------------------
  941|      0|        return 0;
  942|       |
  943|       |    /*
  944|       |     * Now find the strength_bits values actually used
  945|       |     */
  946|     79|    curr = *head_p;
  947|     79|    while (curr != NULL) {
  ------------------
  |  Branch (947:12): [True: 0, False: 79]
  ------------------
  948|      0|        if (curr->active)
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|      0|            number_uses[curr->cipher->strength_bits]++;
  950|      0|        curr = curr->next;
  951|      0|    }
  952|       |    /*
  953|       |     * Go through the list of used strength_bits values in descending
  954|       |     * order.
  955|       |     */
  956|    158|    for (i = max_strength_bits; i >= 0; i--)
  ------------------
  |  Branch (956:33): [True: 79, False: 79]
  ------------------
  957|     79|        if (number_uses[i] > 0)
  ------------------
  |  Branch (957:13): [True: 0, False: 79]
  ------------------
  958|      0|            ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ORD, i, head_p,
  ------------------
  |  |  142|      0|#define CIPHER_ORD      4
  ------------------
  959|      0|                                  tail_p);
  960|       |
  961|     79|    OPENSSL_free(number_uses);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  962|     79|    return 1;
  963|     79|}
ssl_ciph.c:ssl_cipher_collect_aliases:
  721|     79|{
  722|     79|    CIPHER_ORDER *ciph_curr;
  723|     79|    const SSL_CIPHER **ca_curr;
  724|     79|    int i;
  725|     79|    uint32_t mask_mkey = ~disabled_mkey;
  726|     79|    uint32_t mask_auth = ~disabled_auth;
  727|     79|    uint32_t mask_enc = ~disabled_enc;
  728|     79|    uint32_t mask_mac = ~disabled_mac;
  729|       |
  730|       |    /*
  731|       |     * First, add the real ciphers as already collected
  732|       |     */
  733|     79|    ciph_curr = head;
  734|     79|    ca_curr = ca_list;
  735|     79|    while (ciph_curr != NULL) {
  ------------------
  |  Branch (735:12): [True: 0, False: 79]
  ------------------
  736|      0|        *ca_curr = ciph_curr->cipher;
  737|      0|        ca_curr++;
  738|      0|        ciph_curr = ciph_curr->next;
  739|      0|    }
  740|       |
  741|       |    /*
  742|       |     * Now we add the available ones from the cipher_aliases[] table.
  743|       |     * They represent either one or more algorithms, some of which
  744|       |     * in any affected category must be supported (set in enabled_mask),
  745|       |     * or represent a cipher strength value (will be added in any case because algorithms=0).
  746|       |     */
  747|  6.32k|    for (i = 0; i < num_of_group_aliases; i++) {
  ------------------
  |  Branch (747:17): [True: 6.24k, False: 79]
  ------------------
  748|  6.24k|        uint32_t algorithm_mkey = cipher_aliases[i].algorithm_mkey;
  749|  6.24k|        uint32_t algorithm_auth = cipher_aliases[i].algorithm_auth;
  750|  6.24k|        uint32_t algorithm_enc = cipher_aliases[i].algorithm_enc;
  751|  6.24k|        uint32_t algorithm_mac = cipher_aliases[i].algorithm_mac;
  752|       |
  753|  6.24k|        if (algorithm_mkey)
  ------------------
  |  Branch (753:13): [True: 1.97k, False: 4.26k]
  ------------------
  754|  1.97k|            if ((algorithm_mkey & mask_mkey) == 0)
  ------------------
  |  Branch (754:17): [True: 158, False: 1.81k]
  ------------------
  755|    158|                continue;
  756|       |
  757|  6.08k|        if (algorithm_auth)
  ------------------
  |  Branch (757:13): [True: 1.58k, False: 4.50k]
  ------------------
  758|  1.58k|            if ((algorithm_auth & mask_auth) == 0)
  ------------------
  |  Branch (758:17): [True: 237, False: 1.34k]
  ------------------
  759|    237|                continue;
  760|       |
  761|  5.84k|        if (algorithm_enc)
  ------------------
  |  Branch (761:13): [True: 2.29k, False: 3.55k]
  ------------------
  762|  2.29k|            if ((algorithm_enc & mask_enc) == 0)
  ------------------
  |  Branch (762:17): [True: 474, False: 1.81k]
  ------------------
  763|    474|                continue;
  764|       |
  765|  5.37k|        if (algorithm_mac)
  ------------------
  |  Branch (765:13): [True: 790, False: 4.58k]
  ------------------
  766|    790|            if ((algorithm_mac & mask_mac) == 0)
  ------------------
  |  Branch (766:17): [True: 237, False: 553]
  ------------------
  767|    237|                continue;
  768|       |
  769|  5.13k|        *ca_curr = (SSL_CIPHER *)(cipher_aliases + i);
  770|  5.13k|        ca_curr++;
  771|  5.13k|    }
  772|       |
  773|     79|    *ca_curr = NULL;            /* end of list */
  774|     79|}
ssl_ciph.c:ssl_cipher_process_rulestr:
  969|     79|{
  970|     79|    uint32_t alg_mkey, alg_auth, alg_enc, alg_mac, algo_strength;
  971|     79|    int min_tls;
  972|     79|    const char *l, *buf;
  973|     79|    int j, multi, found, rule, retval, ok, buflen;
  974|     79|    uint32_t cipher_id = 0;
  975|     79|    char ch;
  976|       |
  977|     79|    retval = 1;
  978|     79|    l = rule_str;
  979|    395|    for (;;) {
  980|    395|        ch = *l;
  981|       |
  982|    395|        if (ch == '\0')
  ------------------
  |  Branch (982:13): [True: 0, False: 395]
  ------------------
  983|      0|            break;              /* done */
  984|    395|        if (ch == '-') {
  ------------------
  |  Branch (984:13): [True: 0, False: 395]
  ------------------
  985|      0|            rule = CIPHER_DEL;
  ------------------
  |  |  141|      0|#define CIPHER_DEL      3
  ------------------
  986|      0|            l++;
  987|    395|        } else if (ch == '+') {
  ------------------
  |  Branch (987:20): [True: 0, False: 395]
  ------------------
  988|      0|            rule = CIPHER_ORD;
  ------------------
  |  |  142|      0|#define CIPHER_ORD      4
  ------------------
  989|      0|            l++;
  990|    395|        } else if (ch == '!') {
  ------------------
  |  Branch (990:20): [True: 158, False: 237]
  ------------------
  991|    158|            rule = CIPHER_KILL;
  ------------------
  |  |  140|    158|#define CIPHER_KILL     2
  ------------------
  992|    158|            l++;
  993|    237|        } else if (ch == '@') {
  ------------------
  |  Branch (993:20): [True: 0, False: 237]
  ------------------
  994|      0|            rule = CIPHER_SPECIAL;
  ------------------
  |  |  143|      0|#define CIPHER_SPECIAL  5
  ------------------
  995|      0|            l++;
  996|    237|        } else {
  997|    237|            rule = CIPHER_ADD;
  ------------------
  |  |  139|    237|#define CIPHER_ADD      1
  ------------------
  998|    237|        }
  999|       |
 1000|    395|        if (ITEM_SEP(ch)) {
  ------------------
  |  |  608|    395|        (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (608:10): [True: 158, False: 237]
  |  |  |  Branch (608:26): [True: 0, False: 237]
  |  |  |  Branch (608:42): [True: 0, False: 237]
  |  |  |  Branch (608:58): [True: 0, False: 237]
  |  |  ------------------
  ------------------
 1001|    158|            l++;
 1002|    158|            continue;
 1003|    158|        }
 1004|       |
 1005|    237|        alg_mkey = 0;
 1006|    237|        alg_auth = 0;
 1007|    237|        alg_enc = 0;
 1008|    237|        alg_mac = 0;
 1009|    237|        min_tls = 0;
 1010|    237|        algo_strength = 0;
 1011|       |
 1012|    237|        for (;;) {
 1013|    237|            ch = *l;
 1014|    237|            buf = l;
 1015|    237|            buflen = 0;
 1016|    237|#ifndef CHARSET_EBCDIC
 1017|  2.37k|            while (((ch >= 'A') && (ch <= 'Z')) ||
  ------------------
  |  Branch (1017:21): [True: 2.13k, False: 237]
  |  Branch (1017:36): [True: 2.05k, False: 79]
  ------------------
 1018|  2.37k|                   ((ch >= '0') && (ch <= '9')) ||
  ------------------
  |  Branch (1018:21): [True: 237, False: 79]
  |  Branch (1018:36): [True: 0, False: 237]
  ------------------
 1019|  2.37k|                   ((ch >= 'a') && (ch <= 'z')) ||
  ------------------
  |  Branch (1019:21): [True: 79, False: 237]
  |  Branch (1019:36): [True: 79, False: 0]
  ------------------
 1020|  2.37k|                   (ch == '-') || (ch == '_') || (ch == '.') || (ch == '='))
  ------------------
  |  Branch (1020:20): [True: 0, False: 237]
  |  Branch (1020:35): [True: 0, False: 237]
  |  Branch (1020:50): [True: 0, False: 237]
  |  Branch (1020:65): [True: 0, False: 237]
  ------------------
 1021|       |#else
 1022|       |            while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '_') || (ch == '.')
 1023|       |                   || (ch == '='))
 1024|       |#endif
 1025|  2.13k|            {
 1026|  2.13k|                ch = *(++l);
 1027|  2.13k|                buflen++;
 1028|  2.13k|            }
 1029|       |
 1030|    237|            if (buflen == 0) {
  ------------------
  |  Branch (1030:17): [True: 0, False: 237]
  ------------------
 1031|       |                /*
 1032|       |                 * We hit something we cannot deal with,
 1033|       |                 * it is no command or separator nor
 1034|       |                 * alphanumeric, so we call this an error.
 1035|       |                 */
 1036|      0|                ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1037|      0|                return 0;
 1038|      0|            }
 1039|       |
 1040|    237|            if (rule == CIPHER_SPECIAL) {
  ------------------
  |  |  143|    237|#define CIPHER_SPECIAL  5
  ------------------
  |  Branch (1040:17): [True: 0, False: 237]
  ------------------
 1041|      0|                found = 0;      /* unused -- avoid compiler warning */
 1042|      0|                break;          /* special treatment */
 1043|      0|            }
 1044|       |
 1045|       |            /* check for multi-part specification */
 1046|    237|            if (ch == '+') {
  ------------------
  |  Branch (1046:17): [True: 0, False: 237]
  ------------------
 1047|      0|                multi = 1;
 1048|      0|                l++;
 1049|    237|            } else {
 1050|    237|                multi = 0;
 1051|    237|            }
 1052|       |
 1053|       |            /*
 1054|       |             * Now search for the cipher alias in the ca_list. Be careful
 1055|       |             * with the strncmp, because the "buflen" limitation
 1056|       |             * will make the rule "ADH:SOME" and the cipher
 1057|       |             * "ADH-MY-CIPHER" look like a match for buflen=3.
 1058|       |             * So additionally check whether the cipher name found
 1059|       |             * has the correct length. We can save a strlen() call:
 1060|       |             * just checking for the '\0' at the right place is
 1061|       |             * sufficient, we have to strncmp() anyway. (We cannot
 1062|       |             * use strcmp(), because buf is not '\0' terminated.)
 1063|       |             */
 1064|    237|            j = found = 0;
 1065|    237|            cipher_id = 0;
 1066|  3.08k|            while (ca_list[j]) {
  ------------------
  |  Branch (1066:20): [True: 3.08k, False: 0]
  ------------------
 1067|  3.08k|                if (strncmp(buf, ca_list[j]->name, buflen) == 0
  ------------------
  |  Branch (1067:21): [True: 237, False: 2.84k]
  ------------------
 1068|  3.08k|                    && (ca_list[j]->name[buflen] == '\0')) {
  ------------------
  |  Branch (1068:24): [True: 237, False: 0]
  ------------------
 1069|    237|                    found = 1;
 1070|    237|                    break;
 1071|  2.84k|                } else if (ca_list[j]->stdname != NULL
  ------------------
  |  Branch (1071:28): [True: 0, False: 2.84k]
  ------------------
 1072|  2.84k|                           && strncmp(buf, ca_list[j]->stdname, buflen) == 0
  ------------------
  |  Branch (1072:31): [True: 0, False: 0]
  ------------------
 1073|  2.84k|                           && ca_list[j]->stdname[buflen] == '\0') {
  ------------------
  |  Branch (1073:31): [True: 0, False: 0]
  ------------------
 1074|      0|                    found = 1;
 1075|      0|                    break;
 1076|      0|                } else
 1077|  2.84k|                    j++;
 1078|  3.08k|            }
 1079|       |
 1080|    237|            if (!found)
  ------------------
  |  Branch (1080:17): [True: 0, False: 237]
  ------------------
 1081|      0|                break;          /* ignore this entry */
 1082|       |
 1083|    237|            if (ca_list[j]->algorithm_mkey) {
  ------------------
  |  Branch (1083:17): [True: 0, False: 237]
  ------------------
 1084|      0|                if (alg_mkey) {
  ------------------
  |  Branch (1084:21): [True: 0, False: 0]
  ------------------
 1085|      0|                    alg_mkey &= ca_list[j]->algorithm_mkey;
 1086|      0|                    if (!alg_mkey) {
  ------------------
  |  Branch (1086:25): [True: 0, False: 0]
  ------------------
 1087|      0|                        found = 0;
 1088|      0|                        break;
 1089|      0|                    }
 1090|      0|                } else {
 1091|      0|                    alg_mkey = ca_list[j]->algorithm_mkey;
 1092|      0|                }
 1093|      0|            }
 1094|       |
 1095|    237|            if (ca_list[j]->algorithm_auth) {
  ------------------
  |  Branch (1095:17): [True: 0, False: 237]
  ------------------
 1096|      0|                if (alg_auth) {
  ------------------
  |  Branch (1096:21): [True: 0, False: 0]
  ------------------
 1097|      0|                    alg_auth &= ca_list[j]->algorithm_auth;
 1098|      0|                    if (!alg_auth) {
  ------------------
  |  Branch (1098:25): [True: 0, False: 0]
  ------------------
 1099|      0|                        found = 0;
 1100|      0|                        break;
 1101|      0|                    }
 1102|      0|                } else {
 1103|      0|                    alg_auth = ca_list[j]->algorithm_auth;
 1104|      0|                }
 1105|      0|            }
 1106|       |
 1107|    237|            if (ca_list[j]->algorithm_enc) {
  ------------------
  |  Branch (1107:17): [True: 158, False: 79]
  ------------------
 1108|    158|                if (alg_enc) {
  ------------------
  |  Branch (1108:21): [True: 0, False: 158]
  ------------------
 1109|      0|                    alg_enc &= ca_list[j]->algorithm_enc;
 1110|      0|                    if (!alg_enc) {
  ------------------
  |  Branch (1110:25): [True: 0, False: 0]
  ------------------
 1111|      0|                        found = 0;
 1112|      0|                        break;
 1113|      0|                    }
 1114|    158|                } else {
 1115|    158|                    alg_enc = ca_list[j]->algorithm_enc;
 1116|    158|                }
 1117|    158|            }
 1118|       |
 1119|    237|            if (ca_list[j]->algorithm_mac) {
  ------------------
  |  Branch (1119:17): [True: 0, False: 237]
  ------------------
 1120|      0|                if (alg_mac) {
  ------------------
  |  Branch (1120:21): [True: 0, False: 0]
  ------------------
 1121|      0|                    alg_mac &= ca_list[j]->algorithm_mac;
 1122|      0|                    if (!alg_mac) {
  ------------------
  |  Branch (1122:25): [True: 0, False: 0]
  ------------------
 1123|      0|                        found = 0;
 1124|      0|                        break;
 1125|      0|                    }
 1126|      0|                } else {
 1127|      0|                    alg_mac = ca_list[j]->algorithm_mac;
 1128|      0|                }
 1129|      0|            }
 1130|       |
 1131|    237|            if (ca_list[j]->algo_strength & SSL_STRONG_MASK) {
  ------------------
  |  |  241|    237|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
  |  Branch (1131:17): [True: 0, False: 237]
  ------------------
 1132|      0|                if (algo_strength & SSL_STRONG_MASK) {
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
  |  Branch (1132:21): [True: 0, False: 0]
  ------------------
 1133|      0|                    algo_strength &=
 1134|      0|                        (ca_list[j]->algo_strength & SSL_STRONG_MASK) |
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
 1135|      0|                        ~SSL_STRONG_MASK;
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
 1136|      0|                    if (!(algo_strength & SSL_STRONG_MASK)) {
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
  |  Branch (1136:25): [True: 0, False: 0]
  ------------------
 1137|      0|                        found = 0;
 1138|      0|                        break;
 1139|      0|                    }
 1140|      0|                } else {
 1141|      0|                    algo_strength = ca_list[j]->algo_strength & SSL_STRONG_MASK;
  ------------------
  |  |  241|      0|# define SSL_STRONG_MASK         0x0000001FU
  ------------------
 1142|      0|                }
 1143|      0|            }
 1144|       |
 1145|    237|            if (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) {
  ------------------
  |  |  242|    237|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
  |  Branch (1145:17): [True: 79, False: 158]
  ------------------
 1146|     79|                if (algo_strength & SSL_DEFAULT_MASK) {
  ------------------
  |  |  242|     79|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
  |  Branch (1146:21): [True: 0, False: 79]
  ------------------
 1147|      0|                    algo_strength &=
 1148|      0|                        (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) |
  ------------------
  |  |  242|      0|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
 1149|      0|                        ~SSL_DEFAULT_MASK;
  ------------------
  |  |  242|      0|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
 1150|      0|                    if (!(algo_strength & SSL_DEFAULT_MASK)) {
  ------------------
  |  |  242|      0|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
  |  Branch (1150:25): [True: 0, False: 0]
  ------------------
 1151|      0|                        found = 0;
 1152|      0|                        break;
 1153|      0|                    }
 1154|     79|                } else {
 1155|     79|                    algo_strength |=
 1156|     79|                        ca_list[j]->algo_strength & SSL_DEFAULT_MASK;
  ------------------
  |  |  242|     79|# define SSL_DEFAULT_MASK        0X00000020U
  ------------------
 1157|     79|                }
 1158|     79|            }
 1159|       |
 1160|    237|            if (ca_list[j]->valid) {
  ------------------
  |  Branch (1160:17): [True: 0, False: 237]
  ------------------
 1161|       |                /*
 1162|       |                 * explicit ciphersuite found; its protocol version does not
 1163|       |                 * become part of the search pattern!
 1164|       |                 */
 1165|       |
 1166|      0|                cipher_id = ca_list[j]->id;
 1167|    237|            } else {
 1168|       |                /*
 1169|       |                 * not an explicit ciphersuite; only in this case, the
 1170|       |                 * protocol version is considered part of the search pattern
 1171|       |                 */
 1172|       |
 1173|    237|                if (ca_list[j]->min_tls) {
  ------------------
  |  Branch (1173:21): [True: 0, False: 237]
  ------------------
 1174|      0|                    if (min_tls != 0 && min_tls != ca_list[j]->min_tls) {
  ------------------
  |  Branch (1174:25): [True: 0, False: 0]
  |  Branch (1174:41): [True: 0, False: 0]
  ------------------
 1175|      0|                        found = 0;
 1176|      0|                        break;
 1177|      0|                    } else {
 1178|      0|                        min_tls = ca_list[j]->min_tls;
 1179|      0|                    }
 1180|      0|                }
 1181|    237|            }
 1182|       |
 1183|    237|            if (!multi)
  ------------------
  |  Branch (1183:17): [True: 237, False: 0]
  ------------------
 1184|    237|                break;
 1185|    237|        }
 1186|       |
 1187|       |        /*
 1188|       |         * Ok, we have the rule, now apply it
 1189|       |         */
 1190|    237|        if (rule == CIPHER_SPECIAL) { /* special command */
  ------------------
  |  |  143|    237|#define CIPHER_SPECIAL  5
  ------------------
  |  Branch (1190:13): [True: 0, False: 237]
  ------------------
 1191|      0|            ok = 0;
 1192|      0|            if ((buflen == 8) && HAS_PREFIX(buf, "STRENGTH")) {
  ------------------
  |  |   58|      0|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1192:17): [True: 0, False: 0]
  ------------------
 1193|      0|                ok = ssl_cipher_strength_sort(head_p, tail_p);
 1194|      0|            } else if (buflen == 10 && CHECK_AND_SKIP_PREFIX(buf, "SECLEVEL=")) {
  ------------------
  |  |   61|      0|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|      0|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1194:24): [True: 0, False: 0]
  ------------------
 1195|      0|                int level = *buf - '0';
 1196|      0|                if (level < 0 || level > 5) {
  ------------------
  |  Branch (1196:21): [True: 0, False: 0]
  |  Branch (1196:34): [True: 0, False: 0]
  ------------------
 1197|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1198|      0|                } else {
 1199|      0|                    c->sec_level = level;
 1200|      0|                    ok = 1;
 1201|      0|                }
 1202|      0|            } else {
 1203|      0|                ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1204|      0|            }
 1205|      0|            if (ok == 0)
  ------------------
  |  Branch (1205:17): [True: 0, False: 0]
  ------------------
 1206|      0|                retval = 0;
 1207|       |            /*
 1208|       |             * We do not support any "multi" options
 1209|       |             * together with "@", so throw away the
 1210|       |             * rest of the command, if any left, until
 1211|       |             * end or ':' is found.
 1212|       |             */
 1213|      0|            while ((*l != '\0') && !ITEM_SEP(*l))
  ------------------
  |  |  608|      0|        (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (608:10): [True: 0, False: 0]
  |  |  |  Branch (608:26): [True: 0, False: 0]
  |  |  |  Branch (608:42): [True: 0, False: 0]
  |  |  |  Branch (608:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1213:20): [True: 0, False: 0]
  ------------------
 1214|      0|                l++;
 1215|    237|        } else if (found) {
  ------------------
  |  Branch (1215:20): [True: 237, False: 0]
  ------------------
 1216|    237|            ssl_cipher_apply_rule(cipher_id,
 1217|    237|                                  alg_mkey, alg_auth, alg_enc, alg_mac,
 1218|    237|                                  min_tls, algo_strength, rule, -1, head_p,
 1219|    237|                                  tail_p);
 1220|    237|        } else {
 1221|      0|            while ((*l != '\0') && !ITEM_SEP(*l))
  ------------------
  |  |  608|      0|        (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (608:10): [True: 0, False: 0]
  |  |  |  Branch (608:26): [True: 0, False: 0]
  |  |  |  Branch (608:42): [True: 0, False: 0]
  |  |  |  Branch (608:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1221:20): [True: 0, False: 0]
  ------------------
 1222|      0|                l++;
 1223|      0|        }
 1224|    237|        if (*l == '\0')
  ------------------
  |  Branch (1224:13): [True: 79, False: 158]
  ------------------
 1225|     79|            break;              /* done */
 1226|    237|    }
 1227|       |
 1228|     79|    return retval;
 1229|     79|}
ssl_ciph.c:update_cipher_list_by_id:
 1330|     79|{
 1331|     79|    STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(cipherstack);
  ------------------
  |  |   31|     79|# define STACK_OF(type) struct stack_st_##type
  ------------------
                  STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(cipherstack);
  ------------------
  |  | 1021|     79|#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk)))
  ------------------
 1332|       |
 1333|     79|    if (tmp_cipher_list == NULL) {
  ------------------
  |  Branch (1333:9): [True: 0, False: 79]
  ------------------
 1334|      0|        return 0;
 1335|      0|    }
 1336|       |
 1337|     79|    sk_SSL_CIPHER_free(*cipher_list_by_id);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1338|     79|    *cipher_list_by_id = tmp_cipher_list;
 1339|       |
 1340|     79|    (void)sk_SSL_CIPHER_set_cmp_func(*cipher_list_by_id, ssl_cipher_ptr_id_cmp);
  ------------------
  |  | 1023|     79|#define sk_SSL_CIPHER_set_cmp_func(sk, cmp) ((sk_SSL_CIPHER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_compfunc_type(cmp)))
  ------------------
 1341|     79|    sk_SSL_CIPHER_sort(*cipher_list_by_id);
  ------------------
  |  | 1019|     79|#define sk_SSL_CIPHER_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1342|       |
 1343|     79|    return 1;
 1344|     79|}

SSL_CONF_CTX_free:
 1103|     79|{
 1104|     79|    if (cctx) {
  ------------------
  |  Branch (1104:9): [True: 0, False: 79]
  ------------------
 1105|      0|        free_cert_filename(cctx);
 1106|      0|        OPENSSL_free(cctx->prefix);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1107|      0|        sk_X509_NAME_pop_free(cctx->canames, X509_NAME_free);
  ------------------
  |  |   67|      0|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 1108|      0|        OPENSSL_free(cctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1109|      0|    }
 1110|     79|}

OPENSSL_init_ssl:
   47|     81|{
   48|     81|    static int stoperrset = 0;
   49|       |
   50|     81|    if (stopped) {
  ------------------
  |  Branch (50:9): [True: 0, False: 81]
  ------------------
   51|      0|        if (!stoperrset) {
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|       |            /*
   53|       |             * We only ever set this once to avoid getting into an infinite
   54|       |             * loop where the error system keeps trying to init and fails so
   55|       |             * sets an error etc
   56|       |             */
   57|      0|            stoperrset = 1;
   58|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|        }
   60|      0|        return 0;
   61|      0|    }
   62|       |
   63|     81|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  468|     81|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
   64|     81|         |  OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  469|     81|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
   65|     81|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   66|     81|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  473|     81|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (66:9): [True: 81, False: 0]
  ------------------
   67|     81|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  472|     81|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   68|     81|#endif
   69|       |
   70|     81|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (70:9): [True: 0, False: 81]
  ------------------
   71|      0|        return 0;
   72|       |
   73|     81|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|     81|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 81, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 0, False: 81]
  ------------------
   74|      0|        return 0;
   75|       |
   76|     81|    return 1;
   77|     81|}
ssl_init.c:ossl_init_ssl_base:
   25|      2|{
   26|      2|#ifndef OPENSSL_NO_COMP
   27|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: "
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   28|      2|               "SSL_COMP_get_compression_methods()\n");
   29|       |    /*
   30|       |     * This will initialise the built-in compression algorithms. The value
   31|       |     * returned is a STACK_OF(SSL_COMP), but that can be discarded safely
   32|       |     */
   33|      2|    SSL_COMP_get_compression_methods();
   34|      2|#endif
   35|      2|    ssl_sort_cipher_list();
   36|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   37|      2|    ssl_base_inited = 1;
   38|      2|    return 1;
   39|      2|}

ossl_ssl_init:
  707|     79|{
  708|     79|    if (!SSL_CTX_up_ref(ctx))
  ------------------
  |  Branch (708:9): [True: 0, False: 79]
  ------------------
  709|      0|        return 0;
  710|       |
  711|     79|    ssl->lock = CRYPTO_THREAD_lock_new();
  712|       |
  713|     79|    if (ssl->lock == NULL || !CRYPTO_NEW_REF(&ssl->references, 1))
  ------------------
  |  Branch (713:9): [True: 0, False: 79]
  |  Branch (713:30): [True: 0, False: 79]
  ------------------
  714|      0|        goto err;
  715|       |
  716|     79|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, ssl, &ssl->ex_data)) {
  ------------------
  |  |  229|     79|# define CRYPTO_EX_INDEX_SSL              0
  ------------------
  |  Branch (716:9): [True: 0, False: 79]
  ------------------
  717|      0|        CRYPTO_FREE_REF(&ssl->references);
  718|      0|        goto err;
  719|      0|    }
  720|       |
  721|     79|    ssl->ctx = ctx;
  722|     79|    ssl->type = type;
  723|     79|    ssl->defltmeth = ssl->method = method;
  724|       |
  725|     79|    return 1;
  726|       |
  727|      0|err:
  728|      0|    CRYPTO_THREAD_lock_free(ssl->lock);
  729|      0|    ssl->lock = NULL;
  730|      0|    SSL_CTX_free(ctx);
  731|      0|    return 0;
  732|     79|}
SSL_free:
 1425|     79|{
 1426|     79|    int i;
 1427|       |
 1428|     79|    if (s == NULL)
  ------------------
  |  Branch (1428:9): [True: 0, False: 79]
  ------------------
 1429|      0|        return;
 1430|     79|    CRYPTO_DOWN_REF(&s->references, &i);
 1431|     79|    REF_PRINT_COUNT("SSL", i, s);
  ------------------
  |  |  301|     79|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     79|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     79|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     79|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1432|     79|    if (i > 0)
  ------------------
  |  Branch (1432:9): [True: 0, False: 79]
  ------------------
 1433|      0|        return;
 1434|     79|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 1435|       |
 1436|     79|    if (s->method != NULL)
  ------------------
  |  Branch (1436:9): [True: 79, False: 0]
  ------------------
 1437|     79|        s->method->ssl_free(s);
 1438|       |
 1439|     79|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);
  ------------------
  |  |  229|     79|# define CRYPTO_EX_INDEX_SSL              0
  ------------------
 1440|     79|    SSL_CTX_free(s->ctx);
 1441|     79|    CRYPTO_THREAD_lock_free(s->lock);
 1442|     79|    CRYPTO_FREE_REF(&s->references);
 1443|       |
 1444|     79|    OPENSSL_free(s);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1445|     79|}
SSL_set0_rbio:
 1546|     79|{
 1547|     79|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|     79|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|     79|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   33|     79|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|     79|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   34|     79|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|     79|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|     79|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|     79|          : NULL)))
  |  |  ------------------
  ------------------
 1548|       |
 1549|     79|#ifndef OPENSSL_NO_QUIC
 1550|     79|    if (IS_QUIC(s)) {
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 1551|     79|        ossl_quic_conn_set0_net_rbio(s, rbio);
 1552|     79|        return;
 1553|     79|    }
 1554|      0|#endif
 1555|       |
 1556|      0|    if (sc == NULL)
  ------------------
  |  Branch (1556:9): [True: 0, False: 0]
  ------------------
 1557|      0|        return;
 1558|       |
 1559|      0|    BIO_free_all(sc->rbio);
 1560|      0|    sc->rbio = rbio;
 1561|      0|    sc->rlayer.rrlmethod->set1_bio(sc->rlayer.rrl, sc->rbio);
 1562|      0|}
SSL_set0_wbio:
 1565|     79|{
 1566|     79|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|     79|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|     79|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   33|     79|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|     79|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   34|     79|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|     79|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|     79|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|     79|          : NULL)))
  |  |  ------------------
  ------------------
 1567|       |
 1568|     79|#ifndef OPENSSL_NO_QUIC
 1569|     79|    if (IS_QUIC(s)) {
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 1570|     79|        ossl_quic_conn_set0_net_wbio(s, wbio);
 1571|     79|        return;
 1572|     79|    }
 1573|      0|#endif
 1574|       |
 1575|      0|    if (sc == NULL)
  ------------------
  |  Branch (1575:9): [True: 0, False: 0]
  ------------------
 1576|      0|        return;
 1577|       |
 1578|       |    /*
 1579|       |     * If the output buffering BIO is still in place, remove it
 1580|       |     */
 1581|      0|    if (sc->bbio != NULL)
  ------------------
  |  Branch (1581:9): [True: 0, False: 0]
  ------------------
 1582|      0|        sc->wbio = BIO_pop(sc->wbio);
 1583|       |
 1584|      0|    BIO_free_all(sc->wbio);
 1585|      0|    sc->wbio = wbio;
 1586|       |
 1587|       |    /* Re-attach |bbio| to the new |wbio|. */
 1588|      0|    if (sc->bbio != NULL)
  ------------------
  |  Branch (1588:9): [True: 0, False: 0]
  ------------------
 1589|      0|        sc->wbio = BIO_push(sc->bbio, sc->wbio);
 1590|       |
 1591|      0|    sc->rlayer.wrlmethod->set1_bio(sc->rlayer.wrl, sc->wbio);
 1592|      0|}
SSL_set_bio:
 1595|     79|{
 1596|       |    /*
 1597|       |     * For historical reasons, this function has many different cases in
 1598|       |     * ownership handling.
 1599|       |     */
 1600|       |
 1601|       |    /* If nothing has changed, do nothing */
 1602|     79|    if (rbio == SSL_get_rbio(s) && wbio == SSL_get_wbio(s))
  ------------------
  |  Branch (1602:9): [True: 0, False: 79]
  |  Branch (1602:36): [True: 0, False: 0]
  ------------------
 1603|      0|        return;
 1604|       |
 1605|       |    /*
 1606|       |     * If the two arguments are equal then one fewer reference is granted by the
 1607|       |     * caller than we want to take
 1608|       |     */
 1609|     79|    if (rbio != NULL && rbio == wbio) {
  ------------------
  |  Branch (1609:9): [True: 79, False: 0]
  |  Branch (1609:25): [True: 0, False: 79]
  ------------------
 1610|      0|        if (!BIO_up_ref(rbio))
  ------------------
  |  Branch (1610:13): [True: 0, False: 0]
  ------------------
 1611|      0|            return;
 1612|      0|    }
 1613|       |
 1614|       |    /*
 1615|       |     * If only the wbio is changed only adopt one reference.
 1616|       |     */
 1617|     79|    if (rbio == SSL_get_rbio(s)) {
  ------------------
  |  Branch (1617:9): [True: 0, False: 79]
  ------------------
 1618|      0|        SSL_set0_wbio(s, wbio);
 1619|      0|        return;
 1620|      0|    }
 1621|       |    /*
 1622|       |     * There is an asymmetry here for historical reasons. If only the rbio is
 1623|       |     * changed AND the rbio and wbio were originally different, then we only
 1624|       |     * adopt one reference.
 1625|       |     */
 1626|     79|    if (wbio == SSL_get_wbio(s) && SSL_get_rbio(s) != SSL_get_wbio(s)) {
  ------------------
  |  Branch (1626:9): [True: 0, False: 79]
  |  Branch (1626:36): [True: 0, False: 0]
  ------------------
 1627|      0|        SSL_set0_rbio(s, rbio);
 1628|      0|        return;
 1629|      0|    }
 1630|       |
 1631|       |    /* Otherwise, adopt both references. */
 1632|     79|    SSL_set0_rbio(s, rbio);
 1633|     79|    SSL_set0_wbio(s, wbio);
 1634|     79|}
SSL_get_rbio:
 1637|    158|{
 1638|    158|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|    158|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|    158|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 158]
  |  |  |  |  ------------------
  |  |  |  |   33|    158|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|    158|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 158]
  |  |  |  |  ------------------
  |  |  |  |   34|    158|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|    158|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|    158|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 158, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|    158|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|    158|          : NULL)))
  |  |  ------------------
  ------------------
 1639|       |
 1640|    158|#ifndef OPENSSL_NO_QUIC
 1641|    158|    if (IS_QUIC(s))
  ------------------
  |  |   98|    158|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|    158|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 158, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 158, False: 0]
  |  |  ------------------
  ------------------
 1642|    158|        return ossl_quic_conn_get_net_rbio(s);
 1643|      0|#endif
 1644|       |
 1645|      0|    if (sc == NULL)
  ------------------
  |  Branch (1645:9): [True: 0, False: 0]
  ------------------
 1646|      0|        return NULL;
 1647|       |
 1648|      0|    return sc->rbio;
 1649|      0|}
SSL_get_wbio:
 1652|     79|{
 1653|     79|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|     79|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|     79|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   33|     79|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|     79|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   34|     79|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|     79|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|     79|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|     79|          : NULL)))
  |  |  ------------------
  ------------------
 1654|       |
 1655|     79|#ifndef OPENSSL_NO_QUIC
 1656|     79|    if (IS_QUIC(s))
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 1657|     79|        return ossl_quic_conn_get_net_wbio(s);
 1658|      0|#endif
 1659|       |
 1660|      0|    if (sc == NULL)
  ------------------
  |  Branch (1660:9): [True: 0, False: 0]
  ------------------
 1661|      0|        return NULL;
 1662|       |
 1663|      0|    if (sc->bbio != NULL) {
  ------------------
  |  Branch (1663:9): [True: 0, False: 0]
  ------------------
 1664|       |        /*
 1665|       |         * If |bbio| is active, the true caller-configured BIO is its
 1666|       |         * |next_bio|.
 1667|       |         */
 1668|      0|        return BIO_next(sc->bbio);
 1669|      0|    }
 1670|      0|    return sc->wbio;
 1671|      0|}
SSL_CTX_ctrl:
 3117|     79|{
 3118|     79|    long l;
 3119|       |
 3120|       |    /* For some cases with ctx == NULL or larg == 1 perform syntax checks */
 3121|     79|    if (cmd == SSL_CTRL_SET_GROUPS_LIST && larg == 1)
  ------------------
  |  | 1346|    158|# define SSL_CTRL_SET_GROUPS_LIST                92
  ------------------
  |  Branch (3121:9): [True: 79, False: 0]
  |  Branch (3121:44): [True: 0, False: 79]
  ------------------
 3122|      0|        return tls1_set_groups_list(ctx, NULL, NULL, NULL, NULL, NULL, NULL, parg);
 3123|     79|    if (ctx == NULL) {
  ------------------
  |  Branch (3123:9): [True: 0, False: 79]
  ------------------
 3124|      0|        switch (cmd) {
 3125|      0|        case SSL_CTRL_SET_SIGALGS_LIST:
  ------------------
  |  | 1349|      0|# define SSL_CTRL_SET_SIGALGS_LIST               98
  ------------------
  |  Branch (3125:9): [True: 0, False: 0]
  ------------------
 3126|      0|        case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  ------------------
  |  | 1353|      0|# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST        102
  ------------------
  |  Branch (3126:9): [True: 0, False: 0]
  ------------------
 3127|      0|            return tls1_set_sigalgs_list(ctx, NULL, parg, 0);
 3128|      0|        default:
  ------------------
  |  Branch (3128:9): [True: 0, False: 0]
  ------------------
 3129|      0|            return 0;
 3130|      0|        }
 3131|      0|    }
 3132|       |
 3133|     79|    switch (cmd) {
 3134|      0|    case SSL_CTRL_GET_READ_AHEAD:
  ------------------
  |  | 1296|      0|# define SSL_CTRL_GET_READ_AHEAD                 40
  ------------------
  |  Branch (3134:5): [True: 0, False: 79]
  ------------------
 3135|      0|        return ctx->read_ahead;
 3136|      0|    case SSL_CTRL_SET_READ_AHEAD:
  ------------------
  |  | 1297|      0|# define SSL_CTRL_SET_READ_AHEAD                 41
  ------------------
  |  Branch (3136:5): [True: 0, False: 79]
  ------------------
 3137|      0|        l = ctx->read_ahead;
 3138|      0|        ctx->read_ahead = larg;
 3139|      0|        return l;
 3140|       |
 3141|      0|    case SSL_CTRL_SET_MSG_CALLBACK_ARG:
  ------------------
  |  | 1279|      0|# define SSL_CTRL_SET_MSG_CALLBACK_ARG           16
  ------------------
  |  Branch (3141:5): [True: 0, False: 79]
  ------------------
 3142|      0|        ctx->msg_callback_arg = parg;
 3143|      0|        return 1;
 3144|       |
 3145|      0|    case SSL_CTRL_GET_MAX_CERT_LIST:
  ------------------
  |  | 1302|      0|# define SSL_CTRL_GET_MAX_CERT_LIST              50
  ------------------
  |  Branch (3145:5): [True: 0, False: 79]
  ------------------
 3146|      0|        return (long)ctx->max_cert_list;
 3147|      0|    case SSL_CTRL_SET_MAX_CERT_LIST:
  ------------------
  |  | 1303|      0|# define SSL_CTRL_SET_MAX_CERT_LIST              51
  ------------------
  |  Branch (3147:5): [True: 0, False: 79]
  ------------------
 3148|      0|        if (larg < 0)
  ------------------
  |  Branch (3148:13): [True: 0, False: 0]
  ------------------
 3149|      0|            return 0;
 3150|      0|        l = (long)ctx->max_cert_list;
 3151|      0|        ctx->max_cert_list = (size_t)larg;
 3152|      0|        return l;
 3153|       |
 3154|      0|    case SSL_CTRL_SET_SESS_CACHE_SIZE:
  ------------------
  |  | 1298|      0|# define SSL_CTRL_SET_SESS_CACHE_SIZE            42
  ------------------
  |  Branch (3154:5): [True: 0, False: 79]
  ------------------
 3155|      0|        if (larg < 0)
  ------------------
  |  Branch (3155:13): [True: 0, False: 0]
  ------------------
 3156|      0|            return 0;
 3157|      0|        l = (long)ctx->session_cache_size;
 3158|      0|        ctx->session_cache_size = (size_t)larg;
 3159|      0|        return l;
 3160|      0|    case SSL_CTRL_GET_SESS_CACHE_SIZE:
  ------------------
  |  | 1299|      0|# define SSL_CTRL_GET_SESS_CACHE_SIZE            43
  ------------------
  |  Branch (3160:5): [True: 0, False: 79]
  ------------------
 3161|      0|        return (long)ctx->session_cache_size;
 3162|      0|    case SSL_CTRL_SET_SESS_CACHE_MODE:
  ------------------
  |  | 1300|      0|# define SSL_CTRL_SET_SESS_CACHE_MODE            44
  ------------------
  |  Branch (3162:5): [True: 0, False: 79]
  ------------------
 3163|      0|        l = ctx->session_cache_mode;
 3164|      0|        ctx->session_cache_mode = larg;
 3165|      0|        return l;
 3166|      0|    case SSL_CTRL_GET_SESS_CACHE_MODE:
  ------------------
  |  | 1301|      0|# define SSL_CTRL_GET_SESS_CACHE_MODE            45
  ------------------
  |  Branch (3166:5): [True: 0, False: 79]
  ------------------
 3167|      0|        return ctx->session_cache_mode;
 3168|       |
 3169|      0|    case SSL_CTRL_SESS_NUMBER:
  ------------------
  |  | 1283|      0|# define SSL_CTRL_SESS_NUMBER                    20
  ------------------
  |  Branch (3169:5): [True: 0, False: 79]
  ------------------
 3170|      0|        return lh_SSL_SESSION_num_items(ctx->sessions);
 3171|      0|    case SSL_CTRL_SESS_CONNECT:
  ------------------
  |  | 1284|      0|# define SSL_CTRL_SESS_CONNECT                   21
  ------------------
  |  Branch (3171:5): [True: 0, False: 79]
  ------------------
 3172|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect);
 3173|      0|    case SSL_CTRL_SESS_CONNECT_GOOD:
  ------------------
  |  | 1285|      0|# define SSL_CTRL_SESS_CONNECT_GOOD              22
  ------------------
  |  Branch (3173:5): [True: 0, False: 79]
  ------------------
 3174|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect_good);
 3175|      0|    case SSL_CTRL_SESS_CONNECT_RENEGOTIATE:
  ------------------
  |  | 1286|      0|# define SSL_CTRL_SESS_CONNECT_RENEGOTIATE       23
  ------------------
  |  Branch (3175:5): [True: 0, False: 79]
  ------------------
 3176|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect_renegotiate);
 3177|      0|    case SSL_CTRL_SESS_ACCEPT:
  ------------------
  |  | 1287|      0|# define SSL_CTRL_SESS_ACCEPT                    24
  ------------------
  |  Branch (3177:5): [True: 0, False: 79]
  ------------------
 3178|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept);
 3179|      0|    case SSL_CTRL_SESS_ACCEPT_GOOD:
  ------------------
  |  | 1288|      0|# define SSL_CTRL_SESS_ACCEPT_GOOD               25
  ------------------
  |  Branch (3179:5): [True: 0, False: 79]
  ------------------
 3180|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept_good);
 3181|      0|    case SSL_CTRL_SESS_ACCEPT_RENEGOTIATE:
  ------------------
  |  | 1289|      0|# define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE        26
  ------------------
  |  Branch (3181:5): [True: 0, False: 79]
  ------------------
 3182|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept_renegotiate);
 3183|      0|    case SSL_CTRL_SESS_HIT:
  ------------------
  |  | 1290|      0|# define SSL_CTRL_SESS_HIT                       27
  ------------------
  |  Branch (3183:5): [True: 0, False: 79]
  ------------------
 3184|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_hit);
 3185|      0|    case SSL_CTRL_SESS_CB_HIT:
  ------------------
  |  | 1291|      0|# define SSL_CTRL_SESS_CB_HIT                    28
  ------------------
  |  Branch (3185:5): [True: 0, False: 79]
  ------------------
 3186|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_cb_hit);
 3187|      0|    case SSL_CTRL_SESS_MISSES:
  ------------------
  |  | 1292|      0|# define SSL_CTRL_SESS_MISSES                    29
  ------------------
  |  Branch (3187:5): [True: 0, False: 79]
  ------------------
 3188|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_miss);
 3189|      0|    case SSL_CTRL_SESS_TIMEOUTS:
  ------------------
  |  | 1293|      0|# define SSL_CTRL_SESS_TIMEOUTS                  30
  ------------------
  |  Branch (3189:5): [True: 0, False: 79]
  ------------------
 3190|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_timeout);
 3191|      0|    case SSL_CTRL_SESS_CACHE_FULL:
  ------------------
  |  | 1294|      0|# define SSL_CTRL_SESS_CACHE_FULL                31
  ------------------
  |  Branch (3191:5): [True: 0, False: 79]
  ------------------
 3192|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_cache_full);
 3193|      0|    case SSL_CTRL_MODE:
  ------------------
  |  | 1295|      0|# define SSL_CTRL_MODE                           33
  ------------------
  |  Branch (3193:5): [True: 0, False: 79]
  ------------------
 3194|      0|        return (ctx->mode |= larg);
 3195|      0|    case SSL_CTRL_CLEAR_MODE:
  ------------------
  |  | 1338|      0|# define SSL_CTRL_CLEAR_MODE                     78
  ------------------
  |  Branch (3195:5): [True: 0, False: 79]
  ------------------
 3196|      0|        return (ctx->mode &= ~larg);
 3197|      0|    case SSL_CTRL_SET_MAX_SEND_FRAGMENT:
  ------------------
  |  | 1304|      0|# define SSL_CTRL_SET_MAX_SEND_FRAGMENT          52
  ------------------
  |  Branch (3197:5): [True: 0, False: 79]
  ------------------
 3198|      0|        if (larg < 512 || larg > SSL3_RT_MAX_PLAIN_LENGTH)
  ------------------
  |  |  177|      0|# define SSL3_RT_MAX_PLAIN_LENGTH                16384
  ------------------
  |  Branch (3198:13): [True: 0, False: 0]
  |  Branch (3198:27): [True: 0, False: 0]
  ------------------
 3199|      0|            return 0;
 3200|      0|        ctx->max_send_fragment = larg;
 3201|      0|        if (ctx->max_send_fragment < ctx->split_send_fragment)
  ------------------
  |  Branch (3201:13): [True: 0, False: 0]
  ------------------
 3202|      0|            ctx->split_send_fragment = ctx->max_send_fragment;
 3203|      0|        return 1;
 3204|      0|    case SSL_CTRL_SET_SPLIT_SEND_FRAGMENT:
  ------------------
  |  | 1372|      0|# define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT        125
  ------------------
  |  Branch (3204:5): [True: 0, False: 79]
  ------------------
 3205|      0|        if ((size_t)larg > ctx->max_send_fragment || larg == 0)
  ------------------
  |  Branch (3205:13): [True: 0, False: 0]
  |  Branch (3205:54): [True: 0, False: 0]
  ------------------
 3206|      0|            return 0;
 3207|      0|        ctx->split_send_fragment = larg;
 3208|      0|        return 1;
 3209|      0|    case SSL_CTRL_SET_MAX_PIPELINES:
  ------------------
  |  | 1373|      0|# define SSL_CTRL_SET_MAX_PIPELINES              126
  ------------------
  |  Branch (3209:5): [True: 0, False: 79]
  ------------------
 3210|      0|        if (larg < 1 || larg > SSL_MAX_PIPELINES)
  ------------------
  |  |   69|      0|# define SSL_MAX_PIPELINES  32
  ------------------
  |  Branch (3210:13): [True: 0, False: 0]
  |  Branch (3210:25): [True: 0, False: 0]
  ------------------
 3211|      0|            return 0;
 3212|      0|        ctx->max_pipelines = larg;
 3213|      0|        return 1;
 3214|      0|    case SSL_CTRL_CERT_FLAGS:
  ------------------
  |  | 1350|      0|# define SSL_CTRL_CERT_FLAGS                     99
  ------------------
  |  Branch (3214:5): [True: 0, False: 79]
  ------------------
 3215|      0|        return (ctx->cert->cert_flags |= larg);
 3216|      0|    case SSL_CTRL_CLEAR_CERT_FLAGS:
  ------------------
  |  | 1351|      0|# define SSL_CTRL_CLEAR_CERT_FLAGS               100
  ------------------
  |  Branch (3216:5): [True: 0, False: 79]
  ------------------
 3217|      0|        return (ctx->cert->cert_flags &= ~larg);
 3218|      0|    case SSL_CTRL_SET_MIN_PROTO_VERSION:
  ------------------
  |  | 1370|      0|# define SSL_CTRL_SET_MIN_PROTO_VERSION          123
  ------------------
  |  Branch (3218:5): [True: 0, False: 79]
  ------------------
 3219|      0|        return ssl_check_allowed_versions(larg, ctx->max_proto_version)
  ------------------
  |  Branch (3219:16): [True: 0, False: 0]
  ------------------
 3220|      0|               && ssl_set_version_bound(ctx->method->version, (int)larg,
  ------------------
  |  Branch (3220:19): [True: 0, False: 0]
  ------------------
 3221|      0|                                        &ctx->min_proto_version);
 3222|      0|    case SSL_CTRL_GET_MIN_PROTO_VERSION:
  ------------------
  |  | 1377|      0|# define SSL_CTRL_GET_MIN_PROTO_VERSION          130
  ------------------
  |  Branch (3222:5): [True: 0, False: 79]
  ------------------
 3223|      0|        return ctx->min_proto_version;
 3224|      0|    case SSL_CTRL_SET_MAX_PROTO_VERSION:
  ------------------
  |  | 1371|      0|# define SSL_CTRL_SET_MAX_PROTO_VERSION          124
  ------------------
  |  Branch (3224:5): [True: 0, False: 79]
  ------------------
 3225|      0|        return ssl_check_allowed_versions(ctx->min_proto_version, larg)
  ------------------
  |  Branch (3225:16): [True: 0, False: 0]
  ------------------
 3226|      0|               && ssl_set_version_bound(ctx->method->version, (int)larg,
  ------------------
  |  Branch (3226:19): [True: 0, False: 0]
  ------------------
 3227|      0|                                        &ctx->max_proto_version);
 3228|      0|    case SSL_CTRL_GET_MAX_PROTO_VERSION:
  ------------------
  |  | 1378|      0|# define SSL_CTRL_GET_MAX_PROTO_VERSION          131
  ------------------
  |  Branch (3228:5): [True: 0, False: 79]
  ------------------
 3229|      0|        return ctx->max_proto_version;
 3230|     79|    default:
  ------------------
  |  Branch (3230:5): [True: 79, False: 0]
  ------------------
 3231|     79|        return ctx->method->ssl_ctx_ctrl(ctx, cmd, larg, parg);
 3232|     79|    }
 3233|     79|}
ssl_cipher_ptr_id_cmp:
 3261|    237|{
 3262|    237|    if ((*ap)->id > (*bp)->id)
  ------------------
  |  Branch (3262:9): [True: 158, False: 79]
  ------------------
 3263|    158|        return 1;
 3264|     79|    if ((*ap)->id < (*bp)->id)
  ------------------
  |  Branch (3264:9): [True: 79, False: 0]
  ------------------
 3265|     79|        return -1;
 3266|      0|    return 0;
 3267|     79|}
SSL_CTX_set_alpn_select_cb:
 3807|     79|{
 3808|     79|    ctx->ext.alpn_select_cb = cb;
 3809|     79|    ctx->ext.alpn_select_cb_arg = arg;
 3810|     79|}
SSL_CTX_new_ex:
 3988|     79|{
 3989|     79|    SSL_CTX *ret = NULL;
 3990|       |#ifndef OPENSSL_NO_SSLKEYLOG
 3991|       |    const char *keylogfile = ossl_safe_getenv("SSLKEYLOGFILE");
 3992|       |#endif
 3993|       |#ifndef OPENSSL_NO_COMP_ALG
 3994|       |    int i;
 3995|       |#endif
 3996|       |
 3997|     79|    if (meth == NULL) {
  ------------------
  |  Branch (3997:9): [True: 0, False: 79]
  ------------------
 3998|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3999|      0|        return NULL;
 4000|      0|    }
 4001|       |
 4002|     79|    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL))
  ------------------
  |  | 2807|     79|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (4002:9): [True: 0, False: 79]
  ------------------
 4003|      0|        return NULL;
 4004|       |
 4005|       |    /* Doing this for the run once effect */
 4006|     79|    if (SSL_get_ex_data_X509_STORE_CTX_idx() < 0) {
  ------------------
  |  Branch (4006:9): [True: 0, False: 79]
  ------------------
 4007|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4008|      0|        goto err;
 4009|      0|    }
 4010|       |
 4011|     79|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4012|     79|    if (ret == NULL)
  ------------------
  |  Branch (4012:9): [True: 0, False: 79]
  ------------------
 4013|      0|        return NULL;
 4014|       |
 4015|       |    /* Init the reference counting before any call to SSL_CTX_free */
 4016|     79|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (4016:9): [True: 0, False: 79]
  ------------------
 4017|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4018|      0|        return NULL;
 4019|      0|    }
 4020|       |
 4021|     79|    ret->lock = CRYPTO_THREAD_lock_new();
 4022|     79|    if (ret->lock == NULL) {
  ------------------
  |  Branch (4022:9): [True: 0, False: 79]
  ------------------
 4023|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4024|      0|        goto err;
 4025|      0|    }
 4026|       |
 4027|       |#ifdef TSAN_REQUIRES_LOCKING
 4028|       |    ret->tsan_lock = CRYPTO_THREAD_lock_new();
 4029|       |    if (ret->tsan_lock == NULL) {
 4030|       |        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
 4031|       |        goto err;
 4032|       |    }
 4033|       |#endif
 4034|       |
 4035|     79|    ret->libctx = libctx;
 4036|     79|    if (propq != NULL) {
  ------------------
  |  Branch (4036:9): [True: 0, False: 79]
  ------------------
 4037|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4038|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (4038:13): [True: 0, False: 0]
  ------------------
 4039|      0|            goto err;
 4040|      0|    }
 4041|       |
 4042|     79|    ret->method = meth;
 4043|     79|    ret->min_proto_version = 0;
 4044|     79|    ret->max_proto_version = 0;
 4045|     79|    ret->mode = SSL_MODE_AUTO_RETRY;
  ------------------
  |  |  503|     79|# define SSL_MODE_AUTO_RETRY 0x00000004U
  ------------------
 4046|     79|    ret->session_cache_mode = SSL_SESS_CACHE_SERVER;
  ------------------
  |  |  708|     79|# define SSL_SESS_CACHE_SERVER                   0x0002
  ------------------
 4047|     79|    ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT;
  ------------------
  |  |  689|     79|# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT      (1024*20)
  ------------------
 4048|       |    /* We take the system default. */
 4049|     79|    ret->session_timeout = meth->get_timeout();
 4050|     79|    ret->max_cert_list = SSL_MAX_CERT_LIST_DEFAULT;
  ------------------
  |  |  687|     79|# define SSL_MAX_CERT_LIST_DEFAULT (1024*100)
  ------------------
 4051|     79|    ret->verify_mode = SSL_VERIFY_NONE;
  ------------------
  |  | 1170|     79|# define SSL_VERIFY_NONE                 0x00
  ------------------
 4052|       |
 4053|     79|    ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp);
 4054|     79|    if (ret->sessions == NULL) {
  ------------------
  |  Branch (4054:9): [True: 0, False: 79]
  ------------------
 4055|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4056|      0|        goto err;
 4057|      0|    }
 4058|     79|    ret->cert_store = X509_STORE_new();
 4059|     79|    if (ret->cert_store == NULL) {
  ------------------
  |  Branch (4059:9): [True: 0, False: 79]
  ------------------
 4060|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4061|      0|        goto err;
 4062|      0|    }
 4063|     79|#ifndef OPENSSL_NO_CT
 4064|     79|    ret->ctlog_store = CTLOG_STORE_new_ex(libctx, propq);
 4065|     79|    if (ret->ctlog_store == NULL) {
  ------------------
  |  Branch (4065:9): [True: 0, False: 79]
  ------------------
 4066|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CT_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4067|      0|        goto err;
 4068|      0|    }
 4069|     79|#endif
 4070|       |
 4071|       |    /* initialize cipher/digest methods table */
 4072|     79|    if (!ssl_load_ciphers(ret)) {
  ------------------
  |  Branch (4072:9): [True: 0, False: 79]
  ------------------
 4073|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4074|      0|        goto err;
 4075|      0|    }
 4076|       |
 4077|     79|    if (!ssl_load_groups(ret)) {
  ------------------
  |  Branch (4077:9): [True: 0, False: 79]
  ------------------
 4078|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4079|      0|        goto err;
 4080|      0|    }
 4081|       |
 4082|       |    /* load provider sigalgs */
 4083|     79|    if (!ssl_load_sigalgs(ret)) {
  ------------------
  |  Branch (4083:9): [True: 0, False: 79]
  ------------------
 4084|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4085|      0|        goto err;
 4086|      0|    }
 4087|       |
 4088|       |    /* initialise sig algs */
 4089|     79|    if (!ssl_setup_sigalgs(ret)) {
  ------------------
  |  Branch (4089:9): [True: 0, False: 79]
  ------------------
 4090|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4091|      0|        goto err;
 4092|      0|    }
 4093|       |
 4094|     79|    if (!SSL_CTX_set_ciphersuites(ret, OSSL_default_ciphersuites())) {
  ------------------
  |  Branch (4094:9): [True: 0, False: 79]
  ------------------
 4095|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4096|      0|        goto err;
 4097|      0|    }
 4098|       |
 4099|     79|    if ((ret->cert = ssl_cert_new(SSL_PKEY_NUM + ret->sigalg_list_len)) == NULL) {
  ------------------
  |  |  329|     79|# define SSL_PKEY_NUM            9
  ------------------
  |  Branch (4099:9): [True: 0, False: 79]
  ------------------
 4100|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4101|      0|        goto err;
 4102|      0|    }
 4103|       |
 4104|     79|    if (!ssl_create_cipher_list(ret,
  ------------------
  |  Branch (4104:9): [True: 0, False: 79]
  ------------------
 4105|     79|                                ret->tls13_ciphersuites,
 4106|     79|                                &ret->cipher_list, &ret->cipher_list_by_id,
 4107|     79|                                OSSL_default_cipher_list(), ret->cert)
 4108|     79|        || sk_SSL_CIPHER_num(ret->cipher_list) <= 0) {
  ------------------
  |  |  999|     79|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (4108:12): [True: 0, False: 79]
  ------------------
 4109|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4110|      0|        goto err;
 4111|      0|    }
 4112|       |
 4113|     79|    ret->param = X509_VERIFY_PARAM_new();
 4114|     79|    if (ret->param == NULL) {
  ------------------
  |  Branch (4114:9): [True: 0, False: 79]
  ------------------
 4115|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4116|      0|        goto err;
 4117|      0|    }
 4118|       |
 4119|       |    /*
 4120|       |     * If these aren't available from the provider we'll get NULL returns.
 4121|       |     * That's fine but will cause errors later if SSLv3 is negotiated
 4122|       |     */
 4123|     79|    ret->md5 = ssl_evp_md_fetch(libctx, NID_md5, propq);
  ------------------
  |  | 1215|     79|#define NID_md5         4
  ------------------
 4124|     79|    ret->sha1 = ssl_evp_md_fetch(libctx, NID_sha1, propq);
  ------------------
  |  | 2321|     79|#define NID_sha1                64
  ------------------
 4125|       |
 4126|     79|    if ((ret->ca_names = sk_X509_NAME_new_null()) == NULL) {
  ------------------
  |  |   56|     79|#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4126:9): [True: 0, False: 79]
  ------------------
 4127|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4128|      0|        goto err;
 4129|      0|    }
 4130|       |
 4131|     79|    if ((ret->client_ca_names = sk_X509_NAME_new_null()) == NULL) {
  ------------------
  |  |   56|     79|#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4131:9): [True: 0, False: 79]
  ------------------
 4132|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4133|      0|        goto err;
 4134|      0|    }
 4135|       |
 4136|     79|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_CTX, ret, &ret->ex_data)) {
  ------------------
  |  |  230|     79|# define CRYPTO_EX_INDEX_SSL_CTX          1
  ------------------
  |  Branch (4136:9): [True: 0, False: 79]
  ------------------
 4137|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4138|      0|        goto err;
 4139|      0|    }
 4140|       |
 4141|     79|    if ((ret->ext.secure = OPENSSL_secure_zalloc(sizeof(*ret->ext.secure))) == NULL)
  ------------------
  |  |  125|     79|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4141:9): [True: 0, False: 79]
  ------------------
 4142|      0|        goto err;
 4143|       |
 4144|       |    /* No compression for DTLS */
 4145|     79|    if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS))
  ------------------
  |  | 2186|     79|# define SSL_ENC_FLAG_DTLS               0x8
  ------------------
  |  Branch (4145:9): [True: 79, False: 0]
  ------------------
 4146|     79|        ret->comp_methods = SSL_COMP_get_compression_methods();
 4147|       |
 4148|     79|    ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|     79|# define SSL3_RT_MAX_PLAIN_LENGTH                16384
  ------------------
 4149|     79|    ret->split_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|     79|# define SSL3_RT_MAX_PLAIN_LENGTH                16384
  ------------------
 4150|       |
 4151|       |    /* Setup RFC5077 ticket keys */
 4152|     79|    if ((RAND_bytes_ex(libctx, ret->ext.tick_key_name,
  ------------------
  |  Branch (4152:9): [True: 0, False: 79]
  ------------------
 4153|     79|                       sizeof(ret->ext.tick_key_name), 0) <= 0)
 4154|     79|        || (RAND_priv_bytes_ex(libctx, ret->ext.secure->tick_hmac_key,
  ------------------
  |  Branch (4154:12): [True: 0, False: 79]
  ------------------
 4155|     79|                               sizeof(ret->ext.secure->tick_hmac_key), 0) <= 0)
 4156|     79|        || (RAND_priv_bytes_ex(libctx, ret->ext.secure->tick_aes_key,
  ------------------
  |  Branch (4156:12): [True: 0, False: 79]
  ------------------
 4157|     79|                               sizeof(ret->ext.secure->tick_aes_key), 0) <= 0))
 4158|      0|        ret->options |= SSL_OP_NO_TICKET;
  ------------------
  |  |  381|      0|# define SSL_OP_NO_TICKET                                SSL_OP_BIT(14)
  |  |  ------------------
  |  |  |  |  348|      0|#define SSL_OP_BIT(n)  ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
 4159|       |
 4160|     79|    if (RAND_priv_bytes_ex(libctx, ret->ext.cookie_hmac_key,
  ------------------
  |  Branch (4160:9): [True: 0, False: 79]
  ------------------
 4161|     79|                           sizeof(ret->ext.cookie_hmac_key), 0) <= 0) {
 4162|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_RAND_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4163|      0|        goto err;
 4164|      0|    }
 4165|       |
 4166|     79|#ifndef OPENSSL_NO_SRP
 4167|     79|    if (!ssl_ctx_srp_ctx_init_intern(ret)) {
  ------------------
  |  Branch (4167:9): [True: 0, False: 79]
  ------------------
 4168|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4169|      0|        goto err;
 4170|      0|    }
 4171|     79|#endif
 4172|     79|#ifndef OPENSSL_NO_ENGINE
 4173|       |# ifdef OPENSSL_SSL_CLIENT_ENGINE_AUTO
 4174|       |#  define eng_strx(x)     #x
 4175|       |#  define eng_str(x)      eng_strx(x)
 4176|       |    /* Use specific client engine automatically... ignore errors */
 4177|       |    {
 4178|       |        ENGINE *eng;
 4179|       |        eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
 4180|       |        if (!eng) {
 4181|       |            ERR_clear_error();
 4182|       |            ENGINE_load_builtin_engines();
 4183|       |            eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
 4184|       |        }
 4185|       |        if (!eng || !SSL_CTX_set_client_cert_engine(ret, eng))
 4186|       |            ERR_clear_error();
 4187|       |    }
 4188|       |# endif
 4189|     79|#endif
 4190|       |
 4191|       |#ifndef OPENSSL_NO_COMP_ALG
 4192|       |    /*
 4193|       |     * Set the default order: brotli, zlib, zstd
 4194|       |     * Including only those enabled algorithms
 4195|       |     */
 4196|       |    memset(ret->cert_comp_prefs, 0, sizeof(ret->cert_comp_prefs));
 4197|       |    i = 0;
 4198|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_brotli))
 4199|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_brotli;
 4200|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_zlib))
 4201|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_zlib;
 4202|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_zstd))
 4203|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_zstd;
 4204|       |#endif
 4205|       |    /*
 4206|       |     * Disable compression by default to prevent CRIME. Applications can
 4207|       |     * re-enable compression by configuring
 4208|       |     * SSL_CTX_clear_options(ctx, SSL_OP_NO_COMPRESSION);
 4209|       |     * or by using the SSL_CONF library. Similarly we also enable TLSv1.3
 4210|       |     * middlebox compatibility by default. This may be disabled by default in
 4211|       |     * a later OpenSSL version.
 4212|       |     */
 4213|     79|    ret->options |= SSL_OP_NO_COMPRESSION | SSL_OP_ENABLE_MIDDLEBOX_COMPAT;
  ------------------
  |  |  392|     79|# define SSL_OP_NO_COMPRESSION                           SSL_OP_BIT(17)
  |  |  ------------------
  |  |  |  |  348|     79|#define SSL_OP_BIT(n)  ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
                  ret->options |= SSL_OP_NO_COMPRESSION | SSL_OP_ENABLE_MIDDLEBOX_COMPAT;
  ------------------
  |  |  401|     79|# define SSL_OP_ENABLE_MIDDLEBOX_COMPAT                  SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  348|     79|#define SSL_OP_BIT(n)  ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
 4214|       |
 4215|     79|    ret->ext.status_type = TLSEXT_STATUSTYPE_nothing;
  ------------------
  |  | 2203|     79|#define TLSEXT_STATUSTYPE_nothing  -1
  ------------------
 4216|       |
 4217|       |    /*
 4218|       |     * We cannot usefully set a default max_early_data here (which gets
 4219|       |     * propagated in SSL_new(), for the following reason: setting the
 4220|       |     * SSL field causes tls_construct_stoc_early_data() to tell the
 4221|       |     * client that early data will be accepted when constructing a TLS 1.3
 4222|       |     * session ticket, and the client will accordingly send us early data
 4223|       |     * when using that ticket (if the client has early data to send).
 4224|       |     * However, in order for the early data to actually be consumed by
 4225|       |     * the application, the application must also have calls to
 4226|       |     * SSL_read_early_data(); otherwise we'll just skip past the early data
 4227|       |     * and ignore it.  So, since the application must add calls to
 4228|       |     * SSL_read_early_data(), we also require them to add
 4229|       |     * calls to SSL_CTX_set_max_early_data() in order to use early data,
 4230|       |     * eliminating the bandwidth-wasting early data in the case described
 4231|       |     * above.
 4232|       |     */
 4233|     79|    ret->max_early_data = 0;
 4234|       |
 4235|       |    /*
 4236|       |     * Default recv_max_early_data is a fully loaded single record. Could be
 4237|       |     * split across multiple records in practice. We set this differently to
 4238|       |     * max_early_data so that, in the default case, we do not advertise any
 4239|       |     * support for early_data, but if a client were to send us some (e.g.
 4240|       |     * because of an old, stale ticket) then we will tolerate it and skip over
 4241|       |     * it.
 4242|       |     */
 4243|     79|    ret->recv_max_early_data = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|     79|# define SSL3_RT_MAX_PLAIN_LENGTH                16384
  ------------------
 4244|       |
 4245|       |    /* By default we send two session tickets automatically in TLSv1.3 */
 4246|     79|    ret->num_tickets = 2;
 4247|       |
 4248|     79|# ifndef OPENSSL_NO_QUIC
 4249|       |    /* only create a cache for client CTX-es */
 4250|     79|    if (meth == OSSL_QUIC_client_method())
  ------------------
  |  Branch (4250:9): [True: 0, False: 79]
  ------------------
 4251|      0|        if ((ret->tokencache = ossl_quic_new_token_store()) == NULL)
  ------------------
  |  Branch (4251:13): [True: 0, False: 0]
  ------------------
 4252|      0|            goto err;
 4253|     79|    ret->domain_flags = 0;
 4254|     79|    if (IS_QUIC_METHOD(meth)) {
  ------------------
  |  |   52|     79|    ((m) == OSSL_QUIC_client_method() || \
  |  |  ------------------
  |  |  |  Branch (52:6): [True: 0, False: 79]
  |  |  ------------------
  |  |   53|     79|     (m) == OSSL_QUIC_client_thread_method() || \
  |  |  ------------------
  |  |  |  Branch (53:6): [True: 0, False: 79]
  |  |  ------------------
  |  |   54|     79|     (m) == OSSL_QUIC_server_method())
  |  |  ------------------
  |  |  |  Branch (54:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 4255|     79|#  if defined(OPENSSL_THREADS)
 4256|     79|        if (meth == OSSL_QUIC_client_thread_method())
  ------------------
  |  Branch (4256:13): [True: 0, False: 79]
  ------------------
 4257|      0|            ret->domain_flags
 4258|      0|                = SSL_DOMAIN_FLAG_MULTI_THREAD
  ------------------
  |  | 2373|      0|#define SSL_DOMAIN_FLAG_MULTI_THREAD        (1U << 1)
  ------------------
 4259|      0|                | SSL_DOMAIN_FLAG_THREAD_ASSISTED
  ------------------
  |  | 2374|      0|#define SSL_DOMAIN_FLAG_THREAD_ASSISTED     (1U << 2)
  ------------------
 4260|      0|                | SSL_DOMAIN_FLAG_BLOCKING;
  ------------------
  |  | 2375|      0|#define SSL_DOMAIN_FLAG_BLOCKING            (1U << 3)
  ------------------
 4261|     79|        else
 4262|     79|            ret->domain_flags
 4263|     79|                = SSL_DOMAIN_FLAG_MULTI_THREAD
  ------------------
  |  | 2373|     79|#define SSL_DOMAIN_FLAG_MULTI_THREAD        (1U << 1)
  ------------------
 4264|     79|                | SSL_DOMAIN_FLAG_LEGACY_BLOCKING;
  ------------------
  |  | 2376|     79|#define SSL_DOMAIN_FLAG_LEGACY_BLOCKING     (1U << 4)
  ------------------
 4265|       |#  else
 4266|       |        ret->domain_flags
 4267|       |            = SSL_DOMAIN_FLAG_SINGLE_THREAD
 4268|       |            | SSL_DOMAIN_FLAG_LEGACY_BLOCKING;
 4269|       |#  endif
 4270|     79|    }
 4271|     79|# endif
 4272|       |
 4273|     79|    if (!ssl_ctx_system_config(ret)) {
  ------------------
  |  Branch (4273:9): [True: 0, False: 79]
  ------------------
 4274|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 4275|      0|        goto err;
 4276|      0|    }
 4277|       |
 4278|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4279|       |    if (keylogfile != NULL && strlen(keylogfile) != 0) {
 4280|       |        /* Make sure we have a global lock allocated */
 4281|       |        if (!RUN_ONCE(&ssl_keylog_once, ssl_keylog_init)) {
 4282|       |            /* use a trace message as a warning */
 4283|       |            OSSL_TRACE(TLS, "Unable to initalize keylog data\n");
 4284|       |            goto out;
 4285|       |        }
 4286|       |
 4287|       |        /* Grab our global lock */
 4288|       |        if (!CRYPTO_THREAD_write_lock(keylog_lock)) {
 4289|       |            OSSL_TRACE(TLS, "Unable to acquire keylog write lock\n");
 4290|       |            goto out;
 4291|       |        } else {
 4292|       |            /*
 4293|       |             * If the bio for the requested keylog file hasn't been
 4294|       |             * created yet, go ahead and create it, and set it to append
 4295|       |             * if its already there.
 4296|       |             */
 4297|       |            if (keylog_bio == NULL) {
 4298|       |                keylog_bio = BIO_new_file(keylogfile, "a");
 4299|       |                if (keylog_bio == NULL) {
 4300|       |                    OSSL_TRACE(TLS, "Unable to create keylog bio\n");
 4301|       |                    goto out;
 4302|       |                }
 4303|       |                BIO_set_callback_ex(keylog_bio, check_keylog_bio_free);
 4304|       |            } else {
 4305|       |                /* up our refcount for the already-created case */
 4306|       |                BIO_up_ref(keylog_bio);
 4307|       |            }
 4308|       |            /* If we have a bio now, assign the callback handler */
 4309|       |            if (keylog_bio != NULL)
 4310|       |                ret->do_sslkeylog = 1;
 4311|       |            /* unlock, and we're done */
 4312|       |            CRYPTO_THREAD_unlock(keylog_lock);
 4313|       |        }
 4314|       |    }
 4315|       |out:
 4316|       |#endif
 4317|     79|    return ret;
 4318|      0| err:
 4319|      0|    SSL_CTX_free(ret);
 4320|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4321|       |    BIO_free(keylog_bio);
 4322|       |#endif
 4323|      0|    return NULL;
 4324|     79|}
SSL_CTX_new:
 4327|     79|{
 4328|     79|    return SSL_CTX_new_ex(NULL, NULL, meth);
 4329|     79|}
SSL_CTX_up_ref:
 4332|     79|{
 4333|     79|    int i;
 4334|       |
 4335|     79|    if (CRYPTO_UP_REF(&ctx->references, &i) <= 0)
  ------------------
  |  Branch (4335:9): [True: 0, False: 79]
  ------------------
 4336|      0|        return 0;
 4337|       |
 4338|     79|    REF_PRINT_COUNT("SSL_CTX", i, ctx);
  ------------------
  |  |  301|     79|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     79|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|     79|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|     79|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4339|     79|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 4340|     79|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (4340:13): [True: 79, False: 0]
  ------------------
 4341|     79|}
SSL_CTX_free:
 4344|    158|{
 4345|    158|    int i;
 4346|    158|    size_t j;
 4347|       |
 4348|    158|    if (a == NULL)
  ------------------
  |  Branch (4348:9): [True: 0, False: 158]
  ------------------
 4349|      0|        return;
 4350|       |
 4351|    158|    CRYPTO_DOWN_REF(&a->references, &i);
 4352|    158|    REF_PRINT_COUNT("SSL_CTX", i, a);
  ------------------
  |  |  301|    158|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    158|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    158|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    158|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4353|    158|    if (i > 0)
  ------------------
  |  Branch (4353:9): [True: 79, False: 79]
  ------------------
 4354|     79|        return;
 4355|     79|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     79|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 79]
  |  |  ------------------
  ------------------
 4356|       |
 4357|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4358|       |    if (keylog_lock != NULL && CRYPTO_THREAD_write_lock(keylog_lock)) {
 4359|       |        if (a->do_sslkeylog == 1)
 4360|       |            BIO_free(keylog_bio);
 4361|       |        a->do_sslkeylog = 0;
 4362|       |        CRYPTO_THREAD_unlock(keylog_lock);
 4363|       |    }
 4364|       |#endif
 4365|       |
 4366|     79|    X509_VERIFY_PARAM_free(a->param);
 4367|     79|    dane_ctx_final(&a->dane);
 4368|       |
 4369|       |    /*
 4370|       |     * Free internal session cache. However: the remove_cb() may reference
 4371|       |     * the ex_data of SSL_CTX, thus the ex_data store can only be removed
 4372|       |     * after the sessions were flushed.
 4373|       |     * As the ex_data handling routines might also touch the session cache,
 4374|       |     * the most secure solution seems to be: empty (flush) the cache, then
 4375|       |     * free ex_data, then finally free the cache.
 4376|       |     * (See ticket [openssl.org #212].)
 4377|       |     */
 4378|     79|    if (a->sessions != NULL)
  ------------------
  |  Branch (4378:9): [True: 79, False: 0]
  ------------------
 4379|     79|        SSL_CTX_flush_sessions_ex(a, 0);
 4380|       |
 4381|     79|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
  ------------------
  |  |  230|     79|# define CRYPTO_EX_INDEX_SSL_CTX          1
  ------------------
 4382|     79|    lh_SSL_SESSION_free(a->sessions);
 4383|     79|    X509_STORE_free(a->cert_store);
 4384|     79|#ifndef OPENSSL_NO_CT
 4385|     79|    CTLOG_STORE_free(a->ctlog_store);
 4386|     79|#endif
 4387|     79|    sk_SSL_CIPHER_free(a->cipher_list);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4388|     79|    sk_SSL_CIPHER_free(a->cipher_list_by_id);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4389|     79|    sk_SSL_CIPHER_free(a->tls13_ciphersuites);
  ------------------
  |  | 1005|     79|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4390|     79|    ssl_cert_free(a->cert);
 4391|     79|    sk_X509_NAME_pop_free(a->ca_names, X509_NAME_free);
  ------------------
  |  |   67|     79|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 4392|     79|    sk_X509_NAME_pop_free(a->client_ca_names, X509_NAME_free);
  ------------------
  |  |   67|     79|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 4393|     79|    OSSL_STACK_OF_X509_free(a->extra_certs);
 4394|     79|    a->comp_methods = NULL;
 4395|     79|#ifndef OPENSSL_NO_SRTP
 4396|     79|    sk_SRTP_PROTECTION_PROFILE_free(a->srtp_profiles);
  ------------------
  |  |  253|     79|#define sk_SRTP_PROTECTION_PROFILE_free(sk) OPENSSL_sk_free(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk))
  ------------------
 4397|     79|#endif
 4398|     79|#ifndef OPENSSL_NO_SRP
 4399|     79|    ssl_ctx_srp_ctx_free_intern(a);
 4400|     79|#endif
 4401|     79|#ifndef OPENSSL_NO_ENGINE
 4402|     79|    tls_engine_finish(a->client_cert_engine);
 4403|     79|#endif
 4404|       |
 4405|     79|    OPENSSL_free(a->ext.ecpointformats);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4406|     79|    OPENSSL_free(a->ext.supportedgroups);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4407|     79|    OPENSSL_free(a->ext.keyshares);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4408|     79|    OPENSSL_free(a->ext.tuples);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4409|     79|    OPENSSL_free(a->ext.alpn);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4410|     79|    OPENSSL_secure_free(a->ext.secure);
  ------------------
  |  |  127|     79|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4411|       |
 4412|     79|    ssl_evp_md_free(a->md5);
 4413|     79|    ssl_evp_md_free(a->sha1);
 4414|       |
 4415|  1.97k|    for (j = 0; j < SSL_ENC_NUM_IDX; j++)
  ------------------
  |  |  355|  1.97k|# define SSL_ENC_NUM_IDX         24
  ------------------
  |  Branch (4415:17): [True: 1.89k, False: 79]
  ------------------
 4416|  1.89k|        ssl_evp_cipher_free(a->ssl_cipher_methods[j]);
 4417|  1.18k|    for (j = 0; j < SSL_MD_NUM_IDX; j++)
  ------------------
  |  |  203|  1.18k|#define SSL_MD_NUM_IDX  SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  1.18k|# define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (4417:17): [True: 1.10k, False: 79]
  ------------------
 4418|  1.10k|        ssl_evp_md_free(a->ssl_digest_methods[j]);
 4419|  4.74k|    for (j = 0; j < a->group_list_len; j++) {
  ------------------
  |  Branch (4419:17): [True: 4.66k, False: 79]
  ------------------
 4420|  4.66k|        OPENSSL_free(a->group_list[j].tlsname);
  ------------------
  |  |  115|  4.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4421|  4.66k|        OPENSSL_free(a->group_list[j].realname);
  ------------------
  |  |  115|  4.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4422|  4.66k|        OPENSSL_free(a->group_list[j].algorithm);
  ------------------
  |  |  115|  4.66k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4423|  4.66k|    }
 4424|     79|    OPENSSL_free(a->group_list);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4425|    316|    for (j = 0; j < a->sigalg_list_len; j++) {
  ------------------
  |  Branch (4425:17): [True: 237, False: 79]
  ------------------
 4426|    237|        OPENSSL_free(a->sigalg_list[j].name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4427|    237|        OPENSSL_free(a->sigalg_list[j].sigalg_name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4428|    237|        OPENSSL_free(a->sigalg_list[j].sigalg_oid);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4429|    237|        OPENSSL_free(a->sigalg_list[j].sig_name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4430|    237|        OPENSSL_free(a->sigalg_list[j].sig_oid);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4431|    237|        OPENSSL_free(a->sigalg_list[j].hash_name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4432|    237|        OPENSSL_free(a->sigalg_list[j].hash_oid);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4433|    237|        OPENSSL_free(a->sigalg_list[j].keytype);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4434|    237|        OPENSSL_free(a->sigalg_list[j].keytype_oid);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4435|    237|    }
 4436|     79|    OPENSSL_free(a->sigalg_list);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4437|     79|    OPENSSL_free(a->ssl_cert_info);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4438|       |
 4439|     79|    OPENSSL_free(a->sigalg_lookup_cache);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4440|     79|    OPENSSL_free(a->tls12_sigalgs);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4441|       |
 4442|     79|    OPENSSL_free(a->client_cert_type);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4443|     79|    OPENSSL_free(a->server_cert_type);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4444|       |
 4445|     79|    CRYPTO_THREAD_lock_free(a->lock);
 4446|     79|    CRYPTO_FREE_REF(&a->references);
 4447|       |#ifdef TSAN_REQUIRES_LOCKING
 4448|       |    CRYPTO_THREAD_lock_free(a->tsan_lock);
 4449|       |#endif
 4450|       |
 4451|     79|    OPENSSL_free(a->propq);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4452|     79|#ifndef OPENSSL_NO_QLOG
 4453|     79|    OPENSSL_free(a->qlog_title);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4454|     79|#endif
 4455|       |
 4456|     79|#ifndef OPENSSL_NO_QUIC
 4457|     79|    ossl_quic_free_token_store(a->tokencache);
 4458|     79|#endif
 4459|       |
 4460|     79|    OPENSSL_free(a);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4461|     79|}
SSL_get_error:
 4822|     79|{
 4823|     79|    return ossl_ssl_get_error(s, i, /*check_err=*/1);
 4824|     79|}
ossl_ssl_get_error:
 4827|     79|{
 4828|     79|    int reason;
 4829|     79|    unsigned long l;
 4830|     79|    BIO *bio;
 4831|     79|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|     79|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|     79|    ((ssl) == NULL ? NULL                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   33|     79|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|     79|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:9): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   34|     79|        ? (c SSL_CONNECTION *)(ssl)                                                     \
  |  |  |  |   35|     79|        : (SSL_TYPE_IS_QUIC((ssl)->type)                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|     79|          ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl))   \
  |  |  |  |   37|     79|          : NULL)))
  |  |  ------------------
  ------------------
 4832|       |
 4833|     79|    if (i > 0)
  ------------------
  |  Branch (4833:9): [True: 0, False: 79]
  ------------------
 4834|      0|        return SSL_ERROR_NONE;
  ------------------
  |  | 1251|      0|# define SSL_ERROR_NONE                  0
  ------------------
 4835|       |
 4836|     79|#ifndef OPENSSL_NO_QUIC
 4837|     79|    if (IS_QUIC(s)) {
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 4838|     79|        reason = ossl_quic_get_error(s, i);
 4839|     79|        if (reason != SSL_ERROR_NONE)
  ------------------
  |  | 1251|     79|# define SSL_ERROR_NONE                  0
  ------------------
  |  Branch (4839:13): [True: 79, False: 0]
  ------------------
 4840|     79|            return reason;
 4841|     79|    }
 4842|      0|#endif
 4843|       |
 4844|      0|    if (sc == NULL)
  ------------------
  |  Branch (4844:9): [True: 0, False: 0]
  ------------------
 4845|      0|        return SSL_ERROR_SSL;
  ------------------
  |  | 1252|      0|# define SSL_ERROR_SSL                   1
  ------------------
 4846|       |
 4847|       |    /*
 4848|       |     * Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc,
 4849|       |     * where we do encode the error
 4850|       |     */
 4851|      0|    if (check_err && (l = ERR_peek_error()) != 0) {
  ------------------
  |  Branch (4851:9): [True: 0, False: 0]
  |  Branch (4851:22): [True: 0, False: 0]
  ------------------
 4852|      0|        if (ERR_GET_LIB(l) == ERR_LIB_SYS)
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (4852:13): [True: 0, False: 0]
  ------------------
 4853|      0|            return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1256|      0|# define SSL_ERROR_SYSCALL               5/* look at error stack/return
  ------------------
 4854|      0|        else
 4855|      0|            return SSL_ERROR_SSL;
  ------------------
  |  | 1252|      0|# define SSL_ERROR_SSL                   1
  ------------------
 4856|      0|    }
 4857|       |
 4858|      0|#ifndef OPENSSL_NO_QUIC
 4859|      0|    if (!IS_QUIC(s))
  ------------------
  |  |   98|      0|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|      0|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4860|      0|#endif
 4861|      0|    {
 4862|      0|        if (SSL_want_read(s)) {
  ------------------
  |  |  938|      0|# define SSL_want_read(s)            (SSL_want(s) == SSL_READING)
  |  |  ------------------
  |  |  |  |  929|      0|# define SSL_READING            3
  |  |  ------------------
  |  |  |  Branch (938:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4863|      0|            bio = SSL_get_rbio(s);
 4864|      0|            if (BIO_should_read(bio))
  ------------------
  |  |  266|      0|# define BIO_should_read(a)              BIO_test_flags(a, BIO_FLAGS_READ)
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |  |  Branch (266:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4865|      0|                return SSL_ERROR_WANT_READ;
  ------------------
  |  | 1253|      0|# define SSL_ERROR_WANT_READ             2
  ------------------
 4866|      0|            else if (BIO_should_write(bio))
  ------------------
  |  |  267|      0|# define BIO_should_write(a)             BIO_test_flags(a, BIO_FLAGS_WRITE)
  |  |  ------------------
  |  |  |  |  221|      0|# define BIO_FLAGS_WRITE         0x02
  |  |  ------------------
  |  |  |  Branch (267:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4867|       |                /*
 4868|       |                 * This one doesn't make too much sense ... We never try to
 4869|       |                 * write to the rbio, and an application program where rbio and
 4870|       |                 * wbio are separate couldn't even know what it should wait for.
 4871|       |                 * However if we ever set s->rwstate incorrectly (so that we
 4872|       |                 * have SSL_want_read(s) instead of SSL_want_write(s)) and rbio
 4873|       |                 * and wbio *are* the same, this test works around that bug; so
 4874|       |                 * it might be safer to keep it.
 4875|       |                 */
 4876|      0|                return SSL_ERROR_WANT_WRITE;
  ------------------
  |  | 1254|      0|# define SSL_ERROR_WANT_WRITE            3
  ------------------
 4877|      0|            else if (BIO_should_io_special(bio)) {
  ------------------
  |  |  268|      0|# define BIO_should_io_special(a)        BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
  |  |  ------------------
  |  |  |  |  222|      0|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  ------------------
  |  |  |  Branch (268:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4878|      0|                reason = BIO_get_retry_reason(bio);
 4879|      0|                if (reason == BIO_RR_CONNECT)
  ------------------
  |  |  284|      0|# define BIO_RR_CONNECT                  0x02
  ------------------
  |  Branch (4879:21): [True: 0, False: 0]
  ------------------
 4880|      0|                    return SSL_ERROR_WANT_CONNECT;
  ------------------
  |  | 1259|      0|# define SSL_ERROR_WANT_CONNECT          7
  ------------------
 4881|      0|                else if (reason == BIO_RR_ACCEPT)
  ------------------
  |  |  286|      0|# define BIO_RR_ACCEPT                   0x03
  ------------------
  |  Branch (4881:26): [True: 0, False: 0]
  ------------------
 4882|      0|                    return SSL_ERROR_WANT_ACCEPT;
  ------------------
  |  | 1260|      0|# define SSL_ERROR_WANT_ACCEPT           8
  ------------------
 4883|      0|                else
 4884|      0|                    return SSL_ERROR_SYSCALL; /* unknown */
  ------------------
  |  | 1256|      0|# define SSL_ERROR_SYSCALL               5/* look at error stack/return
  ------------------
 4885|      0|            }
 4886|      0|        }
 4887|       |
 4888|      0|        if (SSL_want_write(s)) {
  ------------------
  |  |  939|      0|# define SSL_want_write(s)           (SSL_want(s) == SSL_WRITING)
  |  |  ------------------
  |  |  |  |  928|      0|# define SSL_WRITING            2
  |  |  ------------------
  |  |  |  Branch (939:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4889|       |            /*
 4890|       |             * Access wbio directly - in order to use the buffered bio if
 4891|       |             * present
 4892|       |             */
 4893|      0|            bio = sc->wbio;
 4894|      0|            if (BIO_should_write(bio))
  ------------------
  |  |  267|      0|# define BIO_should_write(a)             BIO_test_flags(a, BIO_FLAGS_WRITE)
  |  |  ------------------
  |  |  |  |  221|      0|# define BIO_FLAGS_WRITE         0x02
  |  |  ------------------
  |  |  |  Branch (267:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4895|      0|                return SSL_ERROR_WANT_WRITE;
  ------------------
  |  | 1254|      0|# define SSL_ERROR_WANT_WRITE            3
  ------------------
 4896|      0|            else if (BIO_should_read(bio))
  ------------------
  |  |  266|      0|# define BIO_should_read(a)              BIO_test_flags(a, BIO_FLAGS_READ)
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |  |  Branch (266:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4897|       |                /*
 4898|       |                 * See above (SSL_want_read(s) with BIO_should_write(bio))
 4899|       |                 */
 4900|      0|                return SSL_ERROR_WANT_READ;
  ------------------
  |  | 1253|      0|# define SSL_ERROR_WANT_READ             2
  ------------------
 4901|      0|            else if (BIO_should_io_special(bio)) {
  ------------------
  |  |  268|      0|# define BIO_should_io_special(a)        BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
  |  |  ------------------
  |  |  |  |  222|      0|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  ------------------
  |  |  |  Branch (268:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4902|      0|                reason = BIO_get_retry_reason(bio);
 4903|      0|                if (reason == BIO_RR_CONNECT)
  ------------------
  |  |  284|      0|# define BIO_RR_CONNECT                  0x02
  ------------------
  |  Branch (4903:21): [True: 0, False: 0]
  ------------------
 4904|      0|                    return SSL_ERROR_WANT_CONNECT;
  ------------------
  |  | 1259|      0|# define SSL_ERROR_WANT_CONNECT          7
  ------------------
 4905|      0|                else if (reason == BIO_RR_ACCEPT)
  ------------------
  |  |  286|      0|# define BIO_RR_ACCEPT                   0x03
  ------------------
  |  Branch (4905:26): [True: 0, False: 0]
  ------------------
 4906|      0|                    return SSL_ERROR_WANT_ACCEPT;
  ------------------
  |  | 1260|      0|# define SSL_ERROR_WANT_ACCEPT           8
  ------------------
 4907|      0|                else
 4908|      0|                    return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1256|      0|# define SSL_ERROR_SYSCALL               5/* look at error stack/return
  ------------------
 4909|      0|            }
 4910|      0|        }
 4911|      0|    }
 4912|       |
 4913|      0|    if (SSL_want_x509_lookup(s))
  ------------------
  |  |  940|      0|# define SSL_want_x509_lookup(s)     (SSL_want(s) == SSL_X509_LOOKUP)
  |  |  ------------------
  |  |  |  |  930|      0|# define SSL_X509_LOOKUP        4
  |  |  ------------------
  |  |  |  Branch (940:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4914|      0|        return SSL_ERROR_WANT_X509_LOOKUP;
  ------------------
  |  | 1255|      0|# define SSL_ERROR_WANT_X509_LOOKUP      4
  ------------------
 4915|      0|    if (SSL_want_retry_verify(s))
  ------------------
  |  |  941|      0|# define SSL_want_retry_verify(s)    (SSL_want(s) == SSL_RETRY_VERIFY)
  |  |  ------------------
  |  |  |  |  934|      0|# define SSL_RETRY_VERIFY       8
  |  |  ------------------
  |  |  |  Branch (941:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4916|      0|        return SSL_ERROR_WANT_RETRY_VERIFY;
  ------------------
  |  | 1264|      0|# define SSL_ERROR_WANT_RETRY_VERIFY    12
  ------------------
 4917|      0|    if (SSL_want_async(s))
  ------------------
  |  |  942|      0|# define SSL_want_async(s)           (SSL_want(s) == SSL_ASYNC_PAUSED)
  |  |  ------------------
  |  |  |  |  931|      0|# define SSL_ASYNC_PAUSED       5
  |  |  ------------------
  |  |  |  Branch (942:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4918|      0|        return SSL_ERROR_WANT_ASYNC;
  ------------------
  |  | 1261|      0|# define SSL_ERROR_WANT_ASYNC            9
  ------------------
 4919|      0|    if (SSL_want_async_job(s))
  ------------------
  |  |  943|      0|# define SSL_want_async_job(s)       (SSL_want(s) == SSL_ASYNC_NO_JOBS)
  |  |  ------------------
  |  |  |  |  932|      0|# define SSL_ASYNC_NO_JOBS      6
  |  |  ------------------
  |  |  |  Branch (943:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4920|      0|        return SSL_ERROR_WANT_ASYNC_JOB;
  ------------------
  |  | 1262|      0|# define SSL_ERROR_WANT_ASYNC_JOB       10
  ------------------
 4921|      0|    if (SSL_want_client_hello_cb(s))
  ------------------
  |  |  944|      0|# define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB)
  |  |  ------------------
  |  |  |  |  933|      0|# define SSL_CLIENT_HELLO_CB    7
  |  |  ------------------
  |  |  |  Branch (944:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4922|      0|        return SSL_ERROR_WANT_CLIENT_HELLO_CB;
  ------------------
  |  | 1263|      0|# define SSL_ERROR_WANT_CLIENT_HELLO_CB 11
  ------------------
 4923|       |
 4924|      0|    if ((sc->shutdown & SSL_RECEIVED_SHUTDOWN) &&
  ------------------
  |  |  214|      0|# define SSL_RECEIVED_SHUTDOWN   2
  ------------------
  |  Branch (4924:9): [True: 0, False: 0]
  ------------------
 4925|      0|        (sc->s3.warn_alert == SSL_AD_CLOSE_NOTIFY))
  ------------------
  |  | 1202|      0|# define SSL_AD_CLOSE_NOTIFY             SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|      0|# define SSL3_AD_CLOSE_NOTIFY             0
  |  |  ------------------
  ------------------
  |  Branch (4925:9): [True: 0, False: 0]
  ------------------
 4926|      0|        return SSL_ERROR_ZERO_RETURN;
  ------------------
  |  | 1258|      0|# define SSL_ERROR_ZERO_RETURN           6
  ------------------
 4927|       |
 4928|      0|    return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1256|      0|# define SSL_ERROR_SYSCALL               5/* look at error stack/return
  ------------------
 4929|      0|}
SSL_set_accept_state:
 4983|     79|{
 4984|     79|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  ------------------
  |  |   23|     79|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|     79|    ((ssl) == NULL ? NULL                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   18|     79|     : ((ssl)->type == SSL_TYPE_SSL_CONNECTION    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1225|     79|#define SSL_TYPE_SSL_CONNECTION     0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:9): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   19|     79|       ? (c SSL_CONNECTION *)(ssl)                \
  |  |  |  |   20|     79|       : NULL))
  |  |  ------------------
  ------------------
 4985|       |
 4986|     79|#ifndef OPENSSL_NO_QUIC
 4987|     79|    if (IS_QUIC(s)) {
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 4988|       |        /* We suppress errors because this is a void function */
 4989|     79|        (void)ossl_quic_set_accept_state(s, 0 /* suppress errors */);
 4990|     79|        return;
 4991|     79|    }
 4992|      0|#endif
 4993|       |
 4994|      0|    sc->server = 1;
 4995|      0|    sc->shutdown = 0;
 4996|      0|    ossl_statem_clear(sc);
 4997|      0|    sc->handshake_func = s->method->ssl_accept;
 4998|       |    /* Ignore return value. Its a void public API function */
 4999|      0|    RECORD_LAYER_reset(&sc->rlayer);
 5000|      0|}
ssl_evp_cipher_fetch:
 7451|  1.81k|{
 7452|  1.81k|    const EVP_CIPHER *ciph;
 7453|       |
 7454|  1.81k|    ciph = tls_get_cipher_from_engine(nid);
 7455|  1.81k|    if (ciph != NULL)
  ------------------
  |  Branch (7455:9): [True: 0, False: 1.81k]
  ------------------
 7456|      0|        return ciph;
 7457|       |
 7458|       |    /*
 7459|       |     * If there is no engine cipher then we do an explicit fetch. This may fail
 7460|       |     * and that could be ok
 7461|       |     */
 7462|  1.81k|    ERR_set_mark();
 7463|  1.81k|    ciph = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), properties);
 7464|  1.81k|    if (ciph != NULL) {
  ------------------
  |  Branch (7464:9): [True: 1.10k, False: 711]
  ------------------
 7465|  1.10k|        OSSL_PARAM params[2];
 7466|  1.10k|        int decrypt_only = 0;
 7467|       |
 7468|  1.10k|        params[0] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_DECRYPT_ONLY,
  ------------------
  |  |  187|  1.10k|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
 7469|  1.10k|                                             &decrypt_only);
 7470|  1.10k|        params[1] = OSSL_PARAM_construct_end();
 7471|  1.10k|        if (EVP_CIPHER_get_params((EVP_CIPHER *)ciph, params)
  ------------------
  |  Branch (7471:13): [True: 1.10k, False: 0]
  ------------------
 7472|  1.10k|            && decrypt_only) {
  ------------------
  |  Branch (7472:16): [True: 0, False: 1.10k]
  ------------------
 7473|       |            /* If a cipher is decrypt-only, it is unusable */
 7474|      0|            EVP_CIPHER_free((EVP_CIPHER *)ciph);
 7475|      0|            ciph = NULL;
 7476|      0|        }
 7477|  1.10k|    }
 7478|  1.81k|    ERR_pop_to_mark();
 7479|  1.81k|    return ciph;
 7480|  1.81k|}
ssl_evp_cipher_free:
 7497|  1.89k|{
 7498|  1.89k|    if (cipher == NULL)
  ------------------
  |  Branch (7498:9): [True: 790, False: 1.10k]
  ------------------
 7499|    790|        return;
 7500|       |
 7501|  1.10k|    if (EVP_CIPHER_get0_provider(cipher) != NULL) {
  ------------------
  |  Branch (7501:9): [True: 1.10k, False: 0]
  ------------------
 7502|       |        /*
 7503|       |         * The cipher was explicitly fetched and therefore it is safe to cast
 7504|       |         * away the const
 7505|       |         */
 7506|  1.10k|        EVP_CIPHER_free((EVP_CIPHER *)cipher);
 7507|  1.10k|    }
 7508|  1.10k|}
ssl_evp_md_fetch:
 7513|  1.26k|{
 7514|  1.26k|    const EVP_MD *md;
 7515|       |
 7516|  1.26k|    md = tls_get_digest_from_engine(nid);
 7517|  1.26k|    if (md != NULL)
  ------------------
  |  Branch (7517:9): [True: 0, False: 1.26k]
  ------------------
 7518|      0|        return md;
 7519|       |
 7520|       |    /* Otherwise we do an explicit fetch */
 7521|  1.26k|    ERR_set_mark();
 7522|  1.26k|    md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), properties);
 7523|  1.26k|    ERR_pop_to_mark();
 7524|  1.26k|    return md;
 7525|  1.26k|}
ssl_evp_md_free:
 7541|  1.26k|{
 7542|  1.26k|    if (md == NULL)
  ------------------
  |  Branch (7542:9): [True: 553, False: 711]
  ------------------
 7543|    553|        return;
 7544|       |
 7545|    711|    if (EVP_MD_get0_provider(md) != NULL) {
  ------------------
  |  Branch (7545:9): [True: 711, False: 0]
  ------------------
 7546|       |        /*
 7547|       |         * The digest was explicitly fetched and therefore it is safe to cast
 7548|       |         * away the const
 7549|       |         */
 7550|    711|        EVP_MD_free((EVP_MD *)md);
 7551|    711|    }
 7552|    711|}
SSL_new_listener:
 7993|     79|{
 7994|     79|#ifndef OPENSSL_NO_QUIC
 7995|     79|    if (!IS_QUIC_CTX(ctx))
  ------------------
  |  |   56|     79|#  define IS_QUIC_CTX(ctx)          IS_QUIC_METHOD((ctx)->method)
  |  |  ------------------
  |  |  |  |   52|     79|    ((m) == OSSL_QUIC_client_method() || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   53|     79|     (m) == OSSL_QUIC_client_thread_method() || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:6): [True: 0, False: 79]
  |  |  |  |  ------------------
  |  |  |  |   54|     79|     (m) == OSSL_QUIC_server_method())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (54:6): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7996|      0|        return NULL;
 7997|       |
 7998|     79|    return ossl_quic_new_listener(ctx, flags);
 7999|       |#else
 8000|       |    return NULL;
 8001|       |#endif
 8002|     79|}
SSL_accept_connection:
 8029|     79|{
 8030|     79|#ifndef OPENSSL_NO_QUIC
 8031|     79|    if (!IS_QUIC(ssl))
  ------------------
  |  |   98|     79|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1231|     79|#define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1231:37): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (98:6): [True: 79, False: 0]
  |  |  ------------------
  ------------------
 8032|      0|        return NULL;
 8033|       |
 8034|     79|    return ossl_quic_accept_connection(ssl, flags);
 8035|       |#else
 8036|       |    return NULL;
 8037|       |#endif
 8038|     79|}
ssl_lib.c:dane_ctx_final:
  150|     79|{
  151|     79|    OPENSSL_free(dctx->mdevp);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|     79|    dctx->mdevp = NULL;
  153|       |
  154|     79|    OPENSSL_free(dctx->mdord);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  155|     79|    dctx->mdord = NULL;
  156|     79|    dctx->mdmax = 0;
  157|     79|}

ssl_ctx_system_config:
  105|     79|{
  106|     79|    return ssl_do_config(NULL, ctx, NULL, 1);
  107|     79|}
ssl_mcnf.c:ssl_do_config:
   24|     79|{
   25|     79|    SSL_CONF_CTX *cctx = NULL;
   26|     79|    size_t i, idx, cmd_count;
   27|     79|    int err = 1;
   28|     79|    unsigned int flags;
   29|     79|    unsigned int conf_diagnostics = 0;
   30|     79|    const SSL_METHOD *meth;
   31|     79|    const SSL_CONF_CMD *cmds;
   32|     79|    OSSL_LIB_CTX *prev_libctx = NULL;
   33|     79|    OSSL_LIB_CTX *libctx = NULL;
   34|       |
   35|     79|    if (s == NULL && ctx == NULL) {
  ------------------
  |  Branch (35:9): [True: 79, False: 0]
  |  Branch (35:22): [True: 0, False: 79]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        goto err;
   38|      0|    }
   39|       |
   40|     79|    if (name == NULL && system)
  ------------------
  |  Branch (40:9): [True: 79, False: 0]
  |  Branch (40:25): [True: 79, False: 0]
  ------------------
   41|     79|        name = "system_default";
   42|     79|    if (!conf_ssl_name_find(name, &idx)) {
  ------------------
  |  Branch (42:9): [True: 79, False: 0]
  ------------------
   43|     79|        if (!system)
  ------------------
  |  Branch (43:13): [True: 0, False: 79]
  ------------------
   44|      0|            ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |   87|      0|# define ERR_LIB_SSL             20
  ------------------
                          ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |  150|      0|# define SSL_R_INVALID_CONFIGURATION_NAME                 113
  ------------------
   45|      0|                           "name=%s", name);
   46|     79|        goto err;
   47|     79|    }
   48|      0|    cmds = conf_ssl_get(idx, &name, &cmd_count);
   49|      0|    cctx = SSL_CONF_CTX_new();
   50|      0|    if (cctx == NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 0]
  ------------------
   51|       |        /* this is a fatal error, always report */
   52|      0|        system = 0;
   53|      0|        goto err;
   54|      0|    }
   55|      0|    flags = SSL_CONF_FLAG_FILE;
  ------------------
  |  |  599|      0|# define SSL_CONF_FLAG_FILE              0x2
  ------------------
   56|      0|    if (!system)
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
  ------------------
  |  |  603|      0|# define SSL_CONF_FLAG_CERTIFICATE       0x20
  ------------------
                      flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
  ------------------
  |  |  604|      0|# define SSL_CONF_FLAG_REQUIRE_PRIVATE   0x40
  ------------------
   58|      0|    if (s != NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        meth = s->method;
   60|      0|        SSL_CONF_CTX_set_ssl(cctx, s);
   61|      0|        libctx = s->ctx->libctx;
   62|      0|    } else {
   63|      0|        meth = ctx->method;
   64|      0|        SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
   65|      0|        libctx = ctx->libctx;
   66|      0|    }
   67|      0|    conf_diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
   68|      0|    if (conf_diagnostics)
  ------------------
  |  Branch (68:9): [True: 0, False: 0]
  ------------------
   69|      0|        flags |= SSL_CONF_FLAG_SHOW_ERRORS;
  ------------------
  |  |  602|      0|# define SSL_CONF_FLAG_SHOW_ERRORS       0x10
  ------------------
   70|      0|    if (meth->ssl_accept != ssl_undefined_function)
  ------------------
  |  Branch (70:9): [True: 0, False: 0]
  ------------------
   71|      0|        flags |= SSL_CONF_FLAG_SERVER;
  ------------------
  |  |  601|      0|# define SSL_CONF_FLAG_SERVER            0x8
  ------------------
   72|      0|    if (meth->ssl_connect != ssl_undefined_function)
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  ------------------
   73|      0|        flags |= SSL_CONF_FLAG_CLIENT;
  ------------------
  |  |  600|      0|# define SSL_CONF_FLAG_CLIENT            0x4
  ------------------
   74|      0|    SSL_CONF_CTX_set_flags(cctx, flags);
   75|      0|    prev_libctx = OSSL_LIB_CTX_set0_default(libctx);
   76|      0|    err = 0;
   77|      0|    for (i = 0; i < cmd_count; i++) {
  ------------------
  |  Branch (77:17): [True: 0, False: 0]
  ------------------
   78|      0|        char *cmdstr, *arg;
   79|      0|        int rv;
   80|       |
   81|      0|        conf_ssl_get_cmd(cmds, i, &cmdstr, &arg);
   82|      0|        rv = SSL_CONF_cmd(cctx, cmdstr, arg);
   83|      0|        if (rv <= 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 0]
  ------------------
   84|      0|            ++err;
   85|      0|    }
   86|      0|    if (!SSL_CONF_CTX_finish(cctx))
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|        ++err;
   88|     79| err:
   89|     79|    OSSL_LIB_CTX_set0_default(prev_libctx);
   90|     79|    SSL_CONF_CTX_free(cctx);
   91|     79|    return err == 0 || (system && !conf_diagnostics);
  ------------------
  |  Branch (91:12): [True: 0, False: 79]
  |  Branch (91:25): [True: 79, False: 0]
  |  Branch (91:35): [True: 79, False: 0]
  ------------------
   92|      0|}

SSL_CTX_flush_sessions_ex:
 1216|     79|{
 1217|     79|    STACK_OF(SSL_SESSION) *sk;
  ------------------
  |  |   31|     79|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1218|     79|    SSL_SESSION *current;
 1219|     79|    unsigned long i;
 1220|     79|    const OSSL_TIME timeout = ossl_time_from_time_t(t);
 1221|       |
 1222|     79|    if (!CRYPTO_THREAD_write_lock(s->lock))
  ------------------
  |  Branch (1222:9): [True: 0, False: 79]
  ------------------
 1223|      0|        return;
 1224|       |
 1225|     79|    sk = sk_SSL_SESSION_new_null();
 1226|     79|    i = lh_SSL_SESSION_get_down_load(s->sessions);
 1227|     79|    lh_SSL_SESSION_set_down_load(s->sessions, 0);
 1228|       |
 1229|       |    /*
 1230|       |     * Iterate over the list from the back (oldest), and stop
 1231|       |     * when a session can no longer be removed.
 1232|       |     * Add the session to a temporary list to be freed outside
 1233|       |     * the SSL_CTX lock.
 1234|       |     * But still do the remove_session_cb() within the lock.
 1235|       |     */
 1236|     79|    while (s->session_cache_tail != NULL) {
  ------------------
  |  Branch (1236:12): [True: 0, False: 79]
  ------------------
 1237|      0|        current = s->session_cache_tail;
 1238|      0|        if (t == 0 || sess_timedout(timeout, current)) {
  ------------------
  |  Branch (1238:13): [True: 0, False: 0]
  |  Branch (1238:23): [True: 0, False: 0]
  ------------------
 1239|      0|            lh_SSL_SESSION_delete(s->sessions, current);
 1240|      0|            SSL_SESSION_list_remove(s, current);
 1241|      0|            current->not_resumable = 1;
 1242|      0|            if (s->remove_session_cb != NULL)
  ------------------
  |  Branch (1242:17): [True: 0, False: 0]
  ------------------
 1243|      0|                s->remove_session_cb(s, current);
 1244|       |            /*
 1245|       |             * Throw the session on a stack, it's entirely plausible
 1246|       |             * that while freeing outside the critical section, the
 1247|       |             * session could be re-added, so avoid using the next/prev
 1248|       |             * pointers. If the stack failed to create, or the session
 1249|       |             * couldn't be put on the stack, just free it here
 1250|       |             */
 1251|      0|            if (sk == NULL || !sk_SSL_SESSION_push(sk, current))
  ------------------
  |  Branch (1251:17): [True: 0, False: 0]
  |  Branch (1251:31): [True: 0, False: 0]
  ------------------
 1252|      0|                SSL_SESSION_free(current);
 1253|      0|        } else {
 1254|      0|            break;
 1255|      0|        }
 1256|      0|    }
 1257|       |
 1258|     79|    lh_SSL_SESSION_set_down_load(s->sessions, i);
 1259|     79|    CRYPTO_THREAD_unlock(s->lock);
 1260|       |
 1261|     79|    sk_SSL_SESSION_pop_free(sk, SSL_SESSION_free);
 1262|     79|}

custom_exts_free:
  333|     79|{
  334|     79|    size_t i;
  335|     79|    custom_ext_method *meth;
  336|       |
  337|     79|    for (i = 0, meth = exts->meths; i < exts->meths_count; i++, meth++) {
  ------------------
  |  Branch (337:37): [True: 0, False: 79]
  ------------------
  338|      0|        if (meth->add_cb != custom_ext_add_old_cb_wrap)
  ------------------
  |  Branch (338:13): [True: 0, False: 0]
  ------------------
  339|      0|            continue;
  340|       |
  341|       |        /* Old style API wrapper. Need to free the arguments too */
  342|      0|        OPENSSL_free(meth->add_arg);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  343|      0|        OPENSSL_free(meth->parse_arg);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  344|      0|    }
  345|     79|    OPENSSL_free(exts->meths);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  346|     79|    exts->meths = NULL;
  347|     79|    exts->meths_count = 0;
  348|     79|}

tls1_default_timeout:
   97|     79|{
   98|       |    /*
   99|       |     * 2 hours, the 24 hours mentioned in the TLSv1 spec is way too long for
  100|       |     * http, the cache would over fill
  101|       |     */
  102|     79|    return ossl_seconds2time(60 * 60 * 2);
  ------------------
  |  |   42|     79|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|     79|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  103|     79|}
ssl_load_groups:
  367|     79|{
  368|     79|    if (!OSSL_PROVIDER_do_all(ctx->libctx, discover_provider_groups, ctx))
  ------------------
  |  Branch (368:9): [True: 0, False: 79]
  ------------------
  369|      0|        return 0;
  370|       |
  371|     79|    return SSL_CTX_set1_groups_list(ctx, TLS_DEFAULT_GROUP_LIST);
  ------------------
  |  | 1496|     79|        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s))
  |  |  ------------------
  |  |  |  | 1346|     79|# define SSL_CTRL_SET_GROUPS_LIST                92
  |  |  ------------------
  ------------------
  372|     79|}
ssl_load_sigalgs:
  681|     79|{
  682|     79|    size_t i;
  683|     79|    SSL_CERT_LOOKUP lu;
  684|       |
  685|     79|    if (!OSSL_PROVIDER_do_all(ctx->libctx, discover_provider_sigalgs, ctx))
  ------------------
  |  Branch (685:9): [True: 0, False: 79]
  ------------------
  686|      0|        return 0;
  687|       |
  688|       |    /* now populate ctx->ssl_cert_info */
  689|     79|    if (ctx->sigalg_list_len > 0) {
  ------------------
  |  Branch (689:9): [True: 79, False: 0]
  ------------------
  690|     79|        OPENSSL_free(ctx->ssl_cert_info);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  691|     79|        ctx->ssl_cert_info = OPENSSL_zalloc(sizeof(lu) * ctx->sigalg_list_len);
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  692|     79|        if (ctx->ssl_cert_info == NULL)
  ------------------
  |  Branch (692:13): [True: 0, False: 79]
  ------------------
  693|      0|            return 0;
  694|    316|        for(i = 0; i < ctx->sigalg_list_len; i++) {
  ------------------
  |  Branch (694:20): [True: 237, False: 79]
  ------------------
  695|    237|            ctx->ssl_cert_info[i].nid = OBJ_txt2nid(ctx->sigalg_list[i].sigalg_name);
  696|    237|            ctx->ssl_cert_info[i].amask = SSL_aANY;
  ------------------
  |  |  124|    237|# define SSL_aANY                0x00000000U
  ------------------
  697|    237|        }
  698|     79|    }
  699|       |
  700|       |    /*
  701|       |     * For now, leave it at this: legacy sigalgs stay in their own
  702|       |     * data structures until "legacy cleanup" occurs.
  703|       |     */
  704|       |
  705|     79|    return 1;
  706|     79|}
tls1_set_groups_list:
 1594|     79|{
 1595|     79|    size_t i = 0, j;
 1596|     79|    int ret = 0, parse_ret = 0;
 1597|     79|    gid_cb_st gcb;
 1598|       |
 1599|       |    /* Sanity check */
 1600|     79|    if (ctx == NULL) {
  ------------------
  |  Branch (1600:9): [True: 0, False: 79]
  ------------------
 1601|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1602|      0|        return 0;
 1603|      0|    }
 1604|       |
 1605|     79|    memset(&gcb, 0, sizeof(gcb));
 1606|     79|    gcb.tuple_mode = 1; /* We prepare to collect the first tuple */
 1607|     79|    gcb.ignore_unknown_default = 0;
 1608|     79|    gcb.gidmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|     79|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1609|     79|    gcb.tplmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|     79|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1610|     79|    gcb.ksidmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|     79|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1611|     79|    gcb.ctx = ctx;
 1612|       |
 1613|       |    /* Prepare initial chunks of memory for groups, tuples and keyshares groupIDs */
 1614|     79|    gcb.gid_arr = OPENSSL_malloc(gcb.gidmax * sizeof(*gcb.gid_arr));
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1615|     79|    if (gcb.gid_arr == NULL)
  ------------------
  |  Branch (1615:9): [True: 0, False: 79]
  ------------------
 1616|      0|        goto end;
 1617|     79|    gcb.tuplcnt_arr = OPENSSL_malloc(gcb.tplmax * sizeof(*gcb.tuplcnt_arr));
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1618|     79|    if (gcb.tuplcnt_arr == NULL)
  ------------------
  |  Branch (1618:9): [True: 0, False: 79]
  ------------------
 1619|      0|        goto end;
 1620|     79|    gcb.tuplcnt_arr[0] = 0;
 1621|     79|    gcb.ksid_arr = OPENSSL_malloc(gcb.ksidmax * sizeof(*gcb.ksid_arr));
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1622|     79|    if (gcb.ksid_arr == NULL)
  ------------------
  |  Branch (1622:9): [True: 0, False: 79]
  ------------------
 1623|      0|        goto end;
 1624|       |
 1625|     79|    while (str[0] != '\0' && isspace((unsigned char)*str))
  ------------------
  |  Branch (1625:12): [True: 79, False: 0]
  ------------------
 1626|      0|        str++;
 1627|     79|    if (str[0] == '\0')
  ------------------
  |  Branch (1627:9): [True: 0, False: 79]
  ------------------
 1628|      0|        goto empty_list;
 1629|       |
 1630|       |    /*
 1631|       |     * Start the (potentially recursive) tuple processing by calling CONF_parse_list
 1632|       |     * with the TUPLE_DELIMITER_CHARACTER (which will call tuple_cb after cleaning spaces)
 1633|       |     */
 1634|     79|    parse_ret = CONF_parse_list(str, TUPLE_DELIMITER_CHARACTER, 1, tuple_cb, &gcb);
  ------------------
  |  | 1197|     79|# define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
 1635|       |
 1636|     79|    if (parse_ret == 0)
  ------------------
  |  Branch (1636:9): [True: 0, False: 79]
  ------------------
 1637|      0|        goto end;
 1638|     79|    if (parse_ret == -1) {
  ------------------
  |  Branch (1638:9): [True: 0, False: 79]
  ------------------
 1639|      0|        ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   87|      0|# define ERR_LIB_SSL             20
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|      0|                       "Syntax error in '%s'", str);
 1641|      0|        goto end;
 1642|      0|    }
 1643|       |
 1644|       |    /*
 1645|       |     * We check whether a tuple was completly emptied by using "-" prefix
 1646|       |     * excessively, in which case we remove the tuple
 1647|       |     */
 1648|    395|    for (i = j = 0; j < gcb.tplcnt; j++) {
  ------------------
  |  Branch (1648:21): [True: 316, False: 79]
  ------------------
 1649|    316|        if (gcb.tuplcnt_arr[j] == 0)
  ------------------
  |  Branch (1649:13): [True: 0, False: 316]
  ------------------
 1650|      0|            continue;
 1651|       |        /* If there's a gap, move to first unfilled slot */
 1652|    316|        if (j == i)
  ------------------
  |  Branch (1652:13): [True: 316, False: 0]
  ------------------
 1653|    316|            ++i;
 1654|      0|        else
 1655|      0|            gcb.tuplcnt_arr[i++] = gcb.tuplcnt_arr[j];
 1656|    316|    }
 1657|     79|    gcb.tplcnt = i;
 1658|       |
 1659|     79|    if (gcb.ksidcnt > OPENSSL_CLIENT_MAX_KEY_SHARES) {
  ------------------
  |  |  792|     79|#  define OPENSSL_CLIENT_MAX_KEY_SHARES 4
  ------------------
  |  Branch (1659:9): [True: 0, False: 79]
  ------------------
 1660|      0|        ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   87|      0|# define ERR_LIB_SSL             20
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1661|      0|                       "To many keyshares requested in '%s' (max = %d)",
 1662|      0|                       str, OPENSSL_CLIENT_MAX_KEY_SHARES);
  ------------------
  |  |  792|      0|#  define OPENSSL_CLIENT_MAX_KEY_SHARES 4
  ------------------
 1663|      0|        goto end;
 1664|      0|    }
 1665|       |
 1666|       |    /*
 1667|       |     * For backward compatibility we let the rest of the code know that a key share
 1668|       |     * for the first valid group should be added if no "*" prefix was used anywhere
 1669|       |     */
 1670|     79|    if (gcb.gidcnt > 0 && gcb.ksidcnt == 0) {
  ------------------
  |  Branch (1670:9): [True: 79, False: 0]
  |  Branch (1670:27): [True: 0, False: 79]
  ------------------
 1671|       |        /*
 1672|       |         * No key share group prefix character was used, hence we indicate that a single
 1673|       |         * key share should be sent and flag that it should come from the supported_groups list
 1674|       |         */
 1675|      0|        gcb.ksidcnt = 1;
 1676|      0|        gcb.ksid_arr[0] = 0;
 1677|      0|    }
 1678|       |
 1679|     79| empty_list:
 1680|       |    /*
 1681|       |     * A call to tls1_set_groups_list with any of the args (other than ctx) set
 1682|       |     * to NULL only does a syntax check, hence we're done here and report success
 1683|       |     */
 1684|     79|    if (grpext == NULL || ksext == NULL || tplext == NULL ||
  ------------------
  |  Branch (1684:9): [True: 0, False: 79]
  |  Branch (1684:27): [True: 0, False: 79]
  |  Branch (1684:44): [True: 0, False: 79]
  ------------------
 1685|     79|        grpextlen == NULL || ksextlen == NULL || tplextlen == NULL) {
  ------------------
  |  Branch (1685:9): [True: 0, False: 79]
  |  Branch (1685:30): [True: 0, False: 79]
  |  Branch (1685:50): [True: 0, False: 79]
  ------------------
 1686|      0|        ret = 1;
 1687|      0|        goto end;
 1688|      0|    }
 1689|       |
 1690|       |    /*
 1691|       |     * tuple_cb and gid_cb combo ensures there are no duplicates or unknown groups so we
 1692|       |     * can just go ahead and set the results (after diposing the existing)
 1693|       |     */
 1694|     79|    OPENSSL_free(*grpext);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1695|     79|    *grpext = gcb.gid_arr;
 1696|     79|    *grpextlen = gcb.gidcnt;
 1697|     79|    OPENSSL_free(*ksext);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1698|     79|    *ksext = gcb.ksid_arr;
 1699|     79|    *ksextlen = gcb.ksidcnt;
 1700|     79|    OPENSSL_free(*tplext);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1701|     79|    *tplext = gcb.tuplcnt_arr;
 1702|     79|    *tplextlen = gcb.tplcnt;
 1703|       |
 1704|     79|    return 1;
 1705|       |
 1706|      0| end:
 1707|      0|    OPENSSL_free(gcb.gid_arr);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1708|      0|    OPENSSL_free(gcb.tuplcnt_arr);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1709|      0|    OPENSSL_free(gcb.ksid_arr);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1710|      0|    return ret;
 1711|     79|}
ssl_setup_sigalgs:
 2180|     79|{
 2181|     79|    size_t i, cache_idx, sigalgs_len, enabled;
 2182|     79|    const SIGALG_LOOKUP *lu;
 2183|     79|    SIGALG_LOOKUP *cache = NULL;
 2184|     79|    uint16_t *tls12_sigalgs_list = NULL;
 2185|     79|    EVP_PKEY *tmpkey = EVP_PKEY_new();
 2186|     79|    int istls;
 2187|     79|    int ret = 0;
 2188|       |
 2189|     79|    if (ctx == NULL)
  ------------------
  |  Branch (2189:9): [True: 0, False: 79]
  ------------------
 2190|      0|        goto err;
 2191|       |
 2192|     79|    istls = !SSL_CTX_IS_DTLS(ctx);
  ------------------
  |  |  262|     79|    (ctx->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2186|     79|# define SSL_ENC_FLAG_DTLS               0x8
  |  |  ------------------
  ------------------
 2193|       |
 2194|     79|    sigalgs_len = OSSL_NELEM(sigalg_lookup_tbl) + ctx->sigalg_list_len;
  ------------------
  |  |   14|     79|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 2195|       |
 2196|     79|    cache = OPENSSL_zalloc(sizeof(const SIGALG_LOOKUP) * sigalgs_len);
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2197|     79|    if (cache == NULL || tmpkey == NULL)
  ------------------
  |  Branch (2197:9): [True: 0, False: 79]
  |  Branch (2197:26): [True: 0, False: 79]
  ------------------
 2198|      0|        goto err;
 2199|       |
 2200|     79|    tls12_sigalgs_list = OPENSSL_zalloc(sizeof(uint16_t) * sigalgs_len);
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2201|     79|    if (tls12_sigalgs_list == NULL)
  ------------------
  |  Branch (2201:9): [True: 0, False: 79]
  ------------------
 2202|      0|        goto err;
 2203|       |
 2204|     79|    ERR_set_mark();
 2205|       |    /* First fill cache and tls12_sigalgs list from legacy algorithm list */
 2206|     79|    for (i = 0, lu = sigalg_lookup_tbl;
 2207|  2.52k|         i < OSSL_NELEM(sigalg_lookup_tbl); lu++, i++) {
  ------------------
  |  |   14|  2.52k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (2207:10): [True: 2.44k, False: 79]
  ------------------
 2208|  2.44k|        EVP_PKEY_CTX *pctx;
 2209|       |
 2210|  2.44k|        cache[i] = *lu;
 2211|       |
 2212|       |        /*
 2213|       |         * Check hash is available.
 2214|       |         * This test is not perfect. A provider could have support
 2215|       |         * for a signature scheme, but not a particular hash. However the hash
 2216|       |         * could be available from some other loaded provider. In that case it
 2217|       |         * could be that the signature is available, and the hash is available
 2218|       |         * independently - but not as a combination. We ignore this for now.
 2219|       |         */
 2220|  2.44k|        if (lu->hash != NID_undef
  ------------------
  |  |   18|  4.89k|#define NID_undef                       0
  ------------------
  |  Branch (2220:13): [True: 2.29k, False: 158]
  ------------------
 2221|  2.44k|                && ctx->ssl_digest_methods[lu->hash_idx] == NULL) {
  ------------------
  |  Branch (2221:20): [True: 395, False: 1.89k]
  ------------------
 2222|    395|            cache[i].available = 0;
 2223|    395|            continue;
 2224|    395|        }
 2225|       |
 2226|  2.05k|        if (!EVP_PKEY_set_type(tmpkey, lu->sig)) {
  ------------------
  |  Branch (2226:13): [True: 0, False: 2.05k]
  ------------------
 2227|      0|            cache[i].available = 0;
 2228|      0|            continue;
 2229|      0|        }
 2230|  2.05k|        pctx = EVP_PKEY_CTX_new_from_pkey(ctx->libctx, tmpkey, ctx->propq);
 2231|       |        /* If unable to create pctx we assume the sig algorithm is unavailable */
 2232|  2.05k|        if (pctx == NULL)
  ------------------
  |  Branch (2232:13): [True: 0, False: 2.05k]
  ------------------
 2233|      0|            cache[i].available = 0;
 2234|  2.05k|        EVP_PKEY_CTX_free(pctx);
 2235|  2.05k|    }
 2236|       |
 2237|       |    /* Now complete cache and tls12_sigalgs list with provider sig information */
 2238|     79|    cache_idx = OSSL_NELEM(sigalg_lookup_tbl);
  ------------------
  |  |   14|     79|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 2239|    316|    for (i = 0; i < ctx->sigalg_list_len; i++) {
  ------------------
  |  Branch (2239:17): [True: 237, False: 79]
  ------------------
 2240|    237|        TLS_SIGALG_INFO si = ctx->sigalg_list[i];
 2241|    237|        cache[cache_idx].name = si.name;
 2242|    237|        cache[cache_idx].name12 = si.sigalg_name;
 2243|    237|        cache[cache_idx].sigalg = si.code_point;
 2244|    237|        tls12_sigalgs_list[cache_idx] = si.code_point;
 2245|    237|        cache[cache_idx].hash = si.hash_name?OBJ_txt2nid(si.hash_name):NID_undef;
  ------------------
  |  |   18|    474|#define NID_undef                       0
  ------------------
  |  Branch (2245:33): [True: 0, False: 237]
  ------------------
 2246|    237|        cache[cache_idx].hash_idx = ssl_get_md_idx(cache[cache_idx].hash);
 2247|    237|        cache[cache_idx].sig = OBJ_txt2nid(si.sigalg_name);
 2248|    237|        cache[cache_idx].sig_idx = i + SSL_PKEY_NUM;
  ------------------
  |  |  329|    237|# define SSL_PKEY_NUM            9
  ------------------
 2249|    237|        cache[cache_idx].sigandhash = OBJ_txt2nid(si.sigalg_name);
 2250|    237|        cache[cache_idx].curve = NID_undef;
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
 2251|    237|        cache[cache_idx].mintls = TLS1_3_VERSION;
  ------------------
  |  |   27|    237|# define TLS1_3_VERSION                  0x0304
  ------------------
 2252|    237|        cache[cache_idx].maxtls = TLS1_3_VERSION;
  ------------------
  |  |   27|    237|# define TLS1_3_VERSION                  0x0304
  ------------------
 2253|    237|        cache[cache_idx].mindtls = -1;
 2254|    237|        cache[cache_idx].maxdtls = -1;
 2255|       |        /* Compatibility with TLS 1.3 is checked on load */
 2256|    237|        cache[cache_idx].available = istls;
 2257|    237|        cache[cache_idx].advertise = 0;
 2258|    237|        cache_idx++;
 2259|    237|    }
 2260|     79|    ERR_pop_to_mark();
 2261|       |
 2262|     79|    enabled = 0;
 2263|  2.76k|    for (i = 0; i < OSSL_NELEM(tls12_sigalgs); ++i) {
  ------------------
  |  |   14|  2.76k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (2263:17): [True: 2.68k, False: 79]
  ------------------
 2264|  2.68k|        SIGALG_LOOKUP *ent = cache;
 2265|  2.68k|        size_t j;
 2266|       |
 2267|  47.0k|        for (j = 0; j < sigalgs_len; ent++, j++) {
  ------------------
  |  Branch (2267:21): [True: 47.0k, False: 0]
  ------------------
 2268|  47.0k|            if (ent->sigalg != tls12_sigalgs[i])
  ------------------
  |  Branch (2268:17): [True: 44.3k, False: 2.68k]
  ------------------
 2269|  44.3k|                continue;
 2270|       |            /* Dedup by marking cache entry as default enabled. */
 2271|  2.68k|            if (ent->available && !ent->advertise) {
  ------------------
  |  Branch (2271:17): [True: 2.29k, False: 395]
  |  Branch (2271:35): [True: 2.29k, False: 0]
  ------------------
 2272|  2.29k|                ent->advertise = 1;
 2273|  2.29k|                tls12_sigalgs_list[enabled++] = tls12_sigalgs[i];
 2274|  2.29k|            }
 2275|  2.68k|            break;
 2276|  47.0k|        }
 2277|  2.68k|    }
 2278|       |
 2279|       |    /* Append any provider sigalgs not yet handled */
 2280|    316|    for (i = OSSL_NELEM(sigalg_lookup_tbl); i < sigalgs_len; ++i) {
  ------------------
  |  |   14|     79|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (2280:45): [True: 237, False: 79]
  ------------------
 2281|    237|        SIGALG_LOOKUP *ent = &cache[i];
 2282|       |
 2283|    237|        if (ent->available && !ent->advertise)
  ------------------
  |  Branch (2283:13): [True: 237, False: 0]
  |  Branch (2283:31): [True: 0, False: 237]
  ------------------
 2284|      0|            tls12_sigalgs_list[enabled++] = ent->sigalg;
 2285|    237|    }
 2286|       |
 2287|     79|    ctx->sigalg_lookup_cache = cache;
 2288|     79|    ctx->sigalg_lookup_cache_len = sigalgs_len;
 2289|     79|    ctx->tls12_sigalgs = tls12_sigalgs_list;
 2290|     79|    ctx->tls12_sigalgs_len = enabled;
 2291|     79|    cache = NULL;
 2292|     79|    tls12_sigalgs_list = NULL;
 2293|       |
 2294|     79|    ret = 1;
 2295|     79| err:
 2296|     79|    OPENSSL_free(cache);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2297|     79|    OPENSSL_free(tls12_sigalgs_list);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2298|     79|    EVP_PKEY_free(tmpkey);
 2299|     79|    return ret;
 2300|     79|}
t1_lib.c:discover_provider_groups:
  357|    158|{
  358|    158|    struct provider_ctx_data_st pgd;
  359|       |
  360|    158|    pgd.ctx = vctx;
  361|    158|    pgd.provider = provider;
  362|    158|    return OSSL_PROVIDER_get_capabilities(provider, "TLS-GROUP",
  363|    158|                                          add_provider_groups, &pgd);
  364|    158|}
t1_lib.c:add_provider_groups:
  228|  4.66k|{
  229|  4.66k|    struct provider_ctx_data_st *pgd = data;
  230|  4.66k|    SSL_CTX *ctx = pgd->ctx;
  231|  4.66k|    const OSSL_PARAM *p;
  232|  4.66k|    TLS_GROUP_INFO *ginf = NULL;
  233|  4.66k|    EVP_KEYMGMT *keymgmt;
  234|  4.66k|    unsigned int gid;
  235|  4.66k|    unsigned int is_kem = 0;
  236|  4.66k|    int ret = 0;
  237|       |
  238|  4.66k|    if (ctx->group_list_max_len == ctx->group_list_len) {
  ------------------
  |  Branch (238:9): [True: 474, False: 4.18k]
  ------------------
  239|    474|        TLS_GROUP_INFO *tmp = NULL;
  240|       |
  241|    474|        if (ctx->group_list_max_len == 0)
  ------------------
  |  Branch (241:13): [True: 79, False: 395]
  ------------------
  242|     79|            tmp = OPENSSL_malloc(sizeof(TLS_GROUP_INFO)
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|    474|                                 * TLS_GROUP_LIST_MALLOC_BLOCK_SIZE);
  244|    395|        else
  245|    395|            tmp = OPENSSL_realloc(ctx->group_list,
  ------------------
  |  |  109|    395|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    395|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    395|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  246|    474|                                  (ctx->group_list_max_len
  247|    474|                                   + TLS_GROUP_LIST_MALLOC_BLOCK_SIZE)
  248|    474|                                  * sizeof(TLS_GROUP_INFO));
  249|    474|        if (tmp == NULL)
  ------------------
  |  Branch (249:13): [True: 0, False: 474]
  ------------------
  250|      0|            return 0;
  251|    474|        ctx->group_list = tmp;
  252|    474|        memset(tmp + ctx->group_list_max_len,
  253|    474|               0,
  254|    474|               sizeof(TLS_GROUP_INFO) * TLS_GROUP_LIST_MALLOC_BLOCK_SIZE);
  ------------------
  |  |  225|    474|#define TLS_GROUP_LIST_MALLOC_BLOCK_SIZE        10
  ------------------
  255|    474|        ctx->group_list_max_len += TLS_GROUP_LIST_MALLOC_BLOCK_SIZE;
  ------------------
  |  |  225|    474|#define TLS_GROUP_LIST_MALLOC_BLOCK_SIZE        10
  ------------------
  256|    474|    }
  257|       |
  258|  4.66k|    ginf = &ctx->group_list[ctx->group_list_len];
  259|       |
  260|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME);
  ------------------
  |  |  150|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name"
  ------------------
  261|  4.66k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  4.66k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (261:9): [True: 0, False: 4.66k]
  |  Branch (261:22): [True: 0, False: 4.66k]
  ------------------
  262|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  263|      0|        goto err;
  264|      0|    }
  265|  4.66k|    ginf->tlsname = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|  4.66k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|  4.66k|    if (ginf->tlsname == NULL)
  ------------------
  |  Branch (266:9): [True: 0, False: 4.66k]
  ------------------
  267|      0|        goto err;
  268|       |
  269|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL);
  ------------------
  |  |  151|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal"
  ------------------
  270|  4.66k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  4.66k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (270:9): [True: 0, False: 4.66k]
  |  Branch (270:22): [True: 0, False: 4.66k]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|  4.66k|    ginf->realname = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|  4.66k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  275|  4.66k|    if (ginf->realname == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 4.66k]
  ------------------
  276|      0|        goto err;
  277|       |
  278|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_ID);
  ------------------
  |  |  144|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id"
  ------------------
  279|  4.66k|    if (p == NULL || !OSSL_PARAM_get_uint(p, &gid) || gid > UINT16_MAX) {
  ------------------
  |  Branch (279:9): [True: 0, False: 4.66k]
  |  Branch (279:22): [True: 0, False: 4.66k]
  |  Branch (279:55): [True: 0, False: 4.66k]
  ------------------
  280|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  281|      0|        goto err;
  282|      0|    }
  283|  4.66k|    ginf->group_id = (uint16_t)gid;
  284|       |
  285|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_ALG);
  ------------------
  |  |  143|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg"
  ------------------
  286|  4.66k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  4.66k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (286:9): [True: 0, False: 4.66k]
  |  Branch (286:22): [True: 0, False: 4.66k]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        goto err;
  289|      0|    }
  290|  4.66k|    ginf->algorithm = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|  4.66k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.66k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.66k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|  4.66k|    if (ginf->algorithm == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 4.66k]
  ------------------
  292|      0|        goto err;
  293|       |
  294|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS);
  ------------------
  |  |  152|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits"
  ------------------
  295|  4.66k|    if (p == NULL || !OSSL_PARAM_get_uint(p, &ginf->secbits)) {
  ------------------
  |  Branch (295:9): [True: 0, False: 4.66k]
  |  Branch (295:22): [True: 0, False: 4.66k]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        goto err;
  298|      0|    }
  299|       |
  300|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_IS_KEM);
  ------------------
  |  |  145|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem"
  ------------------
  301|  4.66k|    if (p != NULL && (!OSSL_PARAM_get_uint(p, &is_kem) || is_kem > 1)) {
  ------------------
  |  Branch (301:9): [True: 4.66k, False: 0]
  |  Branch (301:23): [True: 0, False: 4.66k]
  |  Branch (301:59): [True: 0, False: 4.66k]
  ------------------
  302|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|      0|        goto err;
  304|      0|    }
  305|  4.66k|    ginf->is_kem = 1 & is_kem;
  306|       |
  307|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MIN_TLS);
  ------------------
  |  |  149|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls"
  ------------------
  308|  4.66k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->mintls)) {
  ------------------
  |  Branch (308:9): [True: 0, False: 4.66k]
  |  Branch (308:22): [True: 0, False: 4.66k]
  ------------------
  309|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  310|      0|        goto err;
  311|      0|    }
  312|       |
  313|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MAX_TLS);
  ------------------
  |  |  147|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls"
  ------------------
  314|  4.66k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->maxtls)) {
  ------------------
  |  Branch (314:9): [True: 0, False: 4.66k]
  |  Branch (314:22): [True: 0, False: 4.66k]
  ------------------
  315|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  316|      0|        goto err;
  317|      0|    }
  318|       |
  319|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS);
  ------------------
  |  |  148|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls"
  ------------------
  320|  4.66k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->mindtls)) {
  ------------------
  |  Branch (320:9): [True: 0, False: 4.66k]
  |  Branch (320:22): [True: 0, False: 4.66k]
  ------------------
  321|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|        goto err;
  323|      0|    }
  324|       |
  325|  4.66k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS);
  ------------------
  |  |  146|  4.66k|# define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls"
  ------------------
  326|  4.66k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->maxdtls)) {
  ------------------
  |  Branch (326:9): [True: 0, False: 4.66k]
  |  Branch (326:22): [True: 0, False: 4.66k]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|       |    /*
  331|       |     * Now check that the algorithm is actually usable for our property query
  332|       |     * string. Regardless of the result we still return success because we have
  333|       |     * successfully processed this group, even though we may decide not to use
  334|       |     * it.
  335|       |     */
  336|  4.66k|    ret = 1;
  337|  4.66k|    ERR_set_mark();
  338|  4.66k|    keymgmt = EVP_KEYMGMT_fetch(ctx->libctx, ginf->algorithm, ctx->propq);
  339|  4.66k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (339:9): [True: 4.66k, False: 0]
  ------------------
  340|       |        /* We have successfully fetched the algorithm, we can use the group. */
  341|  4.66k|        ctx->group_list_len++;
  342|  4.66k|        ginf = NULL;
  343|  4.66k|        EVP_KEYMGMT_free(keymgmt);
  344|  4.66k|    }
  345|  4.66k|    ERR_pop_to_mark();
  346|  4.66k| err:
  347|  4.66k|    if (ginf != NULL) {
  ------------------
  |  Branch (347:9): [True: 0, False: 4.66k]
  ------------------
  348|      0|        OPENSSL_free(ginf->tlsname);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  349|      0|        OPENSSL_free(ginf->realname);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  350|      0|        OPENSSL_free(ginf->algorithm);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  351|      0|        ginf->algorithm = ginf->tlsname = ginf->realname = NULL;
  352|      0|    }
  353|  4.66k|    return ret;
  354|  4.66k|}
t1_lib.c:discover_provider_sigalgs:
  666|    158|{
  667|    158|    struct provider_ctx_data_st pgd;
  668|       |
  669|    158|    pgd.ctx = vctx;
  670|    158|    pgd.provider = provider;
  671|    158|    OSSL_PROVIDER_get_capabilities(provider, "TLS-SIGALG",
  672|    158|                                   add_provider_sigalgs, &pgd);
  673|       |    /*
  674|       |     * Always OK, even if provider doesn't support the capability:
  675|       |     * Reconsider testing retval when legacy sigalgs are also loaded this way.
  676|       |     */
  677|    158|    return 1;
  678|    158|}
t1_lib.c:add_provider_sigalgs:
  377|    237|{
  378|    237|    struct provider_ctx_data_st *pgd = data;
  379|    237|    SSL_CTX *ctx = pgd->ctx;
  380|    237|    OSSL_PROVIDER *provider = pgd->provider;
  381|    237|    const OSSL_PARAM *p;
  382|    237|    TLS_SIGALG_INFO *sinf = NULL;
  383|    237|    EVP_KEYMGMT *keymgmt;
  384|    237|    const char *keytype;
  385|    237|    unsigned int code_point = 0;
  386|    237|    int ret = 0;
  387|       |
  388|    237|    if (ctx->sigalg_list_max_len == ctx->sigalg_list_len) {
  ------------------
  |  Branch (388:9): [True: 79, False: 158]
  ------------------
  389|     79|        TLS_SIGALG_INFO *tmp = NULL;
  390|       |
  391|     79|        if (ctx->sigalg_list_max_len == 0)
  ------------------
  |  Branch (391:13): [True: 79, False: 0]
  ------------------
  392|     79|            tmp = OPENSSL_malloc(sizeof(TLS_SIGALG_INFO)
  ------------------
  |  |  102|     79|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  393|     79|                                 * TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE);
  394|      0|        else
  395|      0|            tmp = OPENSSL_realloc(ctx->sigalg_list,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  396|     79|                                  (ctx->sigalg_list_max_len
  397|     79|                                   + TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE)
  398|     79|                                  * sizeof(TLS_SIGALG_INFO));
  399|     79|        if (tmp == NULL)
  ------------------
  |  Branch (399:13): [True: 0, False: 79]
  ------------------
  400|      0|            return 0;
  401|     79|        ctx->sigalg_list = tmp;
  402|     79|        memset(tmp + ctx->sigalg_list_max_len, 0,
  403|     79|               sizeof(TLS_SIGALG_INFO) * TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE);
  ------------------
  |  |  374|     79|#define TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE        10
  ------------------
  404|     79|        ctx->sigalg_list_max_len += TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE;
  ------------------
  |  |  374|     79|#define TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE        10
  ------------------
  405|     79|    }
  406|       |
  407|    237|    sinf = &ctx->sigalg_list[ctx->sigalg_list_len];
  408|       |
  409|       |    /* First, mandatory parameters */
  410|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_NAME);
  ------------------
  |  |  163|    237|# define OSSL_CAPABILITY_TLS_SIGALG_NAME "tls-sigalg-name"
  ------------------
  411|    237|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|    237|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (411:9): [True: 0, False: 237]
  |  Branch (411:22): [True: 0, False: 237]
  ------------------
  412|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  413|      0|        goto err;
  414|      0|    }
  415|    237|    OPENSSL_free(sinf->sigalg_name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  416|    237|    sinf->sigalg_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|    237|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  417|    237|    if (sinf->sigalg_name == NULL)
  ------------------
  |  Branch (417:9): [True: 0, False: 237]
  ------------------
  418|      0|        goto err;
  419|       |
  420|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME);
  ------------------
  |  |  156|    237|# define OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME "tls-sigalg-iana-name"
  ------------------
  421|    237|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|    237|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (421:9): [True: 0, False: 237]
  |  Branch (421:22): [True: 0, False: 237]
  ------------------
  422|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  423|      0|        goto err;
  424|      0|    }
  425|    237|    OPENSSL_free(sinf->name);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  426|    237|    sinf->name = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|    237|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  427|    237|    if (sinf->name == NULL)
  ------------------
  |  Branch (427:9): [True: 0, False: 237]
  ------------------
  428|      0|        goto err;
  429|       |
  430|    237|    p = OSSL_PARAM_locate_const(params,
  431|    237|                                OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT);
  ------------------
  |  |  153|    237|# define OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT "tls-sigalg-code-point"
  ------------------
  432|    237|    if (p == NULL
  ------------------
  |  Branch (432:9): [True: 0, False: 237]
  ------------------
  433|    237|        || !OSSL_PARAM_get_uint(p, &code_point)
  ------------------
  |  Branch (433:12): [True: 0, False: 237]
  ------------------
  434|    237|        || code_point > UINT16_MAX) {
  ------------------
  |  Branch (434:12): [True: 0, False: 237]
  ------------------
  435|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  436|      0|        goto err;
  437|      0|    }
  438|    237|    sinf->code_point = (uint16_t)code_point;
  439|       |
  440|    237|    p = OSSL_PARAM_locate_const(params,
  441|    237|                                OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS);
  ------------------
  |  |  165|    237|# define OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS "tls-sigalg-sec-bits"
  ------------------
  442|    237|    if (p == NULL || !OSSL_PARAM_get_uint(p, &sinf->secbits)) {
  ------------------
  |  Branch (442:9): [True: 0, False: 237]
  |  Branch (442:22): [True: 0, False: 237]
  ------------------
  443|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  444|      0|        goto err;
  445|      0|    }
  446|       |
  447|       |    /* Now, optional parameters */
  448|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_OID);
  ------------------
  |  |  164|    237|# define OSSL_CAPABILITY_TLS_SIGALG_OID "tls-sigalg-oid"
  ------------------
  449|    237|    if (p == NULL) {
  ------------------
  |  Branch (449:9): [True: 0, False: 237]
  ------------------
  450|      0|        sinf->sigalg_oid = NULL;
  451|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|    237|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (451:16): [True: 0, False: 237]
  ------------------
  452|      0|        goto err;
  453|    237|    } else {
  454|    237|        OPENSSL_free(sinf->sigalg_oid);
  ------------------
  |  |  115|    237|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  455|    237|        sinf->sigalg_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|    237|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    237|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    237|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  456|    237|        if (sinf->sigalg_oid == NULL)
  ------------------
  |  Branch (456:13): [True: 0, False: 237]
  ------------------
  457|      0|            goto err;
  458|    237|    }
  459|       |
  460|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME);
  ------------------
  |  |  166|    237|# define OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME "tls-sigalg-sig-name"
  ------------------
  461|    237|    if (p == NULL) {
  ------------------
  |  Branch (461:9): [True: 237, False: 0]
  ------------------
  462|    237|        sinf->sig_name = NULL;
  463|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (463:16): [True: 0, False: 0]
  ------------------
  464|      0|        goto err;
  465|      0|    } else {
  466|      0|        OPENSSL_free(sinf->sig_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  467|      0|        sinf->sig_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  468|      0|        if (sinf->sig_name == NULL)
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|            goto err;
  470|      0|    }
  471|       |
  472|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_SIG_OID);
  ------------------
  |  |  167|    237|# define OSSL_CAPABILITY_TLS_SIGALG_SIG_OID "tls-sigalg-sig-oid"
  ------------------
  473|    237|    if (p == NULL) {
  ------------------
  |  Branch (473:9): [True: 237, False: 0]
  ------------------
  474|    237|        sinf->sig_oid = NULL;
  475|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (475:16): [True: 0, False: 0]
  ------------------
  476|      0|        goto err;
  477|      0|    } else {
  478|      0|        OPENSSL_free(sinf->sig_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  479|      0|        sinf->sig_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  480|      0|        if (sinf->sig_oid == NULL)
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|            goto err;
  482|      0|    }
  483|       |
  484|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME);
  ------------------
  |  |  154|    237|# define OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME "tls-sigalg-hash-name"
  ------------------
  485|    237|    if (p == NULL) {
  ------------------
  |  Branch (485:9): [True: 237, False: 0]
  ------------------
  486|    237|        sinf->hash_name = NULL;
  487|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (487:16): [True: 0, False: 0]
  ------------------
  488|      0|        goto err;
  489|      0|    } else {
  490|      0|        OPENSSL_free(sinf->hash_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  491|      0|        sinf->hash_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  492|      0|        if (sinf->hash_name == NULL)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            goto err;
  494|      0|    }
  495|       |
  496|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_HASH_OID);
  ------------------
  |  |  155|    237|# define OSSL_CAPABILITY_TLS_SIGALG_HASH_OID "tls-sigalg-hash-oid"
  ------------------
  497|    237|    if (p == NULL) {
  ------------------
  |  Branch (497:9): [True: 237, False: 0]
  ------------------
  498|    237|        sinf->hash_oid = NULL;
  499|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (499:16): [True: 0, False: 0]
  ------------------
  500|      0|        goto err;
  501|      0|    } else {
  502|      0|        OPENSSL_free(sinf->hash_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  503|      0|        sinf->hash_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  504|      0|        if (sinf->hash_oid == NULL)
  ------------------
  |  Branch (504:13): [True: 0, False: 0]
  ------------------
  505|      0|            goto err;
  506|      0|    }
  507|       |
  508|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE);
  ------------------
  |  |  157|    237|# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE "tls-sigalg-keytype"
  ------------------
  509|    237|    if (p == NULL) {
  ------------------
  |  Branch (509:9): [True: 237, False: 0]
  ------------------
  510|    237|        sinf->keytype = NULL;
  511|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (511:16): [True: 0, False: 0]
  ------------------
  512|      0|        goto err;
  513|      0|    } else {
  514|      0|        OPENSSL_free(sinf->keytype);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  515|      0|        sinf->keytype = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  516|      0|        if (sinf->keytype == NULL)
  ------------------
  |  Branch (516:13): [True: 0, False: 0]
  ------------------
  517|      0|            goto err;
  518|      0|    }
  519|       |
  520|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID);
  ------------------
  |  |  158|    237|# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID "tls-sigalg-keytype-oid"
  ------------------
  521|    237|    if (p == NULL) {
  ------------------
  |  Branch (521:9): [True: 237, False: 0]
  ------------------
  522|    237|        sinf->keytype_oid = NULL;
  523|    237|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (523:16): [True: 0, False: 0]
  ------------------
  524|      0|        goto err;
  525|      0|    } else {
  526|      0|        OPENSSL_free(sinf->keytype_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  527|      0|        sinf->keytype_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  528|      0|        if (sinf->keytype_oid == NULL)
  ------------------
  |  Branch (528:13): [True: 0, False: 0]
  ------------------
  529|      0|            goto err;
  530|      0|    }
  531|       |
  532|       |    /* Optional, not documented prior to 3.5 */
  533|    237|    sinf->mindtls = sinf->maxdtls = -1;
  534|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS);
  ------------------
  |  |  161|    237|# define OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS "tls-min-dtls"
  ------------------
  535|    237|    if (p != NULL && !OSSL_PARAM_get_int(p, &sinf->mindtls)) {
  ------------------
  |  Branch (535:9): [True: 237, False: 0]
  |  Branch (535:22): [True: 0, False: 237]
  ------------------
  536|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  537|      0|        goto err;
  538|      0|    }
  539|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS);
  ------------------
  |  |  159|    237|# define OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS "tls-max-dtls"
  ------------------
  540|    237|    if (p != NULL && !OSSL_PARAM_get_int(p, &sinf->maxdtls)) {
  ------------------
  |  Branch (540:9): [True: 237, False: 0]
  |  Branch (540:22): [True: 0, False: 237]
  ------------------
  541|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  542|      0|        goto err;
  543|      0|    }
  544|       |    /* DTLS version numbers grow downward */
  545|    237|    if ((sinf->maxdtls != 0) && (sinf->maxdtls != -1) &&
  ------------------
  |  Branch (545:9): [True: 237, False: 0]
  |  Branch (545:33): [True: 0, False: 237]
  ------------------
  546|    237|        ((sinf->maxdtls > sinf->mindtls))) {
  ------------------
  |  Branch (546:9): [True: 0, False: 0]
  ------------------
  547|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  548|      0|        goto err;
  549|      0|    }
  550|       |    /* No provider sigalgs are supported in DTLS, reset after checking. */
  551|    237|    sinf->mindtls = sinf->maxdtls = -1;
  552|       |
  553|       |    /* The remaining parameters below are mandatory again */
  554|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS);
  ------------------
  |  |  162|    237|# define OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS "tls-min-tls"
  ------------------
  555|    237|    if (p == NULL || !OSSL_PARAM_get_int(p, &sinf->mintls)) {
  ------------------
  |  Branch (555:9): [True: 0, False: 237]
  |  Branch (555:22): [True: 0, False: 237]
  ------------------
  556|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  557|      0|        goto err;
  558|      0|    }
  559|    237|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS);
  ------------------
  |  |  160|    237|# define OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS "tls-max-tls"
  ------------------
  560|    237|    if (p == NULL || !OSSL_PARAM_get_int(p, &sinf->maxtls)) {
  ------------------
  |  Branch (560:9): [True: 0, False: 237]
  |  Branch (560:22): [True: 0, False: 237]
  ------------------
  561|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  562|      0|        goto err;
  563|      0|    }
  564|    237|    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) &&
  ------------------
  |  Branch (564:9): [True: 0, False: 237]
  |  Branch (564:32): [True: 0, False: 0]
  ------------------
  565|    237|        ((sinf->maxtls < sinf->mintls))) {
  ------------------
  |  Branch (565:9): [True: 0, False: 0]
  ------------------
  566|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  567|      0|        goto err;
  568|      0|    }
  569|    237|    if ((sinf->mintls != 0) && (sinf->mintls != -1) &&
  ------------------
  |  Branch (569:9): [True: 237, False: 0]
  |  Branch (569:32): [True: 237, False: 0]
  ------------------
  570|    237|        ((sinf->mintls > TLS1_3_VERSION)))
  ------------------
  |  |   27|    237|# define TLS1_3_VERSION                  0x0304
  ------------------
  |  Branch (570:9): [True: 0, False: 237]
  ------------------
  571|      0|        sinf->mintls = sinf->maxtls = -1;
  572|    237|    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) &&
  ------------------
  |  Branch (572:9): [True: 0, False: 237]
  |  Branch (572:32): [True: 0, False: 0]
  ------------------
  573|    237|        ((sinf->maxtls < TLS1_3_VERSION)))
  ------------------
  |  |   27|      0|# define TLS1_3_VERSION                  0x0304
  ------------------
  |  Branch (573:9): [True: 0, False: 0]
  ------------------
  574|      0|        sinf->mintls = sinf->maxtls = -1;
  575|       |
  576|       |    /* Ignore unusable sigalgs */
  577|    237|    if (sinf->mintls == -1 && sinf->mindtls == -1) {
  ------------------
  |  Branch (577:9): [True: 0, False: 237]
  |  Branch (577:31): [True: 0, False: 0]
  ------------------
  578|      0|        ret = 1;
  579|      0|        goto err;
  580|      0|    }
  581|       |
  582|       |    /*
  583|       |     * Now check that the algorithm is actually usable for our property query
  584|       |     * string. Regardless of the result we still return success because we have
  585|       |     * successfully processed this signature, even though we may decide not to
  586|       |     * use it.
  587|       |     */
  588|    237|    ret = 1;
  589|    237|    ERR_set_mark();
  590|    237|    keytype = (sinf->keytype != NULL
  ------------------
  |  Branch (590:16): [True: 0, False: 237]
  ------------------
  591|    237|               ? sinf->keytype
  592|    237|               : (sinf->sig_name != NULL
  ------------------
  |  Branch (592:19): [True: 0, False: 237]
  ------------------
  593|    237|                  ? sinf->sig_name
  594|    237|                  : sinf->sigalg_name));
  595|    237|    keymgmt = EVP_KEYMGMT_fetch(ctx->libctx, keytype, ctx->propq);
  596|    237|    if (keymgmt != NULL) {
  ------------------
  |  Branch (596:9): [True: 237, False: 0]
  ------------------
  597|       |        /*
  598|       |         * We have successfully fetched the algorithm - however if the provider
  599|       |         * doesn't match this one then we ignore it.
  600|       |         *
  601|       |         * Note: We're cheating a little here. Technically if the same algorithm
  602|       |         * is available from more than one provider then it is undefined which
  603|       |         * implementation you will get back. Theoretically this could be
  604|       |         * different every time...we assume here that you'll always get the
  605|       |         * same one back if you repeat the exact same fetch. Is this a reasonable
  606|       |         * assumption to make (in which case perhaps we should document this
  607|       |         * behaviour)?
  608|       |         */
  609|    237|        if (EVP_KEYMGMT_get0_provider(keymgmt) == provider) {
  ------------------
  |  Branch (609:13): [True: 237, False: 0]
  ------------------
  610|       |            /*
  611|       |             * We have a match - so we could use this signature;
  612|       |             * Check proper object registration first, though.
  613|       |             * Don't care about return value as this may have been
  614|       |             * done within providers or previous calls to
  615|       |             * add_provider_sigalgs.
  616|       |             */
  617|    237|            OBJ_create(sinf->sigalg_oid, sinf->sigalg_name, NULL);
  618|       |            /* sanity check: Without successful registration don't use alg */
  619|    237|            if ((OBJ_txt2nid(sinf->sigalg_name) == NID_undef) ||
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  |  Branch (619:17): [True: 0, False: 237]
  ------------------
  620|    237|                (OBJ_nid2obj(OBJ_txt2nid(sinf->sigalg_name)) == NULL)) {
  ------------------
  |  Branch (620:17): [True: 0, False: 237]
  ------------------
  621|      0|                    ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  622|      0|                    goto err;
  623|      0|            }
  624|    237|            if (sinf->sig_name != NULL)
  ------------------
  |  Branch (624:17): [True: 0, False: 237]
  ------------------
  625|      0|                OBJ_create(sinf->sig_oid, sinf->sig_name, NULL);
  626|    237|            if (sinf->keytype != NULL)
  ------------------
  |  Branch (626:17): [True: 0, False: 237]
  ------------------
  627|      0|                OBJ_create(sinf->keytype_oid, sinf->keytype, NULL);
  628|    237|            if (sinf->hash_name != NULL)
  ------------------
  |  Branch (628:17): [True: 0, False: 237]
  ------------------
  629|      0|                OBJ_create(sinf->hash_oid, sinf->hash_name, NULL);
  630|    237|            OBJ_add_sigid(OBJ_txt2nid(sinf->sigalg_name),
  631|    237|                          (sinf->hash_name != NULL
  ------------------
  |  Branch (631:28): [True: 0, False: 237]
  ------------------
  632|    237|                           ? OBJ_txt2nid(sinf->hash_name)
  633|    237|                           : NID_undef),
  ------------------
  |  |   18|    237|#define NID_undef                       0
  ------------------
  634|    237|                          OBJ_txt2nid(keytype));
  635|    237|            ctx->sigalg_list_len++;
  636|    237|            sinf = NULL;
  637|    237|        }
  638|    237|        EVP_KEYMGMT_free(keymgmt);
  639|    237|    }
  640|    237|    ERR_pop_to_mark();
  641|    237| err:
  642|    237|    if (sinf != NULL) {
  ------------------
  |  Branch (642:9): [True: 0, False: 237]
  ------------------
  643|      0|        OPENSSL_free(sinf->name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  644|      0|        sinf->name = NULL;
  645|      0|        OPENSSL_free(sinf->sigalg_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  646|      0|        sinf->sigalg_name = NULL;
  647|      0|        OPENSSL_free(sinf->sigalg_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  648|      0|        sinf->sigalg_oid = NULL;
  649|      0|        OPENSSL_free(sinf->sig_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  650|      0|        sinf->sig_name = NULL;
  651|      0|        OPENSSL_free(sinf->sig_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|      0|        sinf->sig_oid = NULL;
  653|      0|        OPENSSL_free(sinf->hash_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  654|      0|        sinf->hash_name = NULL;
  655|      0|        OPENSSL_free(sinf->hash_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  656|      0|        sinf->hash_oid = NULL;
  657|      0|        OPENSSL_free(sinf->keytype);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  658|      0|        sinf->keytype = NULL;
  659|      0|        OPENSSL_free(sinf->keytype_oid);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  660|      0|        sinf->keytype_oid = NULL;
  661|      0|    }
  662|    237|    return ret;
  663|    237|}
t1_lib.c:tuple_cb:
 1531|    316|{
 1532|    316|    gid_cb_st *garg = arg;
 1533|    316|    int retval = 1; /* We assume success */
 1534|    316|    char *restored_tuple_string;
 1535|       |
 1536|       |    /* Sanity checks */
 1537|    316|    if (garg == NULL || tuple == NULL || len <= 0) {
  ------------------
  |  Branch (1537:9): [True: 0, False: 316]
  |  Branch (1537:25): [True: 0, False: 316]
  |  Branch (1537:42): [True: 0, False: 316]
  ------------------
 1538|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1539|      0|        return 0;
 1540|      0|    }
 1541|       |
 1542|       |    /* Memory management for tuples */
 1543|    316|    if (garg->tplcnt == garg->tplmax) {
  ------------------
  |  Branch (1543:9): [True: 0, False: 316]
  ------------------
 1544|      0|        size_t *tmp =
 1545|      0|            OPENSSL_realloc(garg->tuplcnt_arr,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1546|      0|                            (garg->tplmax + GROUPLIST_INCREMENT) * sizeof(*garg->tuplcnt_arr));
 1547|       |
 1548|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1548:13): [True: 0, False: 0]
  ------------------
 1549|      0|            return 0;
 1550|      0|        garg->tplmax += GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1551|      0|        garg->tuplcnt_arr = tmp;
 1552|      0|    }
 1553|       |
 1554|       |    /* Convert to \0-terminated string */
 1555|    316|    restored_tuple_string = OPENSSL_malloc((len + 1 /* \0 */) * sizeof(char));
  ------------------
  |  |  102|    316|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    316|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    316|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1556|    316|    if (restored_tuple_string == NULL)
  ------------------
  |  Branch (1556:9): [True: 0, False: 316]
  ------------------
 1557|      0|        return 0;
 1558|    316|    memcpy(restored_tuple_string, tuple, len);
 1559|    316|    restored_tuple_string[len] = '\0';
 1560|       |
 1561|       |    /* Analyze group list of this tuple */
 1562|    316|    retval = CONF_parse_list(restored_tuple_string, GROUP_DELIMITER_CHARACTER, 1, gid_cb, arg);
  ------------------
  |  | 1201|    316|# define GROUP_DELIMITER_CHARACTER ':'
  ------------------
 1563|       |
 1564|       |    /* We don't need the \o-terminated string anymore */
 1565|    316|    OPENSSL_free(restored_tuple_string);
  ------------------
  |  |  115|    316|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    316|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    316|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1566|       |
 1567|    316|    if (garg->tuplcnt_arr[garg->tplcnt] > 0) { /* Some valid groups are present in current tuple... */
  ------------------
  |  Branch (1567:9): [True: 316, False: 0]
  ------------------
 1568|    316|        if (garg->tuple_mode) {
  ------------------
  |  Branch (1568:13): [True: 316, False: 0]
  ------------------
 1569|       |            /* We 'close' the tuple */
 1570|    316|            garg->tplcnt++;
 1571|    316|            garg->tuplcnt_arr[garg->tplcnt] = 0; /* Next tuple is initialized to be empty */
 1572|    316|            garg->tuple_mode = 1; /* next call will start a tuple (unless overridden in gid_cb) */
 1573|    316|        }
 1574|    316|    }
 1575|       |
 1576|    316|    return retval;
 1577|    316|}
t1_lib.c:gid_cb:
 1257|    632|{
 1258|    632|    gid_cb_st *garg = arg;
 1259|    632|    size_t i, j, k;
 1260|    632|    uint16_t gid = 0;
 1261|    632|    int found_group = 0;
 1262|    632|    char etmp[GROUP_NAME_BUFFER_LENGTH];
 1263|    632|    int retval = 1; /* We assume success */
 1264|    632|    char *current_prefix;
 1265|    632|    int ignore_unknown = 0;
 1266|    632|    int add_keyshare = 0;
 1267|    632|    int remove_group = 0;
 1268|    632|    size_t restored_prefix_index = 0;
 1269|    632|    char *restored_default_group_string;
 1270|    632|    int continue_while_loop = 1;
 1271|       |
 1272|       |    /* Sanity checks */
 1273|    632|    if (garg == NULL || elem == NULL || len <= 0) {
  ------------------
  |  Branch (1273:9): [True: 0, False: 632]
  |  Branch (1273:25): [True: 0, False: 632]
  |  Branch (1273:41): [True: 0, False: 632]
  ------------------
 1274|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1275|      0|        return 0;
 1276|      0|    }
 1277|       |
 1278|       |    /* Check the possible prefixes (remark: Leading and trailing spaces already cleared) */
 1279|  1.42k|    while (continue_while_loop && len > 0
  ------------------
  |  Branch (1279:12): [True: 1.42k, False: 0]
  |  Branch (1279:35): [True: 1.42k, False: 0]
  ------------------
 1280|  1.42k|           && ((current_prefix = strchr(prefixes, elem[0])) != NULL
  ------------------
  |  Branch (1280:16): [True: 790, False: 632]
  ------------------
 1281|  1.42k|               || OPENSSL_strncasecmp(current_prefix = (char *)DEFAULT_GROUPNAME_FIRST_CHARACTER, elem, 1) == 0)) {
  ------------------
  |  Branch (1281:19): [True: 0, False: 632]
  ------------------
 1282|       |
 1283|    790|        switch (*current_prefix) {
 1284|      0|        case TUPLE_DELIMITER_CHARACTER:
  ------------------
  |  | 1197|      0|# define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
  |  Branch (1284:9): [True: 0, False: 790]
  ------------------
 1285|       |            /* tuple delimiter not allowed here -> syntax error */
 1286|      0|            return -1;
 1287|      0|            break;
 1288|      0|        case GROUP_DELIMITER_CHARACTER:
  ------------------
  |  | 1201|      0|# define GROUP_DELIMITER_CHARACTER ':'
  ------------------
  |  Branch (1288:9): [True: 0, False: 790]
  ------------------
 1289|      0|            return -1; /* Not a valid prefix for a single group name-> syntax error */
 1290|      0|            break;
 1291|    158|        case KEY_SHARE_INDICATOR_CHARACTER:
  ------------------
  |  | 1209|    158|# define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
  |  Branch (1291:9): [True: 158, False: 632]
  ------------------
 1292|    158|            if (add_keyshare)
  ------------------
  |  Branch (1292:17): [True: 0, False: 158]
  ------------------
 1293|      0|                return -1; /* Only single key share prefix allowed -> syntax error */
 1294|    158|            add_keyshare = 1;
 1295|    158|            ++elem;
 1296|    158|            --len;
 1297|    158|            break;
 1298|      0|        case REMOVE_GROUP_INDICATOR_CHARACTER:
  ------------------
  |  | 1213|      0|# define REMOVE_GROUP_INDICATOR_CHARACTER '-'
  ------------------
  |  Branch (1298:9): [True: 0, False: 790]
  ------------------
 1299|      0|            if (remove_group)
  ------------------
  |  Branch (1299:17): [True: 0, False: 0]
  ------------------
 1300|      0|                return -1; /* Only single remove group prefix allowed -> syntax error */
 1301|      0|            remove_group = 1;
 1302|      0|            ++elem;
 1303|      0|            --len;
 1304|      0|            break;
 1305|    632|        case IGNORE_UNKNOWN_GROUP_CHARACTER:
  ------------------
  |  | 1205|    632|# define IGNORE_UNKNOWN_GROUP_CHARACTER '?'
  ------------------
  |  Branch (1305:9): [True: 632, False: 158]
  ------------------
 1306|    632|            if (ignore_unknown)
  ------------------
  |  Branch (1306:17): [True: 0, False: 632]
  ------------------
 1307|      0|                return -1; /* Only single ? allowed -> syntax error */
 1308|    632|            ignore_unknown = 1;
 1309|    632|            ++elem;
 1310|    632|            --len;
 1311|    632|            break;
 1312|      0|        default:
  ------------------
  |  Branch (1312:9): [True: 0, False: 790]
  ------------------
 1313|       |            /*
 1314|       |             * Check whether a DEFAULT[_XYZ] 'pseudo group' (= a built-in
 1315|       |             * list of groups) should be added
 1316|       |             */
 1317|      0|            for (i = 0; i < OSSL_NELEM(default_group_strings); i++) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1317:25): [True: 0, False: 0]
  ------------------
 1318|      0|                if ((size_t)len == (strlen(default_group_strings[i].list_name))
  ------------------
  |  Branch (1318:21): [True: 0, False: 0]
  ------------------
 1319|      0|                    && OPENSSL_strncasecmp(default_group_strings[i].list_name, elem, len) == 0) {
  ------------------
  |  Branch (1319:24): [True: 0, False: 0]
  ------------------
 1320|       |                    /*
 1321|       |                     * We're asked to insert an entire list of groups from a
 1322|       |                     * DEFAULT[_XYZ] 'pseudo group' which we do by
 1323|       |                     * recursively calling this function (indirectly via
 1324|       |                     * CONF_parse_list and tuple_cb); essentially, we treat a DEFAULT
 1325|       |                     * group string like a tuple which is appended to the current tuple
 1326|       |                     * rather then starting a new tuple. Variable tuple_mode is the flag which
 1327|       |                     * controls append tuple vs start new tuple.
 1328|       |                     */
 1329|       |
 1330|      0|                    if (ignore_unknown || remove_group)
  ------------------
  |  Branch (1330:25): [True: 0, False: 0]
  |  Branch (1330:43): [True: 0, False: 0]
  ------------------
 1331|      0|                        return -1; /* removal or ignore not allowed here -> syntax error */
 1332|       |
 1333|       |                    /*
 1334|       |                     * First, we restore any keyshare prefix in a new zero-terminated string
 1335|       |                     * (if not already present)
 1336|       |                     */
 1337|      0|                    restored_default_group_string = OPENSSL_malloc((1 /* max prefix length */ +
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1338|      0|                                                                    strlen(default_group_strings[i].group_string) +
 1339|      0|                                                                    1 /* \0 */) * sizeof(char));
 1340|      0|                    if (restored_default_group_string == NULL)
  ------------------
  |  Branch (1340:25): [True: 0, False: 0]
  ------------------
 1341|      0|                        return 0;
 1342|      0|                    if (add_keyshare
  ------------------
  |  Branch (1342:25): [True: 0, False: 0]
  ------------------
 1343|       |                        /* Remark: we tolerate a duplicated keyshare indicator here */
 1344|      0|                        && default_group_strings[i].group_string[0]
  ------------------
  |  Branch (1344:28): [True: 0, False: 0]
  ------------------
 1345|      0|                        != KEY_SHARE_INDICATOR_CHARACTER)
  ------------------
  |  | 1209|      0|# define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
 1346|      0|                        restored_default_group_string[restored_prefix_index++] =
 1347|      0|                            KEY_SHARE_INDICATOR_CHARACTER;
  ------------------
  |  | 1209|      0|# define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
 1348|       |
 1349|      0|                    memcpy(restored_default_group_string + restored_prefix_index,
 1350|      0|                           default_group_strings[i].group_string,
 1351|      0|                           strlen(default_group_strings[i].group_string));
 1352|      0|                    restored_default_group_string[strlen(default_group_strings[i].group_string) +
 1353|      0|                                                  restored_prefix_index] = '\0';
 1354|       |                    /* We execute the recursive call */
 1355|      0|                    garg->ignore_unknown_default = 1; /* We ignore unknown groups for DEFAULT_XYZ */
 1356|       |                    /* we enforce group mode (= append tuple) for DEFAULT_XYZ group lists */
 1357|      0|                    garg->tuple_mode = 0;
 1358|       |                    /* We use the tuple_cb callback to process the pseudo group tuple */
 1359|      0|                    retval = CONF_parse_list(restored_default_group_string,
 1360|      0|                                             TUPLE_DELIMITER_CHARACTER, 1, tuple_cb, garg);
  ------------------
  |  | 1197|      0|# define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
 1361|      0|                    garg->tuple_mode = 1; /* next call to tuple_cb will again start new tuple */
 1362|      0|                    garg->ignore_unknown_default = 0; /* reset to original value */
 1363|       |                    /* We don't need the \0-terminated string anymore */
 1364|      0|                    OPENSSL_free(restored_default_group_string);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1365|       |
 1366|      0|                    return retval;
 1367|      0|                }
 1368|      0|            }
 1369|       |            /*
 1370|       |             * If we reached this point, a group name started with a 'd' or 'D', but no request
 1371|       |             * for a DEFAULT[_XYZ] 'pseudo group' was detected, hence processing of the group
 1372|       |             * name can continue as usual (= the while loop checking prefixes can end)
 1373|       |             */
 1374|      0|            continue_while_loop = 0;
 1375|      0|            break;
 1376|    790|        }
 1377|    790|    }
 1378|       |
 1379|    632|    if (len == 0)
  ------------------
  |  Branch (1379:9): [True: 0, False: 632]
  ------------------
 1380|      0|        return -1; /* Seems we have prefxes without a group name -> syntax error */
 1381|       |
 1382|    632|    if (garg->ignore_unknown_default == 1) /* Always ignore unknown groups for DEFAULT[_XYZ] */
  ------------------
  |  Branch (1382:9): [True: 0, False: 632]
  ------------------
 1383|      0|        ignore_unknown = 1;
 1384|       |
 1385|       |    /* Memory management in case more groups are present compared to initial allocation */
 1386|    632|    if (garg->gidcnt == garg->gidmax) {
  ------------------
  |  Branch (1386:9): [True: 0, False: 632]
  ------------------
 1387|      0|        uint16_t *tmp =
 1388|      0|            OPENSSL_realloc(garg->gid_arr,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1389|      0|                            (garg->gidmax + GROUPLIST_INCREMENT) * sizeof(*garg->gid_arr));
 1390|       |
 1391|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1391:13): [True: 0, False: 0]
  ------------------
 1392|      0|            return 0;
 1393|       |
 1394|      0|        garg->gidmax += GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1395|      0|        garg->gid_arr = tmp;
 1396|      0|    }
 1397|       |    /* Memory management for key share groups */
 1398|    632|    if (garg->ksidcnt == garg->ksidmax) {
  ------------------
  |  Branch (1398:9): [True: 0, False: 632]
  ------------------
 1399|      0|        uint16_t *tmp =
 1400|      0|            OPENSSL_realloc(garg->ksid_arr,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1401|      0|                            (garg->ksidmax + GROUPLIST_INCREMENT) * sizeof(*garg->ksid_arr));
 1402|       |
 1403|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1403:13): [True: 0, False: 0]
  ------------------
 1404|      0|            return 0;
 1405|      0|        garg->ksidmax += GROUPLIST_INCREMENT;
  ------------------
  |  | 1186|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1406|      0|        garg->ksid_arr = tmp;
 1407|      0|    }
 1408|       |
 1409|    632|    if (len > (int)(sizeof(etmp) - 1))
  ------------------
  |  Branch (1409:9): [True: 0, False: 632]
  ------------------
 1410|      0|        return -1; /* group name to long  -> syntax error */
 1411|       |
 1412|       |    /*
 1413|       |     * Prepare addition or removal of a single group by converting
 1414|       |     * a group name into its groupID equivalent
 1415|       |     */
 1416|       |
 1417|       |    /* Create a \0-terminated string and get the gid for this group if possible */
 1418|    632|    memcpy(etmp, elem, len);
 1419|    632|    etmp[len] = 0;
 1420|       |
 1421|       |    /* Get the groupID */
 1422|    632|    gid = tls1_group_name2id(garg->ctx, etmp);
 1423|       |    /*
 1424|       |     * Handle the case where no valid groupID was returned
 1425|       |     * e.g. for an unknown group, which we'd ignore (only) if relevant prefix was set
 1426|       |     */
 1427|    632|    if (gid == 0) {
  ------------------
  |  Branch (1427:9): [True: 0, False: 632]
  ------------------
 1428|       |        /* Is it one of the GOST groups ? */
 1429|      0|        for (i = 0; i < OSSL_NELEM(name2id_arr); i++) {
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1429:21): [True: 0, False: 0]
  ------------------
 1430|      0|            if (OPENSSL_strcasecmp(etmp, name2id_arr[i].group_name) == 0) {
  ------------------
  |  Branch (1430:17): [True: 0, False: 0]
  ------------------
 1431|      0|                gid = name2id_arr[i].groupID;
 1432|      0|                break;
 1433|      0|            }
 1434|      0|        }
 1435|      0|        if (gid == 0) { /* still not found */
  ------------------
  |  Branch (1435:13): [True: 0, False: 0]
  ------------------
 1436|       |            /* Unknown group - ignore if ignore_unknown; trigger error otherwise */
 1437|      0|            retval = ignore_unknown;
 1438|      0|            goto done;
 1439|      0|        }
 1440|      0|    }
 1441|       |
 1442|       |    /* Make sure that at least one provider is supporting this groupID */
 1443|    632|    found_group = 0;
 1444|  3.55k|    for (j = 0; j < garg->ctx->group_list_len; j++)
  ------------------
  |  Branch (1444:17): [True: 3.55k, False: 0]
  ------------------
 1445|  3.55k|        if (garg->ctx->group_list[j].group_id == gid) {
  ------------------
  |  Branch (1445:13): [True: 632, False: 2.92k]
  ------------------
 1446|    632|            found_group = 1;
 1447|    632|            break;
 1448|    632|        }
 1449|       |
 1450|       |    /*
 1451|       |     * No provider supports this group - ignore if
 1452|       |     * ignore_unknown; trigger error otherwise
 1453|       |     */
 1454|    632|    if (found_group == 0) {
  ------------------
  |  Branch (1454:9): [True: 0, False: 632]
  ------------------
 1455|      0|        retval = ignore_unknown;
 1456|      0|        goto done;
 1457|      0|    }
 1458|       |    /* Remove group (and keyshare) from anywhere in the list if present, ignore if not present */
 1459|    632|    if (remove_group) {
  ------------------
  |  Branch (1459:9): [True: 0, False: 632]
  ------------------
 1460|       |        /* Is the current group specified anywhere in the entire list so far? */
 1461|      0|        found_group = 0;
 1462|      0|        for (i = 0; i < garg->gidcnt; i++)
  ------------------
  |  Branch (1462:21): [True: 0, False: 0]
  ------------------
 1463|      0|            if (garg->gid_arr[i] == gid) {
  ------------------
  |  Branch (1463:17): [True: 0, False: 0]
  ------------------
 1464|      0|                found_group = 1;
 1465|      0|                break;
 1466|      0|            }
 1467|       |        /* The group to remove is at position i in the list of (zero indexed) groups */
 1468|      0|        if (found_group) {
  ------------------
  |  Branch (1468:13): [True: 0, False: 0]
  ------------------
 1469|       |            /* We remove that group from its position (which is at i)... */
 1470|      0|            for (j = i; j < (garg->gidcnt - 1); j++)
  ------------------
  |  Branch (1470:25): [True: 0, False: 0]
  ------------------
 1471|      0|                garg->gid_arr[j] = garg->gid_arr[j + 1]; /* ...shift remaining groups left ... */
 1472|      0|            garg->gidcnt--; /* ..and update the book keeping for the number of groups */
 1473|       |
 1474|       |            /*
 1475|       |             * We also must update the number of groups either in a previous tuple (which we
 1476|       |             * must identify and check whether it becomes empty due to the deletion) or in
 1477|       |             * the current tuple, pending where the deleted group resides
 1478|       |             */
 1479|      0|            k = 0;
 1480|      0|            for (j = 0; j < garg->tplcnt; j++) {
  ------------------
  |  Branch (1480:25): [True: 0, False: 0]
  ------------------
 1481|      0|                k += garg->tuplcnt_arr[j];
 1482|       |                /* Remark: i is zero-indexed, k is one-indexed */
 1483|      0|                if (k > i) { /* remove from one of the previous tuples */
  ------------------
  |  Branch (1483:21): [True: 0, False: 0]
  ------------------
 1484|      0|                    garg->tuplcnt_arr[j]--;
 1485|      0|                    break; /* We took care not to have group duplicates, hence we can stop here */
 1486|      0|                }
 1487|      0|            }
 1488|      0|            if (k <= i) /* remove from current tuple */
  ------------------
  |  Branch (1488:17): [True: 0, False: 0]
  ------------------
 1489|      0|                garg->tuplcnt_arr[j]--;
 1490|       |
 1491|       |            /* We also remove the group from the list of keyshares (if present) */
 1492|      0|            found_group = 0;
 1493|      0|            for (i = 0; i < garg->ksidcnt; i++)
  ------------------
  |  Branch (1493:25): [True: 0, False: 0]
  ------------------
 1494|      0|                if (garg->ksid_arr[i] == gid) {
  ------------------
  |  Branch (1494:21): [True: 0, False: 0]
  ------------------
 1495|      0|                    found_group = 1;
 1496|      0|                    break;
 1497|      0|                }
 1498|      0|            if (found_group) {
  ------------------
  |  Branch (1498:17): [True: 0, False: 0]
  ------------------
 1499|       |                /* Found, hence we remove that keyshare from its position (which is at i)... */
 1500|      0|                for (j = i; j < (garg->ksidcnt - 1); j++)
  ------------------
  |  Branch (1500:29): [True: 0, False: 0]
  ------------------
 1501|      0|                    garg->ksid_arr[j] = garg->ksid_arr[j + 1]; /* shift remaining key shares */
 1502|       |                /* ... and update the book keeping */
 1503|      0|                garg->ksidcnt--;
 1504|      0|            }
 1505|      0|        }
 1506|    632|    } else { /* Processing addition of a single new group */
 1507|       |
 1508|       |        /* Check for duplicates */
 1509|  2.84k|        for (i = 0; i < garg->gidcnt; i++)
  ------------------
  |  Branch (1509:21): [True: 2.21k, False: 632]
  ------------------
 1510|  2.21k|            if (garg->gid_arr[i] == gid) {
  ------------------
  |  Branch (1510:17): [True: 0, False: 2.21k]
  ------------------
 1511|       |                /* Duplicate group anywhere in the list of groups - ignore */
 1512|      0|                goto done;
 1513|      0|            }
 1514|       |
 1515|       |        /* Add the current group to the 'flat' list of groups */
 1516|    632|        garg->gid_arr[garg->gidcnt++] = gid;
 1517|       |        /* and update the book keeping for the number of groups in current tuple */
 1518|    632|        garg->tuplcnt_arr[garg->tplcnt]++;
 1519|       |
 1520|       |        /* We memorize if needed that we want to add a key share for the current group */
 1521|    632|        if (add_keyshare)
  ------------------
  |  Branch (1521:13): [True: 158, False: 474]
  ------------------
 1522|    158|            garg->ksid_arr[garg->ksidcnt++] = gid;
 1523|    632|    }
 1524|       |
 1525|    632|done:
 1526|    632|    return retval;
 1527|    632|}
t1_lib.c:tls1_group_name2id:
  709|    632|{
  710|    632|    size_t i;
  711|       |
  712|  3.55k|    for (i = 0; i < ctx->group_list_len; i++) {
  ------------------
  |  Branch (712:17): [True: 3.55k, False: 0]
  ------------------
  713|  3.55k|        if (OPENSSL_strcasecmp(ctx->group_list[i].tlsname, name) == 0
  ------------------
  |  Branch (713:13): [True: 632, False: 2.92k]
  ------------------
  714|  3.55k|                || OPENSSL_strcasecmp(ctx->group_list[i].realname, name) == 0)
  ------------------
  |  Branch (714:20): [True: 0, False: 2.92k]
  ------------------
  715|    632|            return ctx->group_list[i].group_id;
  716|  3.55k|    }
  717|       |
  718|      0|    return 0;
  719|    632|}

tls_engine_finish:
   24|    632|{
   25|    632|    ENGINE_finish(e);
   26|    632|}
tls_get_cipher_from_engine:
   30|  1.81k|{
   31|  1.81k|    const EVP_CIPHER *ret = NULL;
   32|  1.81k|#ifndef OPENSSL_NO_ENGINE
   33|  1.81k|    ENGINE *eng;
   34|       |
   35|       |    /*
   36|       |     * If there is an Engine available for this cipher we use the "implicit"
   37|       |     * form to ensure we use that engine later.
   38|       |     */
   39|  1.81k|    eng = ENGINE_get_cipher_engine(nid);
   40|  1.81k|    if (eng != NULL) {
  ------------------
  |  Branch (40:9): [True: 0, False: 1.81k]
  ------------------
   41|      0|        ret = ENGINE_get_cipher(eng, nid);
   42|      0|        ENGINE_finish(eng);
   43|      0|    }
   44|  1.81k|#endif
   45|  1.81k|    return ret;
   46|  1.81k|}
tls_get_digest_from_engine:
   49|  1.26k|{
   50|  1.26k|    const EVP_MD *ret = NULL;
   51|  1.26k|#ifndef OPENSSL_NO_ENGINE
   52|  1.26k|    ENGINE *eng;
   53|       |
   54|       |    /*
   55|       |     * If there is an Engine available for this digest we use the "implicit"
   56|       |     * form to ensure we use that engine later.
   57|       |     */
   58|  1.26k|    eng = ENGINE_get_digest_engine(nid);
   59|  1.26k|    if (eng != NULL) {
  ------------------
  |  Branch (59:9): [True: 0, False: 1.26k]
  ------------------
   60|      0|        ret = ENGINE_get_digest(eng, nid);
   61|      0|        ENGINE_finish(eng);
   62|      0|    }
   63|  1.26k|#endif
   64|  1.26k|    return ret;
   65|  1.26k|}

ssl_ctx_srp_ctx_free_intern:
   34|     79|{
   35|     79|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 79]
  ------------------
   36|      0|        return 0;
   37|     79|    OPENSSL_free(ctx->srp_ctx.login);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|     79|    OPENSSL_free(ctx->srp_ctx.info);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|     79|    BN_free(ctx->srp_ctx.N);
   40|     79|    BN_free(ctx->srp_ctx.g);
   41|     79|    BN_free(ctx->srp_ctx.s);
   42|     79|    BN_free(ctx->srp_ctx.B);
   43|     79|    BN_free(ctx->srp_ctx.A);
   44|     79|    BN_free(ctx->srp_ctx.a);
   45|     79|    BN_free(ctx->srp_ctx.b);
   46|     79|    BN_free(ctx->srp_ctx.v);
   47|     79|    memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx));
   48|     79|    ctx->srp_ctx.strength = SRP_MINIMAL_N;
  ------------------
  |  |  270|     79|#  define SRP_MINIMAL_N 1024
  ------------------
   49|     79|    return 1;
   50|     79|}
ssl_ctx_srp_ctx_init_intern:
  174|     79|{
  175|     79|    if (ctx == NULL)
  ------------------
  |  Branch (175:9): [True: 0, False: 79]
  ------------------
  176|      0|        return 0;
  177|       |
  178|     79|    memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx));
  179|     79|    ctx->srp_ctx.strength = SRP_MINIMAL_N;
  ------------------
  |  |  270|     79|#  define SRP_MINIMAL_N 1024
  ------------------
  180|       |
  181|     79|    return 1;
  182|     79|}

